diff --git a/dist/index.js b/dist/index.js index ffc2706a..63c5fa66 100644 --- a/dist/index.js +++ b/dist/index.js @@ -168,8 +168,8 @@ function findIssueComment(githubClient, siteId) { }); } function createGitHubDeployment(githubClient, environmentUrl, environment, description) { - var _a, _b; return __awaiter(this, void 0, void 0, function* () { + var _a, _b; const deployRef = (_b = (_a = github_1.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.head.sha) !== null && _b !== void 0 ? _b : github_1.context.sha; const deployment = yield githubClient.rest.repos.createDeployment({ auto_merge: false, @@ -190,8 +190,8 @@ function createGitHubDeployment(githubClient, environmentUrl, environment, descr }); } function run(inputs) { - var _a, _b, _c; return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; try { const netlifyAuthToken = process.env.NETLIFY_AUTH_TOKEN; const siteId = process.env.NETLIFY_SITE_ID; @@ -899,7 +899,7 @@ class OidcClient { .catch(error => { throw new Error(`Failed to get ID Token. \n Error Code : ${error.statusCode}\n - Error Message: ${error.result.message}`); + Error Message: ${error.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -1647,7 +1647,11 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /* eslint-disable @typescript-eslint/no-explicit-any */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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]; @@ -1660,7 +1664,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + 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; }; @@ -1679,6 +1683,7 @@ const http = __importStar(__nccwpck_require__(13685)); const https = __importStar(__nccwpck_require__(95687)); const pm = __importStar(__nccwpck_require__(19835)); const tunnel = __importStar(__nccwpck_require__(74294)); +const undici_1 = __nccwpck_require__(41773); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -1708,16 +1713,16 @@ var HttpCodes; HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); +})(HttpCodes || (exports.HttpCodes = HttpCodes = {})); var Headers; (function (Headers) { Headers["Accept"] = "accept"; Headers["ContentType"] = "content-type"; -})(Headers = exports.Headers || (exports.Headers = {})); +})(Headers || (exports.Headers = Headers = {})); var MediaTypes; (function (MediaTypes) { MediaTypes["ApplicationJson"] = "application/json"; -})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); +})(MediaTypes || (exports.MediaTypes = MediaTypes = {})); /** * Returns the proxy URL, depending upon the supplied url and proxy environment variables. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com @@ -1768,6 +1773,19 @@ class HttpClientResponse { })); }); } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on('data', (chunk) => { + chunks.push(chunk); + }); + this.message.on('end', () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } } exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { @@ -2073,6 +2091,15 @@ class HttpClient { const parsedUrl = new URL(serverUrl); return this._getAgent(parsedUrl); } + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (!useProxy) { + return; + } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } _prepareRequest(method, requestUrl, headers) { const info = {}; info.parsedUrl = requestUrl; @@ -2120,7 +2147,7 @@ class HttpClient { if (this._keepAlive && useProxy) { agent = this._proxyAgent; } - if (this._keepAlive && !useProxy) { + if (!useProxy) { agent = this._agent; } // if agent is already assigned use that agent. @@ -2152,16 +2179,12 @@ class HttpClient { agent = tunnelAgent(agentOptions); this._proxyAgent = agent; } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { + // if tunneling agent isn't assigned create a new agent + if (!agent) { const options = { keepAlive: this._keepAlive, maxSockets }; agent = usingSsl ? new https.Agent(options) : new http.Agent(options); this._agent = agent; } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options @@ -2172,6 +2195,30 @@ class HttpClient { } return agent; } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; + } + // if agent is already assigned use that agent. + if (proxyAgent) { + return proxyAgent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { + token: `${proxyUrl.username}:${proxyUrl.password}` + }))); + this._proxyAgentDispatcher = proxyAgent; + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { + rejectUnauthorized: false + }); + } + return proxyAgent; + } _performExponentialBackoff(retryNumber) { return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); @@ -2272,7 +2319,13 @@ function getProxyUrl(reqUrl) { } })(); if (proxyVar) { - return new URL(proxyVar); + try { + return new URL(proxyVar); + } + catch (_a) { + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) + return new URL(`http://${proxyVar}`); + } } else { return undefined; @@ -2502,6 +2555,170 @@ module.exports.sync = (paths, options) => { }; +/***/ }), + +/***/ 16408: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const fs = __nccwpck_require__(57147); +const path = __nccwpck_require__(71017); +const {promisify} = __nccwpck_require__(73837); +const semver = __nccwpck_require__(8059); + +const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +const 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; + } + } +}; + +const processOptions = options => { + // https://github.com/sindresorhus/make-dir/issues/18 + const defaults = { + mode: 0o777, + fs + }; + + return { + ...defaults, + ...options + }; +}; + +const permissionError = pth => { + // This replicates the exception of `fs.mkdir` with native the + // `recusive` option when run on an invalid drive under Windows. + const error = new Error(`operation not permitted, mkdir '${pth}'`); + error.code = 'EPERM'; + error.errno = -4048; + error.path = pth; + error.syscall = 'mkdir'; + return error; +}; + +const makeDir = async (input, options) => { + checkPath(input); + options = processOptions(options); + + const mkdir = promisify(options.fs.mkdir); + const stat = promisify(options.fs.stat); + + if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) { + const pth = path.resolve(input); + + await mkdir(pth, { + mode: options.mode, + recursive: true + }); + + return pth; + } + + const make = async pth => { + try { + await mkdir(pth, options.mode); + + return pth; + } catch (error) { + if (error.code === 'EPERM') { + throw error; + } + + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth); + } + + if (error.message.includes('null bytes')) { + throw error; + } + + await make(path.dirname(pth)); + + return make(pth); + } + + try { + const stats = await stat(pth); + if (!stats.isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch (_) { + throw error; + } + + return pth; + } + }; + + return make(path.resolve(input)); +}; + +module.exports = makeDir; + +module.exports.sync = (input, options) => { + checkPath(input); + options = processOptions(options); + + if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) { + const pth = path.resolve(input); + + fs.mkdirSync(pth, { + mode: options.mode, + recursive: true + }); + + return pth; + } + + const make = pth => { + try { + options.fs.mkdirSync(pth, options.mode); + } catch (error) { + if (error.code === 'EPERM') { + throw error; + } + + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth); + } + + if (error.message.includes('null bytes')) { + throw error; + } + + make(path.dirname(pth)); + return make(pth); + } + + try { + if (!options.fs.statSync(pth).isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch (_) { + throw error; + } + } + + return pth; + }; + + return make(path.resolve(input)); +}; + + /***/ }), /***/ 63832: @@ -6962,7 +7179,7 @@ module.exports = { removeFalsy } const { resolve } = __nccwpck_require__(71017) -const makeDir = __nccwpck_require__(39126) +const makeDir = __nccwpck_require__(16408) const pMap = __nccwpck_require__(91855) const { getPluginsModulesPath } = __nccwpck_require__(53475) @@ -7123,7 +7340,7 @@ const { promisify } = __nccwpck_require__(73837) const copyFile = __nccwpck_require__(54544) const deleteFiles = __nccwpck_require__(23325) -const makeDir = __nccwpck_require__(39126) +const makeDir = __nccwpck_require__(16408) const pMap = __nccwpck_require__(91855) const unixify = __nccwpck_require__(61011) @@ -15452,7 +15669,7 @@ module.exports.isDynamicImport = function(node) { (function (global, factory) { true ? factory(exports) : 0; -}(this, (function (exports) { 'use strict'; +})(this, (function (exports) { 'use strict'; /** * Creates a continuation function with some arguments already applied. @@ -15524,19 +15741,19 @@ module.exports.isDynamicImport = function(node) { return (fn, ...args) => defer(() => fn(...args)); } - var _defer; + var _defer$1; if (hasQueueMicrotask) { - _defer = queueMicrotask; + _defer$1 = queueMicrotask; } else if (hasSetImmediate) { - _defer = setImmediate; + _defer$1 = setImmediate; } else if (hasNextTick) { - _defer = process.nextTick; + _defer$1 = process.nextTick; } else { - _defer = fallback; + _defer$1 = fallback; } - var setImmediate$1 = wrap(_defer); + var setImmediate$1 = wrap(_defer$1); /** * Take a sync function and make it async, passing its return value to a @@ -15623,7 +15840,7 @@ module.exports.isDynamicImport = function(node) { return promise.then(value => { invokeCallback(callback, null, value); }, err => { - invokeCallback(callback, err && err.message ? err : new Error(err)); + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); }); } @@ -15654,7 +15871,8 @@ module.exports.isDynamicImport = function(node) { // conditionally promisify a function. // only return a promise if a callback is omitted - function awaitify (asyncFn, arity = asyncFn.length) { + function awaitify (asyncFn, arity) { + if (!arity) arity = asyncFn.length; if (!arity) throw new Error('arity is undefined') function awaitable (...args) { if (typeof args[arity - 1] === 'function') { @@ -15673,7 +15891,7 @@ module.exports.isDynamicImport = function(node) { return awaitable } - function applyEach (eachfn) { + function applyEach$1 (eachfn) { return function applyEach(fns, ...callArgs) { const go = awaitify(function (callback) { var that = this; @@ -15712,6 +15930,7 @@ module.exports.isDynamicImport = function(node) { // A temporary value used to identify if the loop should be broken. // See #1064, #1293 const breakLoop = {}; + var breakLoop$1 = breakLoop; function once(fn) { function wrapper (...args) { @@ -15822,7 +16041,7 @@ module.exports.isDynamicImport = function(node) { return } - if (result === breakLoop || (done && running <= 0)) { + if (result === breakLoop$1 || (done && running <= 0)) { done = true; //console.log('done iterCb') return callback(null); @@ -15840,7 +16059,7 @@ module.exports.isDynamicImport = function(node) { replenish(); } - var eachOfLimit = (limit) => { + var eachOfLimit$2 = (limit) => { return (obj, iteratee, callback) => { callback = once(callback); if (limit <= 0) { @@ -15872,7 +16091,7 @@ module.exports.isDynamicImport = function(node) { done = true; canceled = true; } - else if (value === breakLoop || (done && running <= 0)) { + else if (value === breakLoop$1 || (done && running <= 0)) { done = true; return callback(null); } @@ -15923,11 +16142,11 @@ module.exports.isDynamicImport = function(node) { * `iteratee` functions have finished, or an error occurs. Invoked with (err). * @returns {Promise} a promise, if a callback is omitted */ - function eachOfLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); + function eachOfLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback); } - var eachOfLimit$2 = awaitify(eachOfLimit$1, 4); + var eachOfLimit$1 = awaitify(eachOfLimit, 4); // eachOf implementation optimized for array-likes function eachOfArrayLike(coll, iteratee, callback) { @@ -15947,7 +16166,7 @@ module.exports.isDynamicImport = function(node) { if (canceled === true) return if (err) { callback(err); - } else if ((++completed === length) || value === breakLoop) { + } else if ((++completed === length) || value === breakLoop$1) { callback(null); } } @@ -15959,7 +16178,7 @@ module.exports.isDynamicImport = function(node) { // a generic version of eachOf which can handle array, object, and iterator cases. function eachOfGeneric (coll, iteratee, callback) { - return eachOfLimit$2(coll, Infinity, iteratee, callback); + return eachOfLimit$1(coll, Infinity, iteratee, callback); } /** @@ -16239,7 +16458,7 @@ module.exports.isDynamicImport = function(node) { * callback * ); */ - var applyEach$1 = applyEach(map$1); + var applyEach = applyEach$1(map$1); /** * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. @@ -16260,7 +16479,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if a callback is omitted */ function eachOfSeries(coll, iteratee, callback) { - return eachOfLimit$2(coll, 1, iteratee, callback) + return eachOfLimit$1(coll, 1, iteratee, callback) } var eachOfSeries$1 = awaitify(eachOfSeries, 3); @@ -16307,7 +16526,7 @@ module.exports.isDynamicImport = function(node) { * appling the `args` to the list of functions. It takes no args, other than * a callback. */ - var applyEachSeries = applyEach(mapSeries$1); + var applyEachSeries = applyEach$1(mapSeries$1); const PROMISE_SYMBOL = Symbol('promiseCallback'); @@ -16905,7 +17124,7 @@ module.exports.isDynamicImport = function(node) { dll.head = dll.tail = node; } - function queue(worker, concurrency, payload) { + function queue$1(worker, concurrency, payload) { if (concurrency == null) { concurrency = 1; } @@ -17223,8 +17442,8 @@ module.exports.isDynamicImport = function(node) { * await cargo.push({name: 'baz'}); * console.log('finished processing baz'); */ - function cargo(worker, payload) { - return queue(worker, 1, payload); + function cargo$1(worker, payload) { + return queue$1(worker, 1, payload); } /** @@ -17281,8 +17500,8 @@ module.exports.isDynamicImport = function(node) { * console.log('finished processing boo'); * }); */ - function cargo$1(worker, concurrency, payload) { - return queue(worker, concurrency, payload); + function cargo(worker, concurrency, payload) { + return queue$1(worker, concurrency, payload); } /** @@ -17538,7 +17757,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if no callback is passed */ function mapLimit (coll, limit, iteratee, callback) { - return _asyncMap(eachOfLimit(limit), coll, iteratee, callback) + return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback) } var mapLimit$1 = awaitify(mapLimit, 4); @@ -17748,7 +17967,7 @@ module.exports.isDynamicImport = function(node) { * //... * }, callback); */ - function constant(...args) { + function constant$1(...args) { return function (...ignoredArgs/*, callback*/) { var callback = ignoredArgs.pop(); return callback(null, ...args); @@ -17767,7 +17986,7 @@ module.exports.isDynamicImport = function(node) { if (check(result) && !testResult) { testPassed = true; testResult = getResult(true, value); - return callback(null, breakLoop); + return callback(null, breakLoop$1); } callback(); }); @@ -17878,7 +18097,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if a callback is omitted */ function detectLimit(coll, limit, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(limit), coll, iteratee, callback) + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback) } var detectLimit$1 = awaitify(detectLimit, 4); @@ -17904,7 +18123,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if a callback is omitted */ function detectSeries(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback) + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback) } var detectSeries$1 = awaitify(detectSeries, 3); @@ -18137,11 +18356,11 @@ module.exports.isDynamicImport = function(node) { * } * */ - function eachLimit(coll, iteratee, callback) { + function eachLimit$2(coll, iteratee, callback) { return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); } - var each = awaitify(eachLimit, 3); + var each = awaitify(eachLimit$2, 3); /** * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. @@ -18164,10 +18383,10 @@ module.exports.isDynamicImport = function(node) { * `iteratee` functions have finished, or an error occurs. Invoked with (err). * @returns {Promise} a promise, if a callback is omitted */ - function eachLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); + function eachLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); } - var eachLimit$2 = awaitify(eachLimit$1, 4); + var eachLimit$1 = awaitify(eachLimit, 4); /** * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. @@ -18193,7 +18412,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if a callback is omitted */ function eachSeries(coll, iteratee, callback) { - return eachLimit$2(coll, 1, iteratee, callback) + return eachLimit$1(coll, 1, iteratee, callback) } var eachSeries$1 = awaitify(eachSeries, 3); @@ -18370,7 +18589,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if no callback provided */ function everyLimit(coll, limit, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfLimit(limit), coll, iteratee, callback) + return _createTester(bool => !bool, res => !res)(eachOfLimit$2(limit), coll, iteratee, callback) } var everyLimit$1 = awaitify(everyLimit, 4); @@ -18533,7 +18752,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if no callback provided */ function filterLimit (coll, limit, iteratee, callback) { - return _filter(eachOfLimit(limit), coll, iteratee, callback) + return _filter(eachOfLimit$2(limit), coll, iteratee, callback) } var filterLimit$1 = awaitify(filterLimit, 4); @@ -18828,7 +19047,7 @@ module.exports.isDynamicImport = function(node) { callback = once(callback); var newObj = {}; var _iteratee = wrapAsync(iteratee); - return eachOfLimit(limit)(obj, (val, key, next) => { + return eachOfLimit$2(limit)(obj, (val, key, next) => { _iteratee(val, key, (err, result) => { if (err) return next(err); newObj[key] = result; @@ -19105,19 +19324,19 @@ module.exports.isDynamicImport = function(node) { * // a, b, and c equal 1, 2, and 3 * }, 1, 2, 3); */ - var _defer$1; + var _defer; if (hasNextTick) { - _defer$1 = process.nextTick; + _defer = process.nextTick; } else if (hasSetImmediate) { - _defer$1 = setImmediate; + _defer = setImmediate; } else { - _defer$1 = fallback; + _defer = fallback; } - var nextTick = wrap(_defer$1); + var nextTick = wrap(_defer); - var parallel = awaitify((eachfn, tasks, callback) => { + var _parallel = awaitify((eachfn, tasks, callback) => { var results = isArrayLike(tasks) ? [] : {}; eachfn(tasks, (task, key, taskCb) => { @@ -19290,8 +19509,8 @@ module.exports.isDynamicImport = function(node) { * } * */ - function parallel$1(tasks, callback) { - return parallel(eachOf$1, tasks, callback); + function parallel(tasks, callback) { + return _parallel(eachOf$1, tasks, callback); } /** @@ -19315,7 +19534,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if a callback is not passed */ function parallelLimit(tasks, limit, callback) { - return parallel(eachOfLimit(limit), tasks, callback); + return _parallel(eachOfLimit$2(limit), tasks, callback); } /** @@ -19460,9 +19679,9 @@ module.exports.isDynamicImport = function(node) { * console.log('finished processing bar'); * }); */ - function queue$1 (worker, concurrency) { + function queue (worker, concurrency) { var _worker = wrapAsync(worker); - return queue((items, cb) => { + return queue$1((items, cb) => { _worker(items[0], cb); }, concurrency, 1); } @@ -19609,7 +19828,7 @@ module.exports.isDynamicImport = function(node) { */ function priorityQueue(worker, concurrency) { // Start with a normal queue - var q = queue$1(worker, concurrency); + var q = queue(worker, concurrency); var { push, @@ -19864,7 +20083,7 @@ module.exports.isDynamicImport = function(node) { return results; } - function reject(eachfn, arr, _iteratee, callback) { + function reject$2(eachfn, arr, _iteratee, callback) { const iteratee = wrapAsync(_iteratee); return _filter(eachfn, arr, (value, cb) => { iteratee(value, (err, v) => { @@ -19935,10 +20154,10 @@ module.exports.isDynamicImport = function(node) { * } * */ - function reject$1 (coll, iteratee, callback) { - return reject(eachOf$1, coll, iteratee, callback) + function reject (coll, iteratee, callback) { + return reject$2(eachOf$1, coll, iteratee, callback) } - var reject$2 = awaitify(reject$1, 3); + var reject$1 = awaitify(reject, 3); /** * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a @@ -19961,7 +20180,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if no callback is passed */ function rejectLimit (coll, limit, iteratee, callback) { - return reject(eachOfLimit(limit), coll, iteratee, callback) + return reject$2(eachOfLimit$2(limit), coll, iteratee, callback) } var rejectLimit$1 = awaitify(rejectLimit, 4); @@ -19984,11 +20203,11 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if no callback is passed */ function rejectSeries (coll, iteratee, callback) { - return reject(eachOfSeries$1, coll, iteratee, callback) + return reject$2(eachOfSeries$1, coll, iteratee, callback) } var rejectSeries$1 = awaitify(rejectSeries, 3); - function constant$1(value) { + function constant(value) { return function () { return value; } @@ -20085,7 +20304,7 @@ module.exports.isDynamicImport = function(node) { function retry(opts, task, callback) { var options = { times: DEFAULT_TIMES, - intervalFunc: constant$1(DEFAULT_INTERVAL) + intervalFunc: constant(DEFAULT_INTERVAL) }; if (arguments.length < 3 && typeof opts === 'function') { @@ -20126,7 +20345,7 @@ module.exports.isDynamicImport = function(node) { acc.intervalFunc = typeof t.interval === 'function' ? t.interval : - constant$1(+t.interval || DEFAULT_INTERVAL); + constant(+t.interval || DEFAULT_INTERVAL); acc.errorFilter = t.errorFilter; } else if (typeof t === 'number' || typeof t === 'string') { @@ -20357,7 +20576,7 @@ module.exports.isDynamicImport = function(node) { * */ function series(tasks, callback) { - return parallel(eachOfSeries$1, tasks, callback); + return _parallel(eachOfSeries$1, tasks, callback); } /** @@ -20485,7 +20704,7 @@ module.exports.isDynamicImport = function(node) { * @returns {Promise} a promise, if no callback provided */ function someLimit(coll, limit, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfLimit(limit), coll, iteratee, callback) + return _createTester(Boolean, res => res)(eachOfLimit$2(limit), coll, iteratee, callback) } var someLimit$1 = awaitify(someLimit, 4); @@ -21079,7 +21298,7 @@ module.exports.isDynamicImport = function(node) { * @method * @category Control Flow * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). + * execution of `iteratee`. Invoked with (callback). * @param {AsyncFunction} iteratee - An async function which is called each time * `test` passes. Invoked with (callback). * @param {Function} [callback] - A callback which is called after the test @@ -21291,20 +21510,21 @@ module.exports.isDynamicImport = function(node) { * @static */ + var index = { apply, - applyEach: applyEach$1, + applyEach, applyEachSeries, asyncify, auto, autoInject, - cargo, - cargoQueue: cargo$1, + cargo: cargo$1, + cargoQueue: cargo, compose, concat: concat$1, concatLimit: concatLimit$1, concatSeries: concatSeries$1, - constant, + constant: constant$1, detect: detect$1, detectLimit: detectLimit$1, detectSeries: detectSeries$1, @@ -21312,9 +21532,9 @@ module.exports.isDynamicImport = function(node) { doUntil, doWhilst: doWhilst$1, each, - eachLimit: eachLimit$2, + eachLimit: eachLimit$1, eachOf: eachOf$1, - eachOfLimit: eachOfLimit$2, + eachOfLimit: eachOfLimit$1, eachOfSeries: eachOfSeries$1, eachSeries: eachSeries$1, ensureAsync, @@ -21337,16 +21557,16 @@ module.exports.isDynamicImport = function(node) { mapValuesSeries, memoize, nextTick, - parallel: parallel$1, + parallel, parallelLimit, priorityQueue, - queue: queue$1, + queue, race: race$1, reduce: reduce$1, reduceRight, reflect, reflectAll, - reject: reject$2, + reject: reject$1, rejectLimit: rejectLimit$1, rejectSeries: rejectSeries$1, retry, @@ -21384,10 +21604,10 @@ module.exports.isDynamicImport = function(node) { flatMapSeries: concatSeries$1, forEach: each, forEachSeries: eachSeries$1, - forEachLimit: eachLimit$2, + forEachLimit: eachLimit$1, forEachOf: eachOf$1, forEachOfSeries: eachOfSeries$1, - forEachOfLimit: eachOfLimit$2, + forEachOfLimit: eachOfLimit$1, inject: reduce$1, foldl: reduce$1, foldr: reduceRight, @@ -21399,30 +21619,38 @@ module.exports.isDynamicImport = function(node) { doDuring: doWhilst$1 }; - exports.default = index; + exports.all = every$1; + exports.allLimit = everyLimit$1; + exports.allSeries = everySeries$1; + exports.any = some$1; + exports.anyLimit = someLimit$1; + exports.anySeries = someSeries$1; exports.apply = apply; - exports.applyEach = applyEach$1; + exports.applyEach = applyEach; exports.applyEachSeries = applyEachSeries; exports.asyncify = asyncify; exports.auto = auto; exports.autoInject = autoInject; - exports.cargo = cargo; - exports.cargoQueue = cargo$1; + exports.cargo = cargo$1; + exports.cargoQueue = cargo; exports.compose = compose; exports.concat = concat$1; exports.concatLimit = concatLimit$1; exports.concatSeries = concatSeries$1; - exports.constant = constant; + exports.constant = constant$1; + exports.default = index; exports.detect = detect$1; exports.detectLimit = detectLimit$1; exports.detectSeries = detectSeries$1; exports.dir = dir; + exports.doDuring = doWhilst$1; exports.doUntil = doUntil; exports.doWhilst = doWhilst$1; + exports.during = whilst$1; exports.each = each; - exports.eachLimit = eachLimit$2; + exports.eachLimit = eachLimit$1; exports.eachOf = eachOf$1; - exports.eachOfLimit = eachOfLimit$2; + exports.eachOfLimit = eachOfLimit$1; exports.eachOfSeries = eachOfSeries$1; exports.eachSeries = eachSeries$1; exports.ensureAsync = ensureAsync; @@ -21432,10 +21660,25 @@ module.exports.isDynamicImport = function(node) { exports.filter = filter$1; exports.filterLimit = filterLimit$1; exports.filterSeries = filterSeries$1; + exports.find = detect$1; + exports.findLimit = detectLimit$1; + exports.findSeries = detectSeries$1; + exports.flatMap = concat$1; + exports.flatMapLimit = concatLimit$1; + exports.flatMapSeries = concatSeries$1; + exports.foldl = reduce$1; + exports.foldr = reduceRight; + exports.forEach = each; + exports.forEachLimit = eachLimit$1; + exports.forEachOf = eachOf$1; + exports.forEachOfLimit = eachOfLimit$1; + exports.forEachOfSeries = eachOfSeries$1; + exports.forEachSeries = eachSeries$1; exports.forever = forever$1; exports.groupBy = groupBy; exports.groupByLimit = groupByLimit$1; exports.groupBySeries = groupBySeries; + exports.inject = reduce$1; exports.log = log; exports.map = map$1; exports.mapLimit = mapLimit$1; @@ -21445,20 +21688,23 @@ module.exports.isDynamicImport = function(node) { exports.mapValuesSeries = mapValuesSeries; exports.memoize = memoize; exports.nextTick = nextTick; - exports.parallel = parallel$1; + exports.parallel = parallel; exports.parallelLimit = parallelLimit; exports.priorityQueue = priorityQueue; - exports.queue = queue$1; + exports.queue = queue; exports.race = race$1; exports.reduce = reduce$1; exports.reduceRight = reduceRight; exports.reflect = reflect; exports.reflectAll = reflectAll; - exports.reject = reject$2; + exports.reject = reject$1; exports.rejectLimit = rejectLimit$1; exports.rejectSeries = rejectSeries$1; exports.retry = retry; exports.retryable = retryable; + exports.select = filter$1; + exports.selectLimit = filterLimit$1; + exports.selectSeries = filterSeries$1; exports.seq = seq; exports.series = series; exports.setImmediate = setImmediate$1; @@ -21476,37 +21722,11 @@ module.exports.isDynamicImport = function(node) { exports.until = until; exports.waterfall = waterfall$1; exports.whilst = whilst$1; - exports.all = every$1; - exports.allLimit = everyLimit$1; - exports.allSeries = everySeries$1; - exports.any = some$1; - exports.anyLimit = someLimit$1; - exports.anySeries = someSeries$1; - exports.find = detect$1; - exports.findLimit = detectLimit$1; - exports.findSeries = detectSeries$1; - exports.flatMap = concat$1; - exports.flatMapLimit = concatLimit$1; - exports.flatMapSeries = concatSeries$1; - exports.forEach = each; - exports.forEachSeries = eachSeries$1; - exports.forEachLimit = eachLimit$2; - exports.forEachOf = eachOf$1; - exports.forEachOfSeries = eachOfSeries$1; - exports.forEachOfLimit = eachOfLimit$2; - exports.inject = reduce$1; - exports.foldl = reduce$1; - exports.foldr = reduceRight; - exports.select = filter$1; - exports.selectLimit = filterLimit$1; - exports.selectSeries = filterSeries$1; exports.wrapSync = asyncify; - exports.during = whilst$1; - exports.doDuring = doWhilst$1; Object.defineProperty(exports, '__esModule', { value: true }); -}))); +})); /***/ }), @@ -24101,38 +24321,26 @@ module.exports = function callBoundIntrinsic(name, allowMissing) { var bind = __nccwpck_require__(88334); var GetIntrinsic = __nccwpck_require__(74538); +var setFunctionLength = __nccwpck_require__(64056); +var $TypeError = __nccwpck_require__(6361); var $apply = GetIntrinsic('%Function.prototype.apply%'); var $call = GetIntrinsic('%Function.prototype.call%'); var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); +var $defineProperty = __nccwpck_require__(6123); var $max = GetIntrinsic('%Math.max%'); -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } + if (typeof originalFunction !== 'function') { + throw new $TypeError('a function is required'); } - return func; + var func = $reflectApply(bind, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); }; var applyBind = function applyBind() { @@ -28572,7 +28780,7 @@ module.exports = CpFileError; const {promisify} = __nccwpck_require__(73837); const fs = __nccwpck_require__(77758); -const makeDir = __nccwpck_require__(39126); +const makeDir = __nccwpck_require__(20838); const pEvent = __nccwpck_require__(94568); const CpFileError = __nccwpck_require__(78634); @@ -28797,764 +29005,2578 @@ module.exports.sync = (source, destination, options) => { /***/ }), -/***/ 91890: +/***/ 20838: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const EventEmitter = __nccwpck_require__(82361); - -const written = new WeakMap(); - -class ProgressEmitter extends EventEmitter { - constructor(source, destination) { - super(); - this._source = source; - this._destination = destination; - } +const fs = __nccwpck_require__(57147); +const path = __nccwpck_require__(71017); +const {promisify} = __nccwpck_require__(73837); +const semver = __nccwpck_require__(21887); - set written(value) { - written.set(this, value); - this.emitProgress(); - } +const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); - get written() { - return written.get(this); - } +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +const checkPath = pth => { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); - emitProgress() { - const {size, written} = this; - this.emit('progress', { - src: this._source, - dest: this._destination, - size, - written, - percent: written === size ? 1 : written / size - }); + if (pathHasInvalidWinCharacters) { + const error = new Error(`Path contains invalid characters: ${pth}`); + error.code = 'EINVAL'; + throw error; + } } -} - -module.exports = ProgressEmitter; - +}; -/***/ }), +const processOptions = options => { + // https://github.com/sindresorhus/make-dir/issues/18 + const defaults = { + mode: 0o777, + fs + }; -/***/ 11331: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return { + ...defaults, + ...options + }; +}; -"use strict"; +const permissionError = pth => { + // This replicates the exception of `fs.mkdir` with native the + // `recusive` option when run on an invalid drive under Windows. + const error = new Error(`operation not permitted, mkdir '${pth}'`); + error.code = 'EPERM'; + error.errno = -4048; + error.path = pth; + error.syscall = 'mkdir'; + return error; +}; +const makeDir = async (input, options) => { + checkPath(input); + options = processOptions(options); -module.exports = __nccwpck_require__(5570)["default"]; + const mkdir = promisify(options.fs.mkdir); + const stat = promisify(options.fs.stat); + if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) { + const pth = path.resolve(input); -/***/ }), + await mkdir(pth, { + mode: options.mode, + recursive: true + }); -/***/ 42394: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return pth; + } -"use strict"; + const make = async pth => { + try { + await mkdir(pth, options.mode); + return pth; + } catch (error) { + if (error.code === 'EPERM') { + throw error; + } -module.exports = __nccwpck_require__(45816)["default"]; + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth); + } + if (error.message.includes('null bytes')) { + throw error; + } -/***/ }), + await make(path.dirname(pth)); -/***/ 54336: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return make(pth); + } -"use strict"; + try { + const stats = await stat(pth); + if (!stats.isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch (_) { + throw error; + } + return pth; + } + }; -module.exports = __nccwpck_require__(75842)["default"]; + return make(path.resolve(input)); +}; +module.exports = makeDir; -/***/ }), +module.exports.sync = (input, options) => { + checkPath(input); + options = processOptions(options); -/***/ 43377: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) { + const pth = path.resolve(input); -"use strict"; + fs.mkdirSync(pth, { + mode: options.mode, + recursive: true + }); + return pth; + } -module.exports = __nccwpck_require__(93328)["default"]; + const make = pth => { + try { + options.fs.mkdirSync(pth, options.mode); + } catch (error) { + if (error.code === 'EPERM') { + throw error; + } + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth); + } -/***/ }), + if (error.message.includes('null bytes')) { + throw error; + } -/***/ 40753: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + make(path.dirname(pth)); + return make(pth); + } -"use strict"; + try { + if (!options.fs.statSync(pth).isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch (_) { + throw error; + } + } + return pth; + }; -module.exports = __nccwpck_require__(42837)["default"]; + return make(path.resolve(input)); +}; /***/ }), -/***/ 18813: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; +/***/ 21887: +/***/ ((module, exports) => { +exports = module.exports = SemVer -module.exports = __nccwpck_require__(41602)["default"]; +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' -/***/ }), +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 -/***/ 92034: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 -"use strict"; +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 +// The actual regexps go on exports.re +var re = exports.re = [] +var safeRe = exports.safeRe = [] +var src = exports.src = [] +var t = exports.tokens = {} +var R = 0 -module.exports = __nccwpck_require__(45418)["default"]; +function tok (n) { + t[n] = R++ +} +var 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. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] -/***/ 74312: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} -"use strict"; +// 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. -module.exports = __nccwpck_require__(52937)["default"]; +tok('NUMERICIDENTIFIER') +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' +tok('NUMERICIDENTIFIERLOOSE') +src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. -/***/ }), +tok('NONNUMERICIDENTIFIER') +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' -/***/ 53214: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// ## Main Version +// Three dot-separated numeric identifiers. -"use strict"; +tok('MAINVERSION') +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')' +tok('MAINVERSIONLOOSE') +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' -module.exports = __nccwpck_require__(25423)["default"]; +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. +tok('PRERELEASEIDENTIFIER') +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' -/***/ }), +tok('PRERELEASEIDENTIFIERLOOSE') +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' -/***/ 27019: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. -"use strict"; +tok('PRERELEASE') +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' +tok('PRERELEASELOOSE') +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' -module.exports = __nccwpck_require__(30534)["default"]; +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. +tok('BUILDIDENTIFIER') +src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' -/***/ }), +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. -/***/ 14096: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +tok('BUILD') +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' -"use strict"; +// ## 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. -module.exports = __nccwpck_require__(43139)["default"]; +tok('FULL') +tok('FULLPLAIN') +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?' +src[t.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. +tok('LOOSEPLAIN') +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?' -/***/ 5570: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +tok('LOOSE') +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' -"use strict"; -var __webpack_unused_export__; +tok('GTLT') +src[t.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. +tok('XRANGEIDENTIFIERLOOSE') +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +tok('XRANGEIDENTIFIER') +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' -__webpack_unused_export__ = ({ - value: true -}); +tok('XRANGEPLAIN') +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' -var _buffer = __nccwpck_require__(14300); +tok('XRANGEPLAINLOOSE') +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' -var _create_buffer = __nccwpck_require__(9038); +tok('XRANGE') +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' +tok('XRANGELOOSE') +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' -var _create_buffer2 = _interopRequireDefault(_create_buffer); +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +tok('COERCE') +src[t.COERCE] = '(^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' +tok('COERCERTL') +re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') +safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') -var _define_crc = __nccwpck_require__(51498); +// Tilde ranges. +// Meaning is "reasonably at or greater than" +tok('LONETILDE') +src[t.LONETILDE] = '(?:~>?)' -var _define_crc2 = _interopRequireDefault(_define_crc); +tok('TILDETRIM') +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') +var tildeTrimReplace = '$1~' -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +tok('TILDE') +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' +tok('TILDELOOSE') +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' -var crc1 = (0, _define_crc2.default)('crc1', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); +// Caret ranges. +// Meaning is "at least and backwards compatible with" +tok('LONECARET') +src[t.LONECARET] = '(?:\\^)' - var crc = ~~previous; - var accum = 0; +tok('CARETTRIM') +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') +var caretTrimReplace = '$1^' - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - accum += byte; - } +tok('CARET') +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' +tok('CARETLOOSE') +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' - crc += accum % 256; - return crc % 256; -}); +// A simple gt/lt/eq thing, or just "" to indicate "any version" +tok('COMPARATORLOOSE') +src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' +tok('COMPARATOR') +src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' -exports["default"] = crc1; +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +tok('COMPARATORTRIM') +src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' +// this one has to use the /g flag +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') +var 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. +tok('HYPHENRANGE') +src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAIN] + ')' + + '\\s*$' -/***/ 45816: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +tok('HYPHENRANGELOOSE') +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s*$' -"use strict"; -var __webpack_unused_export__; +// Star ranges basically just allow anything at all. +tok('STAR') +src[t.STAR] = '(<|>)?=?\\s*\\*' +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) -__webpack_unused_export__ = ({ - value: true -}); + // Replace all greedy whitespace 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. + safeRe[i] = new RegExp(makeSafeRe(src[i])) + } +} -var _buffer = __nccwpck_require__(14300); +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } -var _create_buffer = __nccwpck_require__(9038); + if (version instanceof SemVer) { + return version + } -var _create_buffer2 = _interopRequireDefault(_create_buffer); + if (typeof version !== 'string') { + return null + } -var _define_crc = __nccwpck_require__(51498); + if (version.length > MAX_LENGTH) { + return null + } -var _define_crc2 = _interopRequireDefault(_define_crc); + var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] + if (!r.test(version)) { + return null + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} -// Generated by `./pycrc.py --algorithm=table-driven --model=crc-16 --generate=c` -// prettier-ignore -var TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040]; +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} -if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} -var crc16 = (0, _define_crc2.default)('crc-16', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); +exports.SemVer = SemVer - var crc = ~~previous; +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - crc = (TABLE[(crc ^ byte) & 0xff] ^ crc >> 8) & 0xffff; + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') } - return crc; -}); + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } -exports["default"] = crc16; + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) -/***/ }), + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } -/***/ 75842: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + this.raw = version -"use strict"; -var __webpack_unused_export__; + // 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') + } -__webpack_unused_export__ = ({ - value: true -}); + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } -var _buffer = __nccwpck_require__(14300); + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } -var _create_buffer = __nccwpck_require__(9038); + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } -var _create_buffer2 = _interopRequireDefault(_create_buffer); + this.build = m[5] ? m[5].split('.') : [] + this.format() +} -var _define_crc = __nccwpck_require__(51498); +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} -var _define_crc2 = _interopRequireDefault(_define_crc); +SemVer.prototype.toString = function () { + return this.version +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } -// Generated by `./pycrc.py --algorithm=table-driven --model=ccitt --generate=c` -// prettier-ignore -var TABLE = [0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0]; + return this.compareMain(other) || this.comparePre(other) +} -if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } -var crc16ccitt = (0, _define_crc2.default)('ccitt', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} - var crc = typeof previous !== 'undefined' ? ~~previous : 0xffff; +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - crc = (TABLE[(crc >> 8 ^ byte) & 0xff] ^ crc << 8) & 0xffff; + // 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 } - return crc; -}); + var i = 0 + do { + var a = this.prerelease[i] + var 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) +} -exports["default"] = crc16ccitt; +SemVer.prototype.compareBuild = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + var i = 0 + do { + var a = this.build[i] + var 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. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + 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) + this.inc('pre', identifier) + 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) + } + this.inc('pre', identifier) + break -/***/ 93328: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + 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': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var 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 + this.prerelease.push(0) + } + } + 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 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break -"use strict"; -var __webpack_unused_export__; + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } -__webpack_unused_export__ = ({ - value: true -}); + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} -var _buffer = __nccwpck_require__(14300); +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} -var _create_buffer = __nccwpck_require__(9038); +exports.compareIdentifiers = compareIdentifiers -var _create_buffer2 = _interopRequireDefault(_create_buffer); +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) -var _define_crc = __nccwpck_require__(51498); + if (anum && bnum) { + a = +a + b = +b + } -var _define_crc2 = _interopRequireDefault(_define_crc); + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} -// Generated by `./pycrc.py --algorithm=table-driven --model=kermit --generate=c` -// prettier-ignore -var TABLE = [0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78]; +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} -if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} -var crc16kermit = (0, _define_crc2.default)('kermit', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} - var crc = typeof previous !== 'undefined' ? ~~previous : 0x0000; +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - crc = (TABLE[(crc ^ byte) & 0xff] ^ crc >> 8) & 0xffff; - } +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} - return crc; -}); +exports.compareBuild = compareBuild +function compareBuild (a, b, loose) { + var versionA = new SemVer(a, loose) + var versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} -exports["default"] = crc16kermit; +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(a, b, loose) + }) +} -/***/ }), +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(b, a, loose) + }) +} -/***/ 42837: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} -"use strict"; -var __webpack_unused_export__; +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} -__webpack_unused_export__ = ({ - value: true -}); +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} -var _buffer = __nccwpck_require__(14300); +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} -var _create_buffer = __nccwpck_require__(9038); +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} -var _create_buffer2 = _interopRequireDefault(_create_buffer); +exports.cmp = cmp +function 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 -var _define_crc = __nccwpck_require__(51498); + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b -var _define_crc2 = _interopRequireDefault(_define_crc); + case '': + case '=': + case '==': + return eq(a, b, loose) -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + case '!=': + return neq(a, b, loose) -// Generated by `./pycrc.py --algorithm=table-driven --model=crc-16-modbus --generate=c` -// prettier-ignore -var TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040]; + case '>': + return gt(a, b, loose) -if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + case '>=': + return gte(a, b, loose) -var crc16modbus = (0, _define_crc2.default)('crc-16-modbus', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + case '<': + return lt(a, b, loose) - var crc = typeof previous !== 'undefined' ? ~~previous : 0xffff; + case '<=': + return lte(a, b, loose) - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - crc = (TABLE[(crc ^ byte) & 0xff] ^ crc >> 8) & 0xffff; + default: + throw new TypeError('Invalid operator: ' + op) } +} - return crc; -}); - -exports["default"] = crc16modbus; - +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } -/***/ }), + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } -/***/ 41602: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } -"use strict"; -var __webpack_unused_export__; + 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 + } -__webpack_unused_export__ = ({ - value: true -}); + debug('comp', this) +} -var _buffer = __nccwpck_require__(14300); +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var m = comp.match(r) -var _create_buffer = __nccwpck_require__(9038); + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } -var _create_buffer2 = _interopRequireDefault(_create_buffer); + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } -var _define_crc = __nccwpck_require__(51498); + // 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) + } +} -var _define_crc2 = _interopRequireDefault(_define_crc); +Comparator.prototype.toString = function () { + return this.value +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) -var crc16xmodem = (0, _define_crc2.default)('xmodem', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + if (this.semver === ANY || version === ANY) { + return true + } - var crc = typeof previous !== 'undefined' ? ~~previous : 0x0; + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - var code = crc >>> 8 & 0xff; + return cmp(version, this.operator, this.semver, this.options) +} - code ^= byte & 0xff; - code ^= code >>> 4; - crc = crc << 8 & 0xffff; - crc ^= code; - code = code << 5 & 0xffff; - crc ^= code; - code = code << 7 & 0xffff; - crc ^= code; +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') } - return crc; -}); + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } -exports["default"] = crc16xmodem; + var rangeTmp + if (this.operator === '') { + if (this.value === '') { + return true + } + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) + } -/***/ }), + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) -/***/ 45418: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} -"use strict"; -var __webpack_unused_export__; +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } -__webpack_unused_export__ = ({ - value: true -}); + if (range instanceof Comparator) { + return new Range(range.value, options) + } -var _buffer = __nccwpck_require__(14300); + if (!(this instanceof Range)) { + return new Range(range, options) + } -var _create_buffer = __nccwpck_require__(9038); + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease -var _create_buffer2 = _interopRequireDefault(_create_buffer); + // 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(' ') -var _define_crc = __nccwpck_require__(51498); + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) -var _define_crc2 = _interopRequireDefault(_define_crc); + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + this.raw) + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + this.format() +} -// Generated by `./pycrc.py --algorithm=table-drive --model=crc-24 --generate=c` -// prettier-ignore -var TABLE = [0x000000, 0x864cfb, 0x8ad50d, 0x0c99f6, 0x93e6e1, 0x15aa1a, 0x1933ec, 0x9f7f17, 0xa18139, 0x27cdc2, 0x2b5434, 0xad18cf, 0x3267d8, 0xb42b23, 0xb8b2d5, 0x3efe2e, 0xc54e89, 0x430272, 0x4f9b84, 0xc9d77f, 0x56a868, 0xd0e493, 0xdc7d65, 0x5a319e, 0x64cfb0, 0xe2834b, 0xee1abd, 0x685646, 0xf72951, 0x7165aa, 0x7dfc5c, 0xfbb0a7, 0x0cd1e9, 0x8a9d12, 0x8604e4, 0x00481f, 0x9f3708, 0x197bf3, 0x15e205, 0x93aefe, 0xad50d0, 0x2b1c2b, 0x2785dd, 0xa1c926, 0x3eb631, 0xb8faca, 0xb4633c, 0x322fc7, 0xc99f60, 0x4fd39b, 0x434a6d, 0xc50696, 0x5a7981, 0xdc357a, 0xd0ac8c, 0x56e077, 0x681e59, 0xee52a2, 0xe2cb54, 0x6487af, 0xfbf8b8, 0x7db443, 0x712db5, 0xf7614e, 0x19a3d2, 0x9fef29, 0x9376df, 0x153a24, 0x8a4533, 0x0c09c8, 0x00903e, 0x86dcc5, 0xb822eb, 0x3e6e10, 0x32f7e6, 0xb4bb1d, 0x2bc40a, 0xad88f1, 0xa11107, 0x275dfc, 0xdced5b, 0x5aa1a0, 0x563856, 0xd074ad, 0x4f0bba, 0xc94741, 0xc5deb7, 0x43924c, 0x7d6c62, 0xfb2099, 0xf7b96f, 0x71f594, 0xee8a83, 0x68c678, 0x645f8e, 0xe21375, 0x15723b, 0x933ec0, 0x9fa736, 0x19ebcd, 0x8694da, 0x00d821, 0x0c41d7, 0x8a0d2c, 0xb4f302, 0x32bff9, 0x3e260f, 0xb86af4, 0x2715e3, 0xa15918, 0xadc0ee, 0x2b8c15, 0xd03cb2, 0x567049, 0x5ae9bf, 0xdca544, 0x43da53, 0xc596a8, 0xc90f5e, 0x4f43a5, 0x71bd8b, 0xf7f170, 0xfb6886, 0x7d247d, 0xe25b6a, 0x641791, 0x688e67, 0xeec29c, 0x3347a4, 0xb50b5f, 0xb992a9, 0x3fde52, 0xa0a145, 0x26edbe, 0x2a7448, 0xac38b3, 0x92c69d, 0x148a66, 0x181390, 0x9e5f6b, 0x01207c, 0x876c87, 0x8bf571, 0x0db98a, 0xf6092d, 0x7045d6, 0x7cdc20, 0xfa90db, 0x65efcc, 0xe3a337, 0xef3ac1, 0x69763a, 0x578814, 0xd1c4ef, 0xdd5d19, 0x5b11e2, 0xc46ef5, 0x42220e, 0x4ebbf8, 0xc8f703, 0x3f964d, 0xb9dab6, 0xb54340, 0x330fbb, 0xac70ac, 0x2a3c57, 0x26a5a1, 0xa0e95a, 0x9e1774, 0x185b8f, 0x14c279, 0x928e82, 0x0df195, 0x8bbd6e, 0x872498, 0x016863, 0xfad8c4, 0x7c943f, 0x700dc9, 0xf64132, 0x693e25, 0xef72de, 0xe3eb28, 0x65a7d3, 0x5b59fd, 0xdd1506, 0xd18cf0, 0x57c00b, 0xc8bf1c, 0x4ef3e7, 0x426a11, 0xc426ea, 0x2ae476, 0xaca88d, 0xa0317b, 0x267d80, 0xb90297, 0x3f4e6c, 0x33d79a, 0xb59b61, 0x8b654f, 0x0d29b4, 0x01b042, 0x87fcb9, 0x1883ae, 0x9ecf55, 0x9256a3, 0x141a58, 0xefaaff, 0x69e604, 0x657ff2, 0xe33309, 0x7c4c1e, 0xfa00e5, 0xf69913, 0x70d5e8, 0x4e2bc6, 0xc8673d, 0xc4fecb, 0x42b230, 0xddcd27, 0x5b81dc, 0x57182a, 0xd154d1, 0x26359f, 0xa07964, 0xace092, 0x2aac69, 0xb5d37e, 0x339f85, 0x3f0673, 0xb94a88, 0x87b4a6, 0x01f85d, 0x0d61ab, 0x8b2d50, 0x145247, 0x921ebc, 0x9e874a, 0x18cbb1, 0xe37b16, 0x6537ed, 0x69ae1b, 0xefe2e0, 0x709df7, 0xf6d10c, 0xfa48fa, 0x7c0401, 0x42fa2f, 0xc4b6d4, 0xc82f22, 0x4e63d9, 0xd11cce, 0x575035, 0x5bc9c3, 0xdd8538]; +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} -if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); +Range.prototype.toString = function () { + return this.range +} -var crc24 = (0, _define_crc2.default)('crc-24', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) - var crc = typeof previous !== 'undefined' ? ~~previous : 0xb704ce; + // `~ 1.2.3` => `~1.2.3` + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - crc = (TABLE[(crc >> 16 ^ byte) & 0xff] ^ crc << 8) & 0xffffff; + // `^ 1.2.3` => `^1.2.3` + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) - return crc; -}); + return set +} -exports["default"] = crc24; +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + return this.set.some(function (thisComparators) { + return ( + isSatisfiable(thisComparators, options) && + range.set.some(function (rangeComparators) { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every(function (thisComparator) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) +} -/***/ }), +// take a set of comparators and determine whether there +// exists a version which can satisfy it +function isSatisfiable (comparators, options) { + var result = true + var remainingComparators = comparators.slice() + var testComparator = remainingComparators.pop() -/***/ 52937: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + while (result && remainingComparators.length) { + result = remainingComparators.every(function (otherComparator) { + return testComparator.intersects(otherComparator, options) + }) -"use strict"; -var __webpack_unused_export__; + testComparator = remainingComparators.pop() + } + return result +} -__webpack_unused_export__ = ({ - value: true -}); +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} -var _buffer = __nccwpck_require__(14300); +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function 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 +} -var _create_buffer = __nccwpck_require__(9038); +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} -var _create_buffer2 = _interopRequireDefault(_create_buffer); +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} -var _define_crc = __nccwpck_require__(51498); +function replaceTilde (comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret -var _define_crc2 = _interopRequireDefault(_define_crc); + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + debug('tilde return', ret) + return ret + }) +} -// Generated by `./pycrc.py --algorithm=table-driven --model=crc-32 --generate=c` -// prettier-ignore -var TABLE = [0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d]; +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} -if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret -var crc32 = (0, _define_crc2.default)('crc-32', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } - var crc = previous === 0 ? 0 : ~~previous ^ -1; + debug('caret return', ret) + return ret + }) +} - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - crc = TABLE[(crc ^ byte) & 0xff] ^ crc >>> 8; +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var 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 + // >1.2.3 => >= 1.2.4 + 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 + } + } + + ret = gtlt + M + '.' + m + '.' + p + pr + } else if (xm) { + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr + } else if (xp) { + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr + } + + 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. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(safeRe[t.STAR], '') +} + +// 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 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($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' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from } - return crc ^ -1; -}); + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } -exports["default"] = crc32; + return (from + ' ' + to).trim() +} +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } -/***/ }), + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } -/***/ 25423: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} -"use strict"; -var __webpack_unused_export__; +function testSet (set, version, options) { + for (var 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 (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } -__webpack_unused_export__ = ({ - value: true -}); + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } -var _buffer = __nccwpck_require__(14300); + // Version has a -pre, but it's not one of the ones we like. + return false + } -var _create_buffer = __nccwpck_require__(9038); + return true +} -var _create_buffer2 = _interopRequireDefault(_create_buffer); +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} -var _define_crc = __nccwpck_require__(51498); +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (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 +} -var _define_crc2 = _interopRequireDefault(_define_crc); +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (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 +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) -// Generated by `./pycrc.py --algorithm=table-driven --model=crc-8 --generate=c` -// prettier-ignore -var TABLE = [0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2, 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea, 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2, 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a, 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32, 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a, 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42, 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a, 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c, 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4, 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec, 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4, 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c, 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44, 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c, 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34, 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b, 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63, 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b, 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13, 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83, 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3]; + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } -if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } -var crc8 = (0, _define_crc2.default)('crc-8', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] - var crc = ~~previous; + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var 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 (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - crc = TABLE[(crc ^ byte) & 0xff] & 0xff; + if (minver && range.test(minver)) { + return minver } - return crc; -}); + return null +} -exports["default"] = crc8; +exports.validRange = validRange +function 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 + } +} +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} -/***/ }), +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} -/***/ 30534: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) -"use strict"; -var __webpack_unused_export__; + var 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 satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } -__webpack_unused_export__ = ({ - value: true -}); + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. -var _buffer = __nccwpck_require__(14300); + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] -var _create_buffer = __nccwpck_require__(9038); + var high = null + var low = null -var _create_buffer2 = _interopRequireDefault(_create_buffer); + comparators.forEach(function (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 + } + }) -var _define_crc = __nccwpck_require__(51498); + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } -var _define_crc2 = _interopRequireDefault(_define_crc); + // 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 +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} -// Generated by `./pycrc.py --algorithm=table-driven --model=dallas-1-wire --generate=c` -// prettier-ignore -var TABLE = [0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83, 0xc2, 0x9c, 0x7e, 0x20, 0xa3, 0xfd, 0x1f, 0x41, 0x9d, 0xc3, 0x21, 0x7f, 0xfc, 0xa2, 0x40, 0x1e, 0x5f, 0x01, 0xe3, 0xbd, 0x3e, 0x60, 0x82, 0xdc, 0x23, 0x7d, 0x9f, 0xc1, 0x42, 0x1c, 0xfe, 0xa0, 0xe1, 0xbf, 0x5d, 0x03, 0x80, 0xde, 0x3c, 0x62, 0xbe, 0xe0, 0x02, 0x5c, 0xdf, 0x81, 0x63, 0x3d, 0x7c, 0x22, 0xc0, 0x9e, 0x1d, 0x43, 0xa1, 0xff, 0x46, 0x18, 0xfa, 0xa4, 0x27, 0x79, 0x9b, 0xc5, 0x84, 0xda, 0x38, 0x66, 0xe5, 0xbb, 0x59, 0x07, 0xdb, 0x85, 0x67, 0x39, 0xba, 0xe4, 0x06, 0x58, 0x19, 0x47, 0xa5, 0xfb, 0x78, 0x26, 0xc4, 0x9a, 0x65, 0x3b, 0xd9, 0x87, 0x04, 0x5a, 0xb8, 0xe6, 0xa7, 0xf9, 0x1b, 0x45, 0xc6, 0x98, 0x7a, 0x24, 0xf8, 0xa6, 0x44, 0x1a, 0x99, 0xc7, 0x25, 0x7b, 0x3a, 0x64, 0x86, 0xd8, 0x5b, 0x05, 0xe7, 0xb9, 0x8c, 0xd2, 0x30, 0x6e, 0xed, 0xb3, 0x51, 0x0f, 0x4e, 0x10, 0xf2, 0xac, 0x2f, 0x71, 0x93, 0xcd, 0x11, 0x4f, 0xad, 0xf3, 0x70, 0x2e, 0xcc, 0x92, 0xd3, 0x8d, 0x6f, 0x31, 0xb2, 0xec, 0x0e, 0x50, 0xaf, 0xf1, 0x13, 0x4d, 0xce, 0x90, 0x72, 0x2c, 0x6d, 0x33, 0xd1, 0x8f, 0x0c, 0x52, 0xb0, 0xee, 0x32, 0x6c, 0x8e, 0xd0, 0x53, 0x0d, 0xef, 0xb1, 0xf0, 0xae, 0x4c, 0x12, 0x91, 0xcf, 0x2d, 0x73, 0xca, 0x94, 0x76, 0x28, 0xab, 0xf5, 0x17, 0x49, 0x08, 0x56, 0xb4, 0xea, 0x69, 0x37, 0xd5, 0x8b, 0x57, 0x09, 0xeb, 0xb5, 0x36, 0x68, 0x8a, 0xd4, 0x95, 0xcb, 0x29, 0x77, 0xf4, 0xaa, 0x48, 0x16, 0xe9, 0xb7, 0x55, 0x0b, 0x88, 0xd6, 0x34, 0x6a, 0x2b, 0x75, 0x97, 0xc9, 0x4a, 0x14, 0xf6, 0xa8, 0x74, 0x2a, 0xc8, 0x96, 0x15, 0x4b, 0xa9, 0xf7, 0xb6, 0xe8, 0x0a, 0x54, 0xd7, 0x89, 0x6b, 0x35]; +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} -if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); +exports.coerce = coerce +function coerce (version, options) { + if (version instanceof SemVer) { + return version + } -var crc81wire = (0, _define_crc2.default)('dallas-1-wire', function (buf, previous) { - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + if (typeof version === 'number') { + version = String(version) + } - var crc = ~~previous; + if (typeof version !== 'string') { + return null + } - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - crc = TABLE[(crc ^ byte) & 0xff] & 0xff; + options = options || {} + + var match = null + if (!options.rtl) { + match = version.match(safeRe[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. + var next + while ((next = safeRe[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 + } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + safeRe[t.COERCERTL].lastIndex = -1 } - return crc; -}); + if (match === null) { + return null + } -exports["default"] = crc81wire; + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) +} /***/ }), -/***/ 43139: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 91890: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var __webpack_unused_export__; +const EventEmitter = __nccwpck_require__(82361); -__webpack_unused_export__ = ({ - value: true -}); +const written = new WeakMap(); -var _buffer = __nccwpck_require__(14300); +class ProgressEmitter extends EventEmitter { + constructor(source, destination) { + super(); + this._source = source; + this._destination = destination; + } -var _create_buffer = __nccwpck_require__(9038); + set written(value) { + written.set(this, value); + this.emitProgress(); + } -var _create_buffer2 = _interopRequireDefault(_create_buffer); + get written() { + return written.get(this); + } -var _define_crc = __nccwpck_require__(51498); + emitProgress() { + const {size, written} = this; + this.emit('progress', { + src: this._source, + dest: this._destination, + size, + written, + percent: written === size ? 1 : written / size + }); + } +} -var _define_crc2 = _interopRequireDefault(_define_crc); +module.exports = ProgressEmitter; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -// Generated by `./pycrc.py --algorithm=table-driven --model=jam --generate=c` -// prettier-ignore -var TABLE = [0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d]; +/***/ }), -if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); +/***/ 11331: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var crcjam = (0, _define_crc2.default)('jam', function (buf) { - var previous = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1; +"use strict"; - if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); - var crc = previous === 0 ? 0 : ~~previous; +module.exports = __nccwpck_require__(5570)["default"]; - for (var index = 0; index < buf.length; index++) { - var byte = buf[index]; - crc = TABLE[(crc ^ byte) & 0xff] ^ crc >>> 8; - } - return crc; -}); +/***/ }), -exports["default"] = crcjam; +/***/ 42394: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; -/***/ }), -/***/ 9038: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +module.exports = __nccwpck_require__(45816)["default"]; -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ - value: true -})); +/***/ 54336: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var _buffer = __nccwpck_require__(14300); +"use strict"; -var createBuffer = _buffer.Buffer.from && _buffer.Buffer.alloc && _buffer.Buffer.allocUnsafe && _buffer.Buffer.allocUnsafeSlow ? _buffer.Buffer.from : // support for Node < 5.10 -function (val) { - return new _buffer.Buffer(val); -}; -exports["default"] = createBuffer; +module.exports = __nccwpck_require__(75842)["default"]; /***/ }), -/***/ 51498: -/***/ ((__unused_webpack_module, exports) => { +/***/ 43377: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); +module.exports = __nccwpck_require__(93328)["default"]; -exports["default"] = function (model, calc) { - var fn = function fn(buf, previous) { - return calc(buf, previous) >>> 0; - }; - fn.signed = calc; - fn.unsigned = fn; - fn.model = model; - return fn; -}; +/***/ }), + +/***/ 40753: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = __nccwpck_require__(42837)["default"]; /***/ }), -/***/ 93973: +/***/ 18813: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports = { - crc1: __nccwpck_require__(11331), - crc8: __nccwpck_require__(53214), - crc81wire: __nccwpck_require__(27019), - crc16: __nccwpck_require__(42394), - crc16ccitt: __nccwpck_require__(54336), - crc16modbus: __nccwpck_require__(40753), - crc16xmodem: __nccwpck_require__(18813), - crc16kermit: __nccwpck_require__(43377), - crc24: __nccwpck_require__(92034), - crc32: __nccwpck_require__(74312), - crcjam: __nccwpck_require__(14096) -}; +module.exports = __nccwpck_require__(41602)["default"]; /***/ }), -/***/ 94521: +/***/ 92034: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/** - * node-crc32-stream - * - * Copyright (c) 2014 Chris Talkington, contributors. + + +module.exports = __nccwpck_require__(45418)["default"]; + + +/***/ }), + +/***/ 74312: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = __nccwpck_require__(52937)["default"]; + + +/***/ }), + +/***/ 53214: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = __nccwpck_require__(25423)["default"]; + + +/***/ }), + +/***/ 27019: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = __nccwpck_require__(30534)["default"]; + + +/***/ }), + +/***/ 14096: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = __nccwpck_require__(43139)["default"]; + + +/***/ }), + +/***/ 5570: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var crc1 = (0, _define_crc2.default)('crc1', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = ~~previous; + var accum = 0; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + accum += byte; + } + + crc += accum % 256; + return crc % 256; +}); + +exports["default"] = crc1; + + +/***/ }), + +/***/ 45816: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Generated by `./pycrc.py --algorithm=table-driven --model=crc-16 --generate=c` +// prettier-ignore +var TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040]; + +if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + +var crc16 = (0, _define_crc2.default)('crc-16', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = ~~previous; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + crc = (TABLE[(crc ^ byte) & 0xff] ^ crc >> 8) & 0xffff; + } + + return crc; +}); + +exports["default"] = crc16; + + +/***/ }), + +/***/ 75842: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Generated by `./pycrc.py --algorithm=table-driven --model=ccitt --generate=c` +// prettier-ignore +var TABLE = [0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0]; + +if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + +var crc16ccitt = (0, _define_crc2.default)('ccitt', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = typeof previous !== 'undefined' ? ~~previous : 0xffff; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + crc = (TABLE[(crc >> 8 ^ byte) & 0xff] ^ crc << 8) & 0xffff; + } + + return crc; +}); + +exports["default"] = crc16ccitt; + + +/***/ }), + +/***/ 93328: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Generated by `./pycrc.py --algorithm=table-driven --model=kermit --generate=c` +// prettier-ignore +var TABLE = [0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78]; + +if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + +var crc16kermit = (0, _define_crc2.default)('kermit', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = typeof previous !== 'undefined' ? ~~previous : 0x0000; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + crc = (TABLE[(crc ^ byte) & 0xff] ^ crc >> 8) & 0xffff; + } + + return crc; +}); + +exports["default"] = crc16kermit; + + +/***/ }), + +/***/ 42837: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Generated by `./pycrc.py --algorithm=table-driven --model=crc-16-modbus --generate=c` +// prettier-ignore +var TABLE = [0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040]; + +if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + +var crc16modbus = (0, _define_crc2.default)('crc-16-modbus', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = typeof previous !== 'undefined' ? ~~previous : 0xffff; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + crc = (TABLE[(crc ^ byte) & 0xff] ^ crc >> 8) & 0xffff; + } + + return crc; +}); + +exports["default"] = crc16modbus; + + +/***/ }), + +/***/ 41602: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var crc16xmodem = (0, _define_crc2.default)('xmodem', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = typeof previous !== 'undefined' ? ~~previous : 0x0; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + var code = crc >>> 8 & 0xff; + + code ^= byte & 0xff; + code ^= code >>> 4; + crc = crc << 8 & 0xffff; + crc ^= code; + code = code << 5 & 0xffff; + crc ^= code; + code = code << 7 & 0xffff; + crc ^= code; + } + + return crc; +}); + +exports["default"] = crc16xmodem; + + +/***/ }), + +/***/ 45418: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Generated by `./pycrc.py --algorithm=table-drive --model=crc-24 --generate=c` +// prettier-ignore +var TABLE = [0x000000, 0x864cfb, 0x8ad50d, 0x0c99f6, 0x93e6e1, 0x15aa1a, 0x1933ec, 0x9f7f17, 0xa18139, 0x27cdc2, 0x2b5434, 0xad18cf, 0x3267d8, 0xb42b23, 0xb8b2d5, 0x3efe2e, 0xc54e89, 0x430272, 0x4f9b84, 0xc9d77f, 0x56a868, 0xd0e493, 0xdc7d65, 0x5a319e, 0x64cfb0, 0xe2834b, 0xee1abd, 0x685646, 0xf72951, 0x7165aa, 0x7dfc5c, 0xfbb0a7, 0x0cd1e9, 0x8a9d12, 0x8604e4, 0x00481f, 0x9f3708, 0x197bf3, 0x15e205, 0x93aefe, 0xad50d0, 0x2b1c2b, 0x2785dd, 0xa1c926, 0x3eb631, 0xb8faca, 0xb4633c, 0x322fc7, 0xc99f60, 0x4fd39b, 0x434a6d, 0xc50696, 0x5a7981, 0xdc357a, 0xd0ac8c, 0x56e077, 0x681e59, 0xee52a2, 0xe2cb54, 0x6487af, 0xfbf8b8, 0x7db443, 0x712db5, 0xf7614e, 0x19a3d2, 0x9fef29, 0x9376df, 0x153a24, 0x8a4533, 0x0c09c8, 0x00903e, 0x86dcc5, 0xb822eb, 0x3e6e10, 0x32f7e6, 0xb4bb1d, 0x2bc40a, 0xad88f1, 0xa11107, 0x275dfc, 0xdced5b, 0x5aa1a0, 0x563856, 0xd074ad, 0x4f0bba, 0xc94741, 0xc5deb7, 0x43924c, 0x7d6c62, 0xfb2099, 0xf7b96f, 0x71f594, 0xee8a83, 0x68c678, 0x645f8e, 0xe21375, 0x15723b, 0x933ec0, 0x9fa736, 0x19ebcd, 0x8694da, 0x00d821, 0x0c41d7, 0x8a0d2c, 0xb4f302, 0x32bff9, 0x3e260f, 0xb86af4, 0x2715e3, 0xa15918, 0xadc0ee, 0x2b8c15, 0xd03cb2, 0x567049, 0x5ae9bf, 0xdca544, 0x43da53, 0xc596a8, 0xc90f5e, 0x4f43a5, 0x71bd8b, 0xf7f170, 0xfb6886, 0x7d247d, 0xe25b6a, 0x641791, 0x688e67, 0xeec29c, 0x3347a4, 0xb50b5f, 0xb992a9, 0x3fde52, 0xa0a145, 0x26edbe, 0x2a7448, 0xac38b3, 0x92c69d, 0x148a66, 0x181390, 0x9e5f6b, 0x01207c, 0x876c87, 0x8bf571, 0x0db98a, 0xf6092d, 0x7045d6, 0x7cdc20, 0xfa90db, 0x65efcc, 0xe3a337, 0xef3ac1, 0x69763a, 0x578814, 0xd1c4ef, 0xdd5d19, 0x5b11e2, 0xc46ef5, 0x42220e, 0x4ebbf8, 0xc8f703, 0x3f964d, 0xb9dab6, 0xb54340, 0x330fbb, 0xac70ac, 0x2a3c57, 0x26a5a1, 0xa0e95a, 0x9e1774, 0x185b8f, 0x14c279, 0x928e82, 0x0df195, 0x8bbd6e, 0x872498, 0x016863, 0xfad8c4, 0x7c943f, 0x700dc9, 0xf64132, 0x693e25, 0xef72de, 0xe3eb28, 0x65a7d3, 0x5b59fd, 0xdd1506, 0xd18cf0, 0x57c00b, 0xc8bf1c, 0x4ef3e7, 0x426a11, 0xc426ea, 0x2ae476, 0xaca88d, 0xa0317b, 0x267d80, 0xb90297, 0x3f4e6c, 0x33d79a, 0xb59b61, 0x8b654f, 0x0d29b4, 0x01b042, 0x87fcb9, 0x1883ae, 0x9ecf55, 0x9256a3, 0x141a58, 0xefaaff, 0x69e604, 0x657ff2, 0xe33309, 0x7c4c1e, 0xfa00e5, 0xf69913, 0x70d5e8, 0x4e2bc6, 0xc8673d, 0xc4fecb, 0x42b230, 0xddcd27, 0x5b81dc, 0x57182a, 0xd154d1, 0x26359f, 0xa07964, 0xace092, 0x2aac69, 0xb5d37e, 0x339f85, 0x3f0673, 0xb94a88, 0x87b4a6, 0x01f85d, 0x0d61ab, 0x8b2d50, 0x145247, 0x921ebc, 0x9e874a, 0x18cbb1, 0xe37b16, 0x6537ed, 0x69ae1b, 0xefe2e0, 0x709df7, 0xf6d10c, 0xfa48fa, 0x7c0401, 0x42fa2f, 0xc4b6d4, 0xc82f22, 0x4e63d9, 0xd11cce, 0x575035, 0x5bc9c3, 0xdd8538]; + +if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + +var crc24 = (0, _define_crc2.default)('crc-24', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = typeof previous !== 'undefined' ? ~~previous : 0xb704ce; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + crc = (TABLE[(crc >> 16 ^ byte) & 0xff] ^ crc << 8) & 0xffffff; + } + + return crc; +}); + +exports["default"] = crc24; + + +/***/ }), + +/***/ 52937: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Generated by `./pycrc.py --algorithm=table-driven --model=crc-32 --generate=c` +// prettier-ignore +var TABLE = [0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d]; + +if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + +var crc32 = (0, _define_crc2.default)('crc-32', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = previous === 0 ? 0 : ~~previous ^ -1; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + crc = TABLE[(crc ^ byte) & 0xff] ^ crc >>> 8; + } + + return crc ^ -1; +}); + +exports["default"] = crc32; + + +/***/ }), + +/***/ 25423: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Generated by `./pycrc.py --algorithm=table-driven --model=crc-8 --generate=c` +// prettier-ignore +var TABLE = [0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2, 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea, 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2, 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a, 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32, 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a, 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42, 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a, 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c, 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4, 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec, 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4, 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c, 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44, 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c, 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34, 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b, 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63, 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b, 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13, 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83, 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3]; + +if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + +var crc8 = (0, _define_crc2.default)('crc-8', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = ~~previous; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + crc = TABLE[(crc ^ byte) & 0xff] & 0xff; + } + + return crc; +}); + +exports["default"] = crc8; + + +/***/ }), + +/***/ 30534: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Generated by `./pycrc.py --algorithm=table-driven --model=dallas-1-wire --generate=c` +// prettier-ignore +var TABLE = [0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83, 0xc2, 0x9c, 0x7e, 0x20, 0xa3, 0xfd, 0x1f, 0x41, 0x9d, 0xc3, 0x21, 0x7f, 0xfc, 0xa2, 0x40, 0x1e, 0x5f, 0x01, 0xe3, 0xbd, 0x3e, 0x60, 0x82, 0xdc, 0x23, 0x7d, 0x9f, 0xc1, 0x42, 0x1c, 0xfe, 0xa0, 0xe1, 0xbf, 0x5d, 0x03, 0x80, 0xde, 0x3c, 0x62, 0xbe, 0xe0, 0x02, 0x5c, 0xdf, 0x81, 0x63, 0x3d, 0x7c, 0x22, 0xc0, 0x9e, 0x1d, 0x43, 0xa1, 0xff, 0x46, 0x18, 0xfa, 0xa4, 0x27, 0x79, 0x9b, 0xc5, 0x84, 0xda, 0x38, 0x66, 0xe5, 0xbb, 0x59, 0x07, 0xdb, 0x85, 0x67, 0x39, 0xba, 0xe4, 0x06, 0x58, 0x19, 0x47, 0xa5, 0xfb, 0x78, 0x26, 0xc4, 0x9a, 0x65, 0x3b, 0xd9, 0x87, 0x04, 0x5a, 0xb8, 0xe6, 0xa7, 0xf9, 0x1b, 0x45, 0xc6, 0x98, 0x7a, 0x24, 0xf8, 0xa6, 0x44, 0x1a, 0x99, 0xc7, 0x25, 0x7b, 0x3a, 0x64, 0x86, 0xd8, 0x5b, 0x05, 0xe7, 0xb9, 0x8c, 0xd2, 0x30, 0x6e, 0xed, 0xb3, 0x51, 0x0f, 0x4e, 0x10, 0xf2, 0xac, 0x2f, 0x71, 0x93, 0xcd, 0x11, 0x4f, 0xad, 0xf3, 0x70, 0x2e, 0xcc, 0x92, 0xd3, 0x8d, 0x6f, 0x31, 0xb2, 0xec, 0x0e, 0x50, 0xaf, 0xf1, 0x13, 0x4d, 0xce, 0x90, 0x72, 0x2c, 0x6d, 0x33, 0xd1, 0x8f, 0x0c, 0x52, 0xb0, 0xee, 0x32, 0x6c, 0x8e, 0xd0, 0x53, 0x0d, 0xef, 0xb1, 0xf0, 0xae, 0x4c, 0x12, 0x91, 0xcf, 0x2d, 0x73, 0xca, 0x94, 0x76, 0x28, 0xab, 0xf5, 0x17, 0x49, 0x08, 0x56, 0xb4, 0xea, 0x69, 0x37, 0xd5, 0x8b, 0x57, 0x09, 0xeb, 0xb5, 0x36, 0x68, 0x8a, 0xd4, 0x95, 0xcb, 0x29, 0x77, 0xf4, 0xaa, 0x48, 0x16, 0xe9, 0xb7, 0x55, 0x0b, 0x88, 0xd6, 0x34, 0x6a, 0x2b, 0x75, 0x97, 0xc9, 0x4a, 0x14, 0xf6, 0xa8, 0x74, 0x2a, 0xc8, 0x96, 0x15, 0x4b, 0xa9, 0xf7, 0xb6, 0xe8, 0x0a, 0x54, 0xd7, 0x89, 0x6b, 0x35]; + +if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + +var crc81wire = (0, _define_crc2.default)('dallas-1-wire', function (buf, previous) { + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = ~~previous; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + crc = TABLE[(crc ^ byte) & 0xff] & 0xff; + } + + return crc; +}); + +exports["default"] = crc81wire; + + +/***/ }), + +/***/ 43139: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +var __webpack_unused_export__; + + +__webpack_unused_export__ = ({ + value: true +}); + +var _buffer = __nccwpck_require__(14300); + +var _create_buffer = __nccwpck_require__(9038); + +var _create_buffer2 = _interopRequireDefault(_create_buffer); + +var _define_crc = __nccwpck_require__(51498); + +var _define_crc2 = _interopRequireDefault(_define_crc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Generated by `./pycrc.py --algorithm=table-driven --model=jam --generate=c` +// prettier-ignore +var TABLE = [0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d]; + +if (typeof Int32Array !== 'undefined') TABLE = new Int32Array(TABLE); + +var crcjam = (0, _define_crc2.default)('jam', function (buf) { + var previous = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1; + + if (!_buffer.Buffer.isBuffer(buf)) buf = (0, _create_buffer2.default)(buf); + + var crc = previous === 0 ? 0 : ~~previous; + + for (var index = 0; index < buf.length; index++) { + var byte = buf[index]; + crc = TABLE[(crc ^ byte) & 0xff] ^ crc >>> 8; + } + + return crc; +}); + +exports["default"] = crcjam; + + +/***/ }), + +/***/ 9038: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); + +var _buffer = __nccwpck_require__(14300); + +var createBuffer = _buffer.Buffer.from && _buffer.Buffer.alloc && _buffer.Buffer.allocUnsafe && _buffer.Buffer.allocUnsafeSlow ? _buffer.Buffer.from : // support for Node < 5.10 +function (val) { + return new _buffer.Buffer(val); +}; + +exports["default"] = createBuffer; + + +/***/ }), + +/***/ 51498: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); + +exports["default"] = function (model, calc) { + var fn = function fn(buf, previous) { + return calc(buf, previous) >>> 0; + }; + fn.signed = calc; + fn.unsigned = fn; + fn.model = model; + + return fn; +}; + + +/***/ }), + +/***/ 93973: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = { + crc1: __nccwpck_require__(11331), + crc8: __nccwpck_require__(53214), + crc81wire: __nccwpck_require__(27019), + crc16: __nccwpck_require__(42394), + crc16ccitt: __nccwpck_require__(54336), + crc16modbus: __nccwpck_require__(40753), + crc16xmodem: __nccwpck_require__(18813), + crc16kermit: __nccwpck_require__(43377), + crc24: __nccwpck_require__(92034), + crc32: __nccwpck_require__(74312), + crcjam: __nccwpck_require__(14096) +}; + + +/***/ }), + +/***/ 94521: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/** + * node-crc32-stream + * + * Copyright (c) 2014 Chris Talkington, contributors. * Licensed under the MIT license. * https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT */ @@ -29716,14 +31738,9 @@ module.exports = len => { /***/ 73680: /***/ ((module) => { -var twoify = function (n) { - if (n && !(n & (n - 1))) return n - var p = 1 - while (p < n) p <<= 1 - return p -} +/* eslint-disable no-var */ -var Cyclist = function (size) { +function Cyclist (size) { if (!(this instanceof Cyclist)) return new Cyclist(size) size = twoify(size) this.mask = size - 1 @@ -29750,6 +31767,13 @@ Cyclist.prototype.del = function (index) { module.exports = Cyclist +function twoify (n) { + if (n && !(n & (n - 1))) return n + var p = 1 + while (p < n) p <<= 1 + return p +} + /***/ }), @@ -30595,6 +32619,70 @@ formatters.O = function (v) { }; +/***/ }), + +/***/ 54564: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var $defineProperty = __nccwpck_require__(6123); + +var $SyntaxError = __nccwpck_require__(75474); +var $TypeError = __nccwpck_require__(6361); + +var gopd = __nccwpck_require__(18501); + +/** @type {import('.')} */ +module.exports = function defineDataProperty( + obj, + property, + value +) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new $TypeError('`obj` must be an object or a function`'); + } + if (typeof property !== 'string' && typeof property !== 'symbol') { + throw new $TypeError('`property` must be a string or a symbol`'); + } + if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { + throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); + } + if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { + throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); + } + if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { + throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); + } + if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { + throw new $TypeError('`loose`, if provided, must be a boolean'); + } + + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + + /* @type {false | TypedPropertyDescriptor} */ + var desc = !!gopd && gopd(obj, property); + + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value: value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { + // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable + obj[property] = value; // eslint-disable-line no-param-reassign + } else { + throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); + } +}; + + /***/ }), /***/ 23325: @@ -178687,6 +180775,114 @@ var eos = function(stream, opts, callback) { module.exports = eos; +/***/ }), + +/***/ 6123: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var GetIntrinsic = __nccwpck_require__(74538); + +/** @type {import('.')} */ +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false; +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = false; + } +} + +module.exports = $defineProperty; + + +/***/ }), + +/***/ 91933: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./eval')} */ +module.exports = EvalError; + + +/***/ }), + +/***/ 28015: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('.')} */ +module.exports = Error; + + +/***/ }), + +/***/ 54415: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./range')} */ +module.exports = RangeError; + + +/***/ }), + +/***/ 46279: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./ref')} */ +module.exports = ReferenceError; + + +/***/ }), + +/***/ 75474: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./syntax')} */ +module.exports = SyntaxError; + + +/***/ }), + +/***/ 6361: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./type')} */ +module.exports = TypeError; + + +/***/ }), + +/***/ 5065: +/***/ ((module) => { + +"use strict"; + + +/** @type {import('./uri')} */ +module.exports = URIError; + + /***/ }), /***/ 45662: @@ -180512,6 +182708,7 @@ if (worker_threads && !worker_threads.isMainThread) { Copyright (C) 2012 Joost-Wim Boekesteijn Copyright (C) 2012 Kris Kowal Copyright (C) 2012 Arpad Borsos + Copyright (C) 2020 Apple Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -180586,29 +182783,31 @@ if (worker_threads && !worker_threads.isMainThread) { Assignment: 1, Conditional: 2, ArrowFunction: 2, - LogicalOR: 3, - LogicalAND: 4, - BitwiseOR: 5, - BitwiseXOR: 6, - BitwiseAND: 7, - Equality: 8, - Relational: 9, - BitwiseSHIFT: 10, - Additive: 11, - Multiplicative: 12, - Exponentiation: 13, - Await: 14, - Unary: 14, - Postfix: 15, - OptionalChaining: 16, - Call: 17, - New: 18, - TaggedTemplate: 19, - Member: 20, - Primary: 21 + Coalesce: 3, + LogicalOR: 4, + LogicalAND: 5, + BitwiseOR: 6, + BitwiseXOR: 7, + BitwiseAND: 8, + Equality: 9, + Relational: 10, + BitwiseSHIFT: 11, + Additive: 12, + Multiplicative: 13, + Exponentiation: 14, + Await: 15, + Unary: 15, + Postfix: 16, + OptionalChaining: 17, + Call: 18, + New: 19, + TaggedTemplate: 20, + Member: 21, + Primary: 22 }; BinaryPrecedence = { + '??': Precedence.Coalesce, '||': Precedence.LogicalOR, '&&': Precedence.LogicalAND, '|': Precedence.BitwiseOR, @@ -180643,7 +182842,8 @@ if (worker_threads && !worker_threads.isMainThread) { F_ALLOW_UNPARATH_NEW = 1 << 2, F_FUNC_BODY = 1 << 3, F_DIRECTIVE_CTX = 1 << 4, - F_SEMICOLON_OPT = 1 << 5; + F_SEMICOLON_OPT = 1 << 5, + F_FOUND_COALESCE = 1 << 6; //Expression flag sets //NOTE: Flag order: @@ -182319,7 +184519,7 @@ if (worker_threads && !worker_threads.isMainThread) { } return parenthesize( [ - this.generateExpression(expr.test, Precedence.LogicalOR, flags), + this.generateExpression(expr.test, Precedence.Coalesce, flags), space + '?' + space, this.generateExpression(expr.consequent, Precedence.Assignment, flags), space + ':' + space, @@ -182331,6 +184531,9 @@ if (worker_threads && !worker_threads.isMainThread) { }, LogicalExpression: function (expr, precedence, flags) { + if (expr.operator === '??') { + flags |= F_FOUND_COALESCE; + } return this.BinaryExpression(expr, precedence, flags); }, @@ -182368,6 +184571,9 @@ if (worker_threads && !worker_threads.isMainThread) { if (expr.operator === 'in' && !(flags & F_ALLOW_IN)) { return ['(', result, ')']; } + if ((expr.operator === '||' || expr.operator === '&&') && (flags & F_FOUND_COALESCE)) { + return ['(', result, ')']; + } return parenthesize(result, currentPrecedence, precedence); }, @@ -182849,6 +185055,16 @@ if (worker_threads && !worker_threads.isMainThread) { return '/' + expr.regex.pattern + '/' + expr.regex.flags; } + if (typeof expr.value === 'bigint') { + return expr.value.toString() + 'n'; + } + + // `expr.value` can be null if `expr.bigint` exists. We need to check + // `expr.bigint` first. + if (expr.bigint) { + return expr.bigint + 'n'; + } + if (expr.value === null) { return 'null'; } @@ -184521,103 +186737,108 @@ module.exports = function globParent(str, opts) { /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; - -const taskManager = __nccwpck_require__(42708); -const patternManager = __nccwpck_require__(18306); -const async_1 = __nccwpck_require__(95679); -const stream_1 = __nccwpck_require__(94630); -const sync_1 = __nccwpck_require__(42405); -const settings_1 = __nccwpck_require__(10952); -const utils = __nccwpck_require__(45444); -async function FastGlob(source, options) { - assertPatternsInput(source); - const works = getWorks(source, async_1.default, options); - const result = await Promise.all(works); - return utils.array.flatten(result); -} -// https://github.com/typescript-eslint/typescript-eslint/issues/60 -// eslint-disable-next-line no-redeclare -(function (FastGlob) { - function sync(source, options) { - assertPatternsInput(source); - const works = getWorks(source, sync_1.default, options); - return utils.array.flatten(works); - } - FastGlob.sync = sync; - function stream(source, options) { - assertPatternsInput(source); - const works = getWorks(source, stream_1.default, options); - /** - * The stream returned by the provider cannot work with an asynchronous iterator. - * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. - * This affects performance (+25%). I don't see best solution right now. - */ - return utils.stream.merge(works); - } - FastGlob.stream = stream; - function generateTasks(source, options) { - assertPatternsInput(source); - const patterns = patternManager.transform([].concat(source)); - const settings = new settings_1.default(options); - return taskManager.generate(patterns, settings); - } - FastGlob.generateTasks = generateTasks; - function isDynamicPattern(source, options) { - assertPatternsInput(source); - const settings = new settings_1.default(options); - return utils.pattern.isDynamicPattern(source, settings); - } - FastGlob.isDynamicPattern = isDynamicPattern; - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escape(source); - } - FastGlob.escapePath = escapePath; -})(FastGlob || (FastGlob = {})); -function getWorks(source, _Provider, options) { - const patterns = patternManager.transform([].concat(source)); - const settings = new settings_1.default(options); - const tasks = taskManager.generate(patterns, settings); - const provider = new _Provider(settings); - return tasks.map(provider.read, provider); -} -function assertPatternsInput(input) { - const source = [].concat(input); - const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); - if (!isValidSource) { - throw new TypeError('Patterns must be a string (non empty) or an array of strings'); - } -} -module.exports = FastGlob; - - -/***/ }), - -/***/ 18306: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.removeDuplicateSlashes = exports.transform = void 0; -/** - * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string. - * The latter is due to the presence of the device path at the beginning of the UNC path. - * @todo rewrite to negative lookbehind with the next major release. - */ -const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; -function transform(patterns) { - return patterns.map((pattern) => removeDuplicateSlashes(pattern)); -} -exports.transform = transform; -/** - * This package only works with forward slashes as a path separator. - * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes. - */ -function removeDuplicateSlashes(pattern) { - return pattern.replace(DOUBLE_SLASH_RE, '/'); -} -exports.removeDuplicateSlashes = removeDuplicateSlashes; +const taskManager = __nccwpck_require__(42708); +const async_1 = __nccwpck_require__(95679); +const stream_1 = __nccwpck_require__(94630); +const sync_1 = __nccwpck_require__(42405); +const settings_1 = __nccwpck_require__(10952); +const utils = __nccwpck_require__(45444); +async function FastGlob(source, options) { + assertPatternsInput(source); + const works = getWorks(source, async_1.default, options); + const result = await Promise.all(works); + return utils.array.flatten(result); +} +// https://github.com/typescript-eslint/typescript-eslint/issues/60 +// eslint-disable-next-line no-redeclare +(function (FastGlob) { + FastGlob.glob = FastGlob; + FastGlob.globSync = sync; + FastGlob.globStream = stream; + FastGlob.async = FastGlob; + function sync(source, options) { + assertPatternsInput(source); + const works = getWorks(source, sync_1.default, options); + return utils.array.flatten(works); + } + FastGlob.sync = sync; + function stream(source, options) { + assertPatternsInput(source); + const works = getWorks(source, stream_1.default, options); + /** + * The stream returned by the provider cannot work with an asynchronous iterator. + * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. + * This affects performance (+25%). I don't see best solution right now. + */ + return utils.stream.merge(works); + } + FastGlob.stream = stream; + function generateTasks(source, options) { + assertPatternsInput(source); + const patterns = [].concat(source); + const settings = new settings_1.default(options); + return taskManager.generate(patterns, settings); + } + FastGlob.generateTasks = generateTasks; + function isDynamicPattern(source, options) { + assertPatternsInput(source); + const settings = new settings_1.default(options); + return utils.pattern.isDynamicPattern(source, settings); + } + FastGlob.isDynamicPattern = isDynamicPattern; + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escape(source); + } + FastGlob.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertPathToPattern(source); + } + FastGlob.convertPathToPattern = convertPathToPattern; + let posix; + (function (posix) { + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escapePosixPath(source); + } + posix.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertPosixPathToPattern(source); + } + posix.convertPathToPattern = convertPathToPattern; + })(posix = FastGlob.posix || (FastGlob.posix = {})); + let win32; + (function (win32) { + function escapePath(source) { + assertPatternsInput(source); + return utils.path.escapeWindowsPath(source); + } + win32.escapePath = escapePath; + function convertPathToPattern(source) { + assertPatternsInput(source); + return utils.path.convertWindowsPathToPattern(source); + } + win32.convertPathToPattern = convertPathToPattern; + })(win32 = FastGlob.win32 || (FastGlob.win32 = {})); +})(FastGlob || (FastGlob = {})); +function getWorks(source, _Provider, options) { + const patterns = [].concat(source); + const settings = new settings_1.default(options); + const tasks = taskManager.generate(patterns, settings); + const provider = new _Provider(settings); + return tasks.map(provider.read, provider); +} +function assertPatternsInput(input) { + const source = [].concat(input); + const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); + if (!isValidSource) { + throw new TypeError('Patterns must be a string (non empty) or an array of strings'); + } +} +module.exports = FastGlob; /***/ }), @@ -184626,86 +186847,116 @@ exports.removeDuplicateSlashes = removeDuplicateSlashes; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; -const utils = __nccwpck_require__(45444); -function generate(patterns, settings) { - const positivePatterns = getPositivePatterns(patterns); - const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); - const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); - const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); - const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); - const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); - return staticTasks.concat(dynamicTasks); -} -exports.generate = generate; -/** - * Returns tasks grouped by basic pattern directories. - * - * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. - * This is necessary because directory traversal starts at the base directory and goes deeper. - */ -function convertPatternsToTasks(positive, negative, dynamic) { - const tasks = []; - const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); - const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); - const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); - const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); - tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); - /* - * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory - * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. - */ - if ('.' in insideCurrentDirectoryGroup) { - tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); - } - else { - tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); - } - return tasks; -} -exports.convertPatternsToTasks = convertPatternsToTasks; -function getPositivePatterns(patterns) { - return utils.pattern.getPositivePatterns(patterns); -} -exports.getPositivePatterns = getPositivePatterns; -function getNegativePatternsAsPositive(patterns, ignore) { - const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); - const positive = negative.map(utils.pattern.convertToPositivePattern); - return positive; -} -exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; -function groupPatternsByBaseDirectory(patterns) { - const group = {}; - return patterns.reduce((collection, pattern) => { - const base = utils.pattern.getBaseDirectory(pattern); - if (base in collection) { - collection[base].push(pattern); - } - else { - collection[base] = [pattern]; - } - return collection; - }, group); -} -exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; -function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map((base) => { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); - }); -} -exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; -function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - dynamic, - positive, - negative, - base, - patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) - }; -} -exports.convertPatternGroupToTask = convertPatternGroupToTask; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; +const utils = __nccwpck_require__(45444); +function generate(input, settings) { + const patterns = processPatterns(input, settings); + const ignore = processPatterns(settings.ignore, settings); + const positivePatterns = getPositivePatterns(patterns); + const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); + const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); + const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); + const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); + const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); + return staticTasks.concat(dynamicTasks); +} +exports.generate = generate; +function processPatterns(input, settings) { + let patterns = input; + /** + * The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry + * and some problems with the micromatch package (see fast-glob issues: #365, #394). + * + * To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown + * in matching in the case of a large set of patterns after expansion. + */ + if (settings.braceExpansion) { + patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns); + } + /** + * If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used + * at any nesting level. + * + * We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change + * the pattern in the filter before creating a regular expression. There is no need to change the patterns + * in the application. Only on the input. + */ + if (settings.baseNameMatch) { + patterns = patterns.map((pattern) => pattern.includes('/') ? pattern : `**/${pattern}`); + } + /** + * This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion. + */ + return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern)); +} +/** + * Returns tasks grouped by basic pattern directories. + * + * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. + * This is necessary because directory traversal starts at the base directory and goes deeper. + */ +function convertPatternsToTasks(positive, negative, dynamic) { + const tasks = []; + const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); + const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); + const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); + const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); + tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); + /* + * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory + * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. + */ + if ('.' in insideCurrentDirectoryGroup) { + tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); + } + else { + tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); + } + return tasks; +} +exports.convertPatternsToTasks = convertPatternsToTasks; +function getPositivePatterns(patterns) { + return utils.pattern.getPositivePatterns(patterns); +} +exports.getPositivePatterns = getPositivePatterns; +function getNegativePatternsAsPositive(patterns, ignore) { + const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); + const positive = negative.map(utils.pattern.convertToPositivePattern); + return positive; +} +exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; +function groupPatternsByBaseDirectory(patterns) { + const group = {}; + return patterns.reduce((collection, pattern) => { + const base = utils.pattern.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } + else { + collection[base] = [pattern]; + } + return collection; + }, group); +} +exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; +function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map((base) => { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); +} +exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; +function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + dynamic, + positive, + negative, + base, + patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) + }; +} +exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ }), @@ -184714,29 +186965,29 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const async_1 = __nccwpck_require__(97747); -const provider_1 = __nccwpck_require__(60257); -class ProviderAsync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new async_1.default(this._settings); - } - async read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = await this.api(root, task, options); - return entries.map((entry) => options.transform(entry)); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports["default"] = ProviderAsync; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const async_1 = __nccwpck_require__(97747); +const provider_1 = __nccwpck_require__(60257); +class ProviderAsync extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new async_1.default(this._settings); + } + async read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = await this.api(root, task, options); + return entries.map((entry) => options.transform(entry)); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports["default"] = ProviderAsync; /***/ }), @@ -184745,68 +186996,68 @@ exports["default"] = ProviderAsync; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(45444); -const partial_1 = __nccwpck_require__(35295); -class DeepFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - } - getFilter(basePath, positive, negative) { - const matcher = this._getMatcher(positive); - const negativeRe = this._getNegativePatternsRe(negative); - return (entry) => this._filter(basePath, entry, matcher, negativeRe); - } - _getMatcher(patterns) { - return new partial_1.default(patterns, this._settings, this._micromatchOptions); - } - _getNegativePatternsRe(patterns) { - const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); - return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); - } - _filter(basePath, entry, matcher, negativeRe) { - if (this._isSkippedByDeep(basePath, entry.path)) { - return false; - } - if (this._isSkippedSymbolicLink(entry)) { - return false; - } - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._isSkippedByPositivePatterns(filepath, matcher)) { - return false; - } - return this._isSkippedByNegativePatterns(filepath, negativeRe); - } - _isSkippedByDeep(basePath, entryPath) { - /** - * Avoid unnecessary depth calculations when it doesn't matter. - */ - if (this._settings.deep === Infinity) { - return false; - } - return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; - } - _getEntryLevel(basePath, entryPath) { - const entryPathDepth = entryPath.split('/').length; - if (basePath === '') { - return entryPathDepth; - } - const basePathDepth = basePath.split('/').length; - return entryPathDepth - basePathDepth; - } - _isSkippedSymbolicLink(entry) { - return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); - } - _isSkippedByPositivePatterns(entryPath, matcher) { - return !this._settings.baseNameMatch && !matcher.match(entryPath); - } - _isSkippedByNegativePatterns(entryPath, patternsRe) { - return !utils.pattern.matchAny(entryPath, patternsRe); - } -} -exports["default"] = DeepFilter; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(45444); +const partial_1 = __nccwpck_require__(35295); +class DeepFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + } + getFilter(basePath, positive, negative) { + const matcher = this._getMatcher(positive); + const negativeRe = this._getNegativePatternsRe(negative); + return (entry) => this._filter(basePath, entry, matcher, negativeRe); + } + _getMatcher(patterns) { + return new partial_1.default(patterns, this._settings, this._micromatchOptions); + } + _getNegativePatternsRe(patterns) { + const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); + return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); + } + _filter(basePath, entry, matcher, negativeRe) { + if (this._isSkippedByDeep(basePath, entry.path)) { + return false; + } + if (this._isSkippedSymbolicLink(entry)) { + return false; + } + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._isSkippedByPositivePatterns(filepath, matcher)) { + return false; + } + return this._isSkippedByNegativePatterns(filepath, negativeRe); + } + _isSkippedByDeep(basePath, entryPath) { + /** + * Avoid unnecessary depth calculations when it doesn't matter. + */ + if (this._settings.deep === Infinity) { + return false; + } + return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; + } + _getEntryLevel(basePath, entryPath) { + const entryPathDepth = entryPath.split('/').length; + if (basePath === '') { + return entryPathDepth; + } + const basePathDepth = basePath.split('/').length; + return entryPathDepth - basePathDepth; + } + _isSkippedSymbolicLink(entry) { + return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); + } + _isSkippedByPositivePatterns(entryPath, matcher) { + return !this._settings.baseNameMatch && !matcher.match(entryPath); + } + _isSkippedByNegativePatterns(entryPath, patternsRe) { + return !utils.pattern.matchAny(entryPath, patternsRe); + } +} +exports["default"] = DeepFilter; /***/ }), @@ -184815,70 +187066,69 @@ exports["default"] = DeepFilter; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(45444); -class EntryFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this.index = new Map(); - } - getFilter(positive, negative) { - const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); - const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions); - return (entry) => this._filter(entry, positiveRe, negativeRe); - } - _filter(entry, positiveRe, negativeRe) { - if (this._settings.unique && this._isDuplicateEntry(entry)) { - return false; - } - if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { - return false; - } - if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) { - return false; - } - const filepath = this._settings.baseNameMatch ? entry.name : entry.path; - const isDirectory = entry.dirent.isDirectory(); - const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory); - if (this._settings.unique && isMatched) { - this._createIndexRecord(entry); - } - return isMatched; - } - _isDuplicateEntry(entry) { - return this.index.has(entry.path); - } - _createIndexRecord(entry) { - this.index.set(entry.path, undefined); - } - _onlyFileFilter(entry) { - return this._settings.onlyFiles && !entry.dirent.isFile(); - } - _onlyDirectoryFilter(entry) { - return this._settings.onlyDirectories && !entry.dirent.isDirectory(); - } - _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { - if (!this._settings.absolute) { - return false; - } - const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); - return utils.pattern.matchAny(fullpath, patternsRe); - } - _isMatchToPatterns(entryPath, patternsRe, isDirectory) { - const filepath = utils.path.removeLeadingDotSegment(entryPath); - // Trying to match files and directories by patterns. - const isMatched = utils.pattern.matchAny(filepath, patternsRe); - // A pattern with a trailling slash can be used for directory matching. - // To apply such pattern, we need to add a tralling slash to the path. - if (!isMatched && isDirectory) { - return utils.pattern.matchAny(filepath + '/', patternsRe); - } - return isMatched; - } -} -exports["default"] = EntryFilter; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(45444); +class EntryFilter { + constructor(_settings, _micromatchOptions) { + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this.index = new Map(); + } + getFilter(positive, negative) { + const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); + const negativeRe = utils.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })); + return (entry) => this._filter(entry, positiveRe, negativeRe); + } + _filter(entry, positiveRe, negativeRe) { + const filepath = utils.path.removeLeadingDotSegment(entry.path); + if (this._settings.unique && this._isDuplicateEntry(filepath)) { + return false; + } + if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { + return false; + } + if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) { + return false; + } + const isDirectory = entry.dirent.isDirectory(); + const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory); + if (this._settings.unique && isMatched) { + this._createIndexRecord(filepath); + } + return isMatched; + } + _isDuplicateEntry(filepath) { + return this.index.has(filepath); + } + _createIndexRecord(filepath) { + this.index.set(filepath, undefined); + } + _onlyFileFilter(entry) { + return this._settings.onlyFiles && !entry.dirent.isFile(); + } + _onlyDirectoryFilter(entry) { + return this._settings.onlyDirectories && !entry.dirent.isDirectory(); + } + _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { + if (!this._settings.absolute) { + return false; + } + const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); + return utils.pattern.matchAny(fullpath, patternsRe); + } + _isMatchToPatterns(filepath, patternsRe, isDirectory) { + // Trying to match files and directories by patterns. + const isMatched = utils.pattern.matchAny(filepath, patternsRe); + // A pattern with a trailling slash can be used for directory matching. + // To apply such pattern, we need to add a tralling slash to the path. + if (!isMatched && isDirectory) { + return utils.pattern.matchAny(filepath + '/', patternsRe); + } + return isMatched; + } +} +exports["default"] = EntryFilter; /***/ }), @@ -184887,21 +187137,21 @@ exports["default"] = EntryFilter; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(45444); -class ErrorFilter { - constructor(_settings) { - this._settings = _settings; - } - getFilter() { - return (error) => this._isNonFatalError(error); - } - _isNonFatalError(error) { - return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; - } -} -exports["default"] = ErrorFilter; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(45444); +class ErrorFilter { + constructor(_settings) { + this._settings = _settings; + } + getFilter() { + return (error) => this._isNonFatalError(error); + } + _isNonFatalError(error) { + return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; + } +} +exports["default"] = ErrorFilter; /***/ }), @@ -184910,56 +187160,51 @@ exports["default"] = ErrorFilter; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(45444); -class Matcher { - constructor(_patterns, _settings, _micromatchOptions) { - this._patterns = _patterns; - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this._storage = []; - this._fillStorage(); - } - _fillStorage() { - /** - * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level). - * So, before expand patterns with brace expansion into separated patterns. - */ - const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns); - for (const pattern of patterns) { - const segments = this._getPatternSegments(pattern); - const sections = this._splitSegmentsIntoSections(segments); - this._storage.push({ - complete: sections.length <= 1, - pattern, - segments, - sections - }); - } - } - _getPatternSegments(pattern) { - const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); - return parts.map((part) => { - const dynamic = utils.pattern.isDynamicPattern(part, this._settings); - if (!dynamic) { - return { - dynamic: false, - pattern: part - }; - } - return { - dynamic: true, - pattern: part, - patternRe: utils.pattern.makeRe(part, this._micromatchOptions) - }; - }); - } - _splitSegmentsIntoSections(segments) { - return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); - } -} -exports["default"] = Matcher; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(45444); +class Matcher { + constructor(_patterns, _settings, _micromatchOptions) { + this._patterns = _patterns; + this._settings = _settings; + this._micromatchOptions = _micromatchOptions; + this._storage = []; + this._fillStorage(); + } + _fillStorage() { + for (const pattern of this._patterns) { + const segments = this._getPatternSegments(pattern); + const sections = this._splitSegmentsIntoSections(segments); + this._storage.push({ + complete: sections.length <= 1, + pattern, + segments, + sections + }); + } + } + _getPatternSegments(pattern) { + const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); + return parts.map((part) => { + const dynamic = utils.pattern.isDynamicPattern(part, this._settings); + if (!dynamic) { + return { + dynamic: false, + pattern: part + }; + } + return { + dynamic: true, + pattern: part, + patternRe: utils.pattern.makeRe(part, this._micromatchOptions) + }; + }); + } + _splitSegmentsIntoSections(segments) { + return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); + } +} +exports["default"] = Matcher; /***/ }), @@ -184968,44 +187213,44 @@ exports["default"] = Matcher; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const matcher_1 = __nccwpck_require__(32576); -class PartialMatcher extends matcher_1.default { - match(filepath) { - const parts = filepath.split('/'); - const levels = parts.length; - const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); - for (const pattern of patterns) { - const section = pattern.sections[0]; - /** - * In this case, the pattern has a globstar and we must read all directories unconditionally, - * but only if the level has reached the end of the first group. - * - * fixtures/{a,b}/** - * ^ true/false ^ always true - */ - if (!pattern.complete && levels > section.length) { - return true; - } - const match = parts.every((part, index) => { - const segment = pattern.segments[index]; - if (segment.dynamic && segment.patternRe.test(part)) { - return true; - } - if (!segment.dynamic && segment.pattern === part) { - return true; - } - return false; - }); - if (match) { - return true; - } - } - return false; - } -} -exports["default"] = PartialMatcher; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const matcher_1 = __nccwpck_require__(32576); +class PartialMatcher extends matcher_1.default { + match(filepath) { + const parts = filepath.split('/'); + const levels = parts.length; + const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); + for (const pattern of patterns) { + const section = pattern.sections[0]; + /** + * In this case, the pattern has a globstar and we must read all directories unconditionally, + * but only if the level has reached the end of the first group. + * + * fixtures/{a,b}/** + * ^ true/false ^ always true + */ + if (!pattern.complete && levels > section.length) { + return true; + } + const match = parts.every((part, index) => { + const segment = pattern.segments[index]; + if (segment.dynamic && segment.patternRe.test(part)) { + return true; + } + if (!segment.dynamic && segment.pattern === part) { + return true; + } + return false; + }); + if (match) { + return true; + } + } + return false; + } +} +exports["default"] = PartialMatcher; /***/ }), @@ -185014,54 +187259,54 @@ exports["default"] = PartialMatcher; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __nccwpck_require__(71017); -const deep_1 = __nccwpck_require__(36983); -const entry_1 = __nccwpck_require__(71343); -const error_1 = __nccwpck_require__(36654); -const entry_2 = __nccwpck_require__(94029); -class Provider { - constructor(_settings) { - this._settings = _settings; - this.errorFilter = new error_1.default(this._settings); - this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); - this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); - this.entryTransformer = new entry_2.default(this._settings); - } - _getRootDirectory(task) { - return path.resolve(this._settings.cwd, task.base); - } - _getReaderOptions(task) { - const basePath = task.base === '.' ? '' : task.base; - return { - basePath, - pathSegmentSeparator: '/', - concurrency: this._settings.concurrency, - deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), - entryFilter: this.entryFilter.getFilter(task.positive, task.negative), - errorFilter: this.errorFilter.getFilter(), - followSymbolicLinks: this._settings.followSymbolicLinks, - fs: this._settings.fs, - stats: this._settings.stats, - throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, - transform: this.entryTransformer.getTransformer() - }; - } - _getMicromatchOptions() { - return { - dot: this._settings.dot, - matchBase: this._settings.baseNameMatch, - nobrace: !this._settings.braceExpansion, - nocase: !this._settings.caseSensitiveMatch, - noext: !this._settings.extglob, - noglobstar: !this._settings.globstar, - posix: true, - strictSlashes: false - }; - } -} -exports["default"] = Provider; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const path = __nccwpck_require__(71017); +const deep_1 = __nccwpck_require__(36983); +const entry_1 = __nccwpck_require__(71343); +const error_1 = __nccwpck_require__(36654); +const entry_2 = __nccwpck_require__(94029); +class Provider { + constructor(_settings) { + this._settings = _settings; + this.errorFilter = new error_1.default(this._settings); + this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); + this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); + this.entryTransformer = new entry_2.default(this._settings); + } + _getRootDirectory(task) { + return path.resolve(this._settings.cwd, task.base); + } + _getReaderOptions(task) { + const basePath = task.base === '.' ? '' : task.base; + return { + basePath, + pathSegmentSeparator: '/', + concurrency: this._settings.concurrency, + deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), + entryFilter: this.entryFilter.getFilter(task.positive, task.negative), + errorFilter: this.errorFilter.getFilter(), + followSymbolicLinks: this._settings.followSymbolicLinks, + fs: this._settings.fs, + stats: this._settings.stats, + throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, + transform: this.entryTransformer.getTransformer() + }; + } + _getMicromatchOptions() { + return { + dot: this._settings.dot, + matchBase: this._settings.baseNameMatch, + nobrace: !this._settings.braceExpansion, + nocase: !this._settings.caseSensitiveMatch, + noext: !this._settings.extglob, + noglobstar: !this._settings.globstar, + posix: true, + strictSlashes: false + }; + } +} +exports["default"] = Provider; /***/ }), @@ -185070,37 +187315,37 @@ exports["default"] = Provider; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __nccwpck_require__(12781); -const stream_2 = __nccwpck_require__(12083); -const provider_1 = __nccwpck_require__(60257); -class ProviderStream extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_2.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const source = this.api(root, task, options); - const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); - source - .once('error', (error) => destination.emit('error', error)) - .on('data', (entry) => destination.emit('data', options.transform(entry))) - .once('end', () => destination.emit('end')); - destination - .once('close', () => source.destroy()); - return destination; - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports["default"] = ProviderStream; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const stream_1 = __nccwpck_require__(12781); +const stream_2 = __nccwpck_require__(12083); +const provider_1 = __nccwpck_require__(60257); +class ProviderStream extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new stream_2.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const source = this.api(root, task, options); + const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); + source + .once('error', (error) => destination.emit('error', error)) + .on('data', (entry) => destination.emit('data', options.transform(entry))) + .once('end', () => destination.emit('end')); + destination + .once('close', () => source.destroy()); + return destination; + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports["default"] = ProviderStream; /***/ }), @@ -185109,29 +187354,29 @@ exports["default"] = ProviderStream; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const sync_1 = __nccwpck_require__(76234); -const provider_1 = __nccwpck_require__(60257); -class ProviderSync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new sync_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = this.api(root, task, options); - return entries.map(options.transform); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports["default"] = ProviderSync; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const sync_1 = __nccwpck_require__(76234); +const provider_1 = __nccwpck_require__(60257); +class ProviderSync extends provider_1.default { + constructor() { + super(...arguments); + this._reader = new sync_1.default(this._settings); + } + read(task) { + const root = this._getRootDirectory(task); + const options = this._getReaderOptions(task); + const entries = this.api(root, task, options); + return entries.map(options.transform); + } + api(root, task, options) { + if (task.dynamic) { + return this._reader.dynamic(root, options); + } + return this._reader.static(task.patterns, options); + } +} +exports["default"] = ProviderSync; /***/ }), @@ -185140,32 +187385,32 @@ exports["default"] = ProviderSync; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const utils = __nccwpck_require__(45444); -class EntryTransformer { - constructor(_settings) { - this._settings = _settings; - } - getTransformer() { - return (entry) => this._transform(entry); - } - _transform(entry) { - let filepath = entry.path; - if (this._settings.absolute) { - filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); - filepath = utils.path.unixify(filepath); - } - if (this._settings.markDirectories && entry.dirent.isDirectory()) { - filepath += '/'; - } - if (!this._settings.objectMode) { - return filepath; - } - return Object.assign(Object.assign({}, entry), { path: filepath }); - } -} -exports["default"] = EntryTransformer; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const utils = __nccwpck_require__(45444); +class EntryTransformer { + constructor(_settings) { + this._settings = _settings; + } + getTransformer() { + return (entry) => this._transform(entry); + } + _transform(entry) { + let filepath = entry.path; + if (this._settings.absolute) { + filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); + filepath = utils.path.unixify(filepath); + } + if (this._settings.markDirectories && entry.dirent.isDirectory()) { + filepath += '/'; + } + if (!this._settings.objectMode) { + return filepath; + } + return Object.assign(Object.assign({}, entry), { path: filepath }); + } +} +exports["default"] = EntryTransformer; /***/ }), @@ -185174,41 +187419,41 @@ exports["default"] = EntryTransformer; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsWalk = __nccwpck_require__(26026); -const reader_1 = __nccwpck_require__(65582); -const stream_1 = __nccwpck_require__(12083); -class ReaderAsync extends reader_1.default { - constructor() { - super(...arguments); - this._walkAsync = fsWalk.walk; - this._readerStream = new stream_1.default(this._settings); - } - dynamic(root, options) { - return new Promise((resolve, reject) => { - this._walkAsync(root, options, (error, entries) => { - if (error === null) { - resolve(entries); - } - else { - reject(error); - } - }); - }); - } - async static(patterns, options) { - const entries = []; - const stream = this._readerStream.static(patterns, options); - // After #235, replace it with an asynchronous iterator. - return new Promise((resolve, reject) => { - stream.once('error', reject); - stream.on('data', (entry) => entries.push(entry)); - stream.once('end', () => resolve(entries)); - }); - } -} -exports["default"] = ReaderAsync; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const fsWalk = __nccwpck_require__(26026); +const reader_1 = __nccwpck_require__(65582); +const stream_1 = __nccwpck_require__(12083); +class ReaderAsync extends reader_1.default { + constructor() { + super(...arguments); + this._walkAsync = fsWalk.walk; + this._readerStream = new stream_1.default(this._settings); + } + dynamic(root, options) { + return new Promise((resolve, reject) => { + this._walkAsync(root, options, (error, entries) => { + if (error === null) { + resolve(entries); + } + else { + reject(error); + } + }); + }); + } + async static(patterns, options) { + const entries = []; + const stream = this._readerStream.static(patterns, options); + // After #235, replace it with an asynchronous iterator. + return new Promise((resolve, reject) => { + stream.once('error', reject); + stream.on('data', (entry) => entries.push(entry)); + stream.once('end', () => resolve(entries)); + }); + } +} +exports["default"] = ReaderAsync; /***/ }), @@ -185217,39 +187462,39 @@ exports["default"] = ReaderAsync; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const path = __nccwpck_require__(71017); -const fsStat = __nccwpck_require__(70109); -const utils = __nccwpck_require__(45444); -class Reader { - constructor(_settings) { - this._settings = _settings; - this._fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this._settings.followSymbolicLinks, - fs: this._settings.fs, - throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks - }); - } - _getFullEntryPath(filepath) { - return path.resolve(this._settings.cwd, filepath); - } - _makeEntry(stats, pattern) { - const entry = { - name: pattern, - path: pattern, - dirent: utils.fs.createDirentFromStats(pattern, stats) - }; - if (this._settings.stats) { - entry.stats = stats; - } - return entry; - } - _isFatalError(error) { - return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; - } -} -exports["default"] = Reader; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const path = __nccwpck_require__(71017); +const fsStat = __nccwpck_require__(70109); +const utils = __nccwpck_require__(45444); +class Reader { + constructor(_settings) { + this._settings = _settings; + this._fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this._settings.followSymbolicLinks, + fs: this._settings.fs, + throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks + }); + } + _getFullEntryPath(filepath) { + return path.resolve(this._settings.cwd, filepath); + } + _makeEntry(stats, pattern) { + const entry = { + name: pattern, + path: pattern, + dirent: utils.fs.createDirentFromStats(pattern, stats) + }; + if (this._settings.stats) { + entry.stats = stats; + } + return entry; + } + _isFatalError(error) { + return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; + } +} +exports["default"] = Reader; /***/ }), @@ -185258,61 +187503,61 @@ exports["default"] = Reader; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const stream_1 = __nccwpck_require__(12781); -const fsStat = __nccwpck_require__(70109); -const fsWalk = __nccwpck_require__(26026); -const reader_1 = __nccwpck_require__(65582); -class ReaderStream extends reader_1.default { - constructor() { - super(...arguments); - this._walkStream = fsWalk.walkStream; - this._stat = fsStat.stat; - } - dynamic(root, options) { - return this._walkStream(root, options); - } - static(patterns, options) { - const filepaths = patterns.map(this._getFullEntryPath, this); - const stream = new stream_1.PassThrough({ objectMode: true }); - stream._write = (index, _enc, done) => { - return this._getEntry(filepaths[index], patterns[index], options) - .then((entry) => { - if (entry !== null && options.entryFilter(entry)) { - stream.push(entry); - } - if (index === filepaths.length - 1) { - stream.end(); - } - done(); - }) - .catch(done); - }; - for (let i = 0; i < filepaths.length; i++) { - stream.write(i); - } - return stream; - } - _getEntry(filepath, pattern, options) { - return this._getStat(filepath) - .then((stats) => this._makeEntry(stats, pattern)) - .catch((error) => { - if (options.errorFilter(error)) { - return null; - } - throw error; - }); - } - _getStat(filepath) { - return new Promise((resolve, reject) => { - this._stat(filepath, this._fsStatSettings, (error, stats) => { - return error === null ? resolve(stats) : reject(error); - }); - }); - } -} -exports["default"] = ReaderStream; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const stream_1 = __nccwpck_require__(12781); +const fsStat = __nccwpck_require__(70109); +const fsWalk = __nccwpck_require__(26026); +const reader_1 = __nccwpck_require__(65582); +class ReaderStream extends reader_1.default { + constructor() { + super(...arguments); + this._walkStream = fsWalk.walkStream; + this._stat = fsStat.stat; + } + dynamic(root, options) { + return this._walkStream(root, options); + } + static(patterns, options) { + const filepaths = patterns.map(this._getFullEntryPath, this); + const stream = new stream_1.PassThrough({ objectMode: true }); + stream._write = (index, _enc, done) => { + return this._getEntry(filepaths[index], patterns[index], options) + .then((entry) => { + if (entry !== null && options.entryFilter(entry)) { + stream.push(entry); + } + if (index === filepaths.length - 1) { + stream.end(); + } + done(); + }) + .catch(done); + }; + for (let i = 0; i < filepaths.length; i++) { + stream.write(i); + } + return stream; + } + _getEntry(filepath, pattern, options) { + return this._getStat(filepath) + .then((stats) => this._makeEntry(stats, pattern)) + .catch((error) => { + if (options.errorFilter(error)) { + return null; + } + throw error; + }); + } + _getStat(filepath) { + return new Promise((resolve, reject) => { + this._stat(filepath, this._fsStatSettings, (error, stats) => { + return error === null ? resolve(stats) : reject(error); + }); + }); + } +} +exports["default"] = ReaderStream; /***/ }), @@ -185321,49 +187566,49 @@ exports["default"] = ReaderStream; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -const fsStat = __nccwpck_require__(70109); -const fsWalk = __nccwpck_require__(26026); -const reader_1 = __nccwpck_require__(65582); -class ReaderSync extends reader_1.default { - constructor() { - super(...arguments); - this._walkSync = fsWalk.walkSync; - this._statSync = fsStat.statSync; - } - dynamic(root, options) { - return this._walkSync(root, options); - } - static(patterns, options) { - const entries = []; - for (const pattern of patterns) { - const filepath = this._getFullEntryPath(pattern); - const entry = this._getEntry(filepath, pattern, options); - if (entry === null || !options.entryFilter(entry)) { - continue; - } - entries.push(entry); - } - return entries; - } - _getEntry(filepath, pattern, options) { - try { - const stats = this._getStat(filepath); - return this._makeEntry(stats, pattern); - } - catch (error) { - if (options.errorFilter(error)) { - return null; - } - throw error; - } - } - _getStat(filepath) { - return this._statSync(filepath, this._fsStatSettings); - } -} -exports["default"] = ReaderSync; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +const fsStat = __nccwpck_require__(70109); +const fsWalk = __nccwpck_require__(26026); +const reader_1 = __nccwpck_require__(65582); +class ReaderSync extends reader_1.default { + constructor() { + super(...arguments); + this._walkSync = fsWalk.walkSync; + this._statSync = fsStat.statSync; + } + dynamic(root, options) { + return this._walkSync(root, options); + } + static(patterns, options) { + const entries = []; + for (const pattern of patterns) { + const filepath = this._getFullEntryPath(pattern); + const entry = this._getEntry(filepath, pattern, options); + if (entry === null || !options.entryFilter(entry)) { + continue; + } + entries.push(entry); + } + return entries; + } + _getEntry(filepath, pattern, options) { + try { + const stats = this._getStat(filepath); + return this._makeEntry(stats, pattern); + } + catch (error) { + if (options.errorFilter(error)) { + return null; + } + throw error; + } + } + _getStat(filepath) { + return this._statSync(filepath, this._fsStatSettings); + } +} +exports["default"] = ReaderSync; /***/ }), @@ -185372,63 +187617,65 @@ exports["default"] = ReaderSync; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; -const fs = __nccwpck_require__(57147); -const os = __nccwpck_require__(22037); -/** - * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. - * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 - */ -const CPU_COUNT = Math.max(os.cpus().length, 1); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - lstatSync: fs.lstatSync, - stat: fs.stat, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync -}; -class Settings { - constructor(_options = {}) { - this._options = _options; - this.absolute = this._getValue(this._options.absolute, false); - this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); - this.braceExpansion = this._getValue(this._options.braceExpansion, true); - this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); - this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); - this.cwd = this._getValue(this._options.cwd, process.cwd()); - this.deep = this._getValue(this._options.deep, Infinity); - this.dot = this._getValue(this._options.dot, false); - this.extglob = this._getValue(this._options.extglob, true); - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); - this.fs = this._getFileSystemMethods(this._options.fs); - this.globstar = this._getValue(this._options.globstar, true); - this.ignore = this._getValue(this._options.ignore, []); - this.markDirectories = this._getValue(this._options.markDirectories, false); - this.objectMode = this._getValue(this._options.objectMode, false); - this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); - this.onlyFiles = this._getValue(this._options.onlyFiles, true); - this.stats = this._getValue(this._options.stats, false); - this.suppressErrors = this._getValue(this._options.suppressErrors, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); - this.unique = this._getValue(this._options.unique, true); - if (this.onlyDirectories) { - this.onlyFiles = false; - } - if (this.stats) { - this.objectMode = true; - } - } - _getValue(option, value) { - return option === undefined ? value : option; - } - _getFileSystemMethods(methods = {}) { - return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); - } -} -exports["default"] = Settings; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; +const fs = __nccwpck_require__(57147); +const os = __nccwpck_require__(22037); +/** + * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. + * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 + */ +const CPU_COUNT = Math.max(os.cpus().length, 1); +exports.DEFAULT_FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + lstatSync: fs.lstatSync, + stat: fs.stat, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +class Settings { + constructor(_options = {}) { + this._options = _options; + this.absolute = this._getValue(this._options.absolute, false); + this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); + this.braceExpansion = this._getValue(this._options.braceExpansion, true); + this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); + this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); + this.cwd = this._getValue(this._options.cwd, process.cwd()); + this.deep = this._getValue(this._options.deep, Infinity); + this.dot = this._getValue(this._options.dot, false); + this.extglob = this._getValue(this._options.extglob, true); + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); + this.fs = this._getFileSystemMethods(this._options.fs); + this.globstar = this._getValue(this._options.globstar, true); + this.ignore = this._getValue(this._options.ignore, []); + this.markDirectories = this._getValue(this._options.markDirectories, false); + this.objectMode = this._getValue(this._options.objectMode, false); + this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); + this.onlyFiles = this._getValue(this._options.onlyFiles, true); + this.stats = this._getValue(this._options.stats, false); + this.suppressErrors = this._getValue(this._options.suppressErrors, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); + this.unique = this._getValue(this._options.unique, true); + if (this.onlyDirectories) { + this.onlyFiles = false; + } + if (this.stats) { + this.objectMode = true; + } + // Remove the cast to the array in the next major (#404). + this.ignore = [].concat(this.ignore); + } + _getValue(option, value) { + return option === undefined ? value : option; + } + _getFileSystemMethods(methods = {}) { + return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); + } +} +exports["default"] = Settings; /***/ }), @@ -185437,28 +187684,28 @@ exports["default"] = Settings; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.splitWhen = exports.flatten = void 0; -function flatten(items) { - return items.reduce((collection, item) => [].concat(collection, item), []); -} -exports.flatten = flatten; -function splitWhen(items, predicate) { - const result = [[]]; - let groupIndex = 0; - for (const item of items) { - if (predicate(item)) { - groupIndex++; - result[groupIndex] = []; - } - else { - result[groupIndex].push(item); - } - } - return result; -} -exports.splitWhen = splitWhen; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.splitWhen = exports.flatten = void 0; +function flatten(items) { + return items.reduce((collection, item) => [].concat(collection, item), []); +} +exports.flatten = flatten; +function splitWhen(items, predicate) { + const result = [[]]; + let groupIndex = 0; + for (const item of items) { + if (predicate(item)) { + groupIndex++; + result[groupIndex] = []; + } + else { + result[groupIndex].push(item); + } + } + return result; +} +exports.splitWhen = splitWhen; /***/ }), @@ -185467,13 +187714,13 @@ exports.splitWhen = splitWhen; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isEnoentCodeError = void 0; -function isEnoentCodeError(error) { - return error.code === 'ENOENT'; -} -exports.isEnoentCodeError = isEnoentCodeError; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isEnoentCodeError = void 0; +function isEnoentCodeError(error) { + return error.code === 'ENOENT'; +} +exports.isEnoentCodeError = isEnoentCodeError; /***/ }), @@ -185482,25 +187729,25 @@ exports.isEnoentCodeError = isEnoentCodeError; /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createDirentFromStats = void 0; -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } -} -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} -exports.createDirentFromStats = createDirentFromStats; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +} +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +exports.createDirentFromStats = createDirentFromStats; /***/ }), @@ -185509,23 +187756,23 @@ exports.createDirentFromStats = createDirentFromStats; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; -const array = __nccwpck_require__(85325); -exports.array = array; -const errno = __nccwpck_require__(41230); -exports.errno = errno; -const fs = __nccwpck_require__(17543); -exports.fs = fs; -const path = __nccwpck_require__(63873); -exports.path = path; -const pattern = __nccwpck_require__(81221); -exports.pattern = pattern; -const stream = __nccwpck_require__(18382); -exports.stream = stream; -const string = __nccwpck_require__(52203); -exports.string = string; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; +const array = __nccwpck_require__(85325); +exports.array = array; +const errno = __nccwpck_require__(41230); +exports.errno = errno; +const fs = __nccwpck_require__(17543); +exports.fs = fs; +const path = __nccwpck_require__(63873); +exports.path = path; +const pattern = __nccwpck_require__(81221); +exports.pattern = pattern; +const stream = __nccwpck_require__(18382); +exports.stream = stream; +const string = __nccwpck_require__(52203); +exports.string = string; /***/ }), @@ -185534,39 +187781,74 @@ exports.string = string; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0; -const path = __nccwpck_require__(71017); -const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ -const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; -/** - * Designed to work only with simple paths: `dir\\file`. - */ -function unixify(filepath) { - return filepath.replace(/\\/g, '/'); -} -exports.unixify = unixify; -function makeAbsolute(cwd, filepath) { - return path.resolve(cwd, filepath); -} -exports.makeAbsolute = makeAbsolute; -function escape(pattern) { - return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); -} -exports.escape = escape; -function removeLeadingDotSegment(entry) { - // We do not use `startsWith` because this is 10x slower than current implementation for some cases. - // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with - if (entry.charAt(0) === '.') { - const secondCharactery = entry.charAt(1); - if (secondCharactery === '/' || secondCharactery === '\\') { - return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); - } - } - return entry; -} -exports.removeLeadingDotSegment = removeLeadingDotSegment; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; +const os = __nccwpck_require__(22037); +const path = __nccwpck_require__(71017); +const IS_WINDOWS_PLATFORM = os.platform() === 'win32'; +const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ +/** + * All non-escaped special characters. + * Posix: ()*?[]{|}, !+@ before (, ! at the beginning, \\ before non-special characters. + * Windows: (){}[], !+@ before (, ! at the beginning. + */ +const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; +const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g; +/** + * The device path (\\.\ or \\?\). + * https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths + */ +const DOS_DEVICE_PATH_RE = /^\\\\([.?])/; +/** + * All backslashes except those escaping special characters. + * Windows: !()+@{} + * https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions + */ +const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g; +/** + * Designed to work only with simple paths: `dir\\file`. + */ +function unixify(filepath) { + return filepath.replace(/\\/g, '/'); +} +exports.unixify = unixify; +function makeAbsolute(cwd, filepath) { + return path.resolve(cwd, filepath); +} +exports.makeAbsolute = makeAbsolute; +function removeLeadingDotSegment(entry) { + // We do not use `startsWith` because this is 10x slower than current implementation for some cases. + // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with + if (entry.charAt(0) === '.') { + const secondCharactery = entry.charAt(1); + if (secondCharactery === '/' || secondCharactery === '\\') { + return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); + } + } + return entry; +} +exports.removeLeadingDotSegment = removeLeadingDotSegment; +exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; +function escapeWindowsPath(pattern) { + return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); +} +exports.escapeWindowsPath = escapeWindowsPath; +function escapePosixPath(pattern) { + return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); +} +exports.escapePosixPath = escapePosixPath; +exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; +function convertWindowsPathToPattern(filepath) { + return escapeWindowsPath(filepath) + .replace(DOS_DEVICE_PATH_RE, '//$1') + .replace(WINDOWS_BACKSLASHES_RE, '/'); +} +exports.convertWindowsPathToPattern = convertWindowsPathToPattern; +function convertPosixPathToPattern(filepath) { + return escapePosixPath(filepath); +} +exports.convertPosixPathToPattern = convertPosixPathToPattern; /***/ }), @@ -185575,175 +187857,194 @@ exports.removeLeadingDotSegment = removeLeadingDotSegment; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; -const path = __nccwpck_require__(71017); -const globParent = __nccwpck_require__(14460); -const micromatch = __nccwpck_require__(76228); -const GLOBSTAR = '**'; -const ESCAPE_SYMBOL = '\\'; -const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; -const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; -const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; -const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; -const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; -function isStaticPattern(pattern, options = {}) { - return !isDynamicPattern(pattern, options); -} -exports.isStaticPattern = isStaticPattern; -function isDynamicPattern(pattern, options = {}) { - /** - * A special case with an empty string is necessary for matching patterns that start with a forward slash. - * An empty string cannot be a dynamic pattern. - * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. - */ - if (pattern === '') { - return false; - } - /** - * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check - * filepath directly (without read directory). - */ - if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { - return true; - } - if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { - return true; - } - return false; -} -exports.isDynamicPattern = isDynamicPattern; -function hasBraceExpansion(pattern) { - const openingBraceIndex = pattern.indexOf('{'); - if (openingBraceIndex === -1) { - return false; - } - const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1); - if (closingBraceIndex === -1) { - return false; - } - const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); - return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); -} -function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; -} -exports.convertToPositivePattern = convertToPositivePattern; -function convertToNegativePattern(pattern) { - return '!' + pattern; -} -exports.convertToNegativePattern = convertToNegativePattern; -function isNegativePattern(pattern) { - return pattern.startsWith('!') && pattern[1] !== '('; -} -exports.isNegativePattern = isNegativePattern; -function isPositivePattern(pattern) { - return !isNegativePattern(pattern); -} -exports.isPositivePattern = isPositivePattern; -function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); -} -exports.getNegativePatterns = getNegativePatterns; -function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); -} -exports.getPositivePatterns = getPositivePatterns; -/** - * Returns patterns that can be applied inside the current directory. - * - * @example - * // ['./*', '*', 'a/*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -function getPatternsInsideCurrentDirectory(patterns) { - return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); -} -exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; -/** - * Returns patterns to be expanded relative to (outside) the current directory. - * - * @example - * // ['../*', './../*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -function getPatternsOutsideCurrentDirectory(patterns) { - return patterns.filter(isPatternRelatedToParentDirectory); -} -exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; -function isPatternRelatedToParentDirectory(pattern) { - return pattern.startsWith('..') || pattern.startsWith('./..'); -} -exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; -function getBaseDirectory(pattern) { - return globParent(pattern, { flipBackslashes: false }); -} -exports.getBaseDirectory = getBaseDirectory; -function hasGlobStar(pattern) { - return pattern.includes(GLOBSTAR); -} -exports.hasGlobStar = hasGlobStar; -function endsWithSlashGlobStar(pattern) { - return pattern.endsWith('/' + GLOBSTAR); -} -exports.endsWithSlashGlobStar = endsWithSlashGlobStar; -function isAffectDepthOfReadingPattern(pattern) { - const basename = path.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); -} -exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; -function expandPatternsWithBraceExpansion(patterns) { - return patterns.reduce((collection, pattern) => { - return collection.concat(expandBraceExpansion(pattern)); - }, []); -} -exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; -function expandBraceExpansion(pattern) { - return micromatch.braces(pattern, { - expand: true, - nodupes: true - }); -} -exports.expandBraceExpansion = expandBraceExpansion; -function getPatternParts(pattern, options) { - let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); - /** - * The scan method returns an empty array in some cases. - * See micromatch/picomatch#58 for more details. - */ - if (parts.length === 0) { - parts = [pattern]; - } - /** - * The scan method does not return an empty part for the pattern with a forward slash. - * This is another part of micromatch/picomatch#58. - */ - if (parts[0].startsWith('/')) { - parts[0] = parts[0].slice(1); - parts.unshift(''); - } - return parts; -} -exports.getPatternParts = getPatternParts; -function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); -} -exports.makeRe = makeRe; -function convertPatternsToRe(patterns, options) { - return patterns.map((pattern) => makeRe(pattern, options)); -} -exports.convertPatternsToRe = convertPatternsToRe; -function matchAny(entry, patternsRe) { - return patternsRe.some((patternRe) => patternRe.test(entry)); -} -exports.matchAny = matchAny; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; +const path = __nccwpck_require__(71017); +const globParent = __nccwpck_require__(14460); +const micromatch = __nccwpck_require__(76228); +const GLOBSTAR = '**'; +const ESCAPE_SYMBOL = '\\'; +const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; +const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; +const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; +const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; +const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; +/** + * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string. + * The latter is due to the presence of the device path at the beginning of the UNC path. + */ +const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; +function isStaticPattern(pattern, options = {}) { + return !isDynamicPattern(pattern, options); +} +exports.isStaticPattern = isStaticPattern; +function isDynamicPattern(pattern, options = {}) { + /** + * A special case with an empty string is necessary for matching patterns that start with a forward slash. + * An empty string cannot be a dynamic pattern. + * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. + */ + if (pattern === '') { + return false; + } + /** + * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check + * filepath directly (without read directory). + */ + if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { + return true; + } + if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { + return true; + } + if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { + return true; + } + return false; +} +exports.isDynamicPattern = isDynamicPattern; +function hasBraceExpansion(pattern) { + const openingBraceIndex = pattern.indexOf('{'); + if (openingBraceIndex === -1) { + return false; + } + const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1); + if (closingBraceIndex === -1) { + return false; + } + const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); + return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); +} +function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; +} +exports.convertToPositivePattern = convertToPositivePattern; +function convertToNegativePattern(pattern) { + return '!' + pattern; +} +exports.convertToNegativePattern = convertToNegativePattern; +function isNegativePattern(pattern) { + return pattern.startsWith('!') && pattern[1] !== '('; +} +exports.isNegativePattern = isNegativePattern; +function isPositivePattern(pattern) { + return !isNegativePattern(pattern); +} +exports.isPositivePattern = isPositivePattern; +function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); +} +exports.getNegativePatterns = getNegativePatterns; +function getPositivePatterns(patterns) { + return patterns.filter(isPositivePattern); +} +exports.getPositivePatterns = getPositivePatterns; +/** + * Returns patterns that can be applied inside the current directory. + * + * @example + * // ['./*', '*', 'a/*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsInsideCurrentDirectory(patterns) { + return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); +} +exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; +/** + * Returns patterns to be expanded relative to (outside) the current directory. + * + * @example + * // ['../*', './../*'] + * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) + */ +function getPatternsOutsideCurrentDirectory(patterns) { + return patterns.filter(isPatternRelatedToParentDirectory); +} +exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; +function isPatternRelatedToParentDirectory(pattern) { + return pattern.startsWith('..') || pattern.startsWith('./..'); +} +exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; +function getBaseDirectory(pattern) { + return globParent(pattern, { flipBackslashes: false }); +} +exports.getBaseDirectory = getBaseDirectory; +function hasGlobStar(pattern) { + return pattern.includes(GLOBSTAR); +} +exports.hasGlobStar = hasGlobStar; +function endsWithSlashGlobStar(pattern) { + return pattern.endsWith('/' + GLOBSTAR); +} +exports.endsWithSlashGlobStar = endsWithSlashGlobStar; +function isAffectDepthOfReadingPattern(pattern) { + const basename = path.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); +} +exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; +function expandPatternsWithBraceExpansion(patterns) { + return patterns.reduce((collection, pattern) => { + return collection.concat(expandBraceExpansion(pattern)); + }, []); +} +exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; +function expandBraceExpansion(pattern) { + const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true }); + /** + * Sort the patterns by length so that the same depth patterns are processed side by side. + * `a/{b,}/{c,}/*` – `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']` + */ + patterns.sort((a, b) => a.length - b.length); + /** + * Micromatch can return an empty string in the case of patterns like `{a,}`. + */ + return patterns.filter((pattern) => pattern !== ''); +} +exports.expandBraceExpansion = expandBraceExpansion; +function getPatternParts(pattern, options) { + let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); + /** + * The scan method returns an empty array in some cases. + * See micromatch/picomatch#58 for more details. + */ + if (parts.length === 0) { + parts = [pattern]; + } + /** + * The scan method does not return an empty part for the pattern with a forward slash. + * This is another part of micromatch/picomatch#58. + */ + if (parts[0].startsWith('/')) { + parts[0] = parts[0].slice(1); + parts.unshift(''); + } + return parts; +} +exports.getPatternParts = getPatternParts; +function makeRe(pattern, options) { + return micromatch.makeRe(pattern, options); +} +exports.makeRe = makeRe; +function convertPatternsToRe(patterns, options) { + return patterns.map((pattern) => makeRe(pattern, options)); +} +exports.convertPatternsToRe = convertPatternsToRe; +function matchAny(entry, patternsRe) { + return patternsRe.some((patternRe) => patternRe.test(entry)); +} +exports.matchAny = matchAny; +/** + * This package only works with forward slashes as a path separator. + * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes. + */ +function removeDuplicateSlashes(pattern) { + return pattern.replace(DOUBLE_SLASH_RE, '/'); +} +exports.removeDuplicateSlashes = removeDuplicateSlashes; /***/ }), @@ -185752,23 +188053,23 @@ exports.matchAny = matchAny; /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.merge = void 0; -const merge2 = __nccwpck_require__(82578); -function merge(streams) { - const mergedStream = merge2(streams); - streams.forEach((stream) => { - stream.once('error', (error) => mergedStream.emit('error', error)); - }); - mergedStream.once('close', () => propagateCloseEventToSources(streams)); - mergedStream.once('end', () => propagateCloseEventToSources(streams)); - return mergedStream; -} -exports.merge = merge; -function propagateCloseEventToSources(streams) { - streams.forEach((stream) => stream.emit('close')); -} + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.merge = void 0; +const merge2 = __nccwpck_require__(82578); +function merge(streams) { + const mergedStream = merge2(streams); + streams.forEach((stream) => { + stream.once('error', (error) => mergedStream.emit('error', error)); + }); + mergedStream.once('close', () => propagateCloseEventToSources(streams)); + mergedStream.once('end', () => propagateCloseEventToSources(streams)); + return mergedStream; +} +exports.merge = merge; +function propagateCloseEventToSources(streams) { + streams.forEach((stream) => stream.emit('close')); +} /***/ }), @@ -185777,17 +188078,17 @@ function propagateCloseEventToSources(streams) { /***/ ((__unused_webpack_module, exports) => { "use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isEmpty = exports.isString = void 0; -function isString(input) { - return typeof input === 'string'; -} -exports.isString = isString; -function isEmpty(input) { - return input === ''; -} -exports.isEmpty = isEmpty; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isEmpty = exports.isString = void 0; +function isString(input) { + return typeof input === 'string'; +} +exports.isString = isString; +function isEmpty(input) { + return input === ''; +} +exports.isEmpty = isEmpty; /***/ }), @@ -185802,15 +188103,15 @@ exports.isEmpty = isEmpty; var reusify = __nccwpck_require__(32113) -function fastqueue (context, worker, concurrency) { +function fastqueue (context, worker, _concurrency) { if (typeof context === 'function') { - concurrency = worker + _concurrency = worker worker = context context = null } - if (concurrency < 1) { - throw new Error('fastqueue concurrency must be greater than 1') + if (!(_concurrency >= 1)) { + throw new Error('fastqueue concurrency must be equal to or greater than 1') } var cache = reusify(Task) @@ -185825,7 +188126,23 @@ function fastqueue (context, worker, concurrency) { saturated: noop, pause: pause, paused: false, - concurrency: concurrency, + + get concurrency () { + return _concurrency + }, + set concurrency (value) { + if (!(value >= 1)) { + throw new Error('fastqueue concurrency must be equal to or greater than 1') + } + _concurrency = value + + if (self.paused) return + for (; queueHead && _running < _concurrency;) { + _running++ + release() + } + }, + running: running, resume: resume, idle: idle, @@ -185875,7 +188192,12 @@ function fastqueue (context, worker, concurrency) { function resume () { if (!self.paused) return self.paused = false - for (var i = 0; i < self.concurrency; i++) { + if (queueHead === null) { + _running++ + release() + return + } + for (; queueHead && _running < _concurrency;) { _running++ release() } @@ -185894,7 +188216,7 @@ function fastqueue (context, worker, concurrency) { current.callback = done || noop current.errorHandler = errorHandler - if (_running === self.concurrency || self.paused) { + if (_running >= _concurrency || self.paused) { if (queueTail) { queueTail.next = current queueTail = current @@ -185916,8 +188238,9 @@ function fastqueue (context, worker, concurrency) { current.release = release current.value = value current.callback = done || noop + current.errorHandler = errorHandler - if (_running === self.concurrency || self.paused) { + if (_running >= _concurrency || self.paused) { if (queueHead) { current.next = queueHead queueHead = current @@ -185937,7 +188260,7 @@ function fastqueue (context, worker, concurrency) { cache.release(holder) } var next = queueHead - if (next) { + if (next && _running <= _concurrency) { if (!self.paused) { if (queueTail === queueHead) { queueTail = null @@ -186000,9 +188323,9 @@ function Task () { } } -function queueAsPromised (context, worker, concurrency) { +function queueAsPromised (context, worker, _concurrency) { if (typeof context === 'function') { - concurrency = worker + _concurrency = worker worker = context context = null } @@ -186014,7 +188337,7 @@ function queueAsPromised (context, worker, concurrency) { }, cb) } - var queue = fastqueue(context, asyncWrapper, concurrency) + var queue = fastqueue(context, asyncWrapper, _concurrency) var pushCb = queue.push var unshiftCb = queue.unshift @@ -189796,43 +192119,75 @@ exports.realpath = function realpath(p, cache, cb) { /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; var toStr = Object.prototype.toString; +var max = Math.max; var funcType = '[object Function]'; +var concatty = function concatty(a, b) { + var arr = []; + + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + + return arr; +}; + +var slicy = function slicy(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; +}; + +var joiny = function (arr, joiner) { + var str = ''; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; +}; + module.exports = function bind(that) { var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { + if (typeof target !== 'function' || toStr.apply(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } - var args = slice.call(arguments, 1); + var args = slicy(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, - args.concat(slice.call(arguments)) + concatty(args, arguments) ); if (Object(result) === result) { return result; } return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); } + return target.apply( + that, + concatty(args, arguments) + ); + }; - var boundLength = Math.max(0, target.length - args.length); + var boundLength = max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); + boundArgs[i] = '$' + i; } - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; @@ -189972,9 +192327,15 @@ module.exports.sync = sync; var undefined; -var $SyntaxError = SyntaxError; +var $Error = __nccwpck_require__(28015); +var $EvalError = __nccwpck_require__(91933); +var $RangeError = __nccwpck_require__(54415); +var $ReferenceError = __nccwpck_require__(46279); +var $SyntaxError = __nccwpck_require__(75474); +var $TypeError = __nccwpck_require__(6361); +var $URIError = __nccwpck_require__(5065); + var $Function = Function; -var $TypeError = TypeError; // eslint-disable-next-line consistent-return var getEvalledConstructor = function (expressionSyntax) { @@ -190013,18 +192374,24 @@ var ThrowTypeError = $gOPD : throwTypeError; var hasSymbols = __nccwpck_require__(40587)(); +var hasProto = __nccwpck_require__(45894)(); -var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto +var getProto = Object.getPrototypeOf || ( + hasProto + ? function (x) { return x.__proto__; } // eslint-disable-line no-proto + : null +); var needsEval = {}; -var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); +var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); var INTRINSICS = { + __proto__: null, '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, - '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': needsEval, '%AsyncGenerator%': needsEval, @@ -190041,9 +192408,9 @@ var INTRINSICS = { '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, - '%Error%': Error, + '%Error%': $Error, '%eval%': eval, // eslint-disable-line no-eval - '%EvalError%': EvalError, + '%EvalError%': $EvalError, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, @@ -190054,10 +192421,10 @@ var INTRINSICS = { '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%isFinite%': isFinite, '%isNaN%': isNaN, - '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, - '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), '%Math%': Math, '%Number%': Number, '%Object%': Object, @@ -190065,15 +192432,15 @@ var INTRINSICS = { '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, - '%RangeError%': RangeError, - '%ReferenceError%': ReferenceError, + '%RangeError%': $RangeError, + '%ReferenceError%': $ReferenceError, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%Set%': typeof Set === 'undefined' ? undefined : Set, - '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%String%': String, - '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, '%Symbol%': hasSymbols ? Symbol : undefined, '%SyntaxError%': $SyntaxError, '%ThrowTypeError%': ThrowTypeError, @@ -190083,18 +192450,20 @@ var INTRINSICS = { '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, - '%URIError%': URIError, + '%URIError%': $URIError, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet }; -try { - null.error; // eslint-disable-line no-unused-expressions -} catch (e) { - // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 - var errorProto = getProto(getProto(e)); - INTRINSICS['%Error.prototype%'] = errorProto; +if (getProto) { + try { + null.error; // eslint-disable-line no-unused-expressions + } catch (e) { + // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 + var errorProto = getProto(getProto(e)); + INTRINSICS['%Error.prototype%'] = errorProto; + } } var doEval = function doEval(name) { @@ -190112,7 +192481,7 @@ var doEval = function doEval(name) { } } else if (name === '%AsyncIteratorPrototype%') { var gen = doEval('%AsyncGenerator%'); - if (gen) { + if (gen && getProto) { value = getProto(gen.prototype); } } @@ -190123,6 +192492,7 @@ var doEval = function doEval(name) { }; var LEGACY_ALIASES = { + __proto__: null, '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], '%ArrayPrototype%': ['Array', 'prototype'], '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], @@ -190177,7 +192547,7 @@ var LEGACY_ALIASES = { }; var bind = __nccwpck_require__(88334); -var hasOwn = __nccwpck_require__(76339); +var hasOwn = __nccwpck_require__(62157); var $concat = bind.call(Function.call, Array.prototype.concat); var $spliceApply = bind.call(Function.apply, Array.prototype.splice); var $replace = bind.call(Function.call, String.prototype.replace); @@ -214285,6 +216655,30 @@ return /******/ (function(modules) { // webpackBootstrap }); ; +/***/ }), + +/***/ 18501: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var GetIntrinsic = __nccwpck_require__(74538); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); + +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; + + /***/ }), /***/ 67356: @@ -215274,6 +217668,59 @@ module.exports = (flag, argv = process.argv) => { }; +/***/ }), + +/***/ 90176: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var $defineProperty = __nccwpck_require__(6123); + +var hasPropertyDescriptors = function hasPropertyDescriptors() { + return !!$defineProperty; +}; + +hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + // node v0.6 has a bug where array lengths can be Set but not Defined + if (!$defineProperty) { + return null; + } + try { + return $defineProperty([], 'length', { value: 1 }).length !== 1; + } catch (e) { + // In Firefox 4-22, defining length on an array throws an exception. + return true; + } +}; + +module.exports = hasPropertyDescriptors; + + +/***/ }), + +/***/ 45894: +/***/ ((module) => { + +"use strict"; + + +var test = { + __proto__: null, + foo: {} +}; + +var $Object = Object; + +/** @type {import('.')} */ +module.exports = function hasProto() { + // @ts-expect-error: TS errors on an inherited property for some reason + return { __proto__: test }.foo === test.foo + && !(test instanceof $Object); +}; + + /***/ }), /***/ 40587: @@ -215345,19 +217792,6 @@ module.exports = function hasSymbols() { }; -/***/ }), - -/***/ 76339: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var bind = __nccwpck_require__(88334); - -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); - - /***/ }), /***/ 44933: @@ -215516,6 +217950,22 @@ hasha.fromFileSync = (filePath, options) => hasha(fs.readFileSync(filePath), opt module.exports = hasha; +/***/ }), + +/***/ 62157: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; +var bind = __nccwpck_require__(88334); + +/** @type {import('.')} */ +module.exports = bind.call(call, $hasOwn); + + /***/ }), /***/ 91230: @@ -215590,6 +218040,14 @@ const cleanRangeBackSlash = slashes => { // '`foo/`' should not continue with the '`..`' const REPLACERS = [ + [ + // remove BOM + // TODO: + // Other similar zero-width characters? + /^\uFEFF/, + () => EMPTY + ], + // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ // (a\ ) -> (a ) @@ -216316,7 +218774,7 @@ if (typeof Object.create === 'function') { "use strict"; -var has = __nccwpck_require__(76339); +var hasOwn = __nccwpck_require__(62157); function specifierIncluded(current, specifier) { var nodeParts = current.split('.'); @@ -216381,7 +218839,7 @@ function versionIncluded(nodeVersion, specifierValue) { var data = __nccwpck_require__(66151); module.exports = function isCore(x, nodeVersion) { - return has(data, x) && versionIncluded(nodeVersion, data[x]); + return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]); }; @@ -227298,8523 +229756,7935 @@ module.exports = unescape; /***/ }), -/***/ 39126: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 42555: +/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { "use strict"; -const fs = __nccwpck_require__(57147); -const path = __nccwpck_require__(71017); -const {promisify} = __nccwpck_require__(73837); -const semver = __nccwpck_require__(13689); +const isOptionObject = __nccwpck_require__(20864); -const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); +const {hasOwnProperty} = Object.prototype; +const {propertyIsEnumerable} = Object; +const defineProperty = (object, name, value) => Object.defineProperty(object, name, { + value, + writable: true, + enumerable: true, + configurable: true +}); -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); +const globalThis = this; +const defaultMergeOptions = { + concatArrays: false, + ignoreUndefined: false +}; - if (pathHasInvalidWinCharacters) { - const error = new Error(`Path contains invalid characters: ${pth}`); - error.code = 'EINVAL'; - throw error; +const getEnumerableOwnPropertyKeys = value => { + const keys = []; + + for (const key in value) { + if (hasOwnProperty.call(value, key)) { + keys.push(key); } } -}; -const processOptions = options => { - // https://github.com/sindresorhus/make-dir/issues/18 - const defaults = { - mode: 0o777, - fs - }; + /* istanbul ignore else */ + if (Object.getOwnPropertySymbols) { + const symbols = Object.getOwnPropertySymbols(value); - return { - ...defaults, - ...options - }; -}; + for (const symbol of symbols) { + if (propertyIsEnumerable.call(value, symbol)) { + keys.push(symbol); + } + } + } -const permissionError = pth => { - // This replicates the exception of `fs.mkdir` with native the - // `recusive` option when run on an invalid drive under Windows. - const error = new Error(`operation not permitted, mkdir '${pth}'`); - error.code = 'EPERM'; - error.errno = -4048; - error.path = pth; - error.syscall = 'mkdir'; - return error; + return keys; }; -const makeDir = async (input, options) => { - checkPath(input); - options = processOptions(options); - - const mkdir = promisify(options.fs.mkdir); - const stat = promisify(options.fs.stat); - - if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) { - const pth = path.resolve(input); - - await mkdir(pth, { - mode: options.mode, - recursive: true - }); +function clone(value) { + if (Array.isArray(value)) { + return cloneArray(value); + } - return pth; + if (isOptionObject(value)) { + return cloneOptionObject(value); } - const make = async pth => { - try { - await mkdir(pth, options.mode); + return value; +} - return pth; - } catch (error) { - if (error.code === 'EPERM') { - throw error; - } +function cloneArray(array) { + const result = array.slice(0, 0); - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth); - } + getEnumerableOwnPropertyKeys(array).forEach(key => { + defineProperty(result, key, clone(array[key])); + }); - if (error.message.includes('null bytes')) { - throw error; - } + return result; +} - await make(path.dirname(pth)); +function cloneOptionObject(object) { + const result = Object.getPrototypeOf(object) === null ? Object.create(null) : {}; - return make(pth); - } + getEnumerableOwnPropertyKeys(object).forEach(key => { + defineProperty(result, key, clone(object[key])); + }); - try { - const stats = await stat(pth); - if (!stats.isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw error; - } + return result; +} - return pth; +/** + * @param {*} merged already cloned + * @param {*} source something to merge + * @param {string[]} keys keys to merge + * @param {Object} config Config Object + * @returns {*} cloned Object + */ +const mergeKeys = (merged, source, keys, config) => { + keys.forEach(key => { + if (typeof source[key] === 'undefined' && config.ignoreUndefined) { + return; } - }; - - return make(path.resolve(input)); -}; -module.exports = makeDir; - -module.exports.sync = (input, options) => { - checkPath(input); - options = processOptions(options); + // Do not recurse into prototype chain of merged + if (key in merged && merged[key] !== Object.getPrototypeOf(merged)) { + defineProperty(merged, key, merge(merged[key], source[key], config)); + } else { + defineProperty(merged, key, clone(source[key])); + } + }); - if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) { - const pth = path.resolve(input); + return merged; +}; - fs.mkdirSync(pth, { - mode: options.mode, - recursive: true - }); +/** + * @param {*} merged already cloned + * @param {*} source something to merge + * @param {Object} config Config Object + * @returns {*} cloned Object + * + * see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat) + */ +const concatArrays = (merged, source, config) => { + let result = merged.slice(0, 0); + let resultIndex = 0; - return pth; - } + [merged, source].forEach(array => { + const indices = []; - const make = pth => { - try { - options.fs.mkdirSync(pth, options.mode); - } catch (error) { - if (error.code === 'EPERM') { - throw error; + // `result.concat(array)` with cloning + for (let k = 0; k < array.length; k++) { + if (!hasOwnProperty.call(array, k)) { + continue; } - if (error.code === 'ENOENT') { - if (path.dirname(pth) === pth) { - throw permissionError(pth); - } - - if (error.message.includes('null bytes')) { - throw error; - } - - make(path.dirname(pth)); - return make(pth); - } + indices.push(String(k)); - try { - if (!options.fs.statSync(pth).isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw error; + if (array === merged) { + // Already cloned + defineProperty(result, resultIndex++, array[k]); + } else { + defineProperty(result, resultIndex++, clone(array[k])); } } - return pth; - }; + // Merge non-index keys + result = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config); + }); - return make(path.resolve(input)); + return result; }; +/** + * @param {*} merged already cloned + * @param {*} source something to merge + * @param {Object} config Config Object + * @returns {*} cloned Object + */ +function merge(merged, source, config) { + if (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) { + return concatArrays(merged, source, config); + } -/***/ }), - -/***/ 13689: -/***/ ((module, exports) => { - -exports = module.exports = SemVer + if (!isOptionObject(source) || !isOptionObject(merged)) { + return clone(source); + } -var debug -/* istanbul ignore next */ -if (typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift('SEMVER') - console.log.apply(console, args) - } -} else { - debug = function () {} + return mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config); } -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0' +module.exports = function (...options) { + const config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions); + let merged = {_: {}}; -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 + for (const option of options) { + if (option === undefined) { + continue; + } -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 + if (!isOptionObject(option)) { + throw new TypeError('`' + option + '` is not an Option Object'); + } -var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + merged = merge(merged, {_: option}, config); + } -// The actual regexps go on exports.re -var re = exports.re = [] -var safeRe = exports.safeRe = [] -var src = exports.src = [] -var t = exports.tokens = {} -var R = 0 + return merged._; +}; -function tok (n) { - t[n] = R++ -} -var 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. -var safeRegexReplacements = [ - ['\\s', 1], - ['\\d', MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], -] +/***/ 82578: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function makeSafeRe (value) { - for (var i = 0; i < safeRegexReplacements.length; i++) { - var token = safeRegexReplacements[i][0] - var max = safeRegexReplacements[i][1] - value = value - .split(token + '*').join(token + '{0,' + max + '}') - .split(token + '+').join(token + '{1,' + max + '}') - } - return value -} +"use strict"; -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. +/* + * merge2 + * https://github.com/teambition/merge2 + * + * Copyright (c) 2014-2020 Teambition + * Licensed under the MIT license. + */ +const Stream = __nccwpck_require__(12781) +const PassThrough = Stream.PassThrough +const slice = Array.prototype.slice -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. +module.exports = merge2 -tok('NUMERICIDENTIFIER') -src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' -tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' +function merge2 () { + const streamsQueue = [] + const args = slice.call(arguments) + let merging = false + let options = args[args.length - 1] -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. + if (options && !Array.isArray(options) && options.pipe == null) { + args.pop() + } else { + options = {} + } -tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' + const doEnd = options.end !== false + const doPipeError = options.pipeError === true + if (options.objectMode == null) { + options.objectMode = true + } + if (options.highWaterMark == null) { + options.highWaterMark = 64 * 1024 + } + const mergedStream = PassThrough(options) -// ## Main Version -// Three dot-separated numeric identifiers. + function addStream () { + for (let i = 0, len = arguments.length; i < len; i++) { + streamsQueue.push(pauseStreams(arguments[i], options)) + } + mergeStream() + return this + } -tok('MAINVERSION') -src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')' + function mergeStream () { + if (merging) { + return + } + merging = true -tok('MAINVERSIONLOOSE') -src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' + let streams = streamsQueue.shift() + if (!streams) { + process.nextTick(endStream) + return + } + if (!Array.isArray(streams)) { + streams = [streams] + } -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. + let pipesCount = streams.length + 1 -tok('PRERELEASEIDENTIFIER') -src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' + function next () { + if (--pipesCount > 0) { + return + } + merging = false + mergeStream() + } -tok('PRERELEASEIDENTIFIERLOOSE') -src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' + function pipe (stream) { + function onend () { + stream.removeListener('merge2UnpipeEnd', onend) + stream.removeListener('end', onend) + if (doPipeError) { + stream.removeListener('error', onerror) + } + next() + } + function onerror (err) { + mergedStream.emit('error', err) + } + // skip ended stream + if (stream._readableState.endEmitted) { + return next() + } -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. + stream.on('merge2UnpipeEnd', onend) + stream.on('end', onend) -tok('PRERELEASE') -src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' + if (doPipeError) { + stream.on('error', onerror) + } -tok('PRERELEASELOOSE') -src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' + stream.pipe(mergedStream, { end: false }) + // compatible for old stream + stream.resume() + } -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. + for (let i = 0; i < streams.length; i++) { + pipe(streams[i]) + } -tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' + next() + } -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. + function endStream () { + merging = false + // emit 'queueDrain' when all streams merged. + mergedStream.emit('queueDrain') + if (doEnd) { + mergedStream.end() + } + } -tok('BUILD') -src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + - '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' + mergedStream.setMaxListeners(0) + mergedStream.add = addStream + mergedStream.on('unpipe', function (stream) { + stream.emit('merge2UnpipeEnd') + }) -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. + if (args.length) { + addStream.apply(null, args) + } + return mergedStream +} -// 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. +// check and pause streams for pipe. +function pauseStreams (streams, options) { + if (!Array.isArray(streams)) { + // Backwards-compat with old-style streams + if (!streams._readableState && streams.pipe) { + streams = streams.pipe(PassThrough(options)) + } + if (!streams._readableState || !streams.pause || !streams.pipe) { + throw new Error('Only readable stream can be merged.') + } + streams.pause() + } else { + for (let i = 0, len = streams.length; i < len; i++) { + streams[i] = pauseStreams(streams[i], options) + } + } + return streams +} -tok('FULL') -tok('FULLPLAIN') -src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + - src[t.PRERELEASE] + '?' + - src[t.BUILD] + '?' -src[t.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. -tok('LOOSEPLAIN') -src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + - src[t.PRERELEASELOOSE] + '?' + - src[t.BUILD] + '?' +/***/ 316: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -tok('LOOSE') -src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' +"use strict"; -tok('GTLT') -src[t.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. -tok('XRANGEIDENTIFIERLOOSE') -src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -tok('XRANGEIDENTIFIER') -src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.JSONHTTPError = exports.TextHTTPError = exports.HTTPError = exports.getPagination = undefined; -tok('XRANGEPLAIN') -src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:' + src[t.PRERELEASE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -tok('XRANGEPLAINLOOSE') -src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[t.PRERELEASELOOSE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' +var _createClass = 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, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -tok('XRANGE') -src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' -tok('XRANGELOOSE') -src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' +var _pagination = __nccwpck_require__(69724); -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -tok('COERCE') -src[t.COERCE] = '(^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])' -tok('COERCERTL') -re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') -safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') +Object.defineProperty(exports, "getPagination", ({ + enumerable: true, + get: function get() { + return _pagination.getPagination; + } +})); -// Tilde ranges. -// Meaning is "reasonably at or greater than" -tok('LONETILDE') -src[t.LONETILDE] = '(?:~>?)' +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -tok('TILDETRIM') -src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' -re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') -safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') -var tildeTrimReplace = '$1~' +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -tok('TILDE') -src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' -tok('TILDELOOSE') -src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -// Caret ranges. -// Meaning is "at least and backwards compatible with" -tok('LONECARET') -src[t.LONECARET] = '(?:\\^)' +function _extendableBuiltin(cls) { + function ExtendableBuiltin() { + var instance = Reflect.construct(cls, Array.from(arguments)); + Object.setPrototypeOf(instance, Object.getPrototypeOf(this)); + return instance; + } -tok('CARETTRIM') -src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' -re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') -safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') -var caretTrimReplace = '$1^' + ExtendableBuiltin.prototype = Object.create(cls.prototype, { + constructor: { + value: cls, + enumerable: false, + writable: true, + configurable: true + } + }); -tok('CARET') -src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' -tok('CARETLOOSE') -src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' + if (Object.setPrototypeOf) { + Object.setPrototypeOf(ExtendableBuiltin, cls); + } else { + ExtendableBuiltin.__proto__ = cls; + } -// A simple gt/lt/eq thing, or just "" to indicate "any version" -tok('COMPARATORLOOSE') -src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' -tok('COMPARATOR') -src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' + return ExtendableBuiltin; +} -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -tok('COMPARATORTRIM') -src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + - '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' +var HTTPError = exports.HTTPError = function (_extendableBuiltin2) { + _inherits(HTTPError, _extendableBuiltin2); -// this one has to use the /g flag -re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') -safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') -var comparatorTrimReplace = '$1$2$3' + function HTTPError(response) { + _classCallCheck(this, HTTPError); -// 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. -tok('HYPHENRANGE') -src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAIN] + ')' + - '\\s*$' + var _this = _possibleConstructorReturn(this, (HTTPError.__proto__ || Object.getPrototypeOf(HTTPError)).call(this, response.statusText)); -tok('HYPHENRANGELOOSE') -src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s*$' + _this.name = _this.constructor.name; + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(_this, _this.constructor); + } else { + _this.stack = new Error(response.statusText).stack; + } + _this.status = response.status; + return _this; + } -// Star ranges basically just allow anything at all. -tok('STAR') -src[t.STAR] = '(<|>)?=?\\s*\\*' + return HTTPError; +}(_extendableBuiltin(Error)); -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]) - if (!re[i]) { - re[i] = new RegExp(src[i]) +var TextHTTPError = exports.TextHTTPError = function (_HTTPError) { + _inherits(TextHTTPError, _HTTPError); - // Replace all greedy whitespace 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. - safeRe[i] = new RegExp(makeSafeRe(src[i])) - } -} + function TextHTTPError(response, data) { + _classCallCheck(this, TextHTTPError); -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + var _this2 = _possibleConstructorReturn(this, (TextHTTPError.__proto__ || Object.getPrototypeOf(TextHTTPError)).call(this, response)); - if (version instanceof SemVer) { - return version + _this2.data = data; + return _this2; } - if (typeof version !== 'string') { - return null - } + return TextHTTPError; +}(HTTPError); - if (version.length > MAX_LENGTH) { - return null - } +var JSONHTTPError = exports.JSONHTTPError = function (_HTTPError2) { + _inherits(JSONHTTPError, _HTTPError2); - var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] - if (!r.test(version)) { - return null - } + function JSONHTTPError(response, json) { + _classCallCheck(this, JSONHTTPError); - try { - return new SemVer(version, options) - } catch (er) { - return null + var _this3 = _possibleConstructorReturn(this, (JSONHTTPError.__proto__ || Object.getPrototypeOf(JSONHTTPError)).call(this, response)); + + _this3.json = json; + return _this3; } -} -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null -} + return JSONHTTPError; +}(HTTPError); -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} +var API = function () { + function API() { + var apiURL = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var options = arguments[1]; -exports.SemVer = SemVer + _classCallCheck(this, API); -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false + this.apiURL = apiURL; + if (this.apiURL.match(/\/[^\/]?/)) { + // eslint-disable-line no-useless-escape + this._sameOrigin = true; } + this.defaultHeaders = options && options.defaultHeaders || {}; } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version - } else { - version = version.version + + _createClass(API, [{ + key: "headers", + value: function headers() { + var _headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + return _extends({}, this.defaultHeaders, { + "Content-Type": "application/json" + }, _headers); } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version) - } + }, { + key: "parseJsonResponse", + value: function parseJsonResponse(response) { + return response.json().then(function (json) { + if (!response.ok) { + return Promise.reject(new JSONHTTPError(response, json)); + } - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - } + var pagination = (0, _pagination.getPagination)(response); + return pagination ? { pagination: pagination, items: json } : json; + }); + } + }, { + key: "request", + value: function request(path) { + var _this4 = this; - if (!(this instanceof SemVer)) { - return new SemVer(version, options) - } + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose + var headers = this.headers(options.headers || {}); + if (this._sameOrigin) { + options.credentials = options.credentials || "same-origin"; + } + return fetch(this.apiURL + path, _extends({}, options, { headers: headers })).then(function (response) { + var contentType = response.headers.get("Content-Type"); + if (contentType && contentType.match(/json/)) { + return _this4.parseJsonResponse(response); + } - var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) + if (!response.ok) { + return response.text().then(function (data) { + return Promise.reject(new TextHTTPError(response, data)); + }); + } + return response.text().then(function (data) { + data; + }); + }); + } + }]); - if (!m) { - throw new TypeError('Invalid Version: ' + version) - } + return API; +}(); - this.raw = version +exports["default"] = API; - // 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') - } +/***/ 69724: +/***/ ((__unused_webpack_module, exports) => { - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } +"use strict"; - 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(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } +Object.defineProperty(exports, "__esModule", ({ + value: true +})); - this.build = m[5] ? m[5].split('.') : [] - this.format() -} +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') +exports.getPagination = getPagination; +function getPagination(response) { + var links = response.headers.get("Link"); + var pagination = {}; + //var link, url, rel, m, page; + if (links == null) { + return null; } - return this.version -} + links = links.split(","); + var total = response.headers.get("X-Total-Count"); -SemVer.prototype.toString = function () { - return this.version -} + for (var i = 0, len = links.length; i < len; i++) { + var link = links[i].replace(/(^\s*|\s*$)/, ""); -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) + var _link$split = link.split(";"), + _link$split2 = _slicedToArray(_link$split, 2), + url = _link$split2[0], + rel = _link$split2[1]; + + var m = url.match(/page=(\d+)/); + var page = m && parseInt(m[1], 10); + if (rel.match(/last/)) { + pagination.last = page; + } else if (rel.match(/next/)) { + pagination.next = page; + } else if (rel.match(/prev/)) { + pagination.prev = page; + } else if (rel.match(/first/)) { + pagination.first = page; + } } - return this.compareMain(other) || this.comparePre(other) + pagination.last = Math.max(pagination.last || 0, pagination.prev && pagination.prev + 1 || 0); + pagination.current = pagination.next ? pagination.next - 1 : pagination.last || 1; + pagination.total = total ? parseInt(total, 10) : null; + + return pagination; } -SemVer.prototype.compareMain = function (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) -} +/***/ 76228: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +"use strict"; - // 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 - } - var i = 0 - do { - var a = this.prerelease[i] - var 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) -} +const util = __nccwpck_require__(73837); +const braces = __nccwpck_require__(50610); +const picomatch = __nccwpck_require__(78569); +const utils = __nccwpck_require__(30479); +const isEmptyString = val => val === '' || val === './'; -SemVer.prototype.compareBuild = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +/** + * Returns an array of strings that match one or more glob patterns. + * + * ```js + * const mm = require('micromatch'); + * // mm(list, patterns[, options]); + * + * console.log(mm(['a.js', 'a.txt'], ['*.js'])); + * //=> [ 'a.js' ] + * ``` + * @param {String|Array} `list` List of strings to match. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) + * @return {Array} Returns an array of matches + * @summary false + * @api public + */ - var i = 0 - do { - var a = this.build[i] - var 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) -} +const micromatch = (list, patterns, options) => { + patterns = [].concat(patterns); + list = [].concat(list); -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - 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) - this.inc('pre', identifier) - 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) - } - this.inc('pre', identifier) - break + let omit = new Set(); + let keep = new Set(); + let items = new Set(); + let negatives = 0; - 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': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - var 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 - this.prerelease.push(0) - } - } - 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 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break + let onResult = state => { + items.add(state.output); + if (options && options.onResult) { + options.onResult(state); + } + }; - default: - throw new Error('invalid increment argument: ' + release) - } - this.format() - this.raw = this.version - return this -} + for (let i = 0; i < patterns.length; i++) { + let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); + let negated = isMatch.state.negated || isMatch.state.negatedExtglob; + if (negated) negatives++; -exports.inc = inc -function inc (version, release, loose, identifier) { - if (typeof (loose) === 'string') { - identifier = loose - loose = undefined - } + for (let item of list) { + let matched = isMatch(item, true); - try { - return new SemVer(version, loose).inc(release, identifier).version - } catch (er) { - return null - } -} + let match = negated ? !matched.isMatch : matched.isMatch; + if (!match) continue; -exports.diff = diff -function diff (version1, version2) { - if (eq(version1, version2)) { - return null - } else { - var v1 = parse(version1) - var v2 = parse(version2) - var prefix = '' - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre' - var defaultResult = 'prerelease' - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } + if (negated) { + omit.add(matched.output); + } else { + omit.delete(matched.output); + keep.add(matched.output); } } - return defaultResult // may be undefined } -} -exports.compareIdentifiers = compareIdentifiers + let result = negatives === patterns.length ? [...items] : [...keep]; + let matches = result.filter(item => !omit.has(item)); -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) + if (options && matches.length === 0) { + if (options.failglob === true) { + throw new Error(`No matches found for "${patterns.join(', ')}"`); + } - if (anum && bnum) { - a = +a - b = +b + if (options.nonull === true || options.nullglob === true) { + return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; + } } - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) -} - -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major -} + return matches; +}; -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor -} +/** + * Backwards compatibility + */ -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch -} +micromatch.match = micromatch; -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) -} +/** + * Returns a matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns + * true if the string is a match. + * + * ```js + * const mm = require('micromatch'); + * // mm.matcher(pattern[, options]); + * + * const isMatch = mm.matcher('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @param {String} `pattern` Glob pattern + * @param {Object} `options` + * @return {Function} Returns a matcher function. + * @api public + */ -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) -} +micromatch.matcher = (pattern, options) => picomatch(pattern, options); -exports.compareBuild = compareBuild -function compareBuild (a, b, loose) { - var versionA = new SemVer(a, loose) - var versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const mm = require('micromatch'); + * // mm.isMatch(string, patterns[, options]); + * + * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(mm.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `[options]` See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ -exports.rcompare = rcompare -function rcompare (a, b, loose) { - return compare(b, a, loose) -} +micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); -exports.sort = sort -function sort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(a, b, loose) - }) -} +/** + * Backwards compatibility + */ -exports.rsort = rsort -function rsort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(b, a, loose) - }) -} +micromatch.any = micromatch.isMatch; -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 -} +/** + * Returns a list of strings that _**do not match any**_ of the given `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.not(list, patterns[, options]); + * + * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); + * //=> ['b.b', 'c.c'] + * ``` + * @param {Array} `list` Array of strings to match. + * @param {String|Array} `patterns` One or more glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of strings that **do not match** the given patterns. + * @api public + */ -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 -} +micromatch.not = (list, patterns, options = {}) => { + patterns = [].concat(patterns).map(String); + let result = new Set(); + let items = []; -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 -} + let onResult = state => { + if (options.onResult) options.onResult(state); + items.push(state.output); + }; -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 -} + let matches = new Set(micromatch(list, patterns, { ...options, onResult })); -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 -} + for (let item of items) { + if (!matches.has(item)) { + result.add(item); + } + } + return [...result]; +}; -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 -} +/** + * Returns true if the given `string` contains the given pattern. Similar + * to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * ```js + * var mm = require('micromatch'); + * // mm.contains(string, pattern[, options]); + * + * console.log(mm.contains('aa/bb/cc', '*b')); + * //=> true + * console.log(mm.contains('aa/bb/cc', '*d')); + * //=> false + * ``` + * @param {String} `str` The string to match. + * @param {String|Array} `patterns` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any of the patterns matches any part of `str`. + * @api public + */ -exports.cmp = cmp -function 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 +micromatch.contains = (str, pattern, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); + } - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b + if (Array.isArray(pattern)) { + return pattern.some(p => micromatch.contains(str, p, options)); + } - case '': - case '=': - case '==': - return eq(a, b, loose) + if (typeof pattern === 'string') { + if (isEmptyString(str) || isEmptyString(pattern)) { + return false; + } - case '!=': - return neq(a, b, loose) + if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { + return true; + } + } - case '>': - return gt(a, b, loose) + return micromatch.isMatch(str, pattern, { ...options, contains: true }); +}; - case '>=': - return gte(a, b, loose) +/** + * Filter the keys of the given object with the given `glob` pattern + * and `options`. Does not attempt to match nested keys. If you need this feature, + * use [glob-object][] instead. + * + * ```js + * const mm = require('micromatch'); + * // mm.matchKeys(object, patterns[, options]); + * + * const obj = { aa: 'a', ab: 'b', ac: 'c' }; + * console.log(mm.matchKeys(obj, '*b')); + * //=> { ab: 'b' } + * ``` + * @param {Object} `object` The object with keys to filter. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Object} Returns an object with only keys that match the given patterns. + * @api public + */ - case '<': - return lt(a, b, loose) +micromatch.matchKeys = (obj, patterns, options) => { + if (!utils.isObject(obj)) { + throw new TypeError('Expected the first argument to be an object'); + } + let keys = micromatch(Object.keys(obj), patterns, options); + let res = {}; + for (let key of keys) res[key] = obj[key]; + return res; +}; - case '<=': - return lte(a, b, loose) +/** + * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.some(list, patterns[, options]); + * + * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // true + * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list` + * @api public + */ - default: - throw new TypeError('Invalid operator: ' + op) - } -} +micromatch.some = (list, patterns, options) => { + let items = [].concat(list); -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options); + if (items.some(item => isMatch(item))) { + return true; } } + return false; +}; - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } +/** + * Returns true if every string in the given `list` matches + * any of the given glob `patterns`. + * + * ```js + * const mm = require('micromatch'); + * // mm.every(list, patterns[, options]); + * + * console.log(mm.every('foo.js', ['foo.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // false + * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list` + * @api public + */ - if (!(this instanceof Comparator)) { - return new Comparator(comp, options) +micromatch.every = (list, patterns, options) => { + let items = [].concat(list); + + for (let pattern of [].concat(patterns)) { + let isMatch = picomatch(String(pattern), options); + if (!items.every(item => isMatch(item))) { + return false; + } } + return true; +}; - comp = comp.trim().split(/\s+/).join(' ') - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) +/** + * Returns true if **all** of the given `patterns` match + * the specified string. + * + * ```js + * const mm = require('micromatch'); + * // mm.all(string, patterns[, options]); + * + * console.log(mm.all('foo.js', ['foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); + * // false + * + * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); + * // true + * ``` + * @param {String|Array} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version +micromatch.all = (str, patterns, options) => { + if (typeof str !== 'string') { + throw new TypeError(`Expected a string: "${util.inspect(str)}"`); } - debug('comp', this) -} + return [].concat(patterns).every(p => picomatch(p, options)(str)); +}; -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] - var m = comp.match(r) +/** + * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. + * + * ```js + * const mm = require('micromatch'); + * // mm.capture(pattern, string[, options]); + * + * console.log(mm.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(mm.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `glob` Glob pattern to use for matching. + * @param {String} `input` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`. + * @api public + */ - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) - } +micromatch.capture = (glob, input, options) => { + let posix = utils.isWindows(options); + let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); + let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' + if (match) { + return match.slice(1).map(v => v === void 0 ? '' : v); } +}; - // 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) - } -} +/** + * Create a regular expression from the given glob `pattern`. + * + * ```js + * const mm = require('micromatch'); + * // mm.makeRe(pattern[, options]); + * + * console.log(mm.makeRe('*.js')); + * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ + * ``` + * @param {String} `pattern` A glob pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ -Comparator.prototype.toString = function () { - return this.value -} +micromatch.makeRe = (...args) => picomatch.makeRe(...args); -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose) +/** + * Scan a glob pattern to separate the pattern into segments. Used + * by the [split](#split) method. + * + * ```js + * const mm = require('micromatch'); + * const state = mm.scan(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ - if (this.semver === ANY || version === ANY) { - return true - } +micromatch.scan = (...args) => picomatch.scan(...args); - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const mm = require('micromatch'); + * const state = mm.parse(pattern[, options]); + * ``` + * @param {String} `glob` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as regex source string. + * @api public + */ + +micromatch.parse = (patterns, options) => { + let res = []; + for (let pattern of [].concat(patterns || [])) { + for (let str of braces(String(pattern), options)) { + res.push(picomatch.parse(str, options)); } } + return res; +}; - return cmp(version, this.operator, this.semver, this.options) -} +/** + * Process the given brace `pattern`. + * + * ```js + * const { braces } = require('micromatch'); + * console.log(braces('foo/{a,b,c}/bar')); + * //=> [ 'foo/(a|b|c)/bar' ] + * + * console.log(braces('foo/{a,b,c}/bar', { expand: true })); + * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] + * ``` + * @param {String} `pattern` String with brace pattern to process. + * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. + * @return {Array} + * @api public + */ -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') +micromatch.braces = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { + return [pattern]; } + return braces(pattern, options); +}; - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +/** + * Expand braces + */ - var rangeTmp +micromatch.braceExpand = (pattern, options) => { + if (typeof pattern !== 'string') throw new TypeError('Expected a string'); + return micromatch.braces(pattern, { ...options, expand: true }); +}; - if (this.operator === '') { - if (this.value === '') { - return true - } - rangeTmp = new Range(comp.value, options) - return satisfies(this.value, rangeTmp, options) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - rangeTmp = new Range(this.value, options) - return satisfies(comp.semver, rangeTmp, options) - } +/** + * Expose micromatch + */ - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - var sameSemVer = this.semver.version === comp.semver.version - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')) - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')) +module.exports = micromatch; - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan -} -exports.Range = Range -function Range (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +/***/ }), - if (range instanceof Range) { - if (range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease) { - return range - } else { - return new Range(range.raw, options) - } - } +/***/ 83973: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (range instanceof Comparator) { - return new Range(range.value, options) - } +module.exports = minimatch +minimatch.Minimatch = Minimatch - if (!(this instanceof Range)) { - return new Range(range, options) - } +var path = (function () { try { return __nccwpck_require__(71017) } catch (e) {}}()) || { + sep: '/' +} +minimatch.sep = path.sep - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = __nccwpck_require__(33717) - // 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(' ') +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} - // First, split based on boolean or || - this.set = this.raw.split('||').map(function (range) { - return this.parseRange(range.trim()) - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length - }) +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + this.raw) - } +// * => any number of characters +var star = qmark + '*?' - this.format() +// ** 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})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) } -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } } -Range.prototype.toString = function () { - return this.range +function ext (a, b) { + b = b || {} + var t = {} + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + return t } -Range.prototype.parseRange = function (range) { - var loose = this.options.loose - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) +minimatch.defaults = function (def) { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch + } - // `~ 1.2.3` => `~1.2.3` - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) + var orig = minimatch - // `^ 1.2.3` => `^1.2.3` - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) + var m = function minimatch (p, pattern, options) { + return orig(p, pattern, ext(def, options)) + } - // normalize spaces - range = range.split(/\s+/).join(' ') + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + m.Minimatch.defaults = function defaults (options) { + return orig.defaults(ext(def, options)).Minimatch + } - // At this point, the range is completely trimmed and - // ready to be split into comparators. + m.filter = function filter (pattern, options) { + return orig.filter(pattern, ext(def, options)) + } - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options) - }, this).join(' ').split(/\s+/) - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe) - }) + m.defaults = function defaults (options) { + return orig.defaults(ext(def, options)) } - set = set.map(function (comp) { - return new Comparator(comp, this.options) - }, this) - return set -} + m.makeRe = function makeRe (pattern, options) { + return orig.makeRe(pattern, ext(def, options)) + } -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') + m.braceExpand = function braceExpand (pattern, options) { + return orig.braceExpand(pattern, ext(def, options)) } - return this.set.some(function (thisComparators) { - return ( - isSatisfiable(thisComparators, options) && - range.set.some(function (rangeComparators) { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every(function (thisComparator) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) + m.match = function (list, pattern, options) { + return orig.match(list, pattern, ext(def, options)) + } + + return m } -// take a set of comparators and determine whether there -// exists a version which can satisfy it -function isSatisfiable (comparators, options) { - var result = true - var remainingComparators = comparators.slice() - var testComparator = remainingComparators.pop() +Minimatch.defaults = function (def) { + return minimatch.defaults(def).Minimatch +} - while (result && remainingComparators.length) { - result = remainingComparators.every(function (otherComparator) { - return testComparator.intersects(otherComparator, options) - }) +function minimatch (p, pattern, options) { + assertValidPattern(pattern) - testComparator = remainingComparators.pop() + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false } - return result + return new Minimatch(pattern, options).match(p) } -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators -function toComparators (range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value - }).join(' ').trim().split(' ') - }) -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function 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 -} +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' -} + assertValidPattern(pattern) -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options) - }).join(' ') -} + if (!options) options = {} -function replaceTilde (comp, options) { - var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr) - var ret + pattern = pattern.trim() - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else if (pr) { - debug('replaceTilde pr', pr) - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } + // windows support: need to use /, not \ + if (!options.allowWindowsEscape && path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } - debug('tilde return', ret) - return ret - }) -} + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options) - }).join(' ') + // make the set of regexps etc. + this.make() } -function replaceCaret (comp, options) { - debug('caret', comp, options) - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr) - var ret +Minimatch.prototype.debug = function () {} - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + (+M + 1) + '.0.0' - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0' - } - } +Minimatch.prototype.make = make +function make () { + var pattern = this.pattern + var options = this.options - debug('caret return', ret) - return ret - }) -} + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') -} + // step 1: figure out negation, etc. + this.parseNegate() -function replaceXRange (comp, options) { - comp = comp.trim() - var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - var xM = isX(M) - var xm = xM || isX(m) - var xp = xm || isX(p) - var anyX = xp + // step 2: expand braces + var set = this.globSet = this.braceExpand() - if (gtlt === '=' && anyX) { - gtlt = '' - } + if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } - // 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' : '' + this.debug(this.pattern, set) - 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 + // 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) + }) - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - 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 - } - } + this.debug(this.pattern, set) - ret = gtlt + M + '.' + m + '.' + p + pr - } else if (xm) { - ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr - } else if (xp) { - ret = '>=' + M + '.' + m + '.0' + pr + - ' <' + M + '.' + (+m + 1) + '.0' + pr - } + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) - debug('xRange return', ret) + this.debug(this.pattern, set) - return ret + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 }) -} -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars (comp, options) { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(safeRe[t.STAR], '') -} + this.debug(this.pattern, set) -// 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 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace ($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' - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0' - } else { - from = '>=' + from - } + this.set = set +} - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0' - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0' - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr - } else { - to = '<=' + to - } +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 - return (from + ' ' + to).trim() -} + if (options.nonegate) return -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ } - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false +// 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) } -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} } } - 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 (i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === ANY) { - continue - } + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } + assertValidPattern(pattern) - // Version has a -pre, but it's not one of the ones we like. - return false + // 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 true -} - -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) + return expand(pattern) } -exports.maxSatisfying = maxSatisfying -function maxSatisfying (versions, range, options) { - var max = null - var maxSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') } - versions.forEach(function (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 -} -exports.minSatisfying = minSatisfying -function minSatisfying (versions, range, options) { - var min = null - var minSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') } - versions.forEach(function (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 } -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) +// 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 minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } + var options = this.options - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' } + if (pattern === '') return '' - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] + 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 - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var 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 (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ + 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: - throw new Error('Unexpected operation: ' + comparator.operator) + re += '\\' + stateChar + break } - }) - } - - if (minver && range.test(minver)) { - return minver + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } } - return null -} + 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) -exports.validRange = validRange -function 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 - } -} + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr -function ltr (version, range, options) { - return outside(version, range, '<', options) -} + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr -function gtr (version, range, options) { - return outside(version, range, '>', options) -} + case '\\': + clearStateChar() + escaping = true + continue -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) + // 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) - var 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 ">"') - } + // 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 it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } + // 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 - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. + case '(': + if (inClass) { + re += '(' + continue + } - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] + if (!stateChar) { + re += '\\(' + continue + } - var high = null - var low = null + 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 - comparators.forEach(function (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 - } - }) + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } + 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 - // 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 -} + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} + clearStateChar() + re += '|' + continue -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() -exports.coerce = coerce -function coerce (version, options) { - if (version instanceof SemVer) { - return version - } + if (inClass) { + re += '\\' + c + continue + } - if (typeof version === 'number') { - version = String(version) - } + inClass = true + classStart = i + reClassStart = re.length + re += c + continue - if (typeof version !== 'string') { - return null - } + 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 + } - options = options || {} + // 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 + } - var match = null - if (!options.rtl) { - match = version.match(safeRe[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. - var next - while ((next = safeRe[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 - } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - safeRe[t.COERCERTL].lastIndex = -1 - } + // finish up the class. + hasMagic = true + inClass = false + re += c + continue - if (match === null) { - return null - } + default: + // swallow any state char that wasn't consumed + clearStateChar() - return parse(match[2] + - '.' + (match[3] || '0') + - '.' + (match[4] || '0'), options) -} + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + re += c -/***/ }), + } // switch + } // for -/***/ 42555: -/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { + // 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] + } -"use strict"; + // 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 = '\\' + } -const isOptionObject = __nccwpck_require__(20864); + // 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 + '|' + }) -const {hasOwnProperty} = Object.prototype; -const {propertyIsEnumerable} = Object; -const defineProperty = (object, name, value) => Object.defineProperty(object, name, { - value, - writable: true, - enumerable: true, - configurable: true -}); + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type -const globalThis = this; -const defaultMergeOptions = { - concatArrays: false, - ignoreUndefined: false -}; + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } -const getEnumerableOwnPropertyKeys = value => { - const keys = []; + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } - for (const key in value) { - if (hasOwnProperty.call(value, key)) { - keys.push(key); - } - } + // 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 + } - /* istanbul ignore else */ - if (Object.getOwnPropertySymbols) { - const symbols = Object.getOwnPropertySymbols(value); + // 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] - for (const symbol of symbols) { - if (propertyIsEnumerable.call(value, symbol)) { - keys.push(symbol); - } - } - } + 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) - return keys; -}; + nlLast += nlAfter -function clone(value) { - if (Array.isArray(value)) { - return cloneArray(value); - } + // 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 - if (isOptionObject(value)) { - return cloneOptionObject(value); - } + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } - return value; -} + // 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 + } -function cloneArray(array) { - const result = array.slice(0, 0); + if (addPatternStart) { + re = patternStart + re + } - getEnumerableOwnPropertyKeys(array).forEach(key => { - defineProperty(result, key, clone(array[key])); - }); + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } - return result; -} + // 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) + } -function cloneOptionObject(object) { - const result = Object.getPrototypeOf(object) === null ? Object.create(null) : {}; + 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('$.') + } - getEnumerableOwnPropertyKeys(object).forEach(key => { - defineProperty(result, key, clone(object[key])); - }); + regExp._glob = pattern + regExp._src = re - return result; + return regExp } -/** - * @param {*} merged already cloned - * @param {*} source something to merge - * @param {string[]} keys keys to merge - * @param {Object} config Config Object - * @returns {*} cloned Object - */ -const mergeKeys = (merged, source, keys, config) => { - keys.forEach(key => { - if (typeof source[key] === 'undefined' && config.ignoreUndefined) { - return; - } - - // Do not recurse into prototype chain of merged - if (key in merged && merged[key] !== Object.getPrototypeOf(merged)) { - defineProperty(merged, key, merge(merged[key], source[key], config)); - } else { - defineProperty(merged, key, clone(source[key])); - } - }); +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} - return merged; -}; +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp -/** - * @param {*} merged already cloned - * @param {*} source something to merge - * @param {Object} config Config Object - * @returns {*} cloned Object - * - * see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat) - */ -const concatArrays = (merged, source, config) => { - let result = merged.slice(0, 0); - let resultIndex = 0; + // 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 - [merged, source].forEach(array => { - const indices = []; + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options - // `result.concat(array)` with cloning - for (let k = 0; k < array.length; k++) { - if (!hasOwnProperty.call(array, k)) { - continue; - } + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' - indices.push(String(k)); + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') - if (array === merged) { - // Already cloned - defineProperty(result, resultIndex++, array[k]); - } else { - defineProperty(result, resultIndex++, clone(array[k])); - } - } + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' - // Merge non-index keys - result = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config); - }); + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' - return result; -}; + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} -/** - * @param {*} merged already cloned - * @param {*} source something to merge - * @param {Object} config Config Object - * @returns {*} cloned Object - */ -function merge(merged, source, config) { - if (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) { - return concatArrays(merged, source, config); - } +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 +} - if (!isOptionObject(source) || !isOptionObject(merged)) { - return clone(source); - } +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 === '' - return mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config); -} + if (f === '/' && partial) return true -module.exports = function (...options) { - const config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions); - let merged = {_: {}}; + var options = this.options - for (const option of options) { - if (option === undefined) { - continue; - } + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } - if (!isOptionObject(option)) { - throw new TypeError('`' + option + '` is not an Option Object'); - } + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) - merged = merge(merged, {_: option}, config); - } + // 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. - return merged._; -}; + 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 + } + } -/***/ 82578: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} -"use strict"; +// 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 -/* - * merge2 - * https://github.com/teambition/merge2 - * - * Copyright (c) 2014-2020 Teambition - * Licensed under the MIT license. - */ -const Stream = __nccwpck_require__(12781) -const PassThrough = Stream.PassThrough -const slice = Array.prototype.slice + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) -module.exports = merge2 + this.debug('matchOne', file.length, pattern.length) -function merge2 () { - const streamsQueue = [] - const args = slice.call(arguments) - let merging = false - let options = args[args.length - 1] + 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] - if (options && !Array.isArray(options) && options.pipe == null) { - args.pop() - } else { - options = {} - } + this.debug(pattern, p, f) - const doEnd = options.end !== false - const doPipeError = options.pipeError === true - if (options.objectMode == null) { - options.objectMode = true - } - if (options.highWaterMark == null) { - options.highWaterMark = 64 * 1024 - } - const mergedStream = PassThrough(options) + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false - function addStream () { - for (let i = 0, len = arguments.length; i < len; i++) { - streamsQueue.push(pauseStreams(arguments[i], options)) - } - mergeStream() - return this - } + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) - function mergeStream () { - if (merging) { - return - } - merging = true + // "**" + // 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 + } - let streams = streamsQueue.shift() - if (!streams) { - process.nextTick(endStream) - return - } - if (!Array.isArray(streams)) { - streams = [streams] - } + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] - let pipesCount = streams.length + 1 + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - function next () { - if (--pipesCount > 0) { - return - } - merging = false - mergeStream() - } + // 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 + } - function pipe (stream) { - function onend () { - stream.removeListener('merge2UnpipeEnd', onend) - stream.removeListener('end', onend) - if (doPipeError) { - stream.removeListener('error', onerror) + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ } - next() - } - function onerror (err) { - mergedStream.emit('error', err) - } - // skip ended stream - if (stream._readableState.endEmitted) { - return next() } - stream.on('merge2UnpipeEnd', onend) - stream.on('end', onend) - - if (doPipeError) { - stream.on('error', onerror) + // 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 } - - stream.pipe(mergedStream, { end: false }) - // compatible for old stream - stream.resume() + return false } - for (let i = 0; i < streams.length; i++) { - pipe(streams[i]) + // 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) } - next() + if (!hit) return false } - function endStream () { - merging = false - // emit 'queueDrain' when all streams merged. - mergedStream.emit('queueDrain') - if (doEnd) { - mergedStream.end() - } + // 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] === '') } - mergedStream.setMaxListeners(0) - mergedStream.add = addStream - mergedStream.on('unpipe', function (stream) { - stream.emit('merge2UnpipeEnd') - }) + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} - if (args.length) { - addStream.apply(null, args) - } - return mergedStream +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') } -// check and pause streams for pipe. -function pauseStreams (streams, options) { - if (!Array.isArray(streams)) { - // Backwards-compat with old-style streams - if (!streams._readableState && streams.pipe) { - streams = streams.pipe(PassThrough(options)) - } - if (!streams._readableState || !streams.pause || !streams.pipe) { - throw new Error('Only readable stream can be merged.') - } - streams.pause() - } else { - for (let i = 0, len = streams.length; i < len; i++) { - streams[i] = pauseStreams(streams[i], options) - } - } - return streams +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') } /***/ }), -/***/ 316: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 81877: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.JSONHTTPError = exports.TextHTTPError = exports.HTTPError = exports.getPagination = undefined; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = 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, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _pagination = __nccwpck_require__(69724); +const fs = __nccwpck_require__(57147); +const Walker = __nccwpck_require__(46695); +const types = __nccwpck_require__(76848); -Object.defineProperty(exports, "getPagination", ({ - enumerable: true, - get: function get() { - return _pagination.getPagination; - } -})); +/** + * Determines the type of the module from the supplied source code or AST + * + * @param {String|Object} source - The string content or AST of a file + * @return {String} + */ +function fromSource(source) { + if (typeof source === 'undefined') throw new Error('source not supplied'); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + const walker = new Walker(); + let type = 'none'; + let hasDefine = false; + let hasAMDTopLevelRequire = false; + let hasRequire = false; + let hasExports = false; + let hasES6Import = false; + let hasES6Export = false; + const hasDynamicImport = false; -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + // Walker accepts as AST to avoid reparsing + walker.walk(source, (node) => { + if (types.isDefineAMD(node)) hasDefine = true; + if (types.isRequire(node)) hasRequire = true; + if (types.isExports(node)) hasExports = true; + if (types.isAMDDriverScriptRequire(node)) hasAMDTopLevelRequire = true; + if (types.isES6Import(node)) hasES6Import = true; + if (types.isES6Export(node)) hasES6Export = true; -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + if (hasES6Import || hasES6Export || hasDynamicImport) { + type = 'es6'; + walker.stopWalking(); + return; + } -function _extendableBuiltin(cls) { - function ExtendableBuiltin() { - var instance = Reflect.construct(cls, Array.from(arguments)); - Object.setPrototypeOf(instance, Object.getPrototypeOf(this)); - return instance; - } + if (hasDefine || hasAMDTopLevelRequire) { + type = 'amd'; + walker.stopWalking(); + return; + } - ExtendableBuiltin.prototype = Object.create(cls.prototype, { - constructor: { - value: cls, - enumerable: false, - writable: true, - configurable: true + if (hasExports || (hasRequire && !hasDefine)) { + type = 'commonjs'; + walker.stopWalking(); } }); - if (Object.setPrototypeOf) { - Object.setPrototypeOf(ExtendableBuiltin, cls); - } else { - ExtendableBuiltin.__proto__ = cls; - } + return type; +} - return ExtendableBuiltin; +/** + * Synchronously determine the module type for the contents of the passed filepath + * + * @param {String} filepath + * @param {Object} options + * @return {String} + */ +function sync(filepath, options = {}) { + if (!filepath) throw new Error('filename missing'); + + const fileSystem = options.fileSystem ? options.fileSystem : fs; + const data = fileSystem.readFileSync(filepath, 'utf8'); + + return fromSource(data); } -var HTTPError = exports.HTTPError = function (_extendableBuiltin2) { - _inherits(HTTPError, _extendableBuiltin2); +/** + * Asynchronously determines the module type for the contents of the given filepath + * + * @param {String} filepath + * @param {Function} cb - Executed with (err, type) + * @param {Object} options + */ +module.exports = function(filepath, cb, options = {}) { + if (!filepath) throw new Error('filename missing'); + if (!cb) throw new Error('callback missing'); - function HTTPError(response) { - _classCallCheck(this, HTTPError); + const fileSystem = options.fileSystem ? options.fileSystem : fs; - var _this = _possibleConstructorReturn(this, (HTTPError.__proto__ || Object.getPrototypeOf(HTTPError)).call(this, response.statusText)); + fileSystem.readFile(filepath, 'utf8', (err, data) => { + if (err) return cb(err); - _this.name = _this.constructor.name; - if (typeof Error.captureStackTrace === "function") { - Error.captureStackTrace(_this, _this.constructor); - } else { - _this.stack = new Error(response.statusText).stack; + let type; + + try { + type = fromSource(data); + } catch (error) { + return cb(error); } - _this.status = response.status; - return _this; - } - return HTTPError; -}(_extendableBuiltin(Error)); + cb(null, type); + }); +}; -var TextHTTPError = exports.TextHTTPError = function (_HTTPError) { - _inherits(TextHTTPError, _HTTPError); +module.exports.sync = sync; +module.exports.fromSource = fromSource; - function TextHTTPError(response, data) { - _classCallCheck(this, TextHTTPError); - var _this2 = _possibleConstructorReturn(this, (TextHTTPError.__proto__ || Object.getPrototypeOf(TextHTTPError)).call(this, response)); +/***/ }), - _this2.data = data; - return _this2; - } +/***/ 80900: +/***/ ((module) => { - return TextHTTPError; -}(HTTPError); +/** + * Helpers. + */ -var JSONHTTPError = exports.JSONHTTPError = function (_HTTPError2) { - _inherits(JSONHTTPError, _HTTPError2); +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; - function JSONHTTPError(response, json) { - _classCallCheck(this, JSONHTTPError); +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ - var _this3 = _possibleConstructorReturn(this, (JSONHTTPError.__proto__ || Object.getPrototypeOf(JSONHTTPError)).call(this, response)); +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; - _this3.json = json; - return _this3; +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; } +} - return JSONHTTPError; -}(HTTPError); +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ -var API = function () { - function API() { - var apiURL = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var options = arguments[1]; +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} - _classCallCheck(this, API); +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ - this.apiURL = apiURL; - if (this.apiURL.match(/\/[^\/]?/)) { - // eslint-disable-line no-useless-escape - this._sameOrigin = true; - } - this.defaultHeaders = options && options.defaultHeaders || {}; +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); } + return ms + ' ms'; +} - _createClass(API, [{ - key: "headers", - value: function headers() { - var _headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; +/** + * Pluralization helper. + */ - return _extends({}, this.defaultHeaders, { - "Content-Type": "application/json" - }, _headers); - } - }, { - key: "parseJsonResponse", - value: function parseJsonResponse(response) { - return response.json().then(function (json) { - if (!response.ok) { - return Promise.reject(new JSONHTTPError(response, json)); - } +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} - var pagination = (0, _pagination.getPagination)(response); - return pagination ? { pagination: pagination, items: json } : json; - }); - } - }, { - key: "request", - value: function request(path) { - var _this4 = this; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; +/***/ }), - var headers = this.headers(options.headers || {}); - if (this._sameOrigin) { - options.credentials = options.credentials || "same-origin"; - } - return fetch(this.apiURL + path, _extends({}, options, { headers: headers })).then(function (response) { - var contentType = response.headers.get("Content-Type"); - if (contentType && contentType.match(/json/)) { - return _this4.parseJsonResponse(response); - } +/***/ 7978: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (!response.ok) { - return response.text().then(function (data) { - return Promise.reject(new TextHTTPError(response, data)); - }); - } - return response.text().then(function (data) { - data; +var inherits = (__nccwpck_require__(73837).inherits); + +var NestedError = function (message, nested) { + this.nested = nested; + + if (message instanceof Error) { + nested = message; + } else if (typeof message !== 'undefined') { + Object.defineProperty(this, 'message', { + value: message, + writable: true, + enumerable: false, + configurable: true }); - }); } - }]); - - return API; -}(); -exports["default"] = API; + Error.captureStackTrace(this, this.constructor); + var oldStackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); + var stackDescriptor = buildStackDescriptor(oldStackDescriptor, nested); + Object.defineProperty(this, 'stack', stackDescriptor); +}; -/***/ }), +function buildStackDescriptor(oldStackDescriptor, nested) { + if (oldStackDescriptor.get) { + return { + get: function () { + var stack = oldStackDescriptor.get.call(this); + return buildCombinedStacks(stack, this.nested); + } + }; + } else { + var stack = oldStackDescriptor.value; + return { + value: buildCombinedStacks(stack, nested) + }; + } +} -/***/ 69724: -/***/ ((__unused_webpack_module, exports) => { +function buildCombinedStacks(stack, nested) { + if (nested) { + stack += '\nCaused By: ' + nested.stack; + } + return stack; +} -"use strict"; +inherits(NestedError, Error); +NestedError.prototype.name = 'NestedError'; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); +module.exports = NestedError; -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); -exports.getPagination = getPagination; -function getPagination(response) { - var links = response.headers.get("Link"); - var pagination = {}; - //var link, url, rel, m, page; - if (links == null) { - return null; - } - links = links.split(","); - var total = response.headers.get("X-Total-Count"); +/***/ }), - for (var i = 0, len = links.length; i < len; i++) { - var link = links[i].replace(/(^\s*|\s*$)/, ""); +/***/ 82617: +/***/ ((module) => { - var _link$split = link.split(";"), - _link$split2 = _slicedToArray(_link$split, 2), - url = _link$split2[0], - rel = _link$split2[1]; +// Local deploy timeout: 20 mins +const DEFAULT_DEPLOY_TIMEOUT = 1.2e6 +// Concurrent file hash calls +const DEFAULT_CONCURRENT_HASH = 1e2 +// Number of concurrent uploads +const DEFAULT_CONCURRENT_UPLOAD = 5 +// Number of files +const DEFAULT_SYNC_LIMIT = 1e2 +// Number of times to retry an upload +const DEFAULT_MAX_RETRY = 5 - var m = url.match(/page=(\d+)/); - var page = m && parseInt(m[1], 10); - if (rel.match(/last/)) { - pagination.last = page; - } else if (rel.match(/next/)) { - pagination.next = page; - } else if (rel.match(/prev/)) { - pagination.prev = page; - } else if (rel.match(/first/)) { - pagination.first = page; - } - } +const UPLOAD_RANDOM_FACTOR = 0.5 +// 5 seconds +const UPLOAD_INITIAL_DELAY = 5e3 +// 1.5 minute +const UPLOAD_MAX_DELAY = 9e4 - pagination.last = Math.max(pagination.last || 0, pagination.prev && pagination.prev + 1 || 0); - pagination.current = pagination.next ? pagination.next - 1 : pagination.last || 1; - pagination.total = total ? parseInt(total, 10) : null; +// 1 second +const DEPLOY_POLL = 1e3 - return pagination; +module.exports = { + DEFAULT_DEPLOY_TIMEOUT, + DEFAULT_CONCURRENT_HASH, + DEFAULT_CONCURRENT_UPLOAD, + DEFAULT_SYNC_LIMIT, + DEFAULT_MAX_RETRY, + UPLOAD_RANDOM_FACTOR, + UPLOAD_INITIAL_DELAY, + UPLOAD_MAX_DELAY, + DEPLOY_POLL, } + /***/ }), -/***/ 76228: +/***/ 51776: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const { promisify } = __nccwpck_require__(73837) +const walker = __nccwpck_require__(6531) +const pump = promisify(__nccwpck_require__(18341)) -const util = __nccwpck_require__(73837); -const braces = __nccwpck_require__(50610); -const picomatch = __nccwpck_require__(78569); -const utils = __nccwpck_require__(30479); -const isEmptyString = val => val === '' || val === './'; +const { hasherCtor, manifestCollectorCtor, fileFilterCtor, fileNormalizerCtor } = __nccwpck_require__(99498) -/** - * Returns an array of strings that match one or more glob patterns. - * - * ```js - * const mm = require('micromatch'); - * // mm(list, patterns[, options]); - * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {String|Array} `list` List of strings to match. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ +const hashFiles = async ( + dir, + configPath, + { concurrentHash, hashAlgorithm = 'sha1', assetType = 'file', statusCb, filter }, +) => { + if (!filter) throw new Error('Missing filter function option') + const fileStream = walker([configPath, dir], { filter }) + const fileFilter = fileFilterCtor() + const hasher = hasherCtor({ concurrentHash, hashAlgorithm }) + const fileNormalizer = fileNormalizerCtor({ assetType }) -const micromatch = (list, patterns, options) => { - patterns = [].concat(patterns); - list = [].concat(list); + // Written to by manifestCollector + // normalizedPath: hash (wanted by deploy API) + const files = {} + // hash: [fileObj, fileObj, fileObj] + const filesShaMap = {} + const manifestCollector = manifestCollectorCtor(files, filesShaMap, { statusCb, assetType }) - let omit = new Set(); - let keep = new Set(); - let items = new Set(); - let negatives = 0; + await pump(fileStream, fileFilter, hasher, fileNormalizer, manifestCollector) - let onResult = state => { - items.add(state.output); - if (options && options.onResult) { - options.onResult(state); - } - }; + return { files, filesShaMap } +} - for (let i = 0; i < patterns.length; i++) { - let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true); - let negated = isMatch.state.negated || isMatch.state.negatedExtglob; - if (negated) negatives++; +module.exports = hashFiles - for (let item of list) { - let matched = isMatch(item, true); - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) continue; +/***/ }), - if (negated) { - omit.add(matched.output); - } else { - omit.delete(matched.output); - keep.add(matched.output); - } - } - } +/***/ 49949: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - let result = negatives === patterns.length ? [...items] : [...keep]; - let matches = result.filter(item => !omit.has(item)); +const path = __nccwpck_require__(71017) +const { promisify } = __nccwpck_require__(73837) - if (options && matches.length === 0) { - if (options.failglob === true) { - throw new Error(`No matches found for "${patterns.join(', ')}"`); - } +const zipIt = __nccwpck_require__(72803) +const fromArray = __nccwpck_require__(56614) +const pump = promisify(__nccwpck_require__(18341)) - if (options.nonull === true || options.nullglob === true) { - return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; - } - } +const { hasherCtor, manifestCollectorCtor } = __nccwpck_require__(99498) - return matches; -}; +const hashFns = async (dir, { tmpDir, concurrentHash, hashAlgorithm = 'sha256', assetType = 'function', statusCb }) => { + // early out if the functions dir is omitted + if (!dir) return { functions: {}, shaMap: {} } + if (!tmpDir) throw new Error('Missing tmpDir directory for zipping files') -/** - * Backwards compatibility - */ + const functionZips = await zipIt.zipFunctions(dir, tmpDir) -micromatch.match = micromatch; + const fileObjs = functionZips.map(({ path: functionPath, runtime }) => ({ + filepath: functionPath, + root: tmpDir, + relname: path.relative(tmpDir, functionPath), + basename: path.basename(functionPath), + extname: path.extname(functionPath), + type: 'file', + assetType: 'function', + normalizedPath: path.basename(functionPath, path.extname(functionPath)), + runtime, + })) -/** - * Returns a matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * const mm = require('micromatch'); - * // mm.matcher(pattern[, options]); - * - * const isMatch = mm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` - * @return {Function} Returns a matcher function. - * @api public - */ - -micromatch.matcher = (pattern, options) => picomatch(pattern, options); - -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const mm = require('micromatch'); - * // mm.isMatch(string, patterns[, options]); - * - * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(mm.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `[options]` See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); - -/** - * Backwards compatibility - */ + const functionStream = fromArray.obj(fileObjs) -micromatch.any = micromatch.isMatch; + const hasher = hasherCtor({ concurrentHash, hashAlgorithm }) -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.not(list, patterns[, options]); - * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ + // Written to by manifestCollector + // normalizedPath: hash (wanted by deploy API) + const functions = {} + // hash: [fileObj, fileObj, fileObj] + const fnShaMap = {} + const manifestCollector = manifestCollectorCtor(functions, fnShaMap, { statusCb, assetType }) -micromatch.not = (list, patterns, options = {}) => { - patterns = [].concat(patterns).map(String); - let result = new Set(); - let items = []; + await pump(functionStream, hasher, manifestCollector) - let onResult = state => { - if (options.onResult) options.onResult(state); - items.push(state.output); - }; + return { functions, fnShaMap } +} - let matches = new Set(micromatch(list, patterns, { ...options, onResult })); +module.exports = hashFns - for (let item of items) { - if (!matches.has(item)) { - result.add(item); - } - } - return [...result]; -}; -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var mm = require('micromatch'); - * // mm.contains(string, pattern[, options]); - * - * console.log(mm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any of the patterns matches any part of `str`. - * @api public - */ +/***/ }), -micromatch.contains = (str, pattern, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } +/***/ 99498: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (Array.isArray(pattern)) { - return pattern.some(p => micromatch.contains(str, p, options)); - } +const flushWriteStream = __nccwpck_require__(36655) +const hasha = __nccwpck_require__(44933) +const transform = __nccwpck_require__(61950) +const objFilterCtor = (__nccwpck_require__(26248).objCtor) +const map = (__nccwpck_require__(78881).obj) - if (typeof pattern === 'string') { - if (isEmptyString(str) || isEmptyString(pattern)) { - return false; - } +const { normalizePath } = __nccwpck_require__(91649) - if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) { - return true; +// a parallel transform stream segment ctor that hashes fileObj's created by folder-walker +// TODO: use promises instead of callbacks +/* eslint-disable promise/prefer-await-to-callbacks */ +const hasherCtor = ({ concurrentHash, hashAlgorithm }) => { + const hashaOpts = { algorithm: hashAlgorithm } + if (!concurrentHash) throw new Error('Missing required opts') + return transform(concurrentHash, { objectMode: true }, async (fileObj, cb) => { + try { + const hash = await hasha.fromFile(fileObj.filepath, hashaOpts) + // insert hash and asset type to file obj + return cb(null, { ...fileObj, hash }) + } catch (error) { + return cb(error) } - } - - return micromatch.isMatch(str, pattern, { ...options, contains: true }); -}; - -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * const mm = require('micromatch'); - * // mm.matchKeys(object, patterns[, options]); - * - * const obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ + }) +} -micromatch.matchKeys = (obj, patterns, options) => { - if (!utils.isObject(obj)) { - throw new TypeError('Expected the first argument to be an object'); - } - let keys = micromatch(Object.keys(obj), patterns, options); - let res = {}; - for (let key of keys) res[key] = obj[key]; - return res; -}; +// Inject normalized file names into normalizedPath and assetType +const fileNormalizerCtor = ({ assetType }) => + map((fileObj) => ({ ...fileObj, assetType, normalizedPath: normalizePath(fileObj.relname) })) -/** - * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.some(list, patterns[, options]); - * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list` - * @api public - */ +// A writable stream segment ctor that normalizes file paths, and writes shaMap's +const manifestCollectorCtor = (filesObj, shaMap, { statusCb, assetType }) => { + if (!statusCb || !assetType) throw new Error('Missing required options') + return flushWriteStream.obj((fileObj, _, cb) => { + // eslint-disable-next-line no-param-reassign + filesObj[fileObj.normalizedPath] = fileObj.hash -micromatch.some = (list, patterns, options) => { - let items = [].concat(list); + // We map a hash to multiple fileObj's because the same file + // might live in two different locations - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (items.some(item => isMatch(item))) { - return true; + if (Array.isArray(shaMap[fileObj.hash])) { + // eslint-disable-next-line fp/no-mutating-methods + shaMap[fileObj.hash].push(fileObj) + } else { + // eslint-disable-next-line no-param-reassign + shaMap[fileObj.hash] = [fileObj] } - } - return false; -}; - -/** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.every(list, patterns[, options]); - * - * console.log(mm.every('foo.js', ['foo.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list` - * @api public - */ - -micromatch.every = (list, patterns, options) => { - let items = [].concat(list); + statusCb({ + type: 'hashing', + msg: `Hashing ${fileObj.relname}`, + phase: 'progress', + }) + cb(null) + }) +} +/* eslint-enable promise/prefer-await-to-callbacks */ - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - if (!items.every(item => isMatch(item))) { - return false; - } - } - return true; -}; +// transform stream ctor that filters folder-walker results for only files +const fileFilterCtor = objFilterCtor((fileObj) => fileObj.type === 'file') -/** - * Returns true if **all** of the given `patterns` match - * the specified string. - * - * ```js - * const mm = require('micromatch'); - * // mm.all(string, patterns[, options]); - * - * console.log(mm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ +module.exports = { + hasherCtor, + fileNormalizerCtor, + manifestCollectorCtor, + fileFilterCtor, +} -micromatch.all = (str, patterns, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } - return [].concat(patterns).every(p => picomatch(p, options)(str)); -}; +/***/ }), -/** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. - * - * ```js - * const mm = require('micromatch'); - * // mm.capture(pattern, string[, options]); - * - * console.log(mm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `glob` Glob pattern to use for matching. - * @param {String} `input` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`. - * @api public - */ +/***/ 55652: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -micromatch.capture = (glob, input, options) => { - let posix = utils.isWindows(options); - let regex = picomatch.makeRe(String(glob), { ...options, capture: true }); - let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); +const { promisify } = __nccwpck_require__(73837) - if (match) { - return match.slice(1).map(v => v === void 0 ? '' : v); - } -}; +const cleanDeep = __nccwpck_require__(88290) +const rimraf = promisify(__nccwpck_require__(14959)) +const tempy = __nccwpck_require__(34768) -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * const mm = require('micromatch'); - * // mm.makeRe(pattern[, options]); - * - * console.log(mm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ +const { + DEFAULT_DEPLOY_TIMEOUT, + DEFAULT_CONCURRENT_HASH, + DEFAULT_CONCURRENT_UPLOAD, + DEFAULT_SYNC_LIMIT, + DEFAULT_MAX_RETRY, +} = __nccwpck_require__(82617) +const hashFiles = __nccwpck_require__(51776) +const hashFns = __nccwpck_require__(49949) +const uploadFiles = __nccwpck_require__(88497) +const { waitForDiff, waitForDeploy, getUploadList, defaultFilter } = __nccwpck_require__(91649) -micromatch.makeRe = (...args) => picomatch.makeRe(...args); +const deploySite = async ( + api, + siteId, + dir, + { + fnDir = null, + configPath = null, + draft = false, + // API calls this the 'title' + message: title, + tmpDir = tempy.directory(), + deployTimeout = DEFAULT_DEPLOY_TIMEOUT, + concurrentHash = DEFAULT_CONCURRENT_HASH, + concurrentUpload = DEFAULT_CONCURRENT_UPLOAD, + filter = defaultFilter, + syncFileLimit = DEFAULT_SYNC_LIMIT, + maxRetry = DEFAULT_MAX_RETRY, + statusCb = () => { + /* default to noop */ + // statusObj: { + // type: name-of-step + // msg: msg to print + // phase: [start, progress, stop], + // spinner: a spinner from cli-spinners package + // } + }, + deployId: deployIdOpt = null, + hashAlgorithm, + assetType, + branch, + } = {}, +) => { + statusCb({ + type: 'hashing', + msg: `Hashing files...`, + phase: 'start', + }) -/** - * Scan a glob pattern to separate the pattern into segments. Used - * by the [split](#split) method. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.scan(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ + const [{ files, filesShaMap }, { functions, fnShaMap }] = await Promise.all([ + hashFiles(dir, configPath, { concurrentHash, hashAlgorithm, assetType, statusCb, filter }), + hashFns(fnDir, { tmpDir, concurrentHash, hashAlgorithm, statusCb, assetType }), + ]) -micromatch.scan = (...args) => picomatch.scan(...args); + const filesCount = Object.keys(files).length + const functionsCount = Object.keys(functions).length -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.parse(pattern[, options]); - * ``` - * @param {String} `glob` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as regex source string. - * @api public - */ + statusCb({ + type: 'hashing', + msg: `Finished hashing ${filesCount} files${fnDir ? ` and ${functionsCount} functions` : ''}`, + phase: 'stop', + }) -micromatch.parse = (patterns, options) => { - let res = []; - for (let pattern of [].concat(patterns || [])) { - for (let str of braces(String(pattern), options)) { - res.push(picomatch.parse(str, options)); - } + if (filesCount === 0 && functionsCount === 0) { + throw new Error('No files or functions to deploy') } - return res; -}; -/** - * Process the given brace `pattern`. - * - * ```js - * const { braces } = require('micromatch'); - * console.log(braces('foo/{a,b,c}/bar')); - * //=> [ 'foo/(a|b|c)/bar' ] - * - * console.log(braces('foo/{a,b,c}/bar', { expand: true })); - * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] - * ``` - * @param {String} `pattern` String with brace pattern to process. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ + statusCb({ + type: 'create-deploy', + msg: 'CDN diffing files...', + phase: 'start', + }) -micromatch.braces = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) { - return [pattern]; + let deploy + let deployParams = cleanDeep({ + siteId, + body: { + files, + functions, + async: Object.keys(files).length > syncFileLimit, + branch, + draft, + }, + }) + if (deployIdOpt === null) { + if (title) { + deployParams = { ...deployParams, title } + } + deploy = await api.createSiteDeploy(deployParams) + } else { + deployParams = { ...deployParams, deploy_id: deployIdOpt } + deploy = await api.updateSiteDeploy(deployParams) } - return braces(pattern, options); -}; -/** - * Expand braces - */ + if (deployParams.body.async) deploy = await waitForDiff(api, deploy.id, siteId, deployTimeout) -micromatch.braceExpand = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - return micromatch.braces(pattern, { ...options, expand: true }); -}; + const { id: deployId, required: requiredFiles, required_functions: requiredFns } = deploy -/** - * Expose micromatch - */ + statusCb({ + type: 'create-deploy', + msg: `CDN requesting ${requiredFiles.length} files${ + Array.isArray(requiredFns) ? ` and ${requiredFns.length} functions` : '' + }`, + phase: 'stop', + }) -module.exports = micromatch; + const filesUploadList = getUploadList(requiredFiles, filesShaMap) + const functionsUploadList = getUploadList(requiredFns, fnShaMap) + const uploadList = [...filesUploadList, ...functionsUploadList] + await uploadFiles(api, deployId, uploadList, { concurrentUpload, statusCb, maxRetry }) -/***/ }), + statusCb({ + type: 'wait-for-deploy', + msg: 'Waiting for deploy to go live...', + phase: 'start', + }) + deploy = await waitForDeploy(api, deployId, siteId, deployTimeout) -/***/ 83973: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + statusCb({ + type: 'wait-for-deploy', + msg: draft ? 'Draft deploy is live!' : 'Deploy is live!', + phase: 'stop', + }) -module.exports = minimatch -minimatch.Minimatch = Minimatch + await rimraf(tmpDir) -var path = (function () { try { return __nccwpck_require__(71017) } catch (e) {}}()) || { - sep: '/' + const deployManifest = { + deployId, + deploy, + uploadList, + } + return deployManifest } -minimatch.sep = path.sep -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __nccwpck_require__(33717) +module.exports = deploySite -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' +/***/ }), -// * => any number of characters -var star = qmark + '*?' +/***/ 88497: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// ** 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})($|\\\/)).)*?' +const fs = __nccwpck_require__(57147) -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' +const backoff = __nccwpck_require__(33086) +const pMap = __nccwpck_require__(91855) -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') +const { UPLOAD_RANDOM_FACTOR, UPLOAD_INITIAL_DELAY, UPLOAD_MAX_DELAY } = __nccwpck_require__(82617) -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} +const uploadFiles = async (api, deployId, uploadList, { concurrentUpload, statusCb, maxRetry }) => { + if (!concurrentUpload || !statusCb || !maxRetry) throw new Error('Missing required option concurrentUpload') + statusCb({ + type: 'upload', + msg: `Uploading ${uploadList.length} files`, + phase: 'start', + }) -// normalizes slashes. -var slashSplit = /\/+/ + const uploadFile = async (fileObj, index) => { + const { normalizedPath, assetType, runtime, filepath } = fileObj + const readStreamCtor = () => fs.createReadStream(filepath) -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) + statusCb({ + type: 'upload', + msg: `(${index}/${uploadList.length}) Uploading ${normalizedPath}...`, + phase: 'progress', + }) + let response + switch (assetType) { + case 'file': { + response = await retryUpload( + () => + api.uploadDeployFile({ + body: readStreamCtor, + deployId, + path: encodeURI(normalizedPath), + }), + maxRetry, + ) + break + } + case 'function': { + response = await await retryUpload( + () => + api.uploadDeployFunction({ + body: readStreamCtor, + deployId, + name: encodeURI(normalizedPath), + runtime, + }), + maxRetry, + ) + break + } + default: { + const error = new Error('File Object missing assetType property') + error.fileObj = fileObj + throw error + } + } + + return response } -} -function ext (a, b) { - b = b || {} - var t = {} - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - Object.keys(b).forEach(function (k) { - t[k] = b[k] + const results = await pMap(uploadList, uploadFile, { concurrency: concurrentUpload }) + statusCb({ + type: 'upload', + msg: `Finished uploading ${uploadList.length} assets`, + phase: 'stop', }) - return t + return results } -minimatch.defaults = function (def) { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch - } +const retryUpload = (uploadFn, maxRetry) => + new Promise((resolve, reject) => { + let lastError + const fibonacciBackoff = backoff.fibonacci({ + randomisationFactor: UPLOAD_RANDOM_FACTOR, + initialDelay: UPLOAD_INITIAL_DELAY, + maxDelay: UPLOAD_MAX_DELAY, + }) - var orig = minimatch + const tryUpload = async () => { + try { + const results = await uploadFn() + return resolve(results) + } catch (error) { + lastError = error + // observed errors: 408, 401 (4** swallowed), 502 + if (error.status >= 400 || error.name === 'FetchError') { + fibonacciBackoff.backoff() + return + } + return reject(error) + } + } - var m = function minimatch (p, pattern, options) { - return orig(p, pattern, ext(def, options)) - } + fibonacciBackoff.failAfter(maxRetry) - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - m.Minimatch.defaults = function defaults (options) { - return orig.defaults(ext(def, options)).Minimatch - } + fibonacciBackoff.on('backoff', () => { + // Do something when backoff starts, e.g. show to the + // user the delay before next reconnection attempt. + }) - m.filter = function filter (pattern, options) { - return orig.filter(pattern, ext(def, options)) - } + fibonacciBackoff.on('ready', tryUpload) - m.defaults = function defaults (options) { - return orig.defaults(ext(def, options)) - } + fibonacciBackoff.on('fail', () => { + reject(lastError) + }) - m.makeRe = function makeRe (pattern, options) { - return orig.makeRe(pattern, ext(def, options)) - } + tryUpload(0, 0) + }) - m.braceExpand = function braceExpand (pattern, options) { - return orig.braceExpand(pattern, ext(def, options)) - } +module.exports = uploadFiles - m.match = function (list, pattern, options) { - return orig.match(list, pattern, ext(def, options)) - } - return m -} +/***/ }), -Minimatch.defaults = function (def) { - return minimatch.defaults(def).Minimatch -} +/***/ 91649: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function minimatch (p, pattern, options) { - assertValidPattern(pattern) +const { basename, sep } = __nccwpck_require__(71017) - if (!options) options = {} +const pWaitFor = __nccwpck_require__(80414) - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { +const { DEPLOY_POLL } = __nccwpck_require__(82617) + +// Default filter when scanning for files +const defaultFilter = (filePath) => { + if (filePath == null) { return false } - return new Minimatch(pattern, options).match(p) + const filename = basename(filePath) + return ( + filename !== 'node_modules' && + !(filename.startsWith('.') && filename !== '.well-known') && + !filename.includes('/__MACOSX') && + !filename.includes('/.') + ) } -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) +// normalize windows paths to unix paths +const normalizePath = (relname) => { + if (relname.includes('#') || relname.includes('?')) { + throw new Error(`Invalid filename ${relname}. Deployed filenames cannot contain # or ? characters`) } + return ( + relname + .split(sep) + // .map(segment => encodeURI(segment)) // TODO I'm fairly certain we shouldn't encodeURI here, thats only for the file upload step + .join('/') + ) +} - assertValidPattern(pattern) - - if (!options) options = {} +// poll an async deployId until its done diffing +const waitForDiff = async (api, deployId, siteId, timeout) => { + // capture ready deploy during poll + let deploy - pattern = pattern.trim() + const loadDeploy = async () => { + const siteDeploy = await api.getSiteDeploy({ siteId, deployId }) - // windows support: need to use /, not \ - if (!options.allowWindowsEscape && path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') + switch (siteDeploy.state) { + // https://github.com/netlify/bitballoon/blob/master/app/models/deploy.rb#L21-L33 + case 'error': { + const deployError = new Error(`Deploy ${deployId} had an error`) + deployError.deploy = siteDeploy + throw deployError + } + case 'prepared': + case 'uploading': + case 'uploaded': + case 'ready': { + deploy = siteDeploy + return true + } + case 'preparing': + default: { + return false + } + } } - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial + await pWaitFor(loadDeploy, { + interval: DEPLOY_POLL, + timeout, + message: 'Timeout while waiting for deploy', + }) - // make the set of regexps etc. - this.make() + return deploy } -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - var pattern = this.pattern - var options = this.options +// Poll a deployId until its ready +const waitForDeploy = async (api, deployId, siteId, timeout) => { + // capture ready deploy during poll + let deploy - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return + const loadDeploy = async () => { + const siteDeploy = await api.getSiteDeploy({ siteId, deployId }) + switch (siteDeploy.state) { + // https://github.com/netlify/bitballoon/blob/master/app/models/deploy.rb#L21-L33 + case 'error': { + const deployError = new Error(`Deploy ${deployId} had an error`) + deployError.deploy = siteDeploy + throw deployError + } + case 'ready': { + deploy = siteDeploy + return true + } + case 'preparing': + case 'prepared': + case 'uploaded': + case 'uploading': + default: { + return false + } + } } - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() + await pWaitFor(loadDeploy, { + interval: DEPLOY_POLL, + timeout, + message: 'Timeout while waiting for deploy', + }) - if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } + return deploy +} - this.debug(this.pattern, set) +// Transform the fileShaMap and fnShaMap into a generic shaMap that file-uploader.js can use +const getUploadList = (required, shaMap) => { + if (!required || !shaMap) return [] + // TODO: use `Array.flatMap()` instead once we remove support for Node <11.0.0 + // eslint-disable-next-line unicorn/prefer-spread + return [].concat(...required.map((sha) => shaMap[sha])) +} - // 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) - }) +module.exports = { + defaultFilter, + normalizePath, + waitForDiff, + waitForDeploy, + getUploadList, +} - this.debug(this.pattern, set) - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) +/***/ }), - this.debug(this.pattern, set) +/***/ 44666: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) +const dfn = __nccwpck_require__(76490) +const pWaitFor = __nccwpck_require__(80414) - this.debug(this.pattern, set) +const deploy = __nccwpck_require__(55652) +const { getMethods } = __nccwpck_require__(43086) +const { getOperations } = __nccwpck_require__(85393) - this.set = set -} +/* eslint-disable fp/no-this */ +// eslint-disable-next-line fp/no-class +class NetlifyAPI { + constructor(firstArg, secondArg) { + // variadic arguments + const [accessTokenInput, opts = {}] = typeof firstArg === 'object' ? [null, firstArg] : [firstArg, secondArg] -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 + // default opts + const { + userAgent = 'netlify/js-client', + scheme = dfn.schemes[0], + host = dfn.host, + pathPrefix = dfn.basePath, + accessToken = accessTokenInput, + globalParams = {}, + agent, + } = opts - if (options.nonegate) return + const defaultHeaders = { + 'User-agent': userAgent, + accept: 'application/json', + } - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ + const basePath = getBasePath({ scheme, host, pathPrefix }) + const methods = getMethods({ basePath, defaultHeaders, agent, globalParams }) + // eslint-disable-next-line fp/no-mutating-assign + Object.assign(this, { ...methods, defaultHeaders, scheme, host, pathPrefix, globalParams, accessToken, agent }) } - 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) -} + get accessToken() { + const { + defaultHeaders: { Authorization }, + } = this + if (typeof Authorization !== 'string' || !Authorization.startsWith('Bearer ')) { + return null + } -Minimatch.prototype.braceExpand = braceExpand + return Authorization.replace('Bearer ', '') + } -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} + set accessToken(token) { + if (!token) { + // eslint-disable-next-line fp/no-delete + delete this.defaultHeaders.Authorization + return } + + this.defaultHeaders.Authorization = `Bearer ${token}` } - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern + get basePath() { + return getBasePath({ scheme: this.scheme, host: this.host, pathPrefix: this.pathPrefix }) + } - assertValidPattern(pattern) + async getAccessToken(ticket, { poll = DEFAULT_TICKET_POLL, timeout = DEFAULT_TICKET_TIMEOUT } = {}) { + const { id } = ticket - // 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] - } + // ticket capture + let authorizedTicket + const checkTicket = async () => { + const t = await this.showTicket({ ticketId: id }) + if (t.authorized) { + authorizedTicket = t + } + return Boolean(t.authorized) + } - return expand(pattern) -} + await pWaitFor(checkTicket, { + interval: poll, + timeout, + message: 'Timeout while waiting for ticket grant', + }) -var MAX_PATTERN_LENGTH = 1024 * 64 -var assertValidPattern = function (pattern) { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') + const accessTokenResponse = await this.exchangeTicket({ ticketId: authorizedTicket.id }) + // See https://open-api.netlify.com/#/default/exchangeTicket for shape + this.accessToken = accessTokenResponse.access_token + return accessTokenResponse.access_token } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') + async deploy(siteId, buildDir, opts) { + if (!this.accessToken) throw new Error('Missing access token') + // the deploy function is swapped in the package.json browser field for different environments + // See https://github.com/defunctzombie/package-browser-field-spec + return await deploy(this, siteId, buildDir, opts) } } +/* eslint-enable fp/no-this */ -// 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 '' +const getBasePath = function ({ scheme, host, pathPrefix }) { + return `${scheme}://${host}${pathPrefix}` +} - 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 +// 1 second +const DEFAULT_TICKET_POLL = 1e3 +// 1 hour +const DEFAULT_TICKET_TIMEOUT = 3.6e6 - 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 - } - } +module.exports = NetlifyAPI - 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) +module.exports.methods = getOperations() - // 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 +/***/ 18704: +/***/ ((module) => { - // 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) +// Handle request body +const addBody = function (body, parameters, opts) { + if (!body) { + return opts + } - // 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 - } + const bodyA = typeof body === 'function' ? body() : body - // 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 (isBinaryBody(parameters)) { + return { + ...opts, + body: bodyA, + headers: { 'Content-Type': 'application/octet-stream', ...opts.headers }, + } + } - case '(': - if (inClass) { - re += '(' - continue - } + return { + ...opts, + body: JSON.stringify(bodyA), + headers: { 'Content-Type': 'application/json', ...opts.headers }, + } +} - if (!stateChar) { - re += '\\(' - continue - } +const isBinaryBody = function (parameters) { + return Object.values(parameters.body).some(isBodyParam) +} - 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 +const isBodyParam = function ({ schema }) { + return schema && schema.format === 'binary' +} - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } +module.exports = { addBody } - 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 +/***/ 43086: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() +const nodeFetch = __nccwpck_require__(80467) +// Webpack will sometimes export default exports in different places +const fetch = nodeFetch.default || nodeFetch - if (inClass) { - re += '\\' + c - continue - } +const { getOperations } = __nccwpck_require__(85393) - inClass = true - classStart = i - reClassStart = re.length - re += c - continue +const { addBody } = __nccwpck_require__(18704) +const { parseResponse, getFetchError } = __nccwpck_require__(82007) +const { shouldRetry, waitForRetry, MAX_RETRY } = __nccwpck_require__(3866) +const { getUrl } = __nccwpck_require__(15121) - 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 - } +// For each OpenAPI operation, add a corresponding method. +// The `operationId` is the method name. +const getMethods = function ({ basePath, defaultHeaders, agent, globalParams }) { + const operations = getOperations() + const methods = operations.map((method) => getMethod({ method, basePath, defaultHeaders, agent, globalParams })) + return Object.assign({}, ...methods) +} - // 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 - } +const getMethod = function ({ method, basePath, defaultHeaders, agent, globalParams }) { + return { + [method.operationId](params, opts) { + return callMethod({ method, basePath, defaultHeaders, agent, globalParams, params, opts }) + }, + } +} - // finish up the class. - hasMagic = true - inClass = false - re += c - continue +const callMethod = async function ({ method, basePath, defaultHeaders, agent, globalParams, params, opts }) { + const requestParams = { ...globalParams, ...params } + const url = getUrl(method, basePath, requestParams) + const response = await makeRequestOrRetry({ url, method, defaultHeaders, agent, requestParams, opts }) - default: - // swallow any state char that wasn't consumed - clearStateChar() + const parsedResponse = await parseResponse(response) + return parsedResponse +} - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } +const getOpts = function ({ method: { verb, parameters }, defaultHeaders, agent, requestParams: { body }, opts }) { + const optsA = addHttpMethod(verb, opts) + const optsB = addDefaultHeaders(defaultHeaders, optsA) + const optsC = addBody(body, parameters, optsB) + const optsD = addAgent(agent, optsC) + return optsD +} - re += c +// Add the HTTP method based on the OpenAPI definition +const addHttpMethod = function (verb, opts) { + return { ...opts, method: verb.toUpperCase() } +} - } // switch - } // for +// Assign default HTTP headers +const addDefaultHeaders = function (defaultHeaders, opts) { + return { ...opts, headers: { ...defaultHeaders, ...opts.headers } } +} - // 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] +// Assign fetch agent (like for example HttpsProxyAgent) if there is one +const addAgent = function (agent, opts) { + if (agent) { + return { ...opts, agent } } + return opts +} - // 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 = '\\' - } +const makeRequestOrRetry = async function ({ url, method, defaultHeaders, agent, requestParams, opts }) { + // Using a loop is simpler here + // eslint-disable-next-line fp/no-loops + for (let index = 0; index <= MAX_RETRY; index++) { + const optsA = getOpts({ method, defaultHeaders, agent, requestParams, opts }) + // eslint-disable-next-line no-await-in-loop + const { response, error } = await makeRequest(url, optsA) - // 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 + '|' - }) + if (shouldRetry({ response, error }) && index !== MAX_RETRY) { + // eslint-disable-next-line no-await-in-loop + await waitForRetry(response) + continue + } - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type + if (error !== undefined) { + throw error + } - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail + return response } +} - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' +const makeRequest = async function (url, opts) { + try { + const response = await fetch(url, opts) + return { response } + } catch (error) { + const errorA = getFetchError(error, url, opts) + return { error: errorA } } +} - // 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 - } +module.exports = { getMethods } - // 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 +/***/ 82007: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 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 +const { JSONHTTPError, TextHTTPError } = __nccwpck_require__(316) +const omit = (__nccwpck_require__(72657)/* ["default"] */ .Z) - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } +// Read and parse the HTTP response +const parseResponse = async function (response) { + const responseType = getResponseType(response) + const textResponse = await response.text() - // 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 - } + const parsedResponse = parseJsonResponse(response, textResponse, responseType) - if (addPatternStart) { - re = patternStart + re + if (!response.ok) { + const ErrorType = responseType === 'json' ? JSONHTTPError : TextHTTPError + throw new ErrorType(response, parsedResponse) } - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] + return parsedResponse +} + +const getResponseType = function ({ headers }) { + const contentType = headers.get('Content-Type') + + if (contentType != null && contentType.includes('json')) { + return 'json' } - // 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) + return 'text' +} + +const parseJsonResponse = function (response, textResponse, responseType) { + if (responseType === 'text') { + return textResponse } - 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('$.') + return JSON.parse(textResponse) + } catch (error) { + throw new TextHTTPError(response, textResponse) } - - regExp._glob = pattern - regExp._src = re - - return regExp } -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() +const getFetchError = function (error, url, opts) { + const data = omit(opts, ['Authorization']) + error.name = 'FetchError' + error.url = url + error.data = data + return error } -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' : '' +module.exports = { parseResponse, getFetchError } - 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 + ').*$' +/***/ 3866: +/***/ ((module) => { - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp +// We retry: +// - when receiving a rate limiting response +// - on network failures due to timeouts +const shouldRetry = function ({ response = {}, error = {} }) { + return isRetryStatus(response) || RETRY_ERROR_CODES.has(error.code) } -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 +const isRetryStatus = function ({ status }) { + return typeof status === 'number' && (status === RATE_LIMIT_STATUS || String(status).startsWith('5')) } -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 === '' +const waitForRetry = async function (response) { + const delay = getDelay(response) + await sleep(delay) +} - if (f === '/' && partial) return true +const getDelay = function (response) { + if (response === undefined) { + return DEFAULT_RETRY_DELAY + } - var options = this.options + const rateLimitReset = response.headers.get(RATE_LIMIT_HEADER) - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') + if (!rateLimitReset) { + return DEFAULT_RETRY_DELAY } - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) + return Math.max(Number(rateLimitReset) * SECS_TO_MSECS - Date.now(), MIN_RETRY_DELAY) +} - // 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 sleep = function (ms) { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) +} - var set = this.set - this.debug(this.pattern, 'set', set) +const DEFAULT_RETRY_DELAY = 5e3 +const MIN_RETRY_DELAY = 1e3 +const SECS_TO_MSECS = 1e3 +const MAX_RETRY = 5 +const RATE_LIMIT_STATUS = 429 +const RATE_LIMIT_HEADER = 'X-RateLimit-Reset' +const RETRY_ERROR_CODES = new Set(['ETIMEDOUT', 'ECONNRESET']) - // 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 - } +module.exports = { shouldRetry, waitForRetry, MAX_RETRY } - 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 +/***/ 15121: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) +const camelCase = __nccwpck_require__(7994) +const queryString = __nccwpck_require__(22760) - this.debug('matchOne', file.length, pattern.length) +// Replace path parameters and query parameters in the URI, using the OpenAPI +// definition +const getUrl = function ({ path, parameters }, basePath, requestParams) { + const url = `${basePath}${path}` + const urlA = addPathParams(url, parameters, requestParams) + const urlB = addQueryParams(urlA, parameters, requestParams) + return urlB +} - 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] +const addPathParams = function (url, parameters, requestParams) { + const pathParams = getRequestParams(parameters.path, requestParams, 'path variable') + return Object.entries(pathParams).reduce(addPathParam, url) +} - this.debug(pattern, p, f) +const addPathParam = function (url, [name, value]) { + return url.replace(`{${name}}`, value) +} - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false +const addQueryParams = function (url, parameters, requestParams) { + const queryParams = getRequestParams(parameters.query, requestParams, 'query variable') - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) + if (Object.keys(queryParams).length === 0) { + return url + } - // "**" - // 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 - } + return `${url}?${queryString.stringify(queryParams, { arrayFormat: 'brackets' })}` +} - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] +const getRequestParams = function (params, requestParams, name) { + const entries = Object.values(params).map((param) => getRequestParam(param, requestParams, name)) + return Object.assign({}, ...entries) +} - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) +const getRequestParam = function (param, requestParams, name) { + const value = requestParams[param.name] || requestParams[camelCase(param.name)] - // 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 (value !== undefined) { + return { [param.name]: value } + } - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } + if (param.required) { + throw new Error(`Missing required ${name} '${param.name}'`) + } +} - // 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 - } +module.exports = { getUrl } - // 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/* +/***/ 85393: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // 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] === '') - } +const { paths } = __nccwpck_require__(76490) +const omit = (__nccwpck_require__(72657)/* ["default"] */ .Z) - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') +// Retrieve all OpenAPI operations +const getOperations = function () { + // TODO: switch to Array.flat() once we drop support for Node.js < 11.0.0 + // eslint-disable-next-line unicorn/prefer-spread + return [].concat( + ...Object.entries(paths).map(([path, pathItem]) => { + const operations = omit(pathItem, ['parameters']) + return Object.entries(operations).map(([method, operation]) => { + const parameters = getParameters(pathItem.parameters, operation.parameters) + return { ...operation, verb: method, path, parameters } + }) + }), + ) } -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') +const getParameters = function (pathParameters = [], operationParameters = []) { + const parameters = [...pathParameters, ...operationParameters] + return parameters.reduce(addParameter, { path: {}, query: {}, body: {} }) } -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +const addParameter = function (parameters, param) { + return { ...parameters, [param.in]: { ...parameters[param.in], [param.name]: param } } } +module.exports = { getOperations } + /***/ }), -/***/ 81877: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 80467: +/***/ ((module, exports, __nccwpck_require__) => { "use strict"; -const fs = __nccwpck_require__(57147); -const Walker = __nccwpck_require__(46695); -const types = __nccwpck_require__(76848); +Object.defineProperty(exports, "__esModule", ({ value: true })); -/** - * Determines the type of the module from the supplied source code or AST - * - * @param {String|Object} source - The string content or AST of a file - * @return {String} - */ -function fromSource(source) { - if (typeof source === 'undefined') throw new Error('source not supplied'); +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - const walker = new Walker(); - let type = 'none'; - let hasDefine = false; - let hasAMDTopLevelRequire = false; - let hasRequire = false; - let hasExports = false; - let hasES6Import = false; - let hasES6Export = false; - const hasDynamicImport = false; +var Stream = _interopDefault(__nccwpck_require__(12781)); +var http = _interopDefault(__nccwpck_require__(13685)); +var Url = _interopDefault(__nccwpck_require__(57310)); +var whatwgUrl = _interopDefault(__nccwpck_require__(28665)); +var https = _interopDefault(__nccwpck_require__(95687)); +var zlib = _interopDefault(__nccwpck_require__(59796)); - // Walker accepts as AST to avoid reparsing - walker.walk(source, (node) => { - if (types.isDefineAMD(node)) hasDefine = true; - if (types.isRequire(node)) hasRequire = true; - if (types.isExports(node)) hasExports = true; - if (types.isAMDDriverScriptRequire(node)) hasAMDTopLevelRequire = true; - if (types.isES6Import(node)) hasES6Import = true; - if (types.isES6Export(node)) hasES6Export = true; +// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - if (hasES6Import || hasES6Export || hasDynamicImport) { - type = 'es6'; - walker.stopWalking(); - return; - } +// fix for "Readable" isn't a named export issue +const Readable = Stream.Readable; - if (hasDefine || hasAMDTopLevelRequire) { - type = 'amd'; - walker.stopWalking(); - return; - } +const BUFFER = Symbol('buffer'); +const TYPE = Symbol('type'); - if (hasExports || (hasRequire && !hasDefine)) { - type = 'commonjs'; - walker.stopWalking(); - } - }); +class Blob { + constructor() { + this[TYPE] = ''; - return type; + const blobParts = arguments[0]; + const options = arguments[1]; + + const buffers = []; + let size = 0; + + if (blobParts) { + const a = blobParts; + const length = Number(a.length); + for (let i = 0; i < length; i++) { + const element = a[i]; + let buffer; + if (element instanceof Buffer) { + buffer = element; + } else if (ArrayBuffer.isView(element)) { + buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); + } else if (element instanceof ArrayBuffer) { + buffer = Buffer.from(element); + } else if (element instanceof Blob) { + buffer = element[BUFFER]; + } else { + buffer = Buffer.from(typeof element === 'string' ? element : String(element)); + } + size += buffer.length; + buffers.push(buffer); + } + } + + this[BUFFER] = Buffer.concat(buffers); + + let type = options && options.type !== undefined && String(options.type).toLowerCase(); + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type; + } + } + get size() { + return this[BUFFER].length; + } + get type() { + return this[TYPE]; + } + text() { + return Promise.resolve(this[BUFFER].toString()); + } + arrayBuffer() { + const buf = this[BUFFER]; + const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + return Promise.resolve(ab); + } + stream() { + const readable = new Readable(); + readable._read = function () {}; + readable.push(this[BUFFER]); + readable.push(null); + return readable; + } + toString() { + return '[object Blob]'; + } + slice() { + const size = this.size; + + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; + if (start === undefined) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } + if (end === undefined) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } + const span = Math.max(relativeEnd - relativeStart, 0); + + const buffer = this[BUFFER]; + const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); + const blob = new Blob([], { type: arguments[2] }); + blob[BUFFER] = slicedBuffer; + return blob; + } } +Object.defineProperties(Blob.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, + slice: { enumerable: true } +}); + +Object.defineProperty(Blob.prototype, Symbol.toStringTag, { + value: 'Blob', + writable: false, + enumerable: false, + configurable: true +}); + /** - * Synchronously determine the module type for the contents of the passed filepath + * fetch-error.js * - * @param {String} filepath - * @param {Object} options - * @return {String} + * FetchError interface for operational errors */ -function sync(filepath, options = {}) { - if (!filepath) throw new Error('filename missing'); - - const fileSystem = options.fileSystem ? options.fileSystem : fs; - const data = fileSystem.readFileSync(filepath, 'utf8'); - - return fromSource(data); -} /** - * Asynchronously determines the module type for the contents of the given filepath + * Create FetchError instance * - * @param {String} filepath - * @param {Function} cb - Executed with (err, type) - * @param {Object} options + * @param String message Error message for human + * @param String type Error type for machine + * @param String systemError For Node.js system error + * @return FetchError */ -module.exports = function(filepath, cb, options = {}) { - if (!filepath) throw new Error('filename missing'); - if (!cb) throw new Error('callback missing'); +function FetchError(message, type, systemError) { + Error.call(this, message); - const fileSystem = options.fileSystem ? options.fileSystem : fs; + this.message = message; + this.type = type; - fileSystem.readFile(filepath, 'utf8', (err, data) => { - if (err) return cb(err); + // when err.type is `system`, err.code contains system error code + if (systemError) { + this.code = this.errno = systemError.code; + } - let type; + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} - try { - type = fromSource(data); - } catch (error) { - return cb(error); - } - - cb(null, type); - }); -}; - -module.exports.sync = sync; -module.exports.fromSource = fromSource; - - -/***/ }), +FetchError.prototype = Object.create(Error.prototype); +FetchError.prototype.constructor = FetchError; +FetchError.prototype.name = 'FetchError'; -/***/ 80900: -/***/ ((module) => { +let convert; +try { + convert = (__nccwpck_require__(22877).convert); +} catch (e) {} -/** - * Helpers. - */ +const INTERNALS = Symbol('Body internals'); -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; +// fix an issue where "PassThrough" isn't a named export for node <10 +const PassThrough = Stream.PassThrough; /** - * Parse or format the given `val`. - * - * Options: + * Body mixin * - * - `long` verbose formatting [false] + * Ref: https://fetch.spec.whatwg.org/#body * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void */ +function Body(body) { + var _this = this; -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$size = _ref.size; -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} + let size = _ref$size === undefined ? 0 : _ref$size; + var _ref$timeout = _ref.timeout; + let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ + if (body == null) { + // body is undefined or null + body = null; + } else if (isURLSearchParams(body)) { + // body is a URLSearchParams + body = Buffer.from(body.toString()); + } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + // body is ArrayBuffer + body = Buffer.from(body); + } else if (ArrayBuffer.isView(body)) { + // body is ArrayBufferView + body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); + } else if (body instanceof Stream) ; else { + // none of the above + // coerce to string then buffer + body = Buffer.from(String(body)); + } + this[INTERNALS] = { + body, + disturbed: false, + error: null + }; + this.size = size; + this.timeout = timeout; -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; + if (body instanceof Stream) { + body.on('error', function (err) { + const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); + _this[INTERNALS].error = error; + }); + } } -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} +Body.prototype = { + get body() { + return this[INTERNALS].body; + }, -/** - * Pluralization helper. - */ + get bodyUsed() { + return this[INTERNALS].disturbed; + }, -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} + /** + * Decode response as ArrayBuffer + * + * @return Promise + */ + arrayBuffer() { + return consumeBody.call(this).then(function (buf) { + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + }); + }, + /** + * Return raw response as Blob + * + * @return Promise + */ + blob() { + let ct = this.headers && this.headers.get('content-type') || ''; + return consumeBody.call(this).then(function (buf) { + return Object.assign( + // Prevent copying + new Blob([], { + type: ct.toLowerCase() + }), { + [BUFFER]: buf + }); + }); + }, -/***/ }), + /** + * Decode response as json + * + * @return Promise + */ + json() { + var _this2 = this; -/***/ 7978: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return consumeBody.call(this).then(function (buffer) { + try { + return JSON.parse(buffer.toString()); + } catch (err) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); + } + }); + }, -var inherits = (__nccwpck_require__(73837).inherits); + /** + * Decode response as text + * + * @return Promise + */ + text() { + return consumeBody.call(this).then(function (buffer) { + return buffer.toString(); + }); + }, -var NestedError = function (message, nested) { - this.nested = nested; + /** + * Decode response as buffer (non-spec api) + * + * @return Promise + */ + buffer() { + return consumeBody.call(this); + }, - if (message instanceof Error) { - nested = message; - } else if (typeof message !== 'undefined') { - Object.defineProperty(this, 'message', { - value: message, - writable: true, - enumerable: false, - configurable: true - }); - } + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return Promise + */ + textConverted() { + var _this3 = this; - Error.captureStackTrace(this, this.constructor); - var oldStackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); - var stackDescriptor = buildStackDescriptor(oldStackDescriptor, nested); - Object.defineProperty(this, 'stack', stackDescriptor); + return consumeBody.call(this).then(function (buffer) { + return convertBody(buffer, _this3.headers); + }); + } }; -function buildStackDescriptor(oldStackDescriptor, nested) { - if (oldStackDescriptor.get) { - return { - get: function () { - var stack = oldStackDescriptor.get.call(this); - return buildCombinedStacks(stack, this.nested); - } - }; - } else { - var stack = oldStackDescriptor.value; - return { - value: buildCombinedStacks(stack, nested) - }; - } -} - -function buildCombinedStacks(stack, nested) { - if (nested) { - stack += '\nCaused By: ' + nested.stack; - } - return stack; -} +// In browsers, all properties are enumerable. +Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } +}); -inherits(NestedError, Error); -NestedError.prototype.name = 'NestedError'; +Body.mixIn = function (proto) { + for (const name of Object.getOwnPropertyNames(Body.prototype)) { + // istanbul ignore else: future proof + if (!(name in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); + Object.defineProperty(proto, name, desc); + } + } +}; +/** + * Consume and convert an entire Body to a Buffer. + * + * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body + * + * @return Promise + */ +function consumeBody() { + var _this4 = this; -module.exports = NestedError; + if (this[INTERNALS].disturbed) { + return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); + } + this[INTERNALS].disturbed = true; -/***/ }), + if (this[INTERNALS].error) { + return Body.Promise.reject(this[INTERNALS].error); + } -/***/ 82617: -/***/ ((module) => { + let body = this.body; -// Local deploy timeout: 20 mins -const DEFAULT_DEPLOY_TIMEOUT = 1.2e6 -// Concurrent file hash calls -const DEFAULT_CONCURRENT_HASH = 1e2 -// Number of concurrent uploads -const DEFAULT_CONCURRENT_UPLOAD = 5 -// Number of files -const DEFAULT_SYNC_LIMIT = 1e2 -// Number of times to retry an upload -const DEFAULT_MAX_RETRY = 5 + // body is null + if (body === null) { + return Body.Promise.resolve(Buffer.alloc(0)); + } -const UPLOAD_RANDOM_FACTOR = 0.5 -// 5 seconds -const UPLOAD_INITIAL_DELAY = 5e3 -// 1.5 minute -const UPLOAD_MAX_DELAY = 9e4 + // body is blob + if (isBlob(body)) { + body = body.stream(); + } -// 1 second -const DEPLOY_POLL = 1e3 + // body is buffer + if (Buffer.isBuffer(body)) { + return Body.Promise.resolve(body); + } -module.exports = { - DEFAULT_DEPLOY_TIMEOUT, - DEFAULT_CONCURRENT_HASH, - DEFAULT_CONCURRENT_UPLOAD, - DEFAULT_SYNC_LIMIT, - DEFAULT_MAX_RETRY, - UPLOAD_RANDOM_FACTOR, - UPLOAD_INITIAL_DELAY, - UPLOAD_MAX_DELAY, - DEPLOY_POLL, -} + // istanbul ignore if: should never happen + if (!(body instanceof Stream)) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + // body is stream + // get ready to actually consume the body + let accum = []; + let accumBytes = 0; + let abort = false; -/***/ }), + return new Body.Promise(function (resolve, reject) { + let resTimeout; -/***/ 51776: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // allow timeout on slow response body + if (_this4.timeout) { + resTimeout = setTimeout(function () { + abort = true; + reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); + }, _this4.timeout); + } -const { promisify } = __nccwpck_require__(73837) + // handle stream errors + body.on('error', function (err) { + if (err.name === 'AbortError') { + // if the request was aborted, reject with this Error + abort = true; + reject(err); + } else { + // other errors, such as incorrect content-encoding + reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); + } + }); -const walker = __nccwpck_require__(6531) -const pump = promisify(__nccwpck_require__(18341)) + body.on('data', function (chunk) { + if (abort || chunk === null) { + return; + } -const { hasherCtor, manifestCollectorCtor, fileFilterCtor, fileNormalizerCtor } = __nccwpck_require__(99498) + if (_this4.size && accumBytes + chunk.length > _this4.size) { + abort = true; + reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); + return; + } -const hashFiles = async ( - dir, - configPath, - { concurrentHash, hashAlgorithm = 'sha1', assetType = 'file', statusCb, filter }, -) => { - if (!filter) throw new Error('Missing filter function option') - const fileStream = walker([configPath, dir], { filter }) - const fileFilter = fileFilterCtor() - const hasher = hasherCtor({ concurrentHash, hashAlgorithm }) - const fileNormalizer = fileNormalizerCtor({ assetType }) + accumBytes += chunk.length; + accum.push(chunk); + }); - // Written to by manifestCollector - // normalizedPath: hash (wanted by deploy API) - const files = {} - // hash: [fileObj, fileObj, fileObj] - const filesShaMap = {} - const manifestCollector = manifestCollectorCtor(files, filesShaMap, { statusCb, assetType }) + body.on('end', function () { + if (abort) { + return; + } - await pump(fileStream, fileFilter, hasher, fileNormalizer, manifestCollector) + clearTimeout(resTimeout); - return { files, filesShaMap } + try { + resolve(Buffer.concat(accum, accumBytes)); + } catch (err) { + // handle streams that have accumulated too much data (issue #414) + reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + }); } -module.exports = hashFiles - - -/***/ }), - -/***/ 49949: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const path = __nccwpck_require__(71017) -const { promisify } = __nccwpck_require__(73837) +/** + * Detect buffer encoding and convert to target encoding + * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding + * + * @param Buffer buffer Incoming buffer + * @param String encoding Target encoding + * @return String + */ +function convertBody(buffer, headers) { + if (typeof convert !== 'function') { + throw new Error('The package `encoding` must be installed to use the textConverted() function'); + } -const zipIt = __nccwpck_require__(72803) -const fromArray = __nccwpck_require__(56614) -const pump = promisify(__nccwpck_require__(18341)) + const ct = headers.get('content-type'); + let charset = 'utf-8'; + let res, str; -const { hasherCtor, manifestCollectorCtor } = __nccwpck_require__(99498) + // header + if (ct) { + res = /charset=([^;]*)/i.exec(ct); + } -const hashFns = async (dir, { tmpDir, concurrentHash, hashAlgorithm = 'sha256', assetType = 'function', statusCb }) => { - // early out if the functions dir is omitted - if (!dir) return { functions: {}, shaMap: {} } - if (!tmpDir) throw new Error('Missing tmpDir directory for zipping files') + // no charset in content type, peek at response body for at most 1024 bytes + str = buffer.slice(0, 1024).toString(); - const functionZips = await zipIt.zipFunctions(dir, tmpDir) + // html5 + if (!res && str) { + res = / ({ - filepath: functionPath, - root: tmpDir, - relname: path.relative(tmpDir, functionPath), - basename: path.basename(functionPath), - extname: path.extname(functionPath), - type: 'file', - assetType: 'function', - normalizedPath: path.basename(functionPath, path.extname(functionPath)), - runtime, - })) + // html4 + if (!res && str) { + res = / { +/** + * Clone body given Res/Req instance + * + * @param Mixed instance Response or Request instance + * @return Mixed + */ +function clone(instance) { + let p1, p2; + let body = instance.body; -const flushWriteStream = __nccwpck_require__(36655) -const hasha = __nccwpck_require__(44933) -const transform = __nccwpck_require__(61950) -const objFilterCtor = (__nccwpck_require__(26248).objCtor) -const map = (__nccwpck_require__(78881).obj) + // don't allow cloning a used body + if (instance.bodyUsed) { + throw new Error('cannot clone body after it is used'); + } -const { normalizePath } = __nccwpck_require__(91649) + // check that body is a stream and not form-data object + // note: we can't clone the form-data object without having it as a dependency + if (body instanceof Stream && typeof body.getBoundary !== 'function') { + // tee instance body + p1 = new PassThrough(); + p2 = new PassThrough(); + body.pipe(p1); + body.pipe(p2); + // set instance body to teed body and return the other teed body + instance[INTERNALS].body = p1; + body = p2; + } -// a parallel transform stream segment ctor that hashes fileObj's created by folder-walker -// TODO: use promises instead of callbacks -/* eslint-disable promise/prefer-await-to-callbacks */ -const hasherCtor = ({ concurrentHash, hashAlgorithm }) => { - const hashaOpts = { algorithm: hashAlgorithm } - if (!concurrentHash) throw new Error('Missing required opts') - return transform(concurrentHash, { objectMode: true }, async (fileObj, cb) => { - try { - const hash = await hasha.fromFile(fileObj.filepath, hashaOpts) - // insert hash and asset type to file obj - return cb(null, { ...fileObj, hash }) - } catch (error) { - return cb(error) - } - }) + return body; } -// Inject normalized file names into normalizedPath and assetType -const fileNormalizerCtor = ({ assetType }) => - map((fileObj) => ({ ...fileObj, assetType, normalizedPath: normalizePath(fileObj.relname) })) +/** + * Performs the operation "extract a `Content-Type` value from |object|" as + * specified in the specification: + * https://fetch.spec.whatwg.org/#concept-bodyinit-extract + * + * This function assumes that instance.body is present. + * + * @param Mixed instance Any options.body input + */ +function extractContentType(body) { + if (body === null) { + // body is null + return null; + } else if (typeof body === 'string') { + // body is string + return 'text/plain;charset=UTF-8'; + } else if (isURLSearchParams(body)) { + // body is a URLSearchParams + return 'application/x-www-form-urlencoded;charset=UTF-8'; + } else if (isBlob(body)) { + // body is blob + return body.type || null; + } else if (Buffer.isBuffer(body)) { + // body is buffer + return null; + } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + // body is ArrayBuffer + return null; + } else if (ArrayBuffer.isView(body)) { + // body is ArrayBufferView + return null; + } else if (typeof body.getBoundary === 'function') { + // detect form data input from form-data module + return `multipart/form-data;boundary=${body.getBoundary()}`; + } else if (body instanceof Stream) { + // body is stream + // can't really do much about this + return null; + } else { + // Body constructor defaults other things to string + return 'text/plain;charset=UTF-8'; + } +} -// A writable stream segment ctor that normalizes file paths, and writes shaMap's -const manifestCollectorCtor = (filesObj, shaMap, { statusCb, assetType }) => { - if (!statusCb || !assetType) throw new Error('Missing required options') - return flushWriteStream.obj((fileObj, _, cb) => { - // eslint-disable-next-line no-param-reassign - filesObj[fileObj.normalizedPath] = fileObj.hash +/** + * The Fetch Standard treats this as if "total bytes" is a property on the body. + * For us, we have to explicitly get it with a function. + * + * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes + * + * @param Body instance Instance of Body + * @return Number? Number of bytes, or null if not possible + */ +function getTotalBytes(instance) { + const body = instance.body; - // We map a hash to multiple fileObj's because the same file - // might live in two different locations - if (Array.isArray(shaMap[fileObj.hash])) { - // eslint-disable-next-line fp/no-mutating-methods - shaMap[fileObj.hash].push(fileObj) - } else { - // eslint-disable-next-line no-param-reassign - shaMap[fileObj.hash] = [fileObj] - } - statusCb({ - type: 'hashing', - msg: `Hashing ${fileObj.relname}`, - phase: 'progress', - }) - cb(null) - }) + if (body === null) { + // body is null + return 0; + } else if (isBlob(body)) { + return body.size; + } else if (Buffer.isBuffer(body)) { + // body is buffer + return body.length; + } else if (body && typeof body.getLengthSync === 'function') { + // detect form data input from form-data module + if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x + body.hasKnownLength && body.hasKnownLength()) { + // 2.x + return body.getLengthSync(); + } + return null; + } else { + // body is stream + return null; + } } -/* eslint-enable promise/prefer-await-to-callbacks */ -// transform stream ctor that filters folder-walker results for only files -const fileFilterCtor = objFilterCtor((fileObj) => fileObj.type === 'file') +/** + * Write a Body to a Node.js WritableStream (e.g. http.Request) object. + * + * @param Body instance Instance of Body + * @return Void + */ +function writeToStream(dest, instance) { + const body = instance.body; -module.exports = { - hasherCtor, - fileNormalizerCtor, - manifestCollectorCtor, - fileFilterCtor, + + if (body === null) { + // body is null + dest.end(); + } else if (isBlob(body)) { + body.stream().pipe(dest); + } else if (Buffer.isBuffer(body)) { + // body is buffer + dest.write(body); + dest.end(); + } else { + // body is stream + body.pipe(dest); + } } +// expose Promise +Body.Promise = global.Promise; -/***/ }), +/** + * headers.js + * + * Headers class offers convenient helpers + */ -/***/ 55652: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; +const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; -const { promisify } = __nccwpck_require__(73837) +function validateName(name) { + name = `${name}`; + if (invalidTokenRegex.test(name) || name === '') { + throw new TypeError(`${name} is not a legal HTTP header name`); + } +} -const cleanDeep = __nccwpck_require__(88290) -const rimraf = promisify(__nccwpck_require__(14959)) -const tempy = __nccwpck_require__(34768) +function validateValue(value) { + value = `${value}`; + if (invalidHeaderCharRegex.test(value)) { + throw new TypeError(`${value} is not a legal HTTP header value`); + } +} -const { - DEFAULT_DEPLOY_TIMEOUT, - DEFAULT_CONCURRENT_HASH, - DEFAULT_CONCURRENT_UPLOAD, - DEFAULT_SYNC_LIMIT, - DEFAULT_MAX_RETRY, -} = __nccwpck_require__(82617) -const hashFiles = __nccwpck_require__(51776) -const hashFns = __nccwpck_require__(49949) -const uploadFiles = __nccwpck_require__(88497) -const { waitForDiff, waitForDeploy, getUploadList, defaultFilter } = __nccwpck_require__(91649) +/** + * Find the key in the map object given a header name. + * + * Returns undefined if not found. + * + * @param String name Header name + * @return String|Undefined + */ +function find(map, name) { + name = name.toLowerCase(); + for (const key in map) { + if (key.toLowerCase() === name) { + return key; + } + } + return undefined; +} -const deploySite = async ( - api, - siteId, - dir, - { - fnDir = null, - configPath = null, - draft = false, - // API calls this the 'title' - message: title, - tmpDir = tempy.directory(), - deployTimeout = DEFAULT_DEPLOY_TIMEOUT, - concurrentHash = DEFAULT_CONCURRENT_HASH, - concurrentUpload = DEFAULT_CONCURRENT_UPLOAD, - filter = defaultFilter, - syncFileLimit = DEFAULT_SYNC_LIMIT, - maxRetry = DEFAULT_MAX_RETRY, - statusCb = () => { - /* default to noop */ - // statusObj: { - // type: name-of-step - // msg: msg to print - // phase: [start, progress, stop], - // spinner: a spinner from cli-spinners package - // } - }, - deployId: deployIdOpt = null, - hashAlgorithm, - assetType, - branch, - } = {}, -) => { - statusCb({ - type: 'hashing', - msg: `Hashing files...`, - phase: 'start', - }) +const MAP = Symbol('map'); +class Headers { + /** + * Headers class + * + * @param Object headers Response headers + * @return Void + */ + constructor() { + let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; - const [{ files, filesShaMap }, { functions, fnShaMap }] = await Promise.all([ - hashFiles(dir, configPath, { concurrentHash, hashAlgorithm, assetType, statusCb, filter }), - hashFns(fnDir, { tmpDir, concurrentHash, hashAlgorithm, statusCb, assetType }), - ]) + this[MAP] = Object.create(null); - const filesCount = Object.keys(files).length - const functionsCount = Object.keys(functions).length + if (init instanceof Headers) { + const rawHeaders = init.raw(); + const headerNames = Object.keys(rawHeaders); - statusCb({ - type: 'hashing', - msg: `Finished hashing ${filesCount} files${fnDir ? ` and ${functionsCount} functions` : ''}`, - phase: 'stop', - }) + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value); + } + } - if (filesCount === 0 && functionsCount === 0) { - throw new Error('No files or functions to deploy') - } + return; + } - statusCb({ - type: 'create-deploy', - msg: 'CDN diffing files...', - phase: 'start', - }) + // We don't worry about converting prop to ByteString here as append() + // will handle it. + if (init == null) ; else if (typeof init === 'object') { + const method = init[Symbol.iterator]; + if (method != null) { + if (typeof method !== 'function') { + throw new TypeError('Header pairs must be iterable'); + } - let deploy - let deployParams = cleanDeep({ - siteId, - body: { - files, - functions, - async: Object.keys(files).length > syncFileLimit, - branch, - draft, - }, - }) - if (deployIdOpt === null) { - if (title) { - deployParams = { ...deployParams, title } - } - deploy = await api.createSiteDeploy(deployParams) - } else { - deployParams = { ...deployParams, deploy_id: deployIdOpt } - deploy = await api.updateSiteDeploy(deployParams) - } + // sequence> + // Note: per spec we have to first exhaust the lists then process them + const pairs = []; + for (const pair of init) { + if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { + throw new TypeError('Each header pair must be iterable'); + } + pairs.push(Array.from(pair)); + } - if (deployParams.body.async) deploy = await waitForDiff(api, deploy.id, siteId, deployTimeout) + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError('Each header pair must be a name/value tuple'); + } + this.append(pair[0], pair[1]); + } + } else { + // record + for (const key of Object.keys(init)) { + const value = init[key]; + this.append(key, value); + } + } + } else { + throw new TypeError('Provided initializer must be an object'); + } + } - const { id: deployId, required: requiredFiles, required_functions: requiredFns } = deploy + /** + * Return combined header value given name + * + * @param String name Header name + * @return Mixed + */ + get(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key === undefined) { + return null; + } - statusCb({ - type: 'create-deploy', - msg: `CDN requesting ${requiredFiles.length} files${ - Array.isArray(requiredFns) ? ` and ${requiredFns.length} functions` : '' - }`, - phase: 'stop', - }) + return this[MAP][key].join(', '); + } - const filesUploadList = getUploadList(requiredFiles, filesShaMap) - const functionsUploadList = getUploadList(requiredFns, fnShaMap) - const uploadList = [...filesUploadList, ...functionsUploadList] + /** + * Iterate over all headers + * + * @param Function callback Executed for each item with parameters (value, name, thisArg) + * @param Boolean thisArg `this` context for callback function + * @return Void + */ + forEach(callback) { + let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - await uploadFiles(api, deployId, uploadList, { concurrentUpload, statusCb, maxRetry }) + let pairs = getHeaders(this); + let i = 0; + while (i < pairs.length) { + var _pairs$i = pairs[i]; + const name = _pairs$i[0], + value = _pairs$i[1]; - statusCb({ - type: 'wait-for-deploy', - msg: 'Waiting for deploy to go live...', - phase: 'start', - }) - deploy = await waitForDeploy(api, deployId, siteId, deployTimeout) - - statusCb({ - type: 'wait-for-deploy', - msg: draft ? 'Draft deploy is live!' : 'Deploy is live!', - phase: 'stop', - }) - - await rimraf(tmpDir) - - const deployManifest = { - deployId, - deploy, - uploadList, - } - return deployManifest -} + callback.call(thisArg, value, name, this); + pairs = getHeaders(this); + i++; + } + } -module.exports = deploySite + /** + * Overwrite header values given name + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + set(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + this[MAP][key !== undefined ? key : name] = [value]; + } + /** + * Append a value onto existing header + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + append(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + if (key !== undefined) { + this[MAP][key].push(value); + } else { + this[MAP][name] = [value]; + } + } -/***/ }), + /** + * Check for header name existence + * + * @param String name Header name + * @return Boolean + */ + has(name) { + name = `${name}`; + validateName(name); + return find(this[MAP], name) !== undefined; + } -/***/ 88497: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Delete all header values given name + * + * @param String name Header name + * @return Void + */ + delete(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key !== undefined) { + delete this[MAP][key]; + } + } -const fs = __nccwpck_require__(57147) + /** + * Return raw headers (non-spec api) + * + * @return Object + */ + raw() { + return this[MAP]; + } -const backoff = __nccwpck_require__(33086) -const pMap = __nccwpck_require__(91855) + /** + * Get an iterator on keys. + * + * @return Iterator + */ + keys() { + return createHeadersIterator(this, 'key'); + } -const { UPLOAD_RANDOM_FACTOR, UPLOAD_INITIAL_DELAY, UPLOAD_MAX_DELAY } = __nccwpck_require__(82617) + /** + * Get an iterator on values. + * + * @return Iterator + */ + values() { + return createHeadersIterator(this, 'value'); + } -const uploadFiles = async (api, deployId, uploadList, { concurrentUpload, statusCb, maxRetry }) => { - if (!concurrentUpload || !statusCb || !maxRetry) throw new Error('Missing required option concurrentUpload') - statusCb({ - type: 'upload', - msg: `Uploading ${uploadList.length} files`, - phase: 'start', - }) + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return Iterator + */ + [Symbol.iterator]() { + return createHeadersIterator(this, 'key+value'); + } +} +Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - const uploadFile = async (fileObj, index) => { - const { normalizedPath, assetType, runtime, filepath } = fileObj - const readStreamCtor = () => fs.createReadStream(filepath) +Object.defineProperty(Headers.prototype, Symbol.toStringTag, { + value: 'Headers', + writable: false, + enumerable: false, + configurable: true +}); - statusCb({ - type: 'upload', - msg: `(${index}/${uploadList.length}) Uploading ${normalizedPath}...`, - phase: 'progress', - }) - let response - switch (assetType) { - case 'file': { - response = await retryUpload( - () => - api.uploadDeployFile({ - body: readStreamCtor, - deployId, - path: encodeURI(normalizedPath), - }), - maxRetry, - ) - break - } - case 'function': { - response = await await retryUpload( - () => - api.uploadDeployFunction({ - body: readStreamCtor, - deployId, - name: encodeURI(normalizedPath), - runtime, - }), - maxRetry, - ) - break - } - default: { - const error = new Error('File Object missing assetType property') - error.fileObj = fileObj - throw error - } - } +Object.defineProperties(Headers.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true } +}); - return response - } +function getHeaders(headers) { + let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - const results = await pMap(uploadList, uploadFile, { concurrency: concurrentUpload }) - statusCb({ - type: 'upload', - msg: `Finished uploading ${uploadList.length} assets`, - phase: 'stop', - }) - return results + const keys = Object.keys(headers[MAP]).sort(); + return keys.map(kind === 'key' ? function (k) { + return k.toLowerCase(); + } : kind === 'value' ? function (k) { + return headers[MAP][k].join(', '); + } : function (k) { + return [k.toLowerCase(), headers[MAP][k].join(', ')]; + }); } -const retryUpload = (uploadFn, maxRetry) => - new Promise((resolve, reject) => { - let lastError - const fibonacciBackoff = backoff.fibonacci({ - randomisationFactor: UPLOAD_RANDOM_FACTOR, - initialDelay: UPLOAD_INITIAL_DELAY, - maxDelay: UPLOAD_MAX_DELAY, - }) +const INTERNAL = Symbol('internal'); - const tryUpload = async () => { - try { - const results = await uploadFn() - return resolve(results) - } catch (error) { - lastError = error - // observed errors: 408, 401 (4** swallowed), 502 - if (error.status >= 400 || error.name === 'FetchError') { - fibonacciBackoff.backoff() - return - } - return reject(error) - } - } +function createHeadersIterator(target, kind) { + const iterator = Object.create(HeadersIteratorPrototype); + iterator[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator; +} - fibonacciBackoff.failAfter(maxRetry) +const HeadersIteratorPrototype = Object.setPrototypeOf({ + next() { + // istanbul ignore if + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError('Value of `this` is not a HeadersIterator'); + } - fibonacciBackoff.on('backoff', () => { - // Do something when backoff starts, e.g. show to the - // user the delay before next reconnection attempt. - }) + var _INTERNAL = this[INTERNAL]; + const target = _INTERNAL.target, + kind = _INTERNAL.kind, + index = _INTERNAL.index; - fibonacciBackoff.on('ready', tryUpload) + const values = getHeaders(target, kind); + const len = values.length; + if (index >= len) { + return { + value: undefined, + done: true + }; + } - fibonacciBackoff.on('fail', () => { - reject(lastError) - }) + this[INTERNAL].index = index + 1; - tryUpload(0, 0) - }) + return { + value: values[index], + done: false + }; + } +}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); -module.exports = uploadFiles +Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: 'HeadersIterator', + writable: false, + enumerable: false, + configurable: true +}); +/** + * Export the Headers object in a form that Node.js can consume. + * + * @param Headers headers + * @return Object + */ +function exportNodeCompatibleHeaders(headers) { + const obj = Object.assign({ __proto__: null }, headers[MAP]); -/***/ }), + // http.request() only supports string as Host header. This hack makes + // specifying custom Host header possible. + const hostHeaderKey = find(headers[MAP], 'Host'); + if (hostHeaderKey !== undefined) { + obj[hostHeaderKey] = obj[hostHeaderKey][0]; + } -/***/ 91649: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return obj; +} -const { basename, sep } = __nccwpck_require__(71017) +/** + * Create a Headers object from an object of headers, ignoring those that do + * not conform to HTTP grammar productions. + * + * @param Object obj Object of headers + * @return Headers + */ +function createHeadersLenient(obj) { + const headers = new Headers(); + for (const name of Object.keys(obj)) { + if (invalidTokenRegex.test(name)) { + continue; + } + if (Array.isArray(obj[name])) { + for (const val of obj[name]) { + if (invalidHeaderCharRegex.test(val)) { + continue; + } + if (headers[MAP][name] === undefined) { + headers[MAP][name] = [val]; + } else { + headers[MAP][name].push(val); + } + } + } else if (!invalidHeaderCharRegex.test(obj[name])) { + headers[MAP][name] = [obj[name]]; + } + } + return headers; +} -const pWaitFor = __nccwpck_require__(80414) +const INTERNALS$1 = Symbol('Response internals'); -const { DEPLOY_POLL } = __nccwpck_require__(82617) +// fix an issue where "STATUS_CODES" aren't a named export for node <10 +const STATUS_CODES = http.STATUS_CODES; -// Default filter when scanning for files -const defaultFilter = (filePath) => { - if (filePath == null) { - return false - } +/** + * Response class + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +class Response { + constructor() { + let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const filename = basename(filePath) - return ( - filename !== 'node_modules' && - !(filename.startsWith('.') && filename !== '.well-known') && - !filename.includes('/__MACOSX') && - !filename.includes('/.') - ) -} + Body.call(this, body, opts); -// normalize windows paths to unix paths -const normalizePath = (relname) => { - if (relname.includes('#') || relname.includes('?')) { - throw new Error(`Invalid filename ${relname}. Deployed filenames cannot contain # or ? characters`) - } - return ( - relname - .split(sep) - // .map(segment => encodeURI(segment)) // TODO I'm fairly certain we shouldn't encodeURI here, thats only for the file upload step - .join('/') - ) -} + const status = opts.status || 200; + const headers = new Headers(opts.headers); -// poll an async deployId until its done diffing -const waitForDiff = async (api, deployId, siteId, timeout) => { - // capture ready deploy during poll - let deploy + if (body != null && !headers.has('Content-Type')) { + const contentType = extractContentType(body); + if (contentType) { + headers.append('Content-Type', contentType); + } + } - const loadDeploy = async () => { - const siteDeploy = await api.getSiteDeploy({ siteId, deployId }) + this[INTERNALS$1] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter + }; + } - switch (siteDeploy.state) { - // https://github.com/netlify/bitballoon/blob/master/app/models/deploy.rb#L21-L33 - case 'error': { - const deployError = new Error(`Deploy ${deployId} had an error`) - deployError.deploy = siteDeploy - throw deployError - } - case 'prepared': - case 'uploading': - case 'uploaded': - case 'ready': { - deploy = siteDeploy - return true - } - case 'preparing': - default: { - return false - } - } - } + get url() { + return this[INTERNALS$1].url || ''; + } - await pWaitFor(loadDeploy, { - interval: DEPLOY_POLL, - timeout, - message: 'Timeout while waiting for deploy', - }) + get status() { + return this[INTERNALS$1].status; + } - return deploy -} + /** + * Convenience property representing if the request ended normally + */ + get ok() { + return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + } -// Poll a deployId until its ready -const waitForDeploy = async (api, deployId, siteId, timeout) => { - // capture ready deploy during poll - let deploy + get redirected() { + return this[INTERNALS$1].counter > 0; + } - const loadDeploy = async () => { - const siteDeploy = await api.getSiteDeploy({ siteId, deployId }) - switch (siteDeploy.state) { - // https://github.com/netlify/bitballoon/blob/master/app/models/deploy.rb#L21-L33 - case 'error': { - const deployError = new Error(`Deploy ${deployId} had an error`) - deployError.deploy = siteDeploy - throw deployError - } - case 'ready': { - deploy = siteDeploy - return true - } - case 'preparing': - case 'prepared': - case 'uploaded': - case 'uploading': - default: { - return false - } - } - } + get statusText() { + return this[INTERNALS$1].statusText; + } - await pWaitFor(loadDeploy, { - interval: DEPLOY_POLL, - timeout, - message: 'Timeout while waiting for deploy', - }) + get headers() { + return this[INTERNALS$1].headers; + } - return deploy + /** + * Clone this response + * + * @return Response + */ + clone() { + return new Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected + }); + } } -// Transform the fileShaMap and fnShaMap into a generic shaMap that file-uploader.js can use -const getUploadList = (required, shaMap) => { - if (!required || !shaMap) return [] - // TODO: use `Array.flatMap()` instead once we remove support for Node <11.0.0 - // eslint-disable-next-line unicorn/prefer-spread - return [].concat(...required.map((sha) => shaMap[sha])) -} +Body.mixIn(Response.prototype); -module.exports = { - defaultFilter, - normalizePath, - waitForDiff, - waitForDeploy, - getUploadList, -} +Object.defineProperties(Response.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true } +}); +Object.defineProperty(Response.prototype, Symbol.toStringTag, { + value: 'Response', + writable: false, + enumerable: false, + configurable: true +}); -/***/ }), +const INTERNALS$2 = Symbol('Request internals'); +const URL = Url.URL || whatwgUrl.URL; -/***/ 44666: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// fix an issue where "format", "parse" aren't a named export for node <10 +const parse_url = Url.parse; +const format_url = Url.format; -const dfn = __nccwpck_require__(76490) -const pWaitFor = __nccwpck_require__(80414) +/** + * Wrapper around `new URL` to handle arbitrary URLs + * + * @param {string} urlStr + * @return {void} + */ +function parseURL(urlStr) { + /* + Check whether the URL is absolute or not + Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 + Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 + */ + if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { + urlStr = new URL(urlStr).toString(); + } -const deploy = __nccwpck_require__(55652) -const { getMethods } = __nccwpck_require__(43086) -const { getOperations } = __nccwpck_require__(85393) + // Fallback to old implementation for arbitrary URLs + return parse_url(urlStr); +} -/* eslint-disable fp/no-this */ -// eslint-disable-next-line fp/no-class -class NetlifyAPI { - constructor(firstArg, secondArg) { - // variadic arguments - const [accessTokenInput, opts = {}] = typeof firstArg === 'object' ? [null, firstArg] : [firstArg, secondArg] +const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - // default opts - const { - userAgent = 'netlify/js-client', - scheme = dfn.schemes[0], - host = dfn.host, - pathPrefix = dfn.basePath, - accessToken = accessTokenInput, - globalParams = {}, - agent, - } = opts +/** + * Check if a value is an instance of Request. + * + * @param Mixed input + * @return Boolean + */ +function isRequest(input) { + return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; +} - const defaultHeaders = { - 'User-agent': userAgent, - accept: 'application/json', - } +function isAbortSignal(signal) { + const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); + return !!(proto && proto.constructor.name === 'AbortSignal'); +} - const basePath = getBasePath({ scheme, host, pathPrefix }) - const methods = getMethods({ basePath, defaultHeaders, agent, globalParams }) - // eslint-disable-next-line fp/no-mutating-assign - Object.assign(this, { ...methods, defaultHeaders, scheme, host, pathPrefix, globalParams, accessToken, agent }) - } +/** + * Request class + * + * @param Mixed input Url or Request instance + * @param Object init Custom options + * @return Void + */ +class Request { + constructor(input) { + let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - get accessToken() { - const { - defaultHeaders: { Authorization }, - } = this - if (typeof Authorization !== 'string' || !Authorization.startsWith('Bearer ')) { - return null - } + let parsedURL; - return Authorization.replace('Bearer ', '') - } + // normalize input + if (!isRequest(input)) { + if (input && input.href) { + // in order to support Node.js' Url objects; though WHATWG's URL objects + // will fall into this branch also (since their `toString()` will return + // `href` property anyway) + parsedURL = parseURL(input.href); + } else { + // coerce input to a string before attempting to parse + parsedURL = parseURL(`${input}`); + } + input = {}; + } else { + parsedURL = parseURL(input.url); + } - set accessToken(token) { - if (!token) { - // eslint-disable-next-line fp/no-delete - delete this.defaultHeaders.Authorization - return - } + let method = init.method || input.method || 'GET'; + method = method.toUpperCase(); - this.defaultHeaders.Authorization = `Bearer ${token}` - } + if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { + throw new TypeError('Request with GET/HEAD method cannot have body'); + } - get basePath() { - return getBasePath({ scheme: this.scheme, host: this.host, pathPrefix: this.pathPrefix }) - } + let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - async getAccessToken(ticket, { poll = DEFAULT_TICKET_POLL, timeout = DEFAULT_TICKET_TIMEOUT } = {}) { - const { id } = ticket + Body.call(this, inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 + }); - // ticket capture - let authorizedTicket - const checkTicket = async () => { - const t = await this.showTicket({ ticketId: id }) - if (t.authorized) { - authorizedTicket = t - } - return Boolean(t.authorized) - } + const headers = new Headers(init.headers || input.headers || {}); - await pWaitFor(checkTicket, { - interval: poll, - timeout, - message: 'Timeout while waiting for ticket grant', - }) + if (inputBody != null && !headers.has('Content-Type')) { + const contentType = extractContentType(inputBody); + if (contentType) { + headers.append('Content-Type', contentType); + } + } - const accessTokenResponse = await this.exchangeTicket({ ticketId: authorizedTicket.id }) - // See https://open-api.netlify.com/#/default/exchangeTicket for shape - this.accessToken = accessTokenResponse.access_token - return accessTokenResponse.access_token - } + let signal = isRequest(input) ? input.signal : null; + if ('signal' in init) signal = init.signal; - async deploy(siteId, buildDir, opts) { - if (!this.accessToken) throw new Error('Missing access token') - // the deploy function is swapped in the package.json browser field for different environments - // See https://github.com/defunctzombie/package-browser-field-spec - return await deploy(this, siteId, buildDir, opts) - } -} -/* eslint-enable fp/no-this */ + if (signal != null && !isAbortSignal(signal)) { + throw new TypeError('Expected signal to be an instanceof AbortSignal'); + } -const getBasePath = function ({ scheme, host, pathPrefix }) { - return `${scheme}://${host}${pathPrefix}` -} + this[INTERNALS$2] = { + method, + redirect: init.redirect || input.redirect || 'follow', + headers, + parsedURL, + signal + }; -// 1 second -const DEFAULT_TICKET_POLL = 1e3 -// 1 hour -const DEFAULT_TICKET_TIMEOUT = 3.6e6 + // node-fetch-only options + this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; + this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; + this.counter = init.counter || input.counter || 0; + this.agent = init.agent || input.agent; + } -module.exports = NetlifyAPI + get method() { + return this[INTERNALS$2].method; + } -module.exports.methods = getOperations() + get url() { + return format_url(this[INTERNALS$2].parsedURL); + } + get headers() { + return this[INTERNALS$2].headers; + } -/***/ }), + get redirect() { + return this[INTERNALS$2].redirect; + } -/***/ 18704: -/***/ ((module) => { + get signal() { + return this[INTERNALS$2].signal; + } -// Handle request body -const addBody = function (body, parameters, opts) { - if (!body) { - return opts - } + /** + * Clone this request + * + * @return Request + */ + clone() { + return new Request(this); + } +} - const bodyA = typeof body === 'function' ? body() : body +Body.mixIn(Request.prototype); - if (isBinaryBody(parameters)) { - return { - ...opts, - body: bodyA, - headers: { 'Content-Type': 'application/octet-stream', ...opts.headers }, - } - } +Object.defineProperty(Request.prototype, Symbol.toStringTag, { + value: 'Request', + writable: false, + enumerable: false, + configurable: true +}); - return { - ...opts, - body: JSON.stringify(bodyA), - headers: { 'Content-Type': 'application/json', ...opts.headers }, - } -} +Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true } +}); -const isBinaryBody = function (parameters) { - return Object.values(parameters.body).some(isBodyParam) -} +/** + * Convert a Request to Node.js http request options. + * + * @param Request A Request instance + * @return Object The options object to be passed to http.request + */ +function getNodeRequestOptions(request) { + const parsedURL = request[INTERNALS$2].parsedURL; + const headers = new Headers(request[INTERNALS$2].headers); -const isBodyParam = function ({ schema }) { - return schema && schema.format === 'binary' -} + // fetch step 1.3 + if (!headers.has('Accept')) { + headers.set('Accept', '*/*'); + } -module.exports = { addBody } + // Basic fetch + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError('Only absolute URLs are supported'); + } + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError('Only HTTP(S) protocols are supported'); + } -/***/ }), + if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { + throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); + } -/***/ 43086: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // HTTP-network-or-cache fetch steps 2.4-2.7 + let contentLengthValue = null; + if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { + contentLengthValue = '0'; + } + if (request.body != null) { + const totalBytes = getTotalBytes(request); + if (typeof totalBytes === 'number') { + contentLengthValue = String(totalBytes); + } + } + if (contentLengthValue) { + headers.set('Content-Length', contentLengthValue); + } -const nodeFetch = __nccwpck_require__(80467) -// Webpack will sometimes export default exports in different places -const fetch = nodeFetch.default || nodeFetch + // HTTP-network-or-cache fetch step 2.11 + if (!headers.has('User-Agent')) { + headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); + } -const { getOperations } = __nccwpck_require__(85393) + // HTTP-network-or-cache fetch step 2.15 + if (request.compress && !headers.has('Accept-Encoding')) { + headers.set('Accept-Encoding', 'gzip,deflate'); + } -const { addBody } = __nccwpck_require__(18704) -const { parseResponse, getFetchError } = __nccwpck_require__(82007) -const { shouldRetry, waitForRetry, MAX_RETRY } = __nccwpck_require__(3866) -const { getUrl } = __nccwpck_require__(15121) + let agent = request.agent; + if (typeof agent === 'function') { + agent = agent(parsedURL); + } -// For each OpenAPI operation, add a corresponding method. -// The `operationId` is the method name. -const getMethods = function ({ basePath, defaultHeaders, agent, globalParams }) { - const operations = getOperations() - const methods = operations.map((method) => getMethod({ method, basePath, defaultHeaders, agent, globalParams })) - return Object.assign({}, ...methods) -} + // HTTP-network fetch step 4.2 + // chunked encoding is handled by Node.js -const getMethod = function ({ method, basePath, defaultHeaders, agent, globalParams }) { - return { - [method.operationId](params, opts) { - return callMethod({ method, basePath, defaultHeaders, agent, globalParams, params, opts }) - }, - } + return Object.assign({}, parsedURL, { + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent + }); } -const callMethod = async function ({ method, basePath, defaultHeaders, agent, globalParams, params, opts }) { - const requestParams = { ...globalParams, ...params } - const url = getUrl(method, basePath, requestParams) - const response = await makeRequestOrRetry({ url, method, defaultHeaders, agent, requestParams, opts }) +/** + * abort-error.js + * + * AbortError interface for cancelled requests + */ - const parsedResponse = await parseResponse(response) - return parsedResponse -} +/** + * Create AbortError instance + * + * @param String message Error message for human + * @return AbortError + */ +function AbortError(message) { + Error.call(this, message); -const getOpts = function ({ method: { verb, parameters }, defaultHeaders, agent, requestParams: { body }, opts }) { - const optsA = addHttpMethod(verb, opts) - const optsB = addDefaultHeaders(defaultHeaders, optsA) - const optsC = addBody(body, parameters, optsB) - const optsD = addAgent(agent, optsC) - return optsD -} + this.type = 'aborted'; + this.message = message; -// Add the HTTP method based on the OpenAPI definition -const addHttpMethod = function (verb, opts) { - return { ...opts, method: verb.toUpperCase() } + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); } -// Assign default HTTP headers -const addDefaultHeaders = function (defaultHeaders, opts) { - return { ...opts, headers: { ...defaultHeaders, ...opts.headers } } -} +AbortError.prototype = Object.create(Error.prototype); +AbortError.prototype.constructor = AbortError; +AbortError.prototype.name = 'AbortError'; -// Assign fetch agent (like for example HttpsProxyAgent) if there is one -const addAgent = function (agent, opts) { - if (agent) { - return { ...opts, agent } - } - return opts -} +const URL$1 = Url.URL || whatwgUrl.URL; -const makeRequestOrRetry = async function ({ url, method, defaultHeaders, agent, requestParams, opts }) { - // Using a loop is simpler here - // eslint-disable-next-line fp/no-loops - for (let index = 0; index <= MAX_RETRY; index++) { - const optsA = getOpts({ method, defaultHeaders, agent, requestParams, opts }) - // eslint-disable-next-line no-await-in-loop - const { response, error } = await makeRequest(url, optsA) +// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 +const PassThrough$1 = Stream.PassThrough; - if (shouldRetry({ response, error }) && index !== MAX_RETRY) { - // eslint-disable-next-line no-await-in-loop - await waitForRetry(response) - continue - } +const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { + const orig = new URL$1(original).hostname; + const dest = new URL$1(destination).hostname; - if (error !== undefined) { - throw error - } + return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); +}; - return response - } -} +/** + * isSameProtocol reports whether the two provided URLs use the same protocol. + * + * Both domains must already be in canonical form. + * @param {string|URL} original + * @param {string|URL} destination + */ +const isSameProtocol = function isSameProtocol(destination, original) { + const orig = new URL$1(original).protocol; + const dest = new URL$1(destination).protocol; -const makeRequest = async function (url, opts) { - try { - const response = await fetch(url, opts) - return { response } - } catch (error) { - const errorA = getFetchError(error, url, opts) - return { error: errorA } - } -} + return orig === dest; +}; -module.exports = { getMethods } +/** + * Fetch function + * + * @param Mixed url Absolute url or Request instance + * @param Object opts Fetch options + * @return Promise + */ +function fetch(url, opts) { + // allow custom promise + if (!fetch.Promise) { + throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); + } -/***/ }), + Body.Promise = fetch.Promise; -/***/ 82007: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // wrap http.request into fetch + return new fetch.Promise(function (resolve, reject) { + // build request object + const request = new Request(url, opts); + const options = getNodeRequestOptions(request); -const { JSONHTTPError, TextHTTPError } = __nccwpck_require__(316) -const omit = (__nccwpck_require__(72657)/* ["default"] */ .Z) + const send = (options.protocol === 'https:' ? https : http).request; + const signal = request.signal; -// Read and parse the HTTP response -const parseResponse = async function (response) { - const responseType = getResponseType(response) - const textResponse = await response.text() + let response = null; - const parsedResponse = parseJsonResponse(response, textResponse, responseType) + const abort = function abort() { + let error = new AbortError('The user aborted a request.'); + reject(error); + if (request.body && request.body instanceof Stream.Readable) { + destroyStream(request.body, error); + } + if (!response || !response.body) return; + response.body.emit('error', error); + }; - if (!response.ok) { - const ErrorType = responseType === 'json' ? JSONHTTPError : TextHTTPError - throw new ErrorType(response, parsedResponse) - } + if (signal && signal.aborted) { + abort(); + return; + } - return parsedResponse -} + const abortAndFinalize = function abortAndFinalize() { + abort(); + finalize(); + }; -const getResponseType = function ({ headers }) { - const contentType = headers.get('Content-Type') + // send request + const req = send(options); + let reqTimeout; - if (contentType != null && contentType.includes('json')) { - return 'json' - } + if (signal) { + signal.addEventListener('abort', abortAndFinalize); + } - return 'text' -} - -const parseJsonResponse = function (response, textResponse, responseType) { - if (responseType === 'text') { - return textResponse - } + function finalize() { + req.abort(); + if (signal) signal.removeEventListener('abort', abortAndFinalize); + clearTimeout(reqTimeout); + } - try { - return JSON.parse(textResponse) - } catch (error) { - throw new TextHTTPError(response, textResponse) - } -} + if (request.timeout) { + req.once('socket', function (socket) { + reqTimeout = setTimeout(function () { + reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); + finalize(); + }, request.timeout); + }); + } -const getFetchError = function (error, url, opts) { - const data = omit(opts, ['Authorization']) - error.name = 'FetchError' - error.url = url - error.data = data - return error -} + req.on('error', function (err) { + reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); -module.exports = { parseResponse, getFetchError } + if (response && response.body) { + destroyStream(response.body, err); + } + finalize(); + }); -/***/ }), + fixResponseChunkedTransferBadEnding(req, function (err) { + if (signal && signal.aborted) { + return; + } -/***/ 3866: -/***/ ((module) => { + if (response && response.body) { + destroyStream(response.body, err); + } + }); -// We retry: -// - when receiving a rate limiting response -// - on network failures due to timeouts -const shouldRetry = function ({ response = {}, error = {} }) { - return isRetryStatus(response) || RETRY_ERROR_CODES.has(error.code) -} + /* c8 ignore next 18 */ + if (parseInt(process.version.substring(1)) < 14) { + // Before Node.js 14, pipeline() does not fully support async iterators and does not always + // properly handle when the socket close/end events are out of order. + req.on('socket', function (s) { + s.addListener('close', function (hadError) { + // if a data listener is still present we didn't end cleanly + const hasDataListener = s.listenerCount('data') > 0; -const isRetryStatus = function ({ status }) { - return typeof status === 'number' && (status === RATE_LIMIT_STATUS || String(status).startsWith('5')) -} + // if end happened before close but the socket didn't emit an error, do it now + if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { + const err = new Error('Premature close'); + err.code = 'ERR_STREAM_PREMATURE_CLOSE'; + response.body.emit('error', err); + } + }); + }); + } -const waitForRetry = async function (response) { - const delay = getDelay(response) - await sleep(delay) -} + req.on('response', function (res) { + clearTimeout(reqTimeout); -const getDelay = function (response) { - if (response === undefined) { - return DEFAULT_RETRY_DELAY - } + const headers = createHeadersLenient(res.headers); - const rateLimitReset = response.headers.get(RATE_LIMIT_HEADER) + // HTTP fetch step 5 + if (fetch.isRedirect(res.statusCode)) { + // HTTP fetch step 5.2 + const location = headers.get('Location'); - if (!rateLimitReset) { - return DEFAULT_RETRY_DELAY - } + // HTTP fetch step 5.3 + let locationURL = null; + try { + locationURL = location === null ? null : new URL$1(location, request.url).toString(); + } catch (err) { + // error here can only be invalid URL in Location: header + // do not throw when options.redirect == manual + // let the user extract the errorneous redirect URL + if (request.redirect !== 'manual') { + reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); + finalize(); + return; + } + } - return Math.max(Number(rateLimitReset) * SECS_TO_MSECS - Date.now(), MIN_RETRY_DELAY) -} + // HTTP fetch step 5.5 + switch (request.redirect) { + case 'error': + reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); + finalize(); + return; + case 'manual': + // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. + if (locationURL !== null) { + // handle corrupted header + try { + headers.set('Location', locationURL); + } catch (err) { + // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request + reject(err); + } + } + break; + case 'follow': + // HTTP-redirect fetch step 2 + if (locationURL === null) { + break; + } -const sleep = function (ms) { - return new Promise((resolve) => { - setTimeout(resolve, ms) - }) -} + // HTTP-redirect fetch step 5 + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); + finalize(); + return; + } -const DEFAULT_RETRY_DELAY = 5e3 -const MIN_RETRY_DELAY = 1e3 -const SECS_TO_MSECS = 1e3 -const MAX_RETRY = 5 -const RATE_LIMIT_STATUS = 429 -const RATE_LIMIT_HEADER = 'X-RateLimit-Reset' -const RETRY_ERROR_CODES = new Set(['ETIMEDOUT', 'ECONNRESET']) + // HTTP-redirect fetch step 6 (counter increment) + // Create a new Request object. + const requestOpts = { + headers: new Headers(request.headers), + follow: request.follow, + counter: request.counter + 1, + agent: request.agent, + compress: request.compress, + method: request.method, + body: request.body, + signal: request.signal, + timeout: request.timeout, + size: request.size + }; -module.exports = { shouldRetry, waitForRetry, MAX_RETRY } + if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { + for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { + requestOpts.headers.delete(name); + } + } + // HTTP-redirect fetch step 9 + if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { + reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); + finalize(); + return; + } -/***/ }), + // HTTP-redirect fetch step 11 + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { + requestOpts.method = 'GET'; + requestOpts.body = undefined; + requestOpts.headers.delete('content-length'); + } -/***/ 15121: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // HTTP-redirect fetch step 15 + resolve(fetch(new Request(locationURL, requestOpts))); + finalize(); + return; + } + } -const camelCase = __nccwpck_require__(7994) -const queryString = __nccwpck_require__(22760) + // prepare response + res.once('end', function () { + if (signal) signal.removeEventListener('abort', abortAndFinalize); + }); + let body = res.pipe(new PassThrough$1()); -// Replace path parameters and query parameters in the URI, using the OpenAPI -// definition -const getUrl = function ({ path, parameters }, basePath, requestParams) { - const url = `${basePath}${path}` - const urlA = addPathParams(url, parameters, requestParams) - const urlB = addQueryParams(urlA, parameters, requestParams) - return urlB -} + const response_options = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers: headers, + size: request.size, + timeout: request.timeout, + counter: request.counter + }; -const addPathParams = function (url, parameters, requestParams) { - const pathParams = getRequestParams(parameters.path, requestParams, 'path variable') - return Object.entries(pathParams).reduce(addPathParam, url) -} + // HTTP-network fetch step 12.1.1.3 + const codings = headers.get('Content-Encoding'); -const addPathParam = function (url, [name, value]) { - return url.replace(`{${name}}`, value) -} + // HTTP-network fetch step 12.1.1.4: handle content codings -const addQueryParams = function (url, parameters, requestParams) { - const queryParams = getRequestParams(parameters.query, requestParams, 'query variable') + // in following scenarios we ignore compression support + // 1. compression support is disabled + // 2. HEAD request + // 3. no Content-Encoding header + // 4. no content response (204) + // 5. content not modified response (304) + if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { + response = new Response(body, response_options); + resolve(response); + return; + } - if (Object.keys(queryParams).length === 0) { - return url - } + // For Node v6+ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + const zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + }; - return `${url}?${queryString.stringify(queryParams, { arrayFormat: 'brackets' })}` -} + // for gzip + if (codings == 'gzip' || codings == 'x-gzip') { + body = body.pipe(zlib.createGunzip(zlibOptions)); + response = new Response(body, response_options); + resolve(response); + return; + } -const getRequestParams = function (params, requestParams, name) { - const entries = Object.values(params).map((param) => getRequestParam(param, requestParams, name)) - return Object.assign({}, ...entries) -} + // for deflate + if (codings == 'deflate' || codings == 'x-deflate') { + // handle the infamous raw deflate response from old servers + // a hack for old IIS and Apache servers + const raw = res.pipe(new PassThrough$1()); + raw.once('data', function (chunk) { + // see http://stackoverflow.com/questions/37519828 + if ((chunk[0] & 0x0F) === 0x08) { + body = body.pipe(zlib.createInflate()); + } else { + body = body.pipe(zlib.createInflateRaw()); + } + response = new Response(body, response_options); + resolve(response); + }); + raw.on('end', function () { + // some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted. + if (!response) { + response = new Response(body, response_options); + resolve(response); + } + }); + return; + } -const getRequestParam = function (param, requestParams, name) { - const value = requestParams[param.name] || requestParams[camelCase(param.name)] + // for br + if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { + body = body.pipe(zlib.createBrotliDecompress()); + response = new Response(body, response_options); + resolve(response); + return; + } - if (value !== undefined) { - return { [param.name]: value } - } + // otherwise, use response as-is + response = new Response(body, response_options); + resolve(response); + }); - if (param.required) { - throw new Error(`Missing required ${name} '${param.name}'`) - } + writeToStream(req, request); + }); } +function fixResponseChunkedTransferBadEnding(request, errorCallback) { + let socket; -module.exports = { getUrl } - - -/***/ }), - -/***/ 85393: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + request.on('socket', function (s) { + socket = s; + }); -const { paths } = __nccwpck_require__(76490) -const omit = (__nccwpck_require__(72657)/* ["default"] */ .Z) + request.on('response', function (response) { + const headers = response.headers; -// Retrieve all OpenAPI operations -const getOperations = function () { - // TODO: switch to Array.flat() once we drop support for Node.js < 11.0.0 - // eslint-disable-next-line unicorn/prefer-spread - return [].concat( - ...Object.entries(paths).map(([path, pathItem]) => { - const operations = omit(pathItem, ['parameters']) - return Object.entries(operations).map(([method, operation]) => { - const parameters = getParameters(pathItem.parameters, operation.parameters) - return { ...operation, verb: method, path, parameters } - }) - }), - ) -} + if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) { + response.once('close', function (hadError) { + // tests for socket presence, as in some situations the + // the 'socket' event is not triggered for the request + // (happens in deno), avoids `TypeError` + // if a data listener is still present we didn't end cleanly + const hasDataListener = socket && socket.listenerCount('data') > 0; -const getParameters = function (pathParameters = [], operationParameters = []) { - const parameters = [...pathParameters, ...operationParameters] - return parameters.reduce(addParameter, { path: {}, query: {}, body: {} }) + if (hasDataListener && !hadError) { + const err = new Error('Premature close'); + err.code = 'ERR_STREAM_PREMATURE_CLOSE'; + errorCallback(err); + } + }); + } + }); } -const addParameter = function (parameters, param) { - return { ...parameters, [param.in]: { ...parameters[param.in], [param.name]: param } } +function destroyStream(stream, err) { + if (stream.destroy) { + stream.destroy(err); + } else { + // node < 8 + stream.emit('error', err); + stream.end(); + } } -module.exports = { getOperations } - - -/***/ }), - -/***/ 80467: -/***/ ((module, exports, __nccwpck_require__) => { - -"use strict"; +/** + * Redirect code matching + * + * @param Number code Status code + * @return Boolean + */ +fetch.isRedirect = function (code) { + return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; +}; +// expose Promise +fetch.Promise = global.Promise; +module.exports = exports = fetch; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports["default"] = exports; +exports.Headers = Headers; +exports.Request = Request; +exports.Response = Response; +exports.FetchError = FetchError; +exports.AbortError = AbortError; -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var Stream = _interopDefault(__nccwpck_require__(12781)); -var http = _interopDefault(__nccwpck_require__(13685)); -var Url = _interopDefault(__nccwpck_require__(57310)); -var whatwgUrl = _interopDefault(__nccwpck_require__(28665)); -var https = _interopDefault(__nccwpck_require__(95687)); -var zlib = _interopDefault(__nccwpck_require__(59796)); +/***/ }), -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js +/***/ 46695: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; +const parser = __nccwpck_require__(85026); -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); +/** + * @param {Object} options - Options to configure parser + * @param {Object} options.parser - An object with a parse method that returns an AST + */ +module.exports = function(options = {}) { + this.parser = options.parser || parser; -class Blob { - constructor() { - this[TYPE] = ''; + if (options.parser) { + // We don't want to send that down to the actual parser + delete options.parser; + } - const blobParts = arguments[0]; - const options = arguments[1]; + this.options = Object.assign({ + plugins: [ + 'jsx', + 'flow', + 'asyncGenerators', + 'classProperties', + 'doExpressions', + 'dynamicImport', + 'exportDefaultFrom', + 'exportNamespaceFrom', + 'functionBind', + 'functionSent', + 'nullishCoalescingOperator', + 'objectRestSpread', + [ + 'decorators', { + decoratorsBeforeExport: true + } + ], + 'optionalChaining' + ], + allowHashBang: true, + sourceType: 'module' + }, options); - const buffers = []; - let size = 0; + // We use global state to stop the recursive traversal of the AST + this.shouldStop = false; +}; - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } +/** + * @param {String} src + * @param {Object} [options] - Parser options + * @return {Object} The AST of the given src + */ +module.exports.prototype.parse = function(src, options) { + options = options || this.options; - this[BUFFER] = Buffer.concat(buffers); + // Keep around for consumers of parse that supply their own options + if (typeof options.allowHashBang === 'undefined') { + options.allowHashBang = true; + } - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; + return this.parser.parse(src, options); +}; - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); +/** + * Adapted from substack/node-detective + * Executes cb on a non-array AST node + */ +module.exports.prototype.traverse = function(node, cb) { + if (this.shouldStop) return; - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} + if (Array.isArray(node)) { + for (const key of node) { + if (key !== null) { + // Mark that the node has been visited + key.parent = node; + this.traverse(key, cb); + } + } + } else if (node && typeof node === 'object') { + cb(node); -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); + // TODO switch to Object.entries + for (const key of Object.keys(node)) { + // Avoid visited nodes + if (key === 'parent' || !node[key]) continue; -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); + node[key].parent = node; + this.traverse(node[key], cb); + } + } +}; /** - * fetch-error.js + * Executes the passed callback for every traversed node of + * the passed in src's ast * - * FetchError interface for operational errors + * @param {String|Object} src - The source code or AST to traverse + * @param {Function} cb - Called for every node */ +module.exports.prototype.walk = function(src, cb) { + this.shouldStop = false; -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); + const ast = typeof src === 'object' ? src : this.parse(src); - this.message = message; - this.type = type; + this.traverse(ast, cb); +}; - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } +module.exports.prototype.moonwalk = function(node, cb) { + this.shouldStop = false; - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} + if (typeof node !== 'object') { + throw new Error('node must be an object'); + } -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; + reverseTraverse.call(this, node, cb); +}; -let convert; -try { - convert = (__nccwpck_require__(22877).convert); -} catch (e) {} +function reverseTraverse(node, cb) { + if (this.shouldStop || !node.parent) return; -const INTERNALS = Symbol('Body internals'); + if (Array.isArray(node.parent)) { + for (const parent of node.parent) { + cb(parent); + } + } else { + cb(node.parent); + } -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; + reverseTraverse.call(this, node.parent, cb); +} /** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void + * Halts further traversal of the AST */ -function Body(body) { - var _this = this; - - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; +module.exports.prototype.stopWalking = function() { + this.shouldStop = true; +}; - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; +/***/ }), - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} +/***/ 55388: +/***/ ((module) => { -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, +/*! + * normalize-path + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ - get bodyUsed() { - return this[INTERNALS].disturbed; - }, +module.exports = function(path, stripTrailing) { + if (typeof path !== 'string') { + throw new TypeError('expected path to be a string'); + } - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, + if (path === '\\' || path === '/') return '/'; - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, + var len = path.length; + if (len <= 1) return path; - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; + // ensure that win32 namespaces has two leading slashes, so that the path is + // handled properly by the win32 version of path.parse() after being normalized + // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + var prefix = ''; + if (len > 4 && path[3] === '\\') { + var ch = path[2]; + if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { + path = path.slice(2); + prefix = '//'; + } + } - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); + } + return prefix + segs.join('/'); +}; - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, +/***/ }), - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; +/***/ 13262: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; +// pass in a manifest with a 'bin' field here, and it'll turn it +// into a properly santized bin object +const {join, basename} = __nccwpck_require__(71017) -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); +const normalize = pkg => + !pkg.bin ? removeBin(pkg) + : typeof pkg.bin === 'string' ? normalizeString(pkg) + : Array.isArray(pkg.bin) ? normalizeArray(pkg) + : typeof pkg.bin === 'object' ? normalizeObject(pkg) + : removeBin(pkg) -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; +const normalizeString = pkg => { + if (!pkg.name) + return removeBin(pkg) + pkg.bin = { [pkg.name]: pkg.bin } + return normalizeObject(pkg) +} -/** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise - */ -function consumeBody() { - var _this4 = this; +const normalizeArray = pkg => { + pkg.bin = pkg.bin.reduce((acc, k) => { + acc[basename(k)] = k + return acc + }, {}) + return normalizeObject(pkg) +} - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } +const removeBin = pkg => { + delete pkg.bin + return pkg +} - this[INTERNALS].disturbed = true; +const normalizeObject = pkg => { + const orig = pkg.bin + const clean = {} + let hasBins = false + Object.keys(orig).forEach(binKey => { + const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).substr(1) - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } + if (typeof orig[binKey] !== 'string' || !base) + return - let body = this.body; + const binTarget = join('/', orig[binKey]) + .replace(/\\/g, '/').substr(1) - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } + if (!binTarget) + return - // body is blob - if (isBlob(body)) { - body = body.stream(); - } + clean[base] = binTarget + hasBins = true + }) - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } + if (hasBins) + pkg.bin = clean + else + delete pkg.bin - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } + return pkg +} - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; +module.exports = normalize - return new Body.Promise(function (resolve, reject) { - let resTimeout; - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } +/***/ }), - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); +/***/ 20504: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; +var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; +var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var functionToString = Function.prototype.toString; +var $match = String.prototype.match; +var $slice = String.prototype.slice; +var $replace = String.prototype.replace; +var $toUpperCase = String.prototype.toUpperCase; +var $toLowerCase = String.prototype.toLowerCase; +var $test = RegExp.prototype.test; +var $concat = Array.prototype.concat; +var $join = Array.prototype.join; +var $arrSlice = Array.prototype.slice; +var $floor = Math.floor; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; +var gOPS = Object.getOwnPropertySymbols; +var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; +var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; +// ie, `has-tostringtag/shams +var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') + ? Symbol.toStringTag + : null; +var isEnumerable = Object.prototype.propertyIsEnumerable; - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } +var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( + [].__proto__ === Array.prototype // eslint-disable-line no-proto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); - accumBytes += chunk.length; - accum.push(chunk); - }); +function addNumericSeparator(num, str) { + if ( + num === Infinity + || num === -Infinity + || num !== num + || (num && num > -1000 && num < 1000) + || $test.call(/e/, str) + ) { + return str; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === 'number') { + var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str, intStr.length + 1); + return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); + } + } + return $replace.call(str, sepRegex, '$&_'); +} - body.on('end', function () { - if (abort) { - return; - } +var utilInspect = __nccwpck_require__(37265); +var inspectCustom = utilInspect.custom; +var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; - clearTimeout(resTimeout); +module.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} + if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if ( + has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' + ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity + : opts.maxStringLength !== null + ) + ) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; + if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { + throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); + } -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } + if ( + has(opts, 'indent') + && opts.indent !== null + && opts.indent !== '\t' + && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) + ) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + var str = String(obj); + return numericSeparator ? addNumericSeparator(obj, str) : str; + } + if (typeof obj === 'bigint') { + var bigIntStr = String(obj) + 'n'; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') { depth = 0; } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return isArray(obj) ? '[Array]' : '[Object]'; + } - // html5 - if (!res && str) { - res = /= 0) { + return '[Circular]'; + } - if (res) { - res = /charset=(.*)/i.exec(res.pop()); - } - } + function inspect(value, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has(opts, 'quoteStyle')) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value, newOpts, depth + 1, seen); + } + return inspect_(value, opts, depth + 1, seen); + } - // xml - if (!res && str) { - res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str); - } + if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable + var name = nameOf(obj); + var keys = arrObjKeys(obj, inspect); + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); + } + if (isSymbol(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); + return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) { s += '...'; } + s += ''; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) { return '[]'; } + var xs = arrObjKeys(obj, inspect); + if (indent && !singleLineValues(xs)) { + return '[' + indentedJoin(xs, indent) + ']'; + } + return '[ ' + $join.call(xs, ', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { + return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; + } + if (parts.length === 0) { return '[' + String(obj) + ']'; } + return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; + } + if (typeof obj === 'object' && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); + } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); + }); + } + return collectionOf('Map', mapSize.call(obj), mapParts, indent); + } + if (isSet(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + } + return collectionOf('Set', setSize.call(obj), setParts, indent); + } + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + if (isWeakRef(obj)) { + return weakCollectionOf('WeakRef'); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other + /* eslint-env browser */ + if (typeof window !== 'undefined' && obj === window) { + return '{ [object Window] }'; + } + if (obj === global) { + return '{ [object globalThis] }'; + } + if (!isDate(obj) && !isRegExp(obj)) { + var ys = arrObjKeys(obj, inspect); + var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? '' : 'null prototype'; + var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; + var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; + var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); + if (ys.length === 0) { return tag + '{}'; } + if (indent) { + return tag + '{' + indentedJoin(ys, indent) + '}'; + } + return tag + '{ ' + $join.call(ys, ', ') + ' }'; + } + return String(obj); +}; - // found charset - if (res) { - charset = res.pop(); +function wrapQuotes(s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; +} - // prevent decode issues when sites use incorrect encoding - // ref: https://hsivonen.fi/encoding-menu/ - if (charset === 'gb2312' || charset === 'gbk') { - charset = 'gb18030'; - } - } +function quote(s) { + return $replace.call(String(s), /"/g, '"'); +} - // turn raw buffers into a single utf-8 buffer - return convert(buffer, 'UTF-8', charset).toString(); +function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } + +// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives +function isSymbol(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === 'object' && obj instanceof Symbol; + } + if (typeof obj === 'symbol') { + return true; + } + if (!obj || typeof obj !== 'object' || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e) {} + return false; } -/** - * Detect a URLSearchParams object - * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143 - * - * @param Object obj Object to detect by type or brand - * @return String - */ -function isURLSearchParams(obj) { - // Duck-typing as a necessary condition. - if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') { - return false; - } +function isBigInt(obj) { + if (!obj || typeof obj !== 'object' || !bigIntValueOf) { + return false; + } + try { + bigIntValueOf.call(obj); + return true; + } catch (e) {} + return false; +} - // Brand-checking and more duck-typing as optional condition. - return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function'; +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has(obj, key) { + return hasOwn.call(obj, key); } -/** - * Check if `obj` is a W3C `Blob` object (which `File` inherits from) - * @param {*} obj - * @return {boolean} - */ -function isBlob(obj) { - return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]); +function toStr(obj) { + return objectToString.call(obj); } -/** - * Clone body given Res/Req instance - * - * @param Mixed instance Response or Request instance - * @return Mixed - */ -function clone(instance) { - let p1, p2; - let body = instance.body; +function nameOf(f) { + if (f.name) { return f.name; } + var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); + if (m) { return m[1]; } + return null; +} - // don't allow cloning a used body - if (instance.bodyUsed) { - throw new Error('cannot clone body after it is used'); - } +function indexOf(xs, x) { + if (xs.indexOf) { return xs.indexOf(x); } + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { return i; } + } + return -1; +} - // check that body is a stream and not form-data object - // note: we can't clone the form-data object without having it as a dependency - if (body instanceof Stream && typeof body.getBoundary !== 'function') { - // tee instance body - p1 = new PassThrough(); - p2 = new PassThrough(); - body.pipe(p1); - body.pipe(p2); - // set instance body to teed body and return the other teed body - instance[INTERNALS].body = p1; - body = p2; - } +function isMap(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} - return body; +function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + try { + weakMapHas.call(x, weakMapHas); + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; } -/** - * Performs the operation "extract a `Content-Type` value from |object|" as - * specified in the specification: - * https://fetch.spec.whatwg.org/#concept-bodyinit-extract - * - * This function assumes that instance.body is present. - * - * @param Mixed instance Any options.body input - */ -function extractContentType(body) { - if (body === null) { - // body is null - return null; - } else if (typeof body === 'string') { - // body is string - return 'text/plain;charset=UTF-8'; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - return 'application/x-www-form-urlencoded;charset=UTF-8'; - } else if (isBlob(body)) { - // body is blob - return body.type || null; - } else if (Buffer.isBuffer(body)) { - // body is buffer - return null; - } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - return null; - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - return null; - } else if (typeof body.getBoundary === 'function') { - // detect form data input from form-data module - return `multipart/form-data;boundary=${body.getBoundary()}`; - } else if (body instanceof Stream) { - // body is stream - // can't really do much about this - return null; - } else { - // Body constructor defaults other things to string - return 'text/plain;charset=UTF-8'; - } +function isWeakRef(x) { + if (!weakRefDeref || !x || typeof x !== 'object') { + return false; + } + try { + weakRefDeref.call(x); + return true; + } catch (e) {} + return false; } -/** - * The Fetch Standard treats this as if "total bytes" is a property on the body. - * For us, we have to explicitly get it with a function. - * - * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes - * - * @param Body instance Instance of Body - * @return Number? Number of bytes, or null if not possible - */ -function getTotalBytes(instance) { - const body = instance.body; +function isSet(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} +function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + try { + weakSetHas.call(x, weakSetHas); + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} - if (body === null) { - // body is null - return 0; - } else if (isBlob(body)) { - return body.size; - } else if (Buffer.isBuffer(body)) { - // body is buffer - return body.length; - } else if (body && typeof body.getLengthSync === 'function') { - // detect form data input from form-data module - if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x - body.hasKnownLength && body.hasKnownLength()) { - // 2.x - return body.getLengthSync(); - } - return null; - } else { - // body is stream - return null; - } +function isElement(x) { + if (!x || typeof x !== 'object') { return false; } + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; } -/** - * Write a Body to a Node.js WritableStream (e.g. http.Request) object. - * - * @param Body instance Instance of Body - * @return Void - */ -function writeToStream(dest, instance) { - const body = instance.body; +function inspectString(str, opts) { + if (str.length > opts.maxStringLength) { + var remaining = str.length - opts.maxStringLength; + var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); + return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; + } + // eslint-disable-next-line no-control-regex + var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} +function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', + 9: 't', + 10: 'n', + 12: 'f', + 13: 'r' + }[n]; + if (x) { return '\\' + x; } + return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); +} - if (body === null) { - // body is null - dest.end(); - } else if (isBlob(body)) { - body.stream().pipe(dest); - } else if (Buffer.isBuffer(body)) { - // body is buffer - dest.write(body); - dest.end(); - } else { - // body is stream - body.pipe(dest); - } +function markBoxed(str) { + return 'Object(' + str + ')'; } -// expose Promise -Body.Promise = global.Promise; +function weakCollectionOf(type) { + return type + ' { ? }'; +} -/** - * headers.js - * - * Headers class offers convenient helpers - */ +function collectionOf(type, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); + return type + ' (' + size + ') {' + joinedEntries + '}'; +} -const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; -const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; +function singleLineValues(xs) { + for (var i = 0; i < xs.length; i++) { + if (indexOf(xs[i], '\n') >= 0) { + return false; + } + } + return true; +} -function validateName(name) { - name = `${name}`; - if (invalidTokenRegex.test(name) || name === '') { - throw new TypeError(`${name} is not a legal HTTP header name`); - } +function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === '\t') { + baseIndent = '\t'; + } else if (typeof opts.indent === 'number' && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), ' '); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; } -function validateValue(value) { - value = `${value}`; - if (invalidHeaderCharRegex.test(value)) { - throw new TypeError(`${value} is not a legal HTTP header value`); - } +function indentedJoin(xs, indent) { + if (xs.length === 0) { return ''; } + var lineJoiner = '\n' + indent.prev + indent.base; + return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; } -/** - * Find the key in the map object given a header name. - * - * Returns undefined if not found. - * - * @param String name Header name - * @return String|Undefined - */ -function find(map, name) { - name = name.toLowerCase(); - for (const key in map) { - if (key.toLowerCase() === name) { - return key; - } - } - return undefined; +function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + var syms = typeof gOPS === 'function' ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k = 0; k < syms.length; k++) { + symMap['$' + syms[k]] = syms[k]; + } + } + + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { + // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section + continue; // eslint-disable-line no-restricted-syntax, no-continue + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + if (typeof gOPS === 'function') { + for (var j = 0; j < syms.length; j++) { + if (isEnumerable.call(obj, syms[j])) { + xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); + } + } + } + return xs; } -const MAP = Symbol('map'); -class Headers { - /** - * Headers class - * - * @param Object headers Response headers - * @return Void - */ - constructor() { - let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; - this[MAP] = Object.create(null); +/***/ }), - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); +/***/ 37265: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } +module.exports = __nccwpck_require__(73837).inspect; - return; - } - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } +/***/ }), - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } +/***/ 72657: +/***/ ((__unused_webpack_module, exports) => { - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } +"use strict"; +var __webpack_unused_export__; - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - return this[MAP][key].join(', '); - } +__webpack_unused_export__ = ({ + value: true +}); +exports.Z = void 0; - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; +function omit(obj, fields) { + // eslint-disable-next-line prefer-object-spread + var shallowCopy = Object.assign({}, obj); - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; + for (var i = 0; i < fields.length; i += 1) { + var key = fields[i]; + delete shallowCopy[key]; + } - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } + return shallowCopy; +} - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } +var _default = omit; +exports.Z = _default; - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } +/***/ }), - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } +/***/ 1223: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } +var wrappy = __nccwpck_require__(62940) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } +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 +} - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } +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 } -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); +/***/ }), -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; +/***/ 94568: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} +"use strict"; -const INTERNAL = Symbol('internal'); +const pTimeout = __nccwpck_require__(86424); -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 +const symbolAsyncIterator = Symbol.asyncIterator || '@@asyncIterator'; + +const normalizeEmitter = emitter => { + const addListener = emitter.on || emitter.addListener || emitter.addEventListener; + const removeListener = emitter.off || emitter.removeListener || emitter.removeEventListener; + + if (!addListener || !removeListener) { + throw new TypeError('Emitter is not compatible'); + } + + return { + addListener: addListener.bind(emitter), + removeListener: removeListener.bind(emitter) }; - return iterator; -} +}; -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } +const toArray = value => Array.isArray(value) ? value : [value]; - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; +const multiple = (emitter, event, options) => { + let cancel; + const ret = new Promise((resolve, reject) => { + options = { + rejectionEvents: ['error'], + multiArgs: false, + resolveImmediately: false, + ...options + }; - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; + if (!(options.count >= 0 && (options.count === Infinity || Number.isInteger(options.count)))) { + throw new TypeError('The `count` option should be at least 0 or more'); } - this[INTERNAL].index = index + 1; + // Allow multiple events + const events = toArray(event); - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); + const items = []; + const {addListener, removeListener} = normalizeEmitter(emitter); -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); + const onItem = (...args) => { + const value = options.multiArgs ? args : args[0]; -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); + if (options.filter && !options.filter(value)) { + return; + } - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } + items.push(value); - return obj; -} + if (options.count === items.length) { + cancel(); + resolve(items); + } + }; -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); + const rejectHandler = error => { + cancel(); + reject(error); + }; -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; + cancel = () => { + for (const event of events) { + removeListener(event, onItem); + } -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + for (const rejectionEvent of options.rejectionEvents) { + removeListener(rejectionEvent, rejectHandler); + } + }; - Body.call(this, body, opts); + for (const event of events) { + addListener(event, onItem); + } - const status = opts.status || 200; - const headers = new Headers(opts.headers); + for (const rejectionEvent of options.rejectionEvents) { + addListener(rejectionEvent, rejectHandler); + } - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } + if (options.resolveImmediately) { + resolve(items); } + }); - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } + ret.cancel = cancel; - get url() { - return this[INTERNALS$1].url || ''; + if (typeof options.timeout === 'number') { + const timeout = pTimeout(ret, options.timeout); + timeout.cancel = cancel; + return timeout; } - get status() { - return this[INTERNALS$1].status; - } + return ret; +}; - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; +const pEvent = (emitter, event, options) => { + if (typeof options === 'function') { + options = {filter: options}; } - get redirected() { - return this[INTERNALS$1].counter > 0; - } + options = { + ...options, + count: 1, + resolveImmediately: false + }; - get statusText() { - return this[INTERNALS$1].statusText; - } + const arrayPromise = multiple(emitter, event, options); + const promise = arrayPromise.then(array => array[0]); // eslint-disable-line promise/prefer-await-to-then + promise.cancel = arrayPromise.cancel; - get headers() { - return this[INTERNALS$1].headers; - } + return promise; +}; - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} +module.exports = pEvent; +// TODO: Remove this for the next major release +module.exports["default"] = pEvent; -Body.mixIn(Response.prototype); +module.exports.multiple = multiple; -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); +module.exports.iterator = (emitter, event, options) => { + if (typeof options === 'function') { + options = {filter: options}; + } -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); + // Allow multiple events + const events = toArray(event); -const INTERNALS$2 = Symbol('Request internals'); -const URL = Url.URL || whatwgUrl.URL; + options = { + rejectionEvents: ['error'], + resolutionEvents: [], + limit: Infinity, + multiArgs: false, + ...options + }; -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; + const {limit} = options; + const isValidLimit = limit >= 0 && (limit === Infinity || Number.isInteger(limit)); + if (!isValidLimit) { + throw new TypeError('The `limit` option should be a non-negative integer or Infinity'); + } -/** - * Wrapper around `new URL` to handle arbitrary URLs - * - * @param {string} urlStr - * @return {void} - */ -function parseURL(urlStr) { - /* - Check whether the URL is absolute or not - Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 - Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 - */ - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL(urlStr).toString(); + if (limit === 0) { + // Return an empty async iterator to avoid any further cost + return { + [Symbol.asyncIterator]() { + return this; + }, + async next() { + return { + done: true, + value: undefined + }; + } + }; } - // Fallback to old implementation for arbitrary URLs - return parse_url(urlStr); -} + const {addListener, removeListener} = normalizeEmitter(emitter); -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; + let isDone = false; + let error; + let hasPendingError = false; + const nextQueue = []; + const valueQueue = []; + let eventCount = 0; + let isLimitReached = false; -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} + const valueHandler = (...args) => { + eventCount++; + isLimitReached = eventCount === limit; -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} + const value = options.multiArgs ? args : args[0]; -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + if (nextQueue.length > 0) { + const {resolve} = nextQueue.shift(); - let parsedURL; + resolve({done: false, value}); - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parseURL(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parseURL(`${input}`); + if (isLimitReached) { + cancel(); } - input = {}; - } else { - parsedURL = parseURL(input.url); + + return; } - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); + valueQueue.push(value); - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); + if (isLimitReached) { + cancel(); } + }; - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; + const cancel = () => { + isDone = true; + for (const event of events) { + removeListener(event, valueHandler); + } - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); + for (const rejectionEvent of options.rejectionEvents) { + removeListener(rejectionEvent, rejectHandler); + } - const headers = new Headers(init.headers || input.headers || {}); + for (const resolutionEvent of options.resolutionEvents) { + removeListener(resolutionEvent, resolveHandler); + } - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } + while (nextQueue.length > 0) { + const {resolve} = nextQueue.shift(); + resolve({done: true, value: undefined}); } + }; - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; + const rejectHandler = (...args) => { + error = options.multiArgs ? args : args[0]; - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); + if (nextQueue.length > 0) { + const {reject} = nextQueue.shift(); + reject(error); + } else { + hasPendingError = true; } - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } + cancel(); + }; - get method() { - return this[INTERNALS$2].method; - } + const resolveHandler = (...args) => { + const value = options.multiArgs ? args : args[0]; - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } + if (options.filter && !options.filter(value)) { + return; + } - get headers() { - return this[INTERNALS$2].headers; - } + if (nextQueue.length > 0) { + const {resolve} = nextQueue.shift(); + resolve({done: true, value}); + } else { + valueQueue.push(value); + } - get redirect() { - return this[INTERNALS$2].redirect; - } + cancel(); + }; - get signal() { - return this[INTERNALS$2].signal; + for (const event of events) { + addListener(event, valueHandler); } - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); + for (const rejectionEvent of options.rejectionEvents) { + addListener(rejectionEvent, rejectHandler); } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); + for (const resolutionEvent of options.resolutionEvents) { + addListener(resolutionEvent, resolveHandler); } - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } + return { + [symbolAsyncIterator]() { + return this; + }, + async next() { + if (valueQueue.length > 0) { + const value = valueQueue.shift(); + return { + done: isDone && valueQueue.length === 0 && !isLimitReached, + value + }; + } - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } + if (hasPendingError) { + hasPendingError = false; + throw error; + } - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } + if (isDone) { + return { + done: true, + value: undefined + }; + } - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); + return new Promise((resolve, reject) => nextQueue.push({resolve, reject})); + }, + async return(value) { + cancel(); + return { + done: isDone, + value + }; } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } + }; +}; - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } +module.exports.TimeoutError = pTimeout.TimeoutError; - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } +/***/ }), - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } +/***/ 31330: +/***/ ((module) => { - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js +"use strict"; - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} +module.exports = (promise, onFinally) => { + onFinally = onFinally || (() => {}); -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ + return promise.then( + val => new Promise(resolve => { + resolve(onFinally()); + }).then(() => val), + err => new Promise(resolve => { + resolve(onFinally()); + }).then(() => { + throw err; + }) + ); +}; -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - this.type = 'aborted'; - this.message = message; +/***/ }), - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} +/***/ 91855: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; +"use strict"; -const URL$1 = Url.URL || whatwgUrl.URL; +const AggregateError = __nccwpck_require__(61231); -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; +module.exports = async ( + iterable, + mapper, + { + concurrency = Infinity, + stopOnError = true + } = {} +) => { + return new Promise((resolve, reject) => { + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } -const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { - const orig = new URL$1(original).hostname; - const dest = new URL$1(destination).hostname; + if (!(typeof concurrency === 'number' && concurrency >= 1)) { + throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${concurrency}\` (${typeof concurrency})`); + } - return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); -}; + const ret = []; + const errors = []; + const iterator = iterable[Symbol.iterator](); + let isRejected = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; -/** - * isSameProtocol reports whether the two provided URLs use the same protocol. - * - * Both domains must already be in canonical form. - * @param {string|URL} original - * @param {string|URL} destination - */ -const isSameProtocol = function isSameProtocol(destination, original) { - const orig = new URL$1(original).protocol; - const dest = new URL$1(destination).protocol; + const next = () => { + if (isRejected) { + return; + } - return orig === dest; -}; + const nextItem = iterator.next(); + const i = currentIndex; + currentIndex++; -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { + if (nextItem.done) { + isIterableDone = true; - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } + if (resolvingCount === 0) { + if (!stopOnError && errors.length !== 0) { + reject(new AggregateError(errors)); + } else { + resolve(ret); + } + } - Body.Promise = fetch.Promise; + return; + } - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); + resolvingCount++; - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; + (async () => { + try { + const element = await nextItem.value; + ret[i] = await mapper(element, i); + resolvingCount--; + next(); + } catch (error) { + if (stopOnError) { + isRejected = true; + reject(error); + } else { + errors.push(error); + resolvingCount--; + next(); + } + } + })(); + }; - let response = null; + for (let i = 0; i < concurrency; i++) { + next(); - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - destroyStream(request.body, error); + if (isIterableDone) { + break; } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; } + }); +}; - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - // send request - const req = send(options); - let reqTimeout; +/***/ }), - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } +/***/ 86424: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } +"use strict"; - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); +const pFinally = __nccwpck_require__(31330); - if (response && response.body) { - destroyStream(response.body, err); - } +class TimeoutError extends Error { + constructor(message) { + super(message); + this.name = 'TimeoutError'; + } +} - finalize(); - }); +const pTimeout = (promise, milliseconds, fallback) => new Promise((resolve, reject) => { + if (typeof milliseconds !== 'number' || milliseconds < 0) { + throw new TypeError('Expected `milliseconds` to be a positive number'); + } - fixResponseChunkedTransferBadEnding(req, function (err) { - if (signal && signal.aborted) { - return; - } + if (milliseconds === Infinity) { + resolve(promise); + return; + } - if (response && response.body) { - destroyStream(response.body, err); + const timer = setTimeout(() => { + if (typeof fallback === 'function') { + try { + resolve(fallback()); + } catch (error) { + reject(error); } - }); - - /* c8 ignore next 18 */ - if (parseInt(process.version.substring(1)) < 14) { - // Before Node.js 14, pipeline() does not fully support async iterators and does not always - // properly handle when the socket close/end events are out of order. - req.on('socket', function (s) { - s.addListener('close', function (hadError) { - // if a data listener is still present we didn't end cleanly - const hasDataListener = s.listenerCount('data') > 0; - // if end happened before close but the socket didn't emit an error, do it now - if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { - const err = new Error('Premature close'); - err.code = 'ERR_STREAM_PREMATURE_CLOSE'; - response.body.emit('error', err); - } - }); - }); + return; } - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request.url).toString(); - } catch (err) { - // error here can only be invalid URL in Location: header - // do not throw when options.redirect == manual - // let the user extract the errorneous redirect URL - if (request.redirect !== 'manual') { - reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); - finalize(); - return; - } - } + const message = typeof fallback === 'string' ? fallback : `Promise timed out after ${milliseconds} milliseconds`; + const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message); - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } + if (typeof promise.cancel === 'function') { + promise.cancel(); + } - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } + reject(timeoutError); + }, milliseconds); - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; + // TODO: Use native `finally` keyword when targeting Node.js 10 + pFinally( + // eslint-disable-next-line promise/prefer-await-to-then + promise.then(resolve, reject), + () => { + clearTimeout(timer); + } + ); +}); - if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { - for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { - requestOpts.headers.delete(name); - } - } +module.exports = pTimeout; +// TODO: Remove this for the next major release +module.exports["default"] = pTimeout; - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } +module.exports.TimeoutError = TimeoutError; - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } +/***/ }), - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); +/***/ 80746: +/***/ ((module) => { - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; +"use strict"; - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - // HTTP-network fetch step 12.1.1.4: handle content codings +const pTry = (fn, ...arguments_) => new Promise(resolve => { + resolve(fn(...arguments_)); +}); - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } +module.exports = pTry; +// TODO: remove this in the next major version +module.exports["default"] = pTry; - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } +/***/ }), - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - raw.on('end', function () { - // some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted. - if (!response) { - response = new Response(body, response_options); - resolve(response); - } - }); - return; - } +/***/ 80414: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } +"use strict"; - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); +const pTimeout = __nccwpck_require__(86424); - writeToStream(req, request); - }); -} -function fixResponseChunkedTransferBadEnding(request, errorCallback) { - let socket; +const pWaitFor = async (condition, options) => { + options = { + interval: 20, + timeout: Infinity, + leadingCheck: true, + ...options + }; - request.on('socket', function (s) { - socket = s; - }); + let retryTimeout; - request.on('response', function (response) { - const headers = response.headers; + const promise = new Promise((resolve, reject) => { + const check = async () => { + try { + const value = await condition(); - if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) { - response.once('close', function (hadError) { - // if a data listener is still present we didn't end cleanly - const hasDataListener = socket.listenerCount('data') > 0; + if (typeof value !== 'boolean') { + throw new TypeError('Expected condition to return a boolean'); + } - if (hasDataListener && !hadError) { - const err = new Error('Premature close'); - err.code = 'ERR_STREAM_PREMATURE_CLOSE'; - errorCallback(err); + if (value === true) { + resolve(); + } else { + retryTimeout = setTimeout(check, options.interval); } - }); + } catch (error) { + reject(error); + } + }; + + if (options.leadingCheck) { + check(); + } else { + retryTimeout = setTimeout(check, options.interval); } }); -} -function destroyStream(stream, err) { - if (stream.destroy) { - stream.destroy(err); - } else { - // node < 8 - stream.emit('error', err); - stream.end(); + if (options.timeout !== Infinity) { + try { + return await pTimeout(promise, options.timeout); + } catch (error) { + if (retryTimeout) { + clearTimeout(retryTimeout); + } + + throw error; + } } -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; + return promise; }; -// expose Promise -fetch.Promise = global.Promise; - -module.exports = exports = fetch; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports["default"] = exports; -exports.Headers = Headers; -exports.Request = Request; -exports.Response = Response; -exports.FetchError = FetchError; +module.exports = pWaitFor; +// TODO: Remove this for the next major release +module.exports["default"] = pWaitFor; /***/ }), -/***/ 46695: +/***/ 61950: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const parser = __nccwpck_require__(85026); +var Transform = (__nccwpck_require__(60262).Transform); +var inherits = __nccwpck_require__(44124); +var cyclist = __nccwpck_require__(73680); +var util = __nccwpck_require__(73837); -/** - * @param {Object} options - Options to configure parser - * @param {Object} options.parser - An object with a parse method that returns an AST - */ -module.exports = function(options = {}) { - this.parser = options.parser || parser; +var ParallelTransform = function(maxParallel, opts, ontransform) { + if (!(this instanceof ParallelTransform)) return new ParallelTransform(maxParallel, opts, ontransform); - if (options.parser) { - // We don't want to send that down to the actual parser - delete options.parser; - } + if (typeof maxParallel === 'function') { + ontransform = maxParallel; + opts = null; + maxParallel = 1; + } + if (typeof opts === 'function') { + ontransform = opts; + opts = null; + } - this.options = Object.assign({ - plugins: [ - 'jsx', - 'flow', - 'asyncGenerators', - 'classProperties', - 'doExpressions', - 'dynamicImport', - 'exportDefaultFrom', - 'exportNamespaceFrom', - 'functionBind', - 'functionSent', - 'nullishCoalescingOperator', - 'objectRestSpread', - [ - 'decorators', { - decoratorsBeforeExport: true - } - ], - 'optionalChaining' - ], - allowHashBang: true, - sourceType: 'module' - }, options); - - // We use global state to stop the recursive traversal of the AST - this.shouldStop = false; -}; - -/** - * @param {String} src - * @param {Object} [options] - Parser options - * @return {Object} The AST of the given src - */ -module.exports.prototype.parse = function(src, options) { - options = options || this.options; + if (!opts) opts = {}; + if (!opts.highWaterMark) opts.highWaterMark = Math.max(maxParallel, 16); + if (opts.objectMode !== false) opts.objectMode = true; - // Keep around for consumers of parse that supply their own options - if (typeof options.allowHashBang === 'undefined') { - options.allowHashBang = true; - } + Transform.call(this, opts); - return this.parser.parse(src, options); + this._maxParallel = maxParallel; + this._ontransform = ontransform; + this._destroyed = false; + this._flushed = false; + this._ordered = opts.ordered !== false; + this._buffer = this._ordered ? cyclist(maxParallel) : []; + this._top = 0; + this._bottom = 0; + this._ondrain = null; }; -/** - * Adapted from substack/node-detective - * Executes cb on a non-array AST node - */ -module.exports.prototype.traverse = function(node, cb) { - if (this.shouldStop) return; - - if (Array.isArray(node)) { - for (const key of node) { - if (key !== null) { - // Mark that the node has been visited - key.parent = node; - this.traverse(key, cb); - } - } - } else if (node && typeof node === 'object') { - cb(node); - - // TODO switch to Object.entries - for (const key of Object.keys(node)) { - // Avoid visited nodes - if (key === 'parent' || !node[key]) continue; +inherits(ParallelTransform, Transform); - node[key].parent = node; - this.traverse(node[key], cb); - } - } +ParallelTransform.prototype.destroy = function() { + if (this._destroyed) return; + this._destroyed = true; + this.emit('close'); }; -/** - * Executes the passed callback for every traversed node of - * the passed in src's ast - * - * @param {String|Object} src - The source code or AST to traverse - * @param {Function} cb - Called for every node - */ -module.exports.prototype.walk = function(src, cb) { - this.shouldStop = false; +ParallelTransform.prototype._transform = function(chunk, enc, callback) { + var self = this; + var pos = this._top++; - const ast = typeof src === 'object' ? src : this.parse(src); + this._ontransform(chunk, function(err, data) { + if (self._destroyed) return; + if (err) { + self.emit('error', err); + self.push(null); + self.destroy(); + return; + } + if (self._ordered) { + self._buffer.put(pos, (data === undefined || data === null) ? null : data); + } + else { + self._buffer.push(data); + } + self._drain(); + }); - this.traverse(ast, cb); + if (this._top - this._bottom < this._maxParallel) return callback(); + this._ondrain = callback; }; -module.exports.prototype.moonwalk = function(node, cb) { - this.shouldStop = false; - - if (typeof node !== 'object') { - throw new Error('node must be an object'); - } - - reverseTraverse.call(this, node, cb); +ParallelTransform.prototype._flush = function(callback) { + this._flushed = true; + this._ondrain = callback; + this._drain(); }; -function reverseTraverse(node, cb) { - if (this.shouldStop || !node.parent) return; +ParallelTransform.prototype._drain = function() { + if (this._ordered) { + while (this._buffer.get(this._bottom) !== undefined) { + var data = this._buffer.del(this._bottom++); + if (data === null) continue; + this.push(data); + } + } + else { + while (this._buffer.length > 0) { + var data = this._buffer.pop(); + this._bottom++; + if (data === null) continue; + this.push(data); + } + } - if (Array.isArray(node.parent)) { - for (const parent of node.parent) { - cb(parent); - } - } else { - cb(node.parent); - } - reverseTraverse.call(this, node.parent, cb); -} + if (!this._drained() || !this._ondrain) return; -/** - * Halts further traversal of the AST - */ -module.exports.prototype.stopWalking = function() { - this.shouldStop = true; + var ondrain = this._ondrain; + this._ondrain = null; + ondrain(); }; +ParallelTransform.prototype._drained = function() { + var diff = this._top - this._bottom; + return this._flushed ? !diff : diff < this._maxParallel; +}; -/***/ }), +module.exports = ParallelTransform; -/***/ 55388: -/***/ ((module) => { -/*! - * normalize-path - * - * Copyright (c) 2014-2018, Jon Schlinkert. - * Released under the MIT License. - */ +/***/ }), -module.exports = function(path, stripTrailing) { - if (typeof path !== 'string') { - throw new TypeError('expected path to be a string'); - } +/***/ 2888: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (path === '\\' || path === '/') return '/'; +"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 len = path.length; - if (len <= 1) return path; +// 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. - // ensure that win32 namespaces has two leading slashes, so that the path is - // handled properly by the win32 version of path.parse() after being normalized - // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces - var prefix = ''; - if (len > 4 && path[3] === '\\') { - var ch = path[2]; - if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { - path = path.slice(2); - prefix = '//'; - } - } - var segs = path.split(/[/\\]+/); - if (stripTrailing !== false && segs[segs.length - 1] === '') { - segs.pop(); - } - return prefix + segs.join('/'); -}; +/**/ -/***/ }), +var pna = __nccwpck_require__(47810); +/**/ -/***/ 13262: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ -// pass in a manifest with a 'bin' field here, and it'll turn it -// into a properly santized bin object -const {join, basename} = __nccwpck_require__(71017) +module.exports = Duplex; -const normalize = pkg => - !pkg.bin ? removeBin(pkg) - : typeof pkg.bin === 'string' ? normalizeString(pkg) - : Array.isArray(pkg.bin) ? normalizeArray(pkg) - : typeof pkg.bin === 'object' ? normalizeObject(pkg) - : removeBin(pkg) +/**/ +var util = Object.create(__nccwpck_require__(95898)); +util.inherits = __nccwpck_require__(44124); +/**/ -const normalizeString = pkg => { - if (!pkg.name) - return removeBin(pkg) - pkg.bin = { [pkg.name]: pkg.bin } - return normalizeObject(pkg) -} +var Readable = __nccwpck_require__(36964); +var Writable = __nccwpck_require__(62566); -const normalizeArray = pkg => { - pkg.bin = pkg.bin.reduce((acc, k) => { - acc[basename(k)] = k - return acc - }, {}) - return normalizeObject(pkg) -} +util.inherits(Duplex, Readable); -const removeBin = pkg => { - delete pkg.bin - return pkg +{ + // avoid scope creep, the keys array can then be collected + 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]; + } } -const normalizeObject = pkg => { - const orig = pkg.bin - const clean = {} - let hasBins = false - Object.keys(orig).forEach(binKey => { - const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).substr(1) - - if (typeof orig[binKey] !== 'string' || !base) - return +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); - const binTarget = join('/', orig[binKey]) - .replace(/\\/g, '/').substr(1) + Readable.call(this, options); + Writable.call(this, options); - if (!binTarget) - return + if (options && options.readable === false) this.readable = false; - clean[base] = binTarget - hasBins = true - }) + if (options && options.writable === false) this.writable = false; - if (hasBins) - pkg.bin = clean - else - delete pkg.bin + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - return pkg + this.once('end', onend); } -module.exports = normalize - - -/***/ }), +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 () { + return this._writableState.highWaterMark; + } +}); -/***/ 20504: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; -var hasMap = typeof Map === 'function' && Map.prototype; -var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; -var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; -var mapForEach = hasMap && Map.prototype.forEach; -var hasSet = typeof Set === 'function' && Set.prototype; -var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; -var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; -var setForEach = hasSet && Set.prototype.forEach; -var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; -var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; -var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; -var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; -var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; -var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; -var booleanValueOf = Boolean.prototype.valueOf; -var objectToString = Object.prototype.toString; -var functionToString = Function.prototype.toString; -var $match = String.prototype.match; -var $slice = String.prototype.slice; -var $replace = String.prototype.replace; -var $toUpperCase = String.prototype.toUpperCase; -var $toLowerCase = String.prototype.toLowerCase; -var $test = RegExp.prototype.test; -var $concat = Array.prototype.concat; -var $join = Array.prototype.join; -var $arrSlice = Array.prototype.slice; -var $floor = Math.floor; -var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; -var gOPS = Object.getOwnPropertySymbols; -var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; -var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; -// ie, `has-tostringtag/shams -var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') - ? Symbol.toStringTag - : null; -var isEnumerable = Object.prototype.propertyIsEnumerable; + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} -var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( - [].__proto__ === Array.prototype // eslint-disable-line no-proto - ? function (O) { - return O.__proto__; // eslint-disable-line no-proto - } - : null -); +function onEndNT(self) { + self.end(); +} -function addNumericSeparator(num, str) { - if ( - num === Infinity - || num === -Infinity - || num !== num - || (num && num > -1000 && num < 1000) - || $test.call(/e/, str) - ) { - return str; +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; } - var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; - if (typeof num === 'number') { - var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) - if (int !== num) { - var intStr = String(int); - var dec = $slice.call(str, intStr.length + 1); - return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); - } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; } - return $replace.call(str, sepRegex, '$&_'); -} -var utilInspect = __nccwpck_require__(37265); -var inspectCustom = utilInspect.custom; -var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); -module.exports = function inspect_(obj, options, depth, seen) { - var opts = options || {}; +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); - if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { - throw new TypeError('option "quoteStyle" must be "single" or "double"'); - } - if ( - has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' - ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity - : opts.maxStringLength !== null - ) - ) { - throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); - } - var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; - if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { - throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); - } + pna.nextTick(cb, err); +}; - if ( - has(opts, 'indent') - && opts.indent !== null - && opts.indent !== '\t' - && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) - ) { - throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); - } - if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { - throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); - } - var numericSeparator = opts.numericSeparator; +/***/ }), - if (typeof obj === 'undefined') { - return 'undefined'; - } - if (obj === null) { - return 'null'; - } - if (typeof obj === 'boolean') { - return obj ? 'true' : 'false'; - } +/***/ 46040: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (typeof obj === 'string') { - return inspectString(obj, opts); - } - if (typeof obj === 'number') { - if (obj === 0) { - return Infinity / obj > 0 ? '0' : '-0'; - } - var str = String(obj); - return numericSeparator ? addNumericSeparator(obj, str) : str; - } - if (typeof obj === 'bigint') { - var bigIntStr = String(obj) + 'n'; - return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; - } +"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 maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; - if (typeof depth === 'undefined') { depth = 0; } - if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { - return isArray(obj) ? '[Array]' : '[Object]'; - } +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. - var indent = getIndent(opts, depth); - if (typeof seen === 'undefined') { - seen = []; - } else if (indexOf(seen, obj) >= 0) { - return '[Circular]'; - } - function inspect(value, from, noIndent) { - if (from) { - seen = $arrSlice.call(seen); - seen.push(from); - } - if (noIndent) { - var newOpts = { - depth: opts.depth - }; - if (has(opts, 'quoteStyle')) { - newOpts.quoteStyle = opts.quoteStyle; - } - return inspect_(value, newOpts, depth + 1, seen); - } - return inspect_(value, opts, depth + 1, seen); - } +module.exports = PassThrough; - if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable - var name = nameOf(obj); - var keys = arrObjKeys(obj, inspect); - return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); - } - if (isSymbol(obj)) { - var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); - return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; - } - if (isElement(obj)) { - var s = '<' + $toLowerCase.call(String(obj.nodeName)); - var attrs = obj.attributes || []; - for (var i = 0; i < attrs.length; i++) { - s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); - } - s += '>'; - if (obj.childNodes && obj.childNodes.length) { s += '...'; } - s += ''; - return s; - } - if (isArray(obj)) { - if (obj.length === 0) { return '[]'; } - var xs = arrObjKeys(obj, inspect); - if (indent && !singleLineValues(xs)) { - return '[' + indentedJoin(xs, indent) + ']'; - } - return '[ ' + $join.call(xs, ', ') + ' ]'; - } - if (isError(obj)) { - var parts = arrObjKeys(obj, inspect); - if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { - return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; - } - if (parts.length === 0) { return '[' + String(obj) + ']'; } - return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; - } - if (typeof obj === 'object' && customInspect) { - if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { - return utilInspect(obj, { depth: maxDepth - depth }); - } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { - return obj.inspect(); - } - } - if (isMap(obj)) { - var mapParts = []; - if (mapForEach) { - mapForEach.call(obj, function (value, key) { - mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); - }); - } - return collectionOf('Map', mapSize.call(obj), mapParts, indent); - } - if (isSet(obj)) { - var setParts = []; - if (setForEach) { - setForEach.call(obj, function (value) { - setParts.push(inspect(value, obj)); - }); - } - return collectionOf('Set', setSize.call(obj), setParts, indent); - } - if (isWeakMap(obj)) { - return weakCollectionOf('WeakMap'); - } - if (isWeakSet(obj)) { - return weakCollectionOf('WeakSet'); - } - if (isWeakRef(obj)) { - return weakCollectionOf('WeakRef'); - } - if (isNumber(obj)) { - return markBoxed(inspect(Number(obj))); - } - if (isBigInt(obj)) { - return markBoxed(inspect(bigIntValueOf.call(obj))); - } - if (isBoolean(obj)) { - return markBoxed(booleanValueOf.call(obj)); - } - if (isString(obj)) { - return markBoxed(inspect(String(obj))); - } - if (!isDate(obj) && !isRegExp(obj)) { - var ys = arrObjKeys(obj, inspect); - var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; - var protoTag = obj instanceof Object ? '' : 'null prototype'; - var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; - var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; - var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); - if (ys.length === 0) { return tag + '{}'; } - if (indent) { - return tag + '{' + indentedJoin(ys, indent) + '}'; - } - return tag + '{ ' + $join.call(ys, ', ') + ' }'; - } - return String(obj); -}; +var Transform = __nccwpck_require__(35272); -function wrapQuotes(s, defaultStyle, opts) { - var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; - return quoteChar + s + quoteChar; -} +/**/ +var util = Object.create(__nccwpck_require__(95898)); +util.inherits = __nccwpck_require__(44124); +/**/ -function quote(s) { - return $replace.call(String(s), /"/g, '"'); -} +util.inherits(PassThrough, Transform); -function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); -// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives -function isSymbol(obj) { - if (hasShammedSymbols) { - return obj && typeof obj === 'object' && obj instanceof Symbol; - } - if (typeof obj === 'symbol') { - return true; - } - if (!obj || typeof obj !== 'object' || !symToString) { - return false; - } - try { - symToString.call(obj); - return true; - } catch (e) {} - return false; + Transform.call(this, options); } -function isBigInt(obj) { - if (!obj || typeof obj !== 'object' || !bigIntValueOf) { - return false; - } - try { - bigIntValueOf.call(obj); - return true; - } catch (e) {} - return false; -} +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; -var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; -function has(obj, key) { - return hasOwn.call(obj, key); -} +/***/ }), -function toStr(obj) { - return objectToString.call(obj); -} +/***/ 36964: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function nameOf(f) { - if (f.name) { return f.name; } - var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); - if (m) { return m[1]; } - return null; -} +"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. -function indexOf(xs, x) { - if (xs.indexOf) { return xs.indexOf(x); } - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) { return i; } - } - return -1; -} -function isMap(x) { - if (!mapSize || !x || typeof x !== 'object') { - return false; - } - try { - mapSize.call(x); - try { - setSize.call(x); - } catch (s) { - return true; - } - return x instanceof Map; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} -function isWeakMap(x) { - if (!weakMapHas || !x || typeof x !== 'object') { - return false; - } - try { - weakMapHas.call(x, weakMapHas); - try { - weakSetHas.call(x, weakSetHas); - } catch (s) { - return true; - } - return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} +/**/ -function isWeakRef(x) { - if (!weakRefDeref || !x || typeof x !== 'object') { - return false; - } - try { - weakRefDeref.call(x); - return true; - } catch (e) {} - return false; -} +var pna = __nccwpck_require__(47810); +/**/ -function isSet(x) { - if (!setSize || !x || typeof x !== 'object') { - return false; - } - try { - setSize.call(x); - try { - mapSize.call(x); - } catch (m) { - return true; - } - return x instanceof Set; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} +module.exports = Readable; -function isWeakSet(x) { - if (!weakSetHas || !x || typeof x !== 'object') { - return false; - } - try { - weakSetHas.call(x, weakSetHas); - try { - weakMapHas.call(x, weakMapHas); - } catch (s) { - return true; - } - return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} +/**/ +var isArray = __nccwpck_require__(20893); +/**/ -function isElement(x) { - if (!x || typeof x !== 'object') { return false; } - if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { - return true; - } - return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; -} +/**/ +var Duplex; +/**/ -function inspectString(str, opts) { - if (str.length > opts.maxStringLength) { - var remaining = str.length - opts.maxStringLength; - var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); - return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; - } - // eslint-disable-next-line no-control-regex - var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte); - return wrapQuotes(s, 'single', opts); -} +Readable.ReadableState = ReadableState; -function lowbyte(c) { - var n = c.charCodeAt(0); - var x = { - 8: 'b', - 9: 't', - 10: 'n', - 12: 'f', - 13: 'r' - }[n]; - if (x) { return '\\' + x; } - return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); -} +/**/ +var EE = (__nccwpck_require__(82361).EventEmitter); -function markBoxed(str) { - return 'Object(' + str + ')'; -} +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ -function weakCollectionOf(type) { - return type + ' { ? }'; -} +/**/ +var Stream = __nccwpck_require__(48827); +/**/ -function collectionOf(type, size, entries, indent) { - var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); - return type + ' (' + size + ') {' + joinedEntries + '}'; -} +/**/ -function singleLineValues(xs) { - for (var i = 0; i < xs.length; i++) { - if (indexOf(xs[i], '\n') >= 0) { - return false; - } - } - return true; +var Buffer = (__nccwpck_require__(56028).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 getIndent(opts, depth) { - var baseIndent; - if (opts.indent === '\t') { - baseIndent = '\t'; - } else if (typeof opts.indent === 'number' && opts.indent > 0) { - baseIndent = $join.call(Array(opts.indent + 1), ' '); - } else { - return null; - } - return { - base: baseIndent, - prev: $join.call(Array(depth + 1), baseIndent) - }; +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } -function indentedJoin(xs, indent) { - if (xs.length === 0) { return ''; } - var lineJoiner = '\n' + indent.prev + indent.base; - return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; -} +/**/ -function arrObjKeys(obj, inspect) { - var isArr = isArray(obj); - var xs = []; - if (isArr) { - xs.length = obj.length; - for (var i = 0; i < obj.length; i++) { - xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; - } - } - var syms = typeof gOPS === 'function' ? gOPS(obj) : []; - var symMap; - if (hasShammedSymbols) { - symMap = {}; - for (var k = 0; k < syms.length; k++) { - symMap['$' + syms[k]] = syms[k]; - } - } +/**/ +var util = Object.create(__nccwpck_require__(95898)); +util.inherits = __nccwpck_require__(44124); +/**/ - for (var key in obj) { // eslint-disable-line no-restricted-syntax - if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { - // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section - continue; // eslint-disable-line no-restricted-syntax, no-continue - } else if ($test.call(/[^\w$]/, key)) { - xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); - } else { - xs.push(key + ': ' + inspect(obj[key], obj)); - } - } - if (typeof gOPS === 'function') { - for (var j = 0; j < syms.length; j++) { - if (isEnumerable.call(obj, syms[j])) { - xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); - } - } - } - return xs; +/**/ +var debugUtil = __nccwpck_require__(73837); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; } +/**/ +var BufferList = __nccwpck_require__(88120); +var destroyImpl = __nccwpck_require__(59989); +var StringDecoder; -/***/ }), - -/***/ 37265: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = __nccwpck_require__(73837).inspect; +util.inherits(Readable, Stream); +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); -/***/ 72657: -/***/ ((__unused_webpack_module, exports) => { + // 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 (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} -"use strict"; -var __webpack_unused_export__; +function ReadableState(options, stream) { + Duplex = Duplex || __nccwpck_require__(2888); + options = options || {}; -__webpack_unused_export__ = ({ - value: true -}); -exports.Z = void 0; + // 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. + var isDuplex = stream instanceof Duplex; -function omit(obj, fields) { - // eslint-disable-next-line prefer-object-spread - var shallowCopy = Object.assign({}, obj); + // 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; - for (var i = 0; i < fields.length; i += 1) { - var key = fields[i]; - delete shallowCopy[key]; - } + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - return shallowCopy; -} + // 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" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; -var _default = omit; -exports.Z = _default; + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; -/***/ }), + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); -/***/ 1223: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // 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; -var wrappy = __nccwpck_require__(62940) -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) + // 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; -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 -} + // 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; + // 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'; -/***/ 94568: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; -"use strict"; + // if true, a maybeReadMore has been scheduled + this.readingMore = false; -const pTimeout = __nccwpck_require__(86424); + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = (__nccwpck_require__(26107)/* .StringDecoder */ .s); + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} -const symbolAsyncIterator = Symbol.asyncIterator || '@@asyncIterator'; +function Readable(options) { + Duplex = Duplex || __nccwpck_require__(2888); -const normalizeEmitter = emitter => { - const addListener = emitter.on || emitter.addListener || emitter.addEventListener; - const removeListener = emitter.off || emitter.removeListener || emitter.removeEventListener; + if (!(this instanceof Readable)) return new Readable(options); - if (!addListener || !removeListener) { - throw new TypeError('Emitter is not compatible'); - } + this._readableState = new ReadableState(options, this); - return { - addListener: addListener.bind(emitter), - removeListener: removeListener.bind(emitter) - }; -}; + // legacy + this.readable = true; -const toArray = value => Array.isArray(value) ? value : [value]; + if (options) { + if (typeof options.read === 'function') this._read = options.read; -const multiple = (emitter, event, options) => { - let cancel; - const ret = new Promise((resolve, reject) => { - options = { - rejectionEvents: ['error'], - multiArgs: false, - resolveImmediately: false, - ...options - }; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } - if (!(options.count >= 0 && (options.count === Infinity || Number.isInteger(options.count)))) { - throw new TypeError('The `count` option should be at least 0 or more'); - } + Stream.call(this); +} - // Allow multiple events - const events = toArray(event); +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } - const items = []; - const {addListener, removeListener} = normalizeEmitter(emitter); + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); - const onItem = (...args) => { - const value = options.multiArgs ? args : args[0]; +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; - if (options.filter && !options.filter(value)) { - return; - } +// 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; - items.push(value); + 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; + } - if (options.count === items.length) { - cancel(); - resolve(items); - } - }; + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; - const rejectHandler = error => { - cancel(); - reject(error); - }; +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; - cancel = () => { - for (const event of events) { - removeListener(event, onItem); - } +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } - for (const rejectionEvent of options.rejectionEvents) { - removeListener(rejectionEvent, rejectHandler); - } - }; + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } 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; + } + } - for (const event of events) { - addListener(event, onItem); - } + return needMoreData(state); +} - for (const rejectionEvent of options.rejectionEvents) { - addListener(rejectionEvent, rejectHandler); - } +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - if (options.resolveImmediately) { - resolve(items); - } - }); + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} - ret.cancel = cancel; +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} - if (typeof options.timeout === 'number') { - const timeout = pTimeout(ret, options.timeout); - timeout.cancel = cancel; - return timeout; - } +// if it's past the high water mark, we can push in some more. +// 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. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} - return ret; +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; }; -const pEvent = (emitter, event, options) => { - if (typeof options === 'function') { - options = {filter: options}; - } - - options = { - ...options, - count: 1, - resolveImmediately: false - }; - - const arrayPromise = multiple(emitter, event, options); - const promise = arrayPromise.then(array => array[0]); // eslint-disable-line promise/prefer-await-to-then - promise.cancel = arrayPromise.cancel; - - return promise; +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = (__nccwpck_require__(26107)/* .StringDecoder */ .s); + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; }; -module.exports = pEvent; -// TODO: Remove this for the next major release -module.exports["default"] = pEvent; +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + 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; +} -module.exports.multiple = multiple; +// 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; +} -module.exports.iterator = (emitter, event, options) => { - if (typeof options === 'function') { - options = {filter: options}; - } +// 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; - // Allow multiple events - const events = toArray(event); + if (n !== 0) state.emittedReadable = false; - options = { - rejectionEvents: ['error'], - resolutionEvents: [], - limit: Infinity, - multiArgs: false, - ...options - }; + // 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.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } - const {limit} = options; - const isValidLimit = limit >= 0 && (limit === Infinity || Number.isInteger(limit)); - if (!isValidLimit) { - throw new TypeError('The `limit` option should be a non-negative integer or Infinity'); - } + n = howMuchToRead(n, state); - if (limit === 0) { - // Return an empty async iterator to avoid any further cost - return { - [Symbol.asyncIterator]() { - return this; - }, - async next() { - return { - done: true, - value: undefined - }; - } - }; - } + // 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; + } - const {addListener, removeListener} = normalizeEmitter(emitter); + // 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. - let isDone = false; - let error; - let hasPendingError = false; - const nextQueue = []; - const valueQueue = []; - let eventCount = 0; - let isLimitReached = false; + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); - const valueHandler = (...args) => { - eventCount++; - isLimitReached = eventCount === limit; + // 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); + } - const value = options.multiArgs ? args : args[0]; + // 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); + } - if (nextQueue.length > 0) { - const {resolve} = nextQueue.shift(); + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; - resolve({done: false, value}); + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } - if (isLimitReached) { - cancel(); - } + 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; - return; - } + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } - valueQueue.push(value); + if (ret !== null) this.emit('data', ret); - if (isLimitReached) { - cancel(); - } - }; + return ret; +}; - const cancel = () => { - isDone = true; - for (const event of events) { - removeListener(event, valueHandler); - } +function onEofChunk(stream, state) { + 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; - for (const rejectionEvent of options.rejectionEvents) { - removeListener(rejectionEvent, rejectHandler); - } + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} - for (const resolutionEvent of options.resolutionEvents) { - removeListener(resolutionEvent, resolveHandler); - } +// 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; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} - while (nextQueue.length > 0) { - const {resolve} = nextQueue.shift(); - resolve({done: true, value: undefined}); - } - }; +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} - const rejectHandler = (...args) => { - error = options.multiArgs ? args : args[0]; +// 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; + pna.nextTick(maybeReadMore_, stream, state); + } +} - if (nextQueue.length > 0) { - const {reject} = nextQueue.shift(); - reject(error); - } else { - hasPendingError = true; - } +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} - cancel(); - }; +// 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) { + this.emit('error', new Error('_read() is not implemented')); +}; - const resolveHandler = (...args) => { - const value = options.multiArgs ? args : args[0]; +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; - if (options.filter && !options.filter(value)) { - return; - } + 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); - if (nextQueue.length > 0) { - const {resolve} = nextQueue.shift(); - resolve({done: true, value}); - } else { - valueQueue.push(value); - } + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - cancel(); - }; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - for (const event of events) { - addListener(event, valueHandler); - } + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } - for (const rejectionEvent of options.rejectionEvents) { - addListener(rejectionEvent, rejectHandler); - } + function onend() { + debug('onend'); + dest.end(); + } - for (const resolutionEvent of options.resolutionEvents) { - addListener(resolutionEvent, resolveHandler); - } + // 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); - return { - [symbolAsyncIterator]() { - return this; - }, - async next() { - if (valueQueue.length > 0) { - const value = valueQueue.shift(); - return { - done: isDone && valueQueue.length === 0 && !isLimitReached, - value - }; - } + 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); - if (hasPendingError) { - hasPendingError = false; - throw error; - } + cleanedUp = true; - if (isDone) { - return { - done: true, - value: undefined - }; - } + // 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(); + } - return new Promise((resolve, reject) => nextQueue.push({resolve, reject})); - }, - async return(value) { - cancel(); - return { - done: isDone, - value - }; - } - }; -}; + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // 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++; + increasedAwaitDrain = true; + } + src.pause(); + } + } -module.exports.TimeoutError = pTimeout.TimeoutError; + // 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) dest.emit('error', 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); -/***/ 31330: -/***/ ((module) => { + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } -"use strict"; + // tell the dest that it's being piped to + dest.emit('pipe', src); -module.exports = (promise, onFinally) => { - onFinally = onFinally || (() => {}); + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } - return promise.then( - val => new Promise(resolve => { - resolve(onFinally()); - }).then(() => val), - err => new Promise(resolve => { - resolve(onFinally()); - }).then(() => { - throw err; - }) - ); + return dest; }; +function pipeOnDrain(src) { + return function () { + 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); + } + }; +} -/***/ }), - -/***/ 91855: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const AggregateError = __nccwpck_require__(61231); - -module.exports = async ( - iterable, - mapper, - { - concurrency = Infinity, - stopOnError = true - } = {} -) => { - return new Promise((resolve, reject) => { - if (typeof mapper !== 'function') { - throw new TypeError('Mapper function is required'); - } +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; - if (!(typeof concurrency === 'number' && concurrency >= 1)) { - throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${concurrency}\` (${typeof concurrency})`); - } + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; - const ret = []; - const errors = []; - const iterator = iterable[Symbol.iterator](); - let isRejected = false; - let isIterableDone = false; - let resolvingCount = 0; - let currentIndex = 0; + // 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; - const next = () => { - if (isRejected) { - return; - } + if (!dest) dest = state.pipes; - const nextItem = iterator.next(); - const i = currentIndex; - currentIndex++; + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } - if (nextItem.done) { - isIterableDone = true; + // slow case. multiple pipe destinations. - if (resolvingCount === 0) { - if (!stopOnError && errors.length !== 0) { - reject(new AggregateError(errors)); - } else { - resolve(ret); - } - } + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; - return; - } + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, { hasUnpiped: false }); + }return this; + } - resolvingCount++; + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; - (async () => { - try { - const element = await nextItem.value; - ret[i] = await mapper(element, i); - resolvingCount--; - next(); - } catch (error) { - if (stopOnError) { - isRejected = true; - reject(error); - } else { - errors.push(error); - resolvingCount--; - next(); - } - } - })(); - }; + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; - for (let i = 0; i < concurrency; i++) { - next(); + dest.emit('unpipe', this, unpipeInfo); - if (isIterableDone) { - break; - } - } - }); + 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); -/***/ }), - -/***/ 86424: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } -"use strict"; + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} -const pFinally = __nccwpck_require__(31330); +// 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'); + state.flowing = true; + resume(this, state); + } + return this; +}; -class TimeoutError extends Error { - constructor(message) { - super(message); - this.name = 'TimeoutError'; - } +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } } -const pTimeout = (promise, milliseconds, fallback) => new Promise((resolve, reject) => { - if (typeof milliseconds !== 'number' || milliseconds < 0) { - throw new TypeError('Expected `milliseconds` to be a positive number'); - } +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } - if (milliseconds === Infinity) { - resolve(promise); - return; - } + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} - const timer = setTimeout(() => { - if (typeof fallback === 'function') { - try { - resolve(fallback()); - } catch (error) { - reject(error); - } +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; - return; - } +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} - const message = typeof fallback === 'string' ? fallback : `Promise timed out after ${milliseconds} milliseconds`; - const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message); +// 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; - if (typeof promise.cancel === 'function') { - promise.cancel(); - } + var state = this._readableState; + var paused = false; - reject(timeoutError); - }, milliseconds); + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } - // TODO: Use native `finally` keyword when targeting Node.js 10 - pFinally( - // eslint-disable-next-line promise/prefer-await-to-then - promise.then(resolve, reject), - () => { - clearTimeout(timer); - } - ); -}); + _this.push(null); + }); -module.exports = pTimeout; -// TODO: Remove this for the next major release -module.exports["default"] = pTimeout; + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); -module.exports.TimeoutError = TimeoutError; + // 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 (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } -/***/ 80746: -/***/ ((module) => { + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } -"use strict"; - - -const pTry = (fn, ...arguments_) => new Promise(resolve => { - resolve(fn(...arguments_)); -}); - -module.exports = pTry; -// TODO: remove this in the next major version -module.exports["default"] = pTry; - - -/***/ }), - -/***/ 80414: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const pTimeout = __nccwpck_require__(86424); - -const pWaitFor = async (condition, options) => { - options = { - interval: 20, - timeout: Infinity, - leadingCheck: true, - ...options - }; - - let retryTimeout; - - const promise = new Promise((resolve, reject) => { - const check = async () => { - try { - const value = await condition(); - - if (typeof value !== 'boolean') { - throw new TypeError('Expected condition to return a boolean'); - } - - if (value === true) { - resolve(); - } else { - retryTimeout = setTimeout(check, options.interval); - } - } catch (error) { - reject(error); - } - }; - - if (options.leadingCheck) { - check(); - } else { - retryTimeout = setTimeout(check, options.interval); - } - }); - - if (options.timeout !== Infinity) { - try { - return await pTimeout(promise, options.timeout); - } catch (error) { - if (retryTimeout) { - clearTimeout(retryTimeout); - } - - throw error; - } - } - - return promise; -}; - -module.exports = pWaitFor; -// TODO: Remove this for the next major release -module.exports["default"] = pWaitFor; - - -/***/ }), - -/***/ 61950: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var Transform = (__nccwpck_require__(60262).Transform); -var inherits = __nccwpck_require__(44124); -var cyclist = __nccwpck_require__(73680); -var util = __nccwpck_require__(73837); - -var ParallelTransform = function(maxParallel, opts, ontransform) { - if (!(this instanceof ParallelTransform)) return new ParallelTransform(maxParallel, opts, ontransform); - - if (typeof maxParallel === 'function') { - ontransform = maxParallel; - opts = null; - maxParallel = 1; - } - if (typeof opts === 'function') { - ontransform = opts; - opts = null; - } - - if (!opts) opts = {}; - if (!opts.highWaterMark) opts.highWaterMark = Math.max(maxParallel, 16); - if (opts.objectMode !== false) opts.objectMode = true; - - Transform.call(this, opts); + // 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(); + } + }; - this._maxParallel = maxParallel; - this._ontransform = ontransform; - this._destroyed = false; - this._flushed = false; - this._ordered = opts.ordered !== false; - this._buffer = this._ordered ? cyclist(maxParallel) : []; - this._top = 0; - this._bottom = 0; - this._ondrain = null; + return this; }; -inherits(ParallelTransform, Transform); +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 () { + return this._readableState.highWaterMark; + } +}); -ParallelTransform.prototype.destroy = function() { - if (this._destroyed) return; - this._destroyed = true; - this.emit('close'); -}; +// exposed for testing purposes only. +Readable._fromList = fromList; -ParallelTransform.prototype._transform = function(chunk, enc, callback) { - var self = this; - var pos = this._top++; +// 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; - this._ontransform(chunk, function(err, data) { - if (self._destroyed) return; - if (err) { - self.emit('error', err); - self.push(null); - self.destroy(); - return; - } - if (self._ordered) { - self._buffer.put(pos, (data === undefined || data === null) ? null : data); - } - else { - self._buffer.push(data); - } - self._drain(); - }); + 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.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } - if (this._top - this._bottom < this._maxParallel) return callback(); - this._ondrain = callback; -}; + return ret; +} -ParallelTransform.prototype._flush = function(callback) { - this._flushed = true; - this._ondrain = callback; - this._drain(); -}; +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} -ParallelTransform.prototype._drain = function() { - if (this._ordered) { - while (this._buffer.get(this._bottom) !== undefined) { - var data = this._buffer.del(this._bottom++); - if (data === null) continue; - this.push(data); - } - } - else { - while (this._buffer.length > 0) { - var data = this._buffer.pop(); - this._bottom++; - if (data === null) continue; - this.push(data); - } - } +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.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) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.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) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} - if (!this._drained() || !this._ondrain) return; +function endReadable(stream) { + var state = stream._readableState; - var ondrain = this._ondrain; - this._ondrain = null; - ondrain(); -}; + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); -ParallelTransform.prototype._drained = function() { - var diff = this._top - this._bottom; - return this._flushed ? !diff : diff < this._maxParallel; -}; + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} -module.exports = ParallelTransform; +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} /***/ }), -/***/ 2888: +/***/ 35272: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -235839,174 +237709,203 @@ module.exports = ParallelTransform; // 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. - - +// 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. -/**/ -var pna = __nccwpck_require__(47810); -/**/ -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ +module.exports = Transform; -module.exports = Duplex; +var Duplex = __nccwpck_require__(2888); /**/ var util = Object.create(__nccwpck_require__(95898)); util.inherits = __nccwpck_require__(44124); /**/ -var Readable = __nccwpck_require__(36964); -var Writable = __nccwpck_require__(62566); - -util.inherits(Duplex, Readable); +util.inherits(Transform, Duplex); -{ - // avoid scope creep, the keys array can then be collected - 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 afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); + var cb = ts.writecb; - Readable.call(this, options); - Writable.call(this, options); + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } - if (options && options.readable === false) this.readable = false; + ts.writechunk = null; + ts.writecb = null; - if (options && options.writable === false) this.writable = false; + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + cb(er); - this.once('end', onend); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } } -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 () { - return this._writableState.highWaterMark; - } -}); +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; + Duplex.call(this, options); - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; -function onEndNT(self) { - self.end(); -} + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } + // 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; - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; } -}); -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} - pna.nextTick(cb, err); -}; +function prefinish() { + var _this = this; -/***/ }), + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} -/***/ 46040: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; -"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: +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. // -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. // -// 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. +// 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) { + throw new Error('_transform() is not implemented'); +}; -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. +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.writecb && !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; + } +}; -module.exports = PassThrough; +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; -var Transform = __nccwpck_require__(35272); + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; -/**/ -var util = Object.create(__nccwpck_require__(95898)); -util.inherits = __nccwpck_require__(44124); -/**/ +function done(stream, er, data) { + if (er) return stream.emit('error', er); -util.inherits(PassThrough, Transform); + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - Transform.call(this, options); -} + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; + return stream.push(null); +} /***/ }), -/***/ 36964: +/***/ 62566: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -236031,6 +237930,10 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) { // 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. + /**/ @@ -236038,23 +237941,47 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) { var pna = __nccwpck_require__(47810); /**/ -module.exports = Readable; +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 isArray = __nccwpck_require__(20893); +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; /**/ /**/ var Duplex; /**/ -Readable.ReadableState = ReadableState; +Writable.WritableState = WritableState; /**/ -var EE = (__nccwpck_require__(82361).EventEmitter); +var util = Object.create(__nccwpck_require__(95898)); +util.inherits = __nccwpck_require__(44124); +/**/ -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; +/**/ +var internalUtil = { + deprecate: __nccwpck_require__(65278) }; /**/ @@ -236075,42 +238002,13 @@ function _isUint8Array(obj) { /**/ -/**/ -var util = Object.create(__nccwpck_require__(95898)); -util.inherits = __nccwpck_require__(44124); -/**/ - -/**/ -var debugUtil = __nccwpck_require__(73837); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = __nccwpck_require__(88120); var destroyImpl = __nccwpck_require__(59989); -var StringDecoder; - -util.inherits(Readable, Stream); - -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); +util.inherits(Writable, Stream); - // 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 (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} +function nop() {} -function ReadableState(options, stream) { +function WritableState(options, stream) { Duplex = Duplex || __nccwpck_require__(2888); options = options || {}; @@ -236122,918 +238020,864 @@ function ReadableState(options, stream) { // These options can be provided separately as readableXXX and writableXXX. var 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 + // 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.readableObjectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - // 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" + // 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() var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; + var writableHwm = options.writableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; // cast to ints. this.highWaterMark = Math.floor(this.highWaterMark); - // 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; + // if _final has been called + this.finalCalled = false; - // 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; + // 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'; - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; + // 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; - // if true, a maybeReadMore has been scheduled - this.readingMore = false; + // a flag to see when we're in the middle of a write. + this.writing = false; - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = (__nccwpck_require__(26107)/* .StringDecoder */ .s); - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; + // 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; + + // 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 () { + 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 (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; } -function Readable(options) { +function Writable(options) { Duplex = Duplex || __nccwpck_require__(2888); - if (!(this instanceof Readable)) return new Readable(options); + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. - this._readableState = new ReadableState(options, this); + // 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. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } - // legacy - this.readable = true; + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; if (options) { - if (typeof options.read === 'function') this._read = options.read; + 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); } -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; +// 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 valid = true; + var er = false; -// 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 (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} - 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; +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); } - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } + if (typeof cb !== 'function') cb = nop; - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } 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; - } + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } - return needMoreData(state); -} + return ret; +}; -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); +Writable.prototype.cork = function () { + var state = this._writableState; - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} + state.corked++; +}; -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} +Writable.prototype.uncork = function () { + var state = this._writableState; -// if it's past the high water mark, we can push in some more. -// 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. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} + if (state.corked) { + state.corked--; -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } }; -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = (__nccwpck_require__(26107)/* .StringDecoder */ .s); - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; +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 TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; return this; }; -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - 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; +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); } - return state.length; + return chunk; } -// 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.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; +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 () { + return this._writableState.highWaterMark; } +}); - 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; +// 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; - // 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. + state.length += len; - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; - // 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); + 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); } - // 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); - } + return ret; +} - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} - if (ret === null) { - state.needReadable = true; - n = 0; +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 + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); } else { - state.length -= n; + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); } +} - 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; +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; - if (ret !== null) this.emit('data', ret); + onwriteStateUpdate(state); - return ret; -}; + 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); -function onEofChunk(stream, state) { - 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; + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - 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; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } } } -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - 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; - pna.nextTick(maybeReadMore_, stream, state); - } +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); } -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; +// 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'); } - 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) { - this.emit('error', new Error('_read() is not implemented')); -}; +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; + 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; - 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 count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + // 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; - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); + 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; } } - } - function onend() { - debug('onend'); - dest.end(); + if (entry === null) state.lastBufferedRequest = null; } - // 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); + state.bufferedRequest = entry; + state.bufferProcessing = false; +} - 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); +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; - cleanedUp = true; +Writable.prototype._writev = null; - // 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(); - } +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // 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++; - increasedAwaitDrain = true; - } - src.pause(); - } + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; } - // 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) dest.emit('error', er); + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); } - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); + // ignore unnecessary end() calls. + if (!state.ending) endWritable(this, state, cb); +}; - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); +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) { + stream.emit('error', 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.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } } - dest.once('finish', onfinish); + return need; +} - function unpipe() { - debug('unpipe'); - src.unpipe(dest); +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); } + state.ended = true; + stream.writable = false; +} - // tell the dest that it's being piped to - dest.emit('pipe', src); +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; + } - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); + // reuse the free corkReq. + state.corkedRequestsFree.next = corkReq; +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (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; } +}); - return dest; +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); }; -function pipeOnDrain(src) { - return function () { - 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 }; +/***/ 88120: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; +"use strict"; - // 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; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } +var Buffer = (__nccwpck_require__(56028).Buffer); +var util = __nccwpck_require__(73837); - // slow case. multiple pipe destinations. +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { hasUnpiped: false }); - }return this; + this.head = null; + this.tail = null; + this.length = 0; } - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; + BufferList.prototype.push = 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; + }; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; - dest.emit('unpipe', this, unpipeInfo); + BufferList.prototype.shift = 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; + }; - return this; -}; + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; -// 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); + BufferList.prototype.join = 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; + }; - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } + BufferList.prototype.concat = 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; + }; - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; + return BufferList; +}(); -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; } -// 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'); - state.flowing = true; - resume(this, state); - } - return this; -}; +/***/ }), -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} +/***/ 59989: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } +"use strict"; - state.resumeScheduled = false; - state.awaitDrain = 0; - 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 (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; +/**/ -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} +var pna = __nccwpck_require__(47810); +/**/ -// 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) { +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { var _this = this; - var state = this._readableState; - var paused = false; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + pna.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, this, err); + } } - _this.push(null); - }); + return this; + } - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + if (this._readableState) { + this._readableState.destroyed = true; + } - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); + // 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) { + pna.nextTick(emitErrorNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, _this, err); + } + } else if (cb) { + cb(err); } }); - // 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 (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; } - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + 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; } +} - // 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(); - } - }; +function emitErrorNT(self, err) { + self.emit('error', err); +} - return this; +module.exports = { + destroy: destroy, + undestroy: undestroy }; -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 () { - return this._readableState.highWaterMark; - } -}); +/***/ }), -// exposed for testing purposes only. -Readable._fromList = fromList; +/***/ 48827: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// 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; +module.exports = __nccwpck_require__(12781); - 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.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - return ret; -} +/***/ }), -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} +/***/ 60262: +/***/ ((module, exports, __nccwpck_require__) => { -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.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) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; +var Stream = __nccwpck_require__(12781); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = __nccwpck_require__(36964); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __nccwpck_require__(62566); + exports.Duplex = __nccwpck_require__(2888); + exports.Transform = __nccwpck_require__(35272); + exports.PassThrough = __nccwpck_require__(46040); } -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.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) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} -function endReadable(stream) { - var state = stream._readableState; +/***/ }), - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); +/***/ 56028: +/***/ ((module, exports, __nccwpck_require__) => { - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); +/* 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 endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) } -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; +// 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 -1; + 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) +} -/***/ 35272: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/***/ }), + +/***/ 26107: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. @@ -237057,4989 +238901,3797 @@ function indexOf(xs, x) { // 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 Duplex = __nccwpck_require__(2888); /**/ -var util = Object.create(__nccwpck_require__(95898)); -util.inherits = __nccwpck_require__(44124); -/**/ - -util.inherits(Transform, Duplex); -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; +var Buffer = (__nccwpck_require__(56028).Buffer); +/**/ - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); +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; } +}; - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); +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; + } + } +}; - cb(er); +// 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; +} - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); +// 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); } -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); +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 || ''; +}; - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; +StringDecoder.prototype.end = utf8End; - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; - // 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; +// 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; +}; - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; +// 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; +} - if (typeof options.flush === 'function') this._flush = options.flush; +// 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; } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); + 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; } -function prefinish() { - var _this = this; +// 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'; + } + } + } +} - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); +// 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; } -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; +// 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); +} -// 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) { - throw new Error('_transform() is not implemented'); -}; +// 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; +} -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); +// 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); +} -// 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; +// 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; +} - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); +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 { - // 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; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -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); + return buf.toString('base64', i, buf.length - n); +} - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); +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; +} - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} - return stream.push(null); +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; } /***/ }), -/***/ 62566: +/***/ 96978: /***/ ((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. +const fs = __nccwpck_require__(57147); +const {promisify} = __nccwpck_require__(73837); +const pAccess = promisify(fs.access); -/**/ +module.exports = async path => { + try { + await pAccess(path); + return true; + } catch (_) { + return false; + } +}; -var pna = __nccwpck_require__(47810); -/**/ +module.exports.sync = path => { + try { + fs.accessSync(path); + return true; + } catch (_) { + return false; + } +}; -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; +/***/ 38714: +/***/ ((module) => { - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ +"use strict"; -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ -/**/ -var Duplex; -/**/ +function posix(path) { + return path.charAt(0) === '/'; +} -Writable.WritableState = WritableState; +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) !== ':'); -/**/ -var util = Object.create(__nccwpck_require__(95898)); -util.inherits = __nccwpck_require__(44124); -/**/ + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} -/**/ -var internalUtil = { - deprecate: __nccwpck_require__(65278) -}; -/**/ +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; -/**/ -var Stream = __nccwpck_require__(48827); -/**/ -/**/ +/***/ }), -var Buffer = (__nccwpck_require__(56028).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; -} +/***/ 5980: +/***/ ((module) => { -/**/ +"use strict"; -var destroyImpl = __nccwpck_require__(59989); -util.inherits(Writable, Stream); +var isWindows = process.platform === 'win32'; -function nop() {} +// Regex to split a windows path into into [dir, root, basename, name, ext] +var splitWindowsRe = + /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/; -function WritableState(options, stream) { - Duplex = Duplex || __nccwpck_require__(2888); +var win32 = {}; - options = options || {}; +function win32SplitPath(filename) { + return splitWindowsRe.exec(filename).slice(1); +} - // 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. - var isDuplex = stream instanceof Duplex; +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 5) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[1], + dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1), + base: allParts[2], + ext: allParts[4], + name: allParts[3] + }; +}; - // 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() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; +// Split a filename into [dir, root, basename, name, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/; +var posix = {}; - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} - // 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; +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 5) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + + return { + root: allParts[1], + dir: allParts[0].slice(0, -1), + base: allParts[2], + ext: allParts[4], + name: allParts[3], + }; +}; - // 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; +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; - // 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'; +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; - // 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; +/***/ 63433: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // 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; +"use strict"; - // 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; +const {promisify} = __nccwpck_require__(73837); +const fs = __nccwpck_require__(57147); - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; +async function isType(fsStatType, statsMethodName, filePath) { + if (typeof filePath !== 'string') { + throw new TypeError(`Expected a string, got ${typeof filePath}`); + } - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; + try { + const stats = await promisify(fs[fsStatType])(filePath); + return stats[statsMethodName](); + } catch (error) { + if (error.code === 'ENOENT') { + return false; + } - // the amount that is being written when _write is called. - this.writelen = 0; + throw error; + } +} - this.bufferedRequest = null; - this.lastBufferedRequest = null; +function isTypeSync(fsStatType, statsMethodName, filePath) { + if (typeof filePath !== 'string') { + throw new TypeError(`Expected a string, got ${typeof filePath}`); + } - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; + try { + return fs[fsStatType](filePath)[statsMethodName](); + } catch (error) { + if (error.code === 'ENOENT') { + return false; + } - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; + throw error; + } +} - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; +exports.isFile = isType.bind(null, 'stat', 'isFile'); +exports.isDirectory = isType.bind(null, 'stat', 'isDirectory'); +exports.isSymlink = isType.bind(null, 'lstat', 'isSymbolicLink'); +exports.isFileSync = isTypeSync.bind(null, 'statSync', 'isFile'); +exports.isDirectorySync = isTypeSync.bind(null, 'statSync', 'isDirectory'); +exports.isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink'); - // 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; -}; +/***/ 37023: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); +let tty = __nccwpck_require__(76224) -// 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 (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; +let isColorSupported = + !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && + ("FORCE_COLOR" in process.env || + process.argv.includes("--color") || + process.platform === "win32" || + (tty.isatty(1) && process.env.TERM !== "dumb") || + "CI" in process.env) - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; +function formatter(open, close, replace = open) { + return (input) => { + let string = "" + input + let index = string.indexOf(close, open.length) + return !~index + ? open + string + close + : open + replaceClose(string, close, replace, index) + close + } } -function Writable(options) { - Duplex = Duplex || __nccwpck_require__(2888); +function replaceClose(string, close, replace, index) { + let start = string.substring(0, index) + replace + let end = string.substring(index + close.length) + let nextIndex = end.indexOf(close) + return !~nextIndex ? start + end : start + replaceClose(end, close, replace, nextIndex) +} - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. +function createColors(enabled = isColorSupported) { + return { + isColorSupported: enabled, + reset: enabled ? (s) => `\x1b[0m${s}\x1b[0m` : String, + bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String, + dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String, + italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String, + underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String, + inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String, + hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String, + strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String, + black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String, + red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String, + green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String, + yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String, + blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String, + magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String, + cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String, + white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String, + gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String, + bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String, + bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String, + bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String, + bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String, + bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String, + bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String, + bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String, + bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String, + } +} - // 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. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } +module.exports = createColors() +module.exports.createColors = createColors - this._writableState = new WritableState(options, this); - // legacy. - this.writable = true; +/***/ }), - if (options) { - if (typeof options.write === 'function') this._write = options.write; +/***/ 78569: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (typeof options.writev === 'function') this._writev = options.writev; +"use strict"; - if (typeof options.destroy === 'function') this._destroy = options.destroy; - if (typeof options.final === 'function') this._final = options.final; - } +module.exports = __nccwpck_require__(33322); - Stream.call(this); -} -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; +/***/ }), -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} +/***/ 16099: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// 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 valid = true; - var er = false; +"use strict"; - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); +const path = __nccwpck_require__(71017); +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } +/** + * Posix glob regex + */ - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; - if (typeof cb !== 'function') cb = nop; +/** + * Windows glob regex + */ - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } +const WINDOWS_CHARS = { + ...POSIX_CHARS, - return ret; + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` }; -Writable.prototype.cork = function () { - var state = this._writableState; +/** + * POSIX Bracket Regex + */ - state.corked++; +const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' }; -Writable.prototype.uncork = function () { - var state = this._writableState; +module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, - if (state.corked) { - state.corked--; + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, -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 TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ -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 () { - return this._writableState.highWaterMark; - } -}); + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ -// 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; + CHAR_ASTERISK: 42, /* * */ - state.length += len; + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; + SEP: path.sep, - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; } +}; - return ret; -} -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - 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; +/***/ 92139: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} +"use strict"; -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; +const constants = __nccwpck_require__(16099); +const utils = __nccwpck_require__(30479); - onwriteStateUpdate(state); +/** + * Constants + */ - 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); +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } +/** + * Helpers + */ - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); } -} -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} + args.sort(); + const value = `[${args.join('-')}]`; -// 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'); + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); } -} -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; + return value; +}; - 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; +/** + * Create the message for a syntax error + */ - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ - // 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; +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } - 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; - } - } + input = REPLACEMENTS[input] || input; - if (entry === null) state.lastBufferedRequest = null; + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); } - state.bufferedRequest = entry; - state.bufferProcessing = false; -} + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); -Writable.prototype._writev = null; + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); + if (opts.capture) { + star = `(${star})`; } - // ignore unnecessary end() calls. - if (!state.ending) endWritable(this, state, cb); -}; + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } -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) { - stream.emit('error', 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.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; } - } -} -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); + if (count % 2 === 0) { + return false; } - } - return need; -} -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} + state.negated = true; + state.start++; + return true; + }; -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; - } + const increment = type => { + state[type]++; + stack.push(type); + }; - // reuse the free corkReq. - state.corkedRequestsFree.next = corkReq; -} + const decrement = type => { + state[type]--; + stack.pop(); + }; -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; return; } - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; -/***/ }), + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; -/***/ 88120: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; -"use strict"; + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + if (token.type === 'negate') { + let extglobStar = star; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } -var Buffer = (__nccwpck_require__(56028).Buffer); -var util = __nccwpck_require__(73837); + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); + output = token.close = `)${expression})${extglobStar})`; + } - this.head = null; - this.tail = null; - this.length = 0; - } + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } - BufferList.prototype.push = 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; + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); }; - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; + /** + * Fast paths + */ - BufferList.prototype.shift = 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; - }; + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } - BufferList.prototype.join = 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; - }; + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } - BufferList.prototype.concat = 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; - }; + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } - return BufferList; -}(); + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } -/***/ }), + if (output === input && opts.contains === true) { + state.output = input; + return state; + } -/***/ 59989: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + state.output = utils.wrapOutput(output, state, options); + return state; + } -"use strict"; + /** + * Tokenize input until we reach end-of-string + */ + while (!eos()) { + value = advance(); -/**/ + if (value === '\u0000') { + continue; + } -var pna = __nccwpck_require__(47810); -/**/ + /** + * Escaped characters + */ -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; + if (value === '\\') { + const next = peek(); - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; + if (next === '/' && opts.bash !== true) { + continue; + } - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - pna.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - pna.nextTick(emitErrorNT, this, err); + if (next === '.' || next === ';') { + continue; } - } - return this; - } + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; - if (this._readableState) { - this._readableState.destroyed = true; - } + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } - this._destroy(err || null, function (err) { - if (!cb && err) { - if (!_this._writableState) { - pna.nextTick(emitErrorNT, _this, err); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - pna.nextTick(emitErrorNT, _this, err); + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; } - } else if (cb) { - cb(err); } - }); - return this; -} + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; - 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; - } -} + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); -function emitErrorNT(self, err) { - self.emit('error', err); -} + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } -module.exports = { - destroy: destroy, - undestroy: undestroy -}; + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } -/***/ }), + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } -/***/ 48827: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } -module.exports = __nccwpck_require__(12781); + prev.value += value; + append({ value }); + continue; + } + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ -/***/ }), + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } -/***/ 60262: -/***/ ((module, exports, __nccwpck_require__) => { + /** + * Double quotes + */ -var Stream = __nccwpck_require__(12781); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = __nccwpck_require__(36964); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = __nccwpck_require__(62566); - exports.Duplex = __nccwpck_require__(2888); - exports.Transform = __nccwpck_require__(35272); - exports.PassThrough = __nccwpck_require__(46040); -} + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + /** + * Parentheses + */ -/***/ }), + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } -/***/ 56028: -/***/ ((module, exports, __nccwpck_require__) => { + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } -/* eslint-disable node/no-deprecated-api */ -var buffer = __nccwpck_require__(14300) -var Buffer = buffer.Buffer + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } -// 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 -} + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} + /** + * Square brackets + */ -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} + value = `\\${value}`; + } else { + increment('brackets'); + } -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) + push({ type: 'bracket', value }); + continue; } - } 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) -} + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + push({ type: 'text', value, output: `\\${value}` }); + continue; + } -/***/ }), + decrement('brackets'); -/***/ 26107: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } -"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. + prev.value += value; + append({ value }); + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); -/**/ + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } -var Buffer = (__nccwpck_require__(56028).Buffer); -/**/ + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } -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; - } -}; + /** + * Braces + */ -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; -} + if (value === '{' && opts.nobrace !== true) { + increment('braces'); -// 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); -} + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; -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 || ''; -}; + braces.push(open); + push(open); + continue; + } -StringDecoder.prototype.end = utf8End; + if (value === '}') { + const brace = braces[braces.length - 1]; -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } -// 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; -}; + let output = ')'; -// 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; -} + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; -// 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; -} + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } -// 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'; + output = expandRange(range, opts); + state.backtrack = true; } - } - } -} -// 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; -} + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } -// 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); -} + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } -// 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; -} + /** + * Pipes + */ -// 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); + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; } + push({ type: 'text', value }); + continue; } - 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); -} + /** + * Commas + */ -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} + if (value === ',') { + let output = value; -/***/ }), + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } -/***/ 96978: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + push({ type: 'comma', value, output }); + continue; + } -"use strict"; + /** + * Slashes + */ -const fs = __nccwpck_require__(57147); -const {promisify} = __nccwpck_require__(73837); + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } -const pAccess = promisify(fs.access); + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } -module.exports = async path => { - try { - await pAccess(path); - return true; - } catch (_) { - return false; - } -}; + /** + * Dots + */ -module.exports.sync = path => { - try { - fs.accessSync(path); - return true; - } catch (_) { - return false; - } -}; + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } -/***/ }), + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } -/***/ 38714: -/***/ ((module) => { + /** + * Question marks + */ -"use strict"; + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; -function posix(path) { - return path.charAt(0) === '/'; -} + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } -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) !== ':'); + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } - // UNC paths are always absolute - return Boolean(result[2] || isUnc); -} + push({ type: 'text', value, output }); + continue; + } -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + push({ type: 'qmark', value, output: QMARK }); + continue; + } -/***/ }), + /** + * Exclamation + */ -/***/ 5980: -/***/ ((module) => { + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } -"use strict"; + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + /** + * Plus + */ -var isWindows = process.platform === 'win32'; + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } -// Regex to split a windows path into into [dir, root, basename, name, ext] -var splitWindowsRe = - /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/; + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } -var win32 = {}; + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } -function win32SplitPath(filename) { - return splitWindowsRe.exec(filename).slice(1); -} + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } -win32.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = win32SplitPath(pathString); - if (!allParts || allParts.length !== 5) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - return { - root: allParts[1], - dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1), - base: allParts[2], - ext: allParts[4], - name: allParts[3] - }; -}; + /** + * Plain text + */ + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + push({ type: 'text', value }); + continue; + } -// Split a filename into [dir, root, basename, name, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/; -var posix = {}; + /** + * Plain text + */ + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } -function posixSplitPath(filename) { - return splitPathRe.exec(filename).slice(1); -} + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + push({ type: 'text', value }); + continue; + } -posix.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = posixSplitPath(pathString); - if (!allParts || allParts.length !== 5) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - - return { - root: allParts[1], - dir: allParts[0].slice(0, -1), - base: allParts[2], - ext: allParts[4], - name: allParts[3], - }; -}; + /** + * Stars + */ + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } -if (isWindows) - module.exports = win32.parse; -else /* posix */ - module.exports = posix.parse; + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } -module.exports.posix = posix.parse; -module.exports.win32 = win32.parse; + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); -/***/ }), + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } -/***/ 63433: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } -"use strict"; + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } -const {promisify} = __nccwpck_require__(73837); -const fs = __nccwpck_require__(57147); + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } -async function isType(fsStatType, statsMethodName, filePath) { - if (typeof filePath !== 'string') { - throw new TypeError(`Expected a string, got ${typeof filePath}`); - } + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; - try { - const stats = await promisify(fs[fsStatType])(filePath); - return stats[statsMethodName](); - } catch (error) { - if (error.code === 'ENOENT') { - return false; - } + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } - throw error; - } -} + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; -function isTypeSync(fsStatType, statsMethodName, filePath) { - if (typeof filePath !== 'string') { - throw new TypeError(`Expected a string, got ${typeof filePath}`); - } + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; - try { - return fs[fsStatType](filePath)[statsMethodName](); - } catch (error) { - if (error.code === 'ENOENT') { - return false; - } + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; - throw error; - } -} + state.output += prior.output + prev.output; + state.globstar = true; -exports.isFile = isType.bind(null, 'stat', 'isFile'); -exports.isDirectory = isType.bind(null, 'stat', 'isDirectory'); -exports.isSymlink = isType.bind(null, 'lstat', 'isSymbolicLink'); -exports.isFileSync = isTypeSync.bind(null, 'statSync', 'isFile'); -exports.isDirectorySync = isTypeSync.bind(null, 'statSync', 'isDirectory'); -exports.isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink'); + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } -/***/ }), + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } -/***/ 37023: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); -let tty = __nccwpck_require__(76224) + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; -let isColorSupported = - !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && - ("FORCE_COLOR" in process.env || - process.argv.includes("--color") || - process.platform === "win32" || - (tty.isatty(1) && process.env.TERM !== "dumb") || - "CI" in process.env) + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } -function formatter(open, close, replace = open) { - return (input) => { - let string = "" + input - let index = string.indexOf(close, open.length) - return !~index - ? open + string + close - : open + replaceClose(string, close, replace, index) + close - } -} + const token = { type: 'star', value, output: star }; -function replaceClose(string, close, replace, index) { - let start = string.substring(0, index) + replace - let end = string.substring(index + close.length) - let nextIndex = end.indexOf(close) - return !~nextIndex ? start + end : start + replaceClose(end, close, replace, nextIndex) -} + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } -function createColors(enabled = isColorSupported) { - return { - isColorSupported: enabled, - reset: enabled ? (s) => `\x1b[0m${s}\x1b[0m` : String, - bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String, - dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String, - italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String, - underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String, - inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String, - hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String, - strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String, - black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String, - red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String, - green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String, - yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String, - blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String, - magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String, - cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String, - white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String, - gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String, - bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String, - bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String, - bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String, - bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String, - bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String, - bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String, - bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String, - bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String, - } -} + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } -module.exports = createColors() -module.exports.createColors = createColors + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; -/***/ }), + } else { + state.output += nodot; + prev.output += nodot; + } -/***/ 78569: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } -"use strict"; + push(token); + } + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } -module.exports = __nccwpck_require__(33322); + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } -/***/ }), + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } -/***/ 16099: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; -"use strict"; + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + if (token.suffix) { + state.output += token.suffix; + } + } + } -const path = __nccwpck_require__(71017); -const WIN_SLASH = '\\\\/'; -const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + return state; +}; /** - * Posix glob regex + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. */ -const DOT_LITERAL = '\\.'; -const PLUS_LITERAL = '\\+'; -const QMARK_LITERAL = '\\?'; -const SLASH_LITERAL = '\\/'; -const ONE_CHAR = '(?=.)'; -const QMARK = '[^/]'; -const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; -const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; -const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; -const NO_DOT = `(?!${DOT_LITERAL})`; -const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; -const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; -const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; -const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; -const STAR = `${QMARK}*?`; - -const POSIX_CHARS = { - DOT_LITERAL, - PLUS_LITERAL, - QMARK_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - QMARK, - END_ANCHOR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK_NO_DOT, - STAR, - START_ANCHOR -}; +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } -/** - * Windows glob regex - */ + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); -const WINDOWS_CHARS = { - ...POSIX_CHARS, + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); - SLASH_LITERAL: `[${WIN_SLASH}]`, - QMARK: WIN_NO_SLASH, - STAR: `${WIN_NO_SLASH}*?`, - DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, - NO_DOT: `(?!${DOT_LITERAL})`, - NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, - NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - QMARK_NO_DOT: `[^.${WIN_SLASH}]`, - START_ANCHOR: `(?:^|[${WIN_SLASH}])`, - END_ANCHOR: `(?:[${WIN_SLASH}]|$)` -}; + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; -/** - * POSIX Bracket Regex - */ + if (opts.capture) { + star = `(${star})`; + } -const POSIX_REGEX_SOURCE = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - ascii: '\\x00-\\x7F', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E ', - punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9' -}; + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; -module.exports = { - MAX_LENGTH: 1024 * 64, - POSIX_REGEX_SOURCE, + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; - // regular expressions - REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, - REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, - REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, - REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, - REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, - REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; - // Replace globs with equivalent patterns to reduce parsing time. - REPLACEMENTS: { - '***': '*', - '**/**': '**', - '**/**/**': '**' - }, + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; - // Digits - CHAR_0: 48, /* 0 */ - CHAR_9: 57, /* 9 */ + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; - // Alphabet chars. - CHAR_UPPERCASE_A: 65, /* A */ - CHAR_LOWERCASE_A: 97, /* a */ - CHAR_UPPERCASE_Z: 90, /* Z */ - CHAR_LOWERCASE_Z: 122, /* z */ + case '**': + return nodot + globstar(opts); - CHAR_LEFT_PARENTHESES: 40, /* ( */ - CHAR_RIGHT_PARENTHESES: 41, /* ) */ + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; - CHAR_ASTERISK: 42, /* * */ + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; - // Non-alphabetic chars. - CHAR_AMPERSAND: 38, /* & */ - CHAR_AT: 64, /* @ */ - CHAR_BACKWARD_SLASH: 92, /* \ */ - CHAR_CARRIAGE_RETURN: 13, /* \r */ - CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ - CHAR_COLON: 58, /* : */ - CHAR_COMMA: 44, /* , */ - CHAR_DOT: 46, /* . */ - CHAR_DOUBLE_QUOTE: 34, /* " */ - CHAR_EQUAL: 61, /* = */ - CHAR_EXCLAMATION_MARK: 33, /* ! */ - CHAR_FORM_FEED: 12, /* \f */ - CHAR_FORWARD_SLASH: 47, /* / */ - CHAR_GRAVE_ACCENT: 96, /* ` */ - CHAR_HASH: 35, /* # */ - CHAR_HYPHEN_MINUS: 45, /* - */ - CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ - CHAR_LEFT_CURLY_BRACE: 123, /* { */ - CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ - CHAR_LINE_FEED: 10, /* \n */ - CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ - CHAR_PERCENT: 37, /* % */ - CHAR_PLUS: 43, /* + */ - CHAR_QUESTION_MARK: 63, /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ - CHAR_RIGHT_CURLY_BRACE: 125, /* } */ - CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ - CHAR_SEMICOLON: 59, /* ; */ - CHAR_SINGLE_QUOTE: 39, /* ' */ - CHAR_SPACE: 32, /* */ - CHAR_TAB: 9, /* \t */ - CHAR_UNDERSCORE: 95, /* _ */ - CHAR_VERTICAL_LINE: 124, /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; - SEP: path.sep, + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; - /** - * Create EXTGLOB_CHARS - */ + const source = create(match[1]); + if (!source) return; - extglobChars(chars) { - return { - '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, - '?': { type: 'qmark', open: '(?:', close: ')?' }, - '+': { type: 'plus', open: '(?:', close: ')+' }, - '*': { type: 'star', open: '(?:', close: ')*' }, - '@': { type: 'at', open: '(?:', close: ')' } - }; - }, + return source + DOT_LITERAL + match[2]; + } + } + }; - /** - * Create GLOB_CHARS - */ + const output = utils.removePrefix(input, state); + let source = create(output); - globChars(win32) { - return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; } + + return source; }; +module.exports = parse; + /***/ }), -/***/ 92139: +/***/ 33322: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const constants = __nccwpck_require__(16099); +const path = __nccwpck_require__(71017); +const scan = __nccwpck_require__(32429); +const parse = __nccwpck_require__(92139); const utils = __nccwpck_require__(30479); +const constants = __nccwpck_require__(16099); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); /** - * Constants + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public */ -const { - MAX_LENGTH, - POSIX_REGEX_SOURCE, - REGEX_NON_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_BACKREF, - REPLACEMENTS -} = constants; +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; /** - * Helpers + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public */ -const expandRange = (args, options) => { - if (typeof options.expandRange === 'function') { - return options.expandRange(...args, options); +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); } - args.sort(); - const value = `[${args.join('-')}]`; + if (input === '') { + return { isMatch: false, output: '' }; + } - try { - /* eslint-disable-next-line no-new */ - new RegExp(value); - } catch (ex) { - return args.map(v => utils.escapeRegex(v)).join('..'); + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; } - return value; + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; }; /** - * Create the message for a syntax error + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public */ -const syntaxError = (type, char) => { - return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); }; /** - * Parse the given input string. - * @param {String} input - * @param {Object} options - * @return {Object} + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public */ -const parse = (input, options) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); - input = REPLACEMENTS[input] || input; +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; - let len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); - } +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ - const bos = { type: 'bos', value: '', output: opts.prepend || '' }; - const tokens = [bos]; +picomatch.scan = (input, options) => scan(input, options); - const capture = opts.capture ? '' : '?:'; - const win32 = utils.isWindows(options); +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ - // create constants based on platform, for windows or posix - const PLATFORM_CHARS = constants.globChars(win32); - const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } - const { - DOT_LITERAL, - PLUS_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK, - QMARK_NO_DOT, - STAR, - START_ANCHOR - } = PLATFORM_CHARS; + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; - const globstar = opts => { - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } - const nodot = opts.dot ? '' : NO_DOT; - const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; - let star = opts.bash === true ? globstar(opts) : STAR; + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } - if (opts.capture) { - star = `(${star})`; + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); } - // minimatch options support - if (typeof opts.noext === 'boolean') { - opts.noextglob = opts.noext; + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); } - const state = { - input, - index: -1, - start: 0, - dot: opts.dot === true, - consumed: '', - output: '', - prefix: '', - backtrack: false, - negated: false, - brackets: 0, - braces: 0, - parens: 0, - quotes: 0, - globstar: false, - tokens - }; + if (!parsed.output) { + parsed = parse(input, options); + } - input = utils.removePrefix(input, state); - len = input.length; + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; - const extglobs = []; - const braces = []; - const stack = []; - let prev = bos; - let value; +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ - /** - * Tokenizing helpers - */ +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; - const eos = () => state.index === len - 1; - const peek = state.peek = (n = 1) => input[state.index + n]; - const advance = state.advance = () => input[++state.index] || ''; - const remaining = () => input.slice(state.index + 1); - const consume = (value = '', num = 0) => { - state.consumed += value; - state.index += num; - }; +/** + * Picomatch constants. + * @return {Object} + */ - const append = token => { - state.output += token.output != null ? token.output : token.value; - consume(token.value); - }; +picomatch.constants = constants; - const negate = () => { - let count = 1; +/** + * Expose "picomatch" + */ - while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { - advance(); - state.start++; - count++; - } +module.exports = picomatch; - if (count % 2 === 0) { - return false; - } - state.negated = true; - state.start++; - return true; - }; +/***/ }), - const increment = type => { - state[type]++; - stack.push(type); - }; +/***/ 32429: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const decrement = type => { - state[type]--; - stack.pop(); - }; +"use strict"; - /** - * Push tokens onto the tokens array. This helper speeds up - * tokenizing by 1) helping us avoid backtracking as much as possible, - * and 2) helping us avoid creating extra tokens when consecutive - * characters are plain text. This improves performance and simplifies - * lookbehinds. - */ - const push = tok => { - if (prev.type === 'globstar') { - const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); - const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); +const utils = __nccwpck_require__(30479); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = __nccwpck_require__(16099); - if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { - state.output = state.output.slice(0, -prev.output.length); - prev.type = 'star'; - prev.value = '*'; - prev.output = star; - state.output += prev.output; - } - } +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; - if (extglobs.length && tok.type !== 'paren') { - extglobs[extglobs.length - 1].inner += tok.value; - } +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; - if (tok.value || tok.output) append(tok); - if (prev && prev.type === 'text' && tok.type === 'text') { - prev.value += tok.value; - prev.output = (prev.output || '') + tok.value; - return; - } +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ - tok.prev = prev; - tokens.push(tok); - prev = tok; - }; +const scan = (input, options) => { + const opts = options || {}; - const extglobOpen = (type, value) => { - const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; - token.prev = prev; - token.parens = state.parens; - token.output = state.output; - const output = (opts.capture ? '(' : '') + token.open; + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; - increment('parens'); - push({ type, value, output: state.output ? '' : ONE_CHAR }); - push({ type: 'paren', extglob: true, value: advance(), output }); - extglobs.push(token); + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); }; - const extglobClose = token => { - let output = token.close + (opts.capture ? ')' : ''); - let rest; + while (index < length) { + code = advance(); + let next; - if (token.type === 'negate') { - let extglobStar = star; + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); - if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { - extglobStar = globstar(opts); + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; } + continue; + } - if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { - output = token.close = `)$))${extglobStar}`; - } + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; - if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { - // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. - // In this case, we need to parse the string and use it in the output of the original pattern. - // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. - // - // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. - const expression = parse(rest, { ...options, fastpaths: false }).output; + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } - output = token.close = `)${expression})${extglobStar})`; - } + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } - if (token.prev.type === 'bos') { - state.negatedExtglob = true; - } - } + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; - push({ type: 'paren', extglob: true, value, output }); - decrement('parens'); - }; + if (scanToEnd === true) { + continue; + } - /** - * Fast paths - */ + break; + } - if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { - let backslashes = false; + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; - let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { - if (first === '\\') { - backslashes = true; - return m; - } + if (scanToEnd === true) { + continue; + } - if (first === '?') { - if (esc) { - return esc + first + (rest ? QMARK.repeat(rest.length) : ''); - } - if (index === 0) { - return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + break; } - return QMARK.repeat(chars.length); - } - if (first === '.') { - return DOT_LITERAL.repeat(chars.length); - } + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; - if (first === '*') { - if (esc) { - return esc + first + (rest ? star : ''); + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } } - return star; } - return esc ? m : `\\${m}`; - }); - if (backslashes === true) { - if (opts.unescape === true) { - output = output.replace(/\\/g, ''); - } else { - output = output.replace(/\\+/g, m => { - return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); - }); + if (scanToEnd === true) { + continue; } - } - if (output === input && opts.contains === true) { - state.output = input; - return state; + break; } - state.output = utils.wrapOutput(output, state, options); - return state; - } - - /** - * Tokenize input until we reach end-of-string - */ + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; - while (!eos()) { - value = advance(); + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } - if (value === '\u0000') { + lastIndex = index + 1; continue; } - /** - * Escaped characters - */ + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; - if (value === '\\') { - const next = peek(); + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } - if (next === '/' && opts.bash !== true) { - continue; + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; } + } - if (next === '.' || next === ';') { + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { continue; } + break; + } - if (!next) { - value += '\\'; - push({ type: 'text', value }); + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { continue; } + break; + } - // collapse slashes to reduce potential for exploits - const match = /^\\+/.exec(remaining()); - let slashes = 0; - - if (match && match[0].length > 2) { - slashes = match[0].length; - state.index += slashes; - if (slashes % 2 !== 0) { - value += '\\'; + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; } - } - if (opts.unescape === true) { - value = advance(); - } else { - value += advance(); + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } } - if (state.brackets === 0) { - push({ type: 'text', value }); + if (scanToEnd === true) { continue; } + + break; } - /** - * If we're inside a regex character class, continue - * until we reach the closing bracket. - */ + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } - if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { - if (opts.posix !== false && value === ':') { - const inner = prev.value.slice(1); - if (inner.includes('[')) { - prev.posix = true; + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; - if (inner.includes(':')) { - const idx = prev.value.lastIndexOf('['); - const pre = prev.value.slice(0, idx); - const rest = prev.value.slice(idx + 2); - const posix = POSIX_REGEX_SOURCE[rest]; - if (posix) { - prev.value = pre + posix; - state.backtrack = true; - advance(); + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } - if (!bos.output && tokens.indexOf(prev) === 1) { - bos.output = ONE_CHAR; - } - continue; - } + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; } } + continue; } + break; + } - if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { - value = `\\${value}`; - } - - if (value === ']' && (prev.value === '[' || prev.value === '[^')) { - value = `\\${value}`; - } + if (isGlob === true) { + finished = true; - if (opts.posix === true && value === '!' && prev.value === '[') { - value = '^'; + if (scanToEnd === true) { + continue; } - prev.value += value; - append({ value }); - continue; + break; } + } - /** - * If we're inside a quoted string, continue - * until we reach the closing double quote. - */ + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } - if (state.quotes === 1 && value !== '"') { - value = utils.escapeRegex(value); - prev.value += value; - append({ value }); - continue; - } + let base = str; + let prefix = ''; + let glob = ''; - /** - * Double quotes - */ + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } - if (value === '"') { - state.quotes = state.quotes === 1 ? 0 : 1; - if (opts.keepQuotes === true) { - push({ type: 'text', value }); - } - continue; + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); } + } - /** - * Parentheses - */ + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); - if (value === '(') { - increment('parens'); - push({ type: 'paren', value }); - continue; + if (base && backslashes === true) { + base = utils.removeBackslashes(base); } + } - if (value === ')') { - if (state.parens === 0 && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '(')); - } - - const extglob = extglobs[extglobs.length - 1]; - if (extglob && state.parens === extglob.parens + 1) { - extglobClose(extglobs.pop()); - continue; - } + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; - push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); - decrement('parens'); - continue; + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); } + state.tokens = tokens; + } - /** - * Square brackets - */ + if (opts.parts === true || opts.tokens === true) { + let prevIndex; - if (value === '[') { - if (opts.nobracket === true || !remaining().includes(']')) { - if (opts.nobracket !== true && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('closing', ']')); + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; } - - value = `\\${value}`; - } else { - increment('brackets'); + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; } - - push({ type: 'bracket', value }); - continue; - } - - if (value === ']') { - if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { - push({ type: 'text', value, output: `\\${value}` }); - continue; + if (idx !== 0 || value !== '') { + parts.push(value); } + prevIndex = i; + } - if (state.brackets === 0) { - if (opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '[')); - } + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); - push({ type: 'text', value, output: `\\${value}` }); - continue; + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; } + } - decrement('brackets'); + state.slashes = slashes; + state.parts = parts; + } - const prevValue = prev.value.slice(1); - if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { - value = `/${value}`; - } + return state; +}; - prev.value += value; - append({ value }); +module.exports = scan; - // when literal brackets are explicitly disabled - // assume we should match with a regex character class - if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { - continue; - } - const escaped = utils.escapeRegex(prev.value); - state.output = state.output.slice(0, -prev.value.length); +/***/ }), - // when literal brackets are explicitly enabled - // assume we should escape the brackets to match literal characters - if (opts.literalBrackets === true) { - state.output += escaped; - prev.value = escaped; - continue; - } +/***/ 30479: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // when the user specifies nothing, try to match both - prev.value = `(${capture}${escaped}|${prev.value})`; - state.output += prev.value; - continue; - } +"use strict"; - /** - * Braces - */ - if (value === '{' && opts.nobrace !== true) { - increment('braces'); +const path = __nccwpck_require__(71017); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = __nccwpck_require__(16099); - const open = { - type: 'brace', - value, - output: '(', - outputIndex: state.output.length, - tokensIndex: state.tokens.length - }; +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); - braces.push(open); - push(open); - continue; - } +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; - if (value === '}') { - const brace = braces[braces.length - 1]; +exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; +}; - if (opts.nobrace === true || !brace) { - push({ type: 'text', value, output: value }); - continue; - } +exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; +}; - let output = ')'; +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; - if (brace.dots === true) { - const arr = tokens.slice(); - const range = []; +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; - for (let i = arr.length - 1; i >= 0; i--) { - tokens.pop(); - if (arr[i].type === 'brace') { - break; - } - if (arr[i].type !== 'dots') { - range.unshift(arr[i].value); - } - } +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; - output = expandRange(range, opts); - state.backtrack = true; - } + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; - if (brace.comma !== true && brace.dots !== true) { - const out = state.output.slice(0, brace.outputIndex); - const toks = state.tokens.slice(brace.tokensIndex); - brace.value = brace.output = '\\{'; - value = output = '\\}'; - state.output = out; - for (const t of toks) { - state.output += (t.output || t.value); - } - } - push({ type: 'brace', value, output }); - decrement('braces'); - braces.pop(); - continue; - } +/***/ }), - /** - * Pipes - */ +/***/ 98098: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (value === '|') { - if (extglobs.length > 0) { - extglobs[extglobs.length - 1].conditions++; - } - push({ type: 'text', value }); - continue; - } +"use strict"; - /** - * Commas - */ +const path = __nccwpck_require__(71017); +const findUp = __nccwpck_require__(81812); - if (value === ',') { - let output = value; +const pkgDir = async cwd => { + const filePath = await findUp('package.json', {cwd}); + return filePath && path.dirname(filePath); +}; - const brace = braces[braces.length - 1]; - if (brace && stack[stack.length - 1] === 'braces') { - brace.comma = true; - output = '|'; - } +module.exports = pkgDir; +// TODO: Remove this for the next major release +module.exports["default"] = pkgDir; - push({ type: 'comma', value, output }); - continue; - } +module.exports.sync = cwd => { + const filePath = findUp.sync('package.json', {cwd}); + return filePath && path.dirname(filePath); +}; - /** - * Slashes - */ - if (value === '/') { - // if the beginning of the glob is "./", advance the start - // to the current index, and don't add the "./" characters - // to the state. This greatly simplifies lookbehinds when - // checking for BOS characters like "!" and "." (not "./") - if (prev.type === 'dot' && state.index === state.start + 1) { - state.start = state.index + 1; - state.consumed = ''; - state.output = ''; - tokens.pop(); - prev = bos; // reset "prev" to the first token - continue; - } +/***/ }), - push({ type: 'slash', value, output: SLASH_LITERAL }); - continue; - } +/***/ 81812: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Dots - */ +"use strict"; - if (value === '.') { - if (state.braces > 0 && prev.type === 'dot') { - if (prev.value === '.') prev.output = DOT_LITERAL; - const brace = braces[braces.length - 1]; - prev.type = 'dots'; - prev.output += value; - prev.value += value; - brace.dots = true; - continue; - } +const path = __nccwpck_require__(71017); +const locatePath = __nccwpck_require__(5937); +const pathExists = __nccwpck_require__(96978); - if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { - push({ type: 'text', value, output: DOT_LITERAL }); - continue; - } +const stop = Symbol('findUp.stop'); - push({ type: 'dot', value, output: DOT_LITERAL }); - continue; - } +module.exports = async (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); - /** - * Question marks - */ + const runMatcher = async locateOptions => { + if (typeof name !== 'function') { + return locatePath(paths, locateOptions); + } - if (value === '?') { - const isGroup = prev && prev.value === '('; - if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('qmark', value); - continue; - } + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath([foundPath], locateOptions); + } - if (prev && prev.type === 'paren') { - const next = peek(); - let output = value; + return foundPath; + }; - if (next === '<' && !utils.supportsLookbehinds()) { - throw new Error('Node.js v10 or higher is required for regex lookbehinds'); - } + // eslint-disable-next-line no-constant-condition + while (true) { + // eslint-disable-next-line no-await-in-loop + const foundPath = await runMatcher({...options, cwd: directory}); - if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { - output = `\\${value}`; - } + if (foundPath === stop) { + return; + } - push({ type: 'text', value, output }); - continue; - } + if (foundPath) { + return path.resolve(directory, foundPath); + } - if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { - push({ type: 'qmark', value, output: QMARK_NO_DOT }); - continue; - } + if (directory === root) { + return; + } - push({ type: 'qmark', value, output: QMARK }); - continue; - } + directory = path.dirname(directory); + } +}; - /** - * Exclamation - */ +module.exports.sync = (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); - if (value === '!') { - if (opts.noextglob !== true && peek() === '(') { - if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { - extglobOpen('negate', value); - continue; - } - } + const runMatcher = locateOptions => { + if (typeof name !== 'function') { + return locatePath.sync(paths, locateOptions); + } - if (opts.nonegate !== true && state.index === 0) { - negate(); - continue; - } - } + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath.sync([foundPath], locateOptions); + } - /** - * Plus - */ + return foundPath; + }; - if (value === '+') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('plus', value); - continue; - } + // eslint-disable-next-line no-constant-condition + while (true) { + const foundPath = runMatcher({...options, cwd: directory}); - if ((prev && prev.value === '(') || opts.regex === false) { - push({ type: 'plus', value, output: PLUS_LITERAL }); - continue; - } + if (foundPath === stop) { + return; + } - if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { - push({ type: 'plus', value }); - continue; - } + if (foundPath) { + return path.resolve(directory, foundPath); + } - push({ type: 'plus', value: PLUS_LITERAL }); - continue; - } + if (directory === root) { + return; + } - /** - * Plain text - */ + directory = path.dirname(directory); + } +}; - if (value === '@') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - push({ type: 'at', extglob: true, value, output: '' }); - continue; - } +module.exports.exists = pathExists; - push({ type: 'text', value }); - continue; - } +module.exports.sync.exists = pathExists.sync; - /** - * Plain text - */ +module.exports.stop = stop; - if (value !== '*') { - if (value === '$' || value === '^') { - value = `\\${value}`; - } - const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); - if (match) { - value += match[0]; - state.index += match[0].length; - } +/***/ }), - push({ type: 'text', value }); - continue; - } +/***/ 5937: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /** - * Stars - */ +"use strict"; - if (prev && (prev.type === 'globstar' || prev.star === true)) { - prev.type = 'star'; - prev.star = true; - prev.value += value; - prev.output = star; - state.backtrack = true; - state.globstar = true; - consume(value); - continue; - } +const path = __nccwpck_require__(71017); +const fs = __nccwpck_require__(57147); +const {promisify} = __nccwpck_require__(73837); +const pLocate = __nccwpck_require__(26249); - let rest = remaining(); - if (opts.noextglob !== true && /^\([^?]/.test(rest)) { - extglobOpen('star', value); - continue; - } +const fsStat = promisify(fs.stat); +const fsLStat = promisify(fs.lstat); - if (prev.type === 'star') { - if (opts.noglobstar === true) { - consume(value); - continue; - } +const typeMappings = { + directory: 'isDirectory', + file: 'isFile' +}; - const prior = prev.prev; - const before = prior.prev; - const isStart = prior.type === 'slash' || prior.type === 'bos'; - const afterStar = before && (before.type === 'star' || before.type === 'globstar'); +function checkType({type}) { + if (type in typeMappings) { + return; + } - if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { - push({ type: 'star', value, output: '' }); - continue; - } + throw new Error(`Invalid type specified: ${type}`); +} - const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); - const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); - if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { - push({ type: 'star', value, output: '' }); - continue; - } +const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); - // strip consecutive `/**/` - while (rest.slice(0, 3) === '/**') { - const after = input[state.index + 4]; - if (after && after !== '/') { - break; - } - rest = rest.slice(3); - consume('/**', 3); - } +module.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: 'file', + allowSymlinks: true, + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fsStat : fsLStat; - if (prior.type === 'bos' && eos()) { - prev.type = 'globstar'; - prev.value += value; - prev.output = globstar(opts); - state.output = prev.output; - state.globstar = true; - consume(value); - continue; - } + return pLocate(paths, async path_ => { + try { + const stat = await statFn(path.resolve(options.cwd, path_)); + return matchType(options.type, stat); + } catch (_) { + return false; + } + }, options); +}; - if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; +module.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: 'file', + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; - prev.type = 'globstar'; - prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); - prev.value += value; - state.globstar = true; - state.output += prior.output + prev.output; - consume(value); - continue; - } + for (const path_ of paths) { + try { + const stat = statFn(path.resolve(options.cwd, path_)); - if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { - const end = rest[1] !== void 0 ? '|$' : ''; + if (matchType(options.type, stat)) { + return path_; + } + } catch (_) { + } + } +}; - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; - prev.type = 'globstar'; - prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; - prev.value += value; +/***/ }), - state.output += prior.output + prev.output; - state.globstar = true; +/***/ 54752: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - consume(value + advance()); +"use strict"; - push({ type: 'slash', value: '/', output: '' }); - continue; - } +const pTry = __nccwpck_require__(80746); - if (prior.type === 'bos' && rest[0] === '/') { - prev.type = 'globstar'; - prev.value += value; - prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; - state.output = prev.output; - state.globstar = true; - consume(value + advance()); - push({ type: 'slash', value: '/', output: '' }); - continue; - } +const pLimit = concurrency => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); + } - // remove single star from output - state.output = state.output.slice(0, -prev.output.length); + const queue = []; + let activeCount = 0; - // reset previous token to globstar - prev.type = 'globstar'; - prev.output = globstar(opts); - prev.value += value; + const next = () => { + activeCount--; - // reset output with globstar - state.output += prev.output; - state.globstar = true; - consume(value); - continue; - } + if (queue.length > 0) { + queue.shift()(); + } + }; - const token = { type: 'star', value, output: star }; + const run = (fn, resolve, ...args) => { + activeCount++; - if (opts.bash === true) { - token.output = '.*?'; - if (prev.type === 'bos' || prev.type === 'slash') { - token.output = nodot + token.output; - } - push(token); - continue; - } + const result = pTry(fn, ...args); - if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { - token.output = value; - push(token); - continue; - } + resolve(result); - if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { - if (prev.type === 'dot') { - state.output += NO_DOT_SLASH; - prev.output += NO_DOT_SLASH; + result.then(next, next); + }; - } else if (opts.dot === true) { - state.output += NO_DOTS_SLASH; - prev.output += NO_DOTS_SLASH; + const enqueue = (fn, resolve, ...args) => { + if (activeCount < concurrency) { + run(fn, resolve, ...args); + } else { + queue.push(run.bind(null, fn, resolve, ...args)); + } + }; - } else { - state.output += nodot; - prev.output += nodot; - } + const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.length + }, + clearQueue: { + value: () => { + queue.length = 0; + } + } + }); - if (peek() !== '*') { - state.output += ONE_CHAR; - prev.output += ONE_CHAR; - } - } + return generator; +}; - push(token); - } +module.exports = pLimit; +module.exports["default"] = pLimit; - while (state.brackets > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); - state.output = utils.escapeLast(state.output, '['); - decrement('brackets'); - } - while (state.parens > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); - state.output = utils.escapeLast(state.output, '('); - decrement('parens'); - } +/***/ }), - while (state.braces > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); - state.output = utils.escapeLast(state.output, '{'); - decrement('braces'); - } +/***/ 26249: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { - push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); - } +"use strict"; - // rebuild the output if we had to backtrack at any point - if (state.backtrack === true) { - state.output = ''; +const pLimit = __nccwpck_require__(54752); - for (const token of state.tokens) { - state.output += token.output != null ? token.output : token.value; +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} - if (token.suffix) { - state.output += token.suffix; - } - } - } +// The input can also be a promise, so we await it +const testElement = async (element, tester) => tester(await element); - return state; +// The input can also be a promise, so we `Promise.all()` them both +const finder = async element => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); + } + + return false; }; -/** - * Fast paths for creating regular expressions for common glob patterns. - * This can significantly speed up processing and has very little downside - * impact when none of the fast paths match. - */ +const pLocate = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; -parse.fastpaths = (input, options) => { - const opts = { ...options }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - const len = input.length; - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + const limit = pLimit(options.concurrency); + + // Start all the promises concurrently with optional limit + const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); + + // Check the promises either serially or concurrently + const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); + + try { + await Promise.all(items.map(element => checkLimit(finder, element))); + } catch (error) { + if (error instanceof EndError) { + return error.value; + } + + throw error; + } +}; + +module.exports = pLocate; +// TODO: Remove this for the next major release +module.exports["default"] = pLocate; + + +/***/ }), + +/***/ 766: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Container = __nccwpck_require__(93); + +class AtWord extends Container { + constructor (opts) { + super(opts); + this.type = 'atword'; } - input = REPLACEMENTS[input] || input; - const win32 = utils.isWindows(options); + toString () { + let quote = this.quoted ? this.raws.quote : ''; + return [ + this.raws.before, + '@', + // we can't use String() here because it'll try using itself + // as the constructor + String.prototype.toString.call(this.value), + this.raws.after + ].join(''); + } +} - // create constants based on platform, for windows or posix - const { - DOT_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOTS_SLASH, - STAR, - START_ANCHOR - } = constants.globChars(win32); +Container.registerWalker(AtWord); - const nodot = opts.dot ? NO_DOTS : NO_DOT; - const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; - const capture = opts.capture ? '' : '?:'; - const state = { negated: false, prefix: '' }; - let star = opts.bash === true ? '.*?' : STAR; +module.exports = AtWord; - if (opts.capture) { - star = `(${star})`; + +/***/ }), + +/***/ 12946: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Container = __nccwpck_require__(93); +const Node = __nccwpck_require__(35809); + +class Colon extends Node { + constructor (opts) { + super(opts); + this.type = 'colon'; } +} - const globstar = opts => { - if (opts.noglobstar === true) return star; - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; +Container.registerWalker(Colon); - const create = str => { - switch (str) { - case '*': - return `${nodot}${ONE_CHAR}${star}`; +module.exports = Colon; - case '.*': - return `${DOT_LITERAL}${ONE_CHAR}${star}`; - case '*.*': - return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; +/***/ }), - case '*/*': - return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; +/***/ 59475: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - case '**': - return nodot + globstar(opts); +"use strict"; - case '**/*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; - case '**/*.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; +const Container = __nccwpck_require__(93); +const Node = __nccwpck_require__(35809); - case '**/.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; +class Comma extends Node { + constructor (opts) { + super(opts); + this.type = 'comma'; + } +} - default: { - const match = /^(.*?)\.(\w+)$/.exec(str); - if (!match) return; +Container.registerWalker(Comma); - const source = create(match[1]); - if (!source) return; +module.exports = Comma; - return source + DOT_LITERAL + match[2]; - } - } - }; - const output = utils.removePrefix(input, state); - let source = create(output); +/***/ }), - if (source && opts.strictSlashes !== true) { - source += `${SLASH_LITERAL}?`; +/***/ 36227: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Container = __nccwpck_require__(93); +const Node = __nccwpck_require__(35809); + +class Comment extends Node { + constructor (opts) { + super(opts); + this.type = 'comment'; + this.inline = opts.inline || false; } - return source; + toString () { + return [ + this.raws.before, + this.inline ? '//' : '/*', + String(this.value), + this.inline ? '' : '*/', + this.raws.after + ].join(''); + } }; -module.exports = parse; +Container.registerWalker(Comment); + +module.exports = Comment; /***/ }), -/***/ 33322: +/***/ 93: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __nccwpck_require__(71017); -const scan = __nccwpck_require__(32429); -const parse = __nccwpck_require__(92139); -const utils = __nccwpck_require__(30479); -const constants = __nccwpck_require__(16099); -const isObject = val => val && typeof val === 'object' && !Array.isArray(val); +const Node = __nccwpck_require__(35809); -/** - * Creates a matcher function from one or more glob patterns. The - * returned function takes a string to match as its first argument, - * and returns true if the string is a match. The returned matcher - * function also takes a boolean as the second argument that, when true, - * returns an object with additional information. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch(glob[, options]); - * - * const isMatch = picomatch('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @name picomatch - * @param {String|Array} `globs` One or more glob patterns. - * @param {Object=} `options` - * @return {Function=} Returns a matcher function. - * @api public - */ +class Container extends Node { -const picomatch = (glob, options, returnState = false) => { - if (Array.isArray(glob)) { - const fns = glob.map(input => picomatch(input, options, returnState)); - const arrayMatcher = str => { - for (const isMatch of fns) { - const state = isMatch(str); - if (state) return state; - } - return false; - }; - return arrayMatcher; - } + constructor (opts) { + super(opts); - const isState = isObject(glob) && glob.tokens && glob.input; + if (!this.nodes) { + this.nodes = []; + } + } - if (glob === '' || (typeof glob !== 'string' && !isState)) { - throw new TypeError('Expected pattern to be a non-empty string'); + push (child) { + child.parent = this; + this.nodes.push(child); + return this; } - const opts = options || {}; - const posix = utils.isWindows(options); - const regex = isState - ? picomatch.compileRe(glob, options) - : picomatch.makeRe(glob, options, false, true); + each (callback) { + if (!this.lastEach) this.lastEach = 0; + if (!this.indexes) this.indexes = { }; - const state = regex.state; - delete regex.state; + this.lastEach += 1; - let isIgnored = () => false; - if (opts.ignore) { - const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; - isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); - } + let id = this.lastEach, + index, + result; - const matcher = (input, returnObject = false) => { - const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); - const result = { glob, state, regex, posix, input, output, match, isMatch }; + this.indexes[id] = 0; - if (typeof opts.onResult === 'function') { - opts.onResult(result); - } + if (!this.nodes) return undefined; - if (isMatch === false) { - result.isMatch = false; - return returnObject ? result : false; - } + while (this.indexes[id] < this.nodes.length) { + index = this.indexes[id]; + result = callback(this.nodes[index], index); + if (result === false) break; - if (isIgnored(input)) { - if (typeof opts.onIgnore === 'function') { - opts.onIgnore(result); - } - result.isMatch = false; - return returnObject ? result : false; + this.indexes[id] += 1; } - if (typeof opts.onMatch === 'function') { - opts.onMatch(result); - } - return returnObject ? result : true; - }; + delete this.indexes[id]; - if (returnState) { - matcher.state = state; + return result; } - return matcher; -}; + walk (callback) { + return this.each((child, i) => { + let result = callback(child, i); + if (result !== false && child.walk) { + result = child.walk(callback); + } + return result; + }); + } -/** - * Test `input` with the given `regex`. This is used by the main - * `picomatch()` function to test the input string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.test(input, regex[, options]); - * - * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); - * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } - * ``` - * @param {String} `input` String to test. - * @param {RegExp} `regex` - * @return {Object} Returns an object with matching info. - * @api public - */ + walkType (type, callback) { + if (!type || !callback) { + throw new Error('Parameters {type} and {callback} are required.'); + } -picomatch.test = (input, regex, options, { glob, posix } = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected input to be a string'); + // allow users to pass a constructor, or node type string; eg. Word. + type = type.name && type.prototype ? type.name : type; + + return this.walk((node, index) => { + if (node.type === type) { + return callback.call(this, node, index); + } + }); } - if (input === '') { - return { isMatch: false, output: '' }; + append (node) { + node.parent = this; + this.nodes.push(node); + return this; } - const opts = options || {}; - const format = opts.format || (posix ? utils.toPosixSlashes : null); - let match = input === glob; - let output = (match && format) ? format(input) : input; + prepend (node) { + node.parent = this; + this.nodes.unshift(node); + return this; + } - if (match === false) { - output = format ? format(input) : input; - match = output === glob; + cleanRaws (keepBetween) { + super.cleanRaws(keepBetween); + if (this.nodes) { + for (let node of this.nodes) node.cleanRaws(keepBetween); + } } - if (match === false || opts.capture === true) { - if (opts.matchBase === true || opts.basename === true) { - match = picomatch.matchBase(input, regex, options, posix); - } else { - match = regex.exec(output); + insertAfter (oldNode, newNode) { + let oldIndex = this.index(oldNode), + index; + + this.nodes.splice(oldIndex + 1, 0, newNode); + + for (let id in this.indexes) { + index = this.indexes[id]; + if (oldIndex <= index) { + this.indexes[id] = index + this.nodes.length; + } } + + return this; } - return { isMatch: Boolean(match), match, output }; -}; + insertBefore (oldNode, newNode) { + let oldIndex = this.index(oldNode), + index; -/** - * Match the basename of a filepath. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.matchBase(input, glob[, options]); - * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true - * ``` - * @param {String} `input` String to test. - * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). - * @return {Boolean} - * @api public - */ + this.nodes.splice(oldIndex, 0, newNode); -picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { - const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); - return regex.test(path.basename(input)); -}; + for (let id in this.indexes) { + index = this.indexes[id]; + if (oldIndex <= index) { + this.indexes[id] = index + this.nodes.length; + } + } -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.isMatch(string, patterns[, options]); - * - * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String|Array} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + return this; + } -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const picomatch = require('picomatch'); - * const result = picomatch.parse(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as a regex source string. - * @api public - */ + removeChild (child) { + child = this.index(child); + this.nodes[child].parent = undefined; + this.nodes.splice(child, 1); -picomatch.parse = (pattern, options) => { - if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); - return parse(pattern, { ...options, fastpaths: false }); -}; + let index; + for (let id in this.indexes) { + index = this.indexes[id]; + if (index >= child) { + this.indexes[id] = index - 1; + } + } -/** - * Scan a glob pattern to separate the pattern into segments. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.scan(input[, options]); - * - * const result = picomatch.scan('!./foo/*.js'); - * console.log(result); - * { prefix: '!./', - * input: '!./foo/*.js', - * start: 3, - * base: 'foo', - * glob: '*.js', - * isBrace: false, - * isBracket: false, - * isGlob: true, - * isExtglob: false, - * isGlobstar: false, - * negated: true } - * ``` - * @param {String} `input` Glob pattern to scan. - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ + return this; + } -picomatch.scan = (input, options) => scan(input, options); + removeAll () { + for (let node of this.nodes) node.parent = undefined; + this.nodes = []; + return this; + } -/** - * Compile a regular expression from the `state` object returned by the - * [parse()](#parse) method. - * - * @param {Object} `state` - * @param {Object} `options` - * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. - * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. - * @return {RegExp} - * @api public - */ + every (condition) { + return this.nodes.every(condition); + } -picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { - if (returnOutput === true) { - return state.output; + some (condition) { + return this.nodes.some(condition); } - const opts = options || {}; - const prepend = opts.contains ? '' : '^'; - const append = opts.contains ? '' : '$'; + index (child) { + if (typeof child === 'number') { + return child; + } + else { + return this.nodes.indexOf(child); + } + } - let source = `${prepend}(?:${state.output})${append}`; - if (state && state.negated === true) { - source = `^(?!${source}).*$`; + get first () { + if (!this.nodes) return undefined; + return this.nodes[0]; } - const regex = picomatch.toRegex(source, options); - if (returnState === true) { - regex.state = state; + get last () { + if (!this.nodes) return undefined; + return this.nodes[this.nodes.length - 1]; } - return regex; -}; + toString () { + let result = this.nodes.map(String).join(''); -/** - * Create a regular expression from a parsed glob pattern. - * - * ```js - * const picomatch = require('picomatch'); - * const state = picomatch.parse('*.js'); - * // picomatch.compileRe(state[, options]); - * - * console.log(picomatch.compileRe(state)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `state` The object returned from the `.parse` method. - * @param {Object} `options` - * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. - * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ + if (this.value) { + result = this.value + result; + } -picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { - if (!input || typeof input !== 'string') { - throw new TypeError('Expected a non-empty string'); + if (this.raws.before) { + result = this.raws.before + result; + } + + if (this.raws.after) { + result += this.raws.after; + } + + return result; } +} - let parsed = { negated: false, fastpaths: true }; +Container.registerWalker = (constructor) => { + let walkerName = 'walk' + constructor.name; - if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { - parsed.output = parse.fastpaths(input, options); + // plural sugar + if (walkerName.lastIndexOf('s') !== walkerName.length - 1) { + walkerName += 's'; } - if (!parsed.output) { - parsed = parse(input, options); + if (Container.prototype[walkerName]) { + return; } - return picomatch.compileRe(parsed, options, returnOutput, returnState); + // we need access to `this` so we can't use an arrow function + Container.prototype[walkerName] = function (callback) { + return this.walkType(constructor, callback); + }; }; -/** - * Create a regular expression from the given regex source string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.toRegex(source[, options]); - * - * const { output } = picomatch.parse('*.js'); - * console.log(picomatch.toRegex(output)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `source` Regular expression source string. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ +module.exports = Container; -picomatch.toRegex = (source, options) => { - try { - const opts = options || {}; - return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); - } catch (err) { - if (options && options.debug === true) throw err; - return /$^/; - } -}; -/** - * Picomatch constants. - * @return {Object} - */ +/***/ }), -picomatch.constants = constants; +/***/ 75118: +/***/ ((module) => { -/** - * Expose "picomatch" - */ +"use strict"; -module.exports = picomatch; + +class ParserError extends Error { + constructor(message) { + super(message); + + this.name = this.constructor.name; + this.message = message || 'An error ocurred while parsing.'; + + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, this.constructor); + } + else { + this.stack = (new Error(message)).stack; + } + } +} + +module.exports = ParserError; /***/ }), -/***/ 32429: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 36974: +/***/ ((module) => { "use strict"; -const utils = __nccwpck_require__(30479); -const { - CHAR_ASTERISK, /* * */ - CHAR_AT, /* @ */ - CHAR_BACKWARD_SLASH, /* \ */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_EXCLAMATION_MARK, /* ! */ - CHAR_FORWARD_SLASH, /* / */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_PLUS, /* + */ - CHAR_QUESTION_MARK, /* ? */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_RIGHT_SQUARE_BRACKET /* ] */ -} = __nccwpck_require__(16099); +class TokenizeError extends Error { + constructor(message) { + super(message); -const isPathSeparator = code => { - return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; -}; + this.name = this.constructor.name; + this.message = message || 'An error ocurred while tokzenizing.'; -const depth = token => { - if (token.isPrefix !== true) { - token.depth = token.isGlobstar ? Infinity : 1; + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, this.constructor); + } + else { + this.stack = (new Error(message)).stack; + } } -}; - -/** - * Quickly scans a glob pattern and returns an object with a handful of - * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), - * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not - * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). - * - * ```js - * const pm = require('picomatch'); - * console.log(pm.scan('foo/bar/*.js')); - * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {Object} Returns an object with tokens and regex source string. - * @api public - */ +} -const scan = (input, options) => { - const opts = options || {}; +module.exports = TokenizeError; - const length = input.length - 1; - const scanToEnd = opts.parts === true || opts.scanToEnd === true; - const slashes = []; - const tokens = []; - const parts = []; - let str = input; - let index = -1; - let start = 0; - let lastIndex = 0; - let isBrace = false; - let isBracket = false; - let isGlob = false; - let isExtglob = false; - let isGlobstar = false; - let braceEscaped = false; - let backslashes = false; - let negated = false; - let negatedExtglob = false; - let finished = false; - let braces = 0; - let prev; - let code; - let token = { value: '', depth: 0, isGlob: false }; +/***/ }), - const eos = () => index >= length; - const peek = () => str.charCodeAt(index + 1); - const advance = () => { - prev = code; - return str.charCodeAt(++index); - }; +/***/ 51773: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - while (index < length) { - code = advance(); - let next; +"use strict"; - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); - if (code === CHAR_LEFT_CURLY_BRACE) { - braceEscaped = true; - } - continue; - } +const Container = __nccwpck_require__(93); - if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { - braces++; +class FunctionNode extends Container { + constructor (opts) { + super(opts); + this.type = 'func'; + // start off at -1 so we know there haven't been any parens added + this.unbalanced = -1; + } +}; - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } +Container.registerWalker(FunctionNode); - if (code === CHAR_LEFT_CURLY_BRACE) { - braces++; - continue; - } +module.exports = FunctionNode; - if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; - if (scanToEnd === true) { - continue; - } +/***/ }), - break; - } +/***/ 83184: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (braceEscaped !== true && code === CHAR_COMMA) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; +"use strict"; - if (scanToEnd === true) { - continue; - } - break; - } +const Parser = __nccwpck_require__(8281); +const AtWord = __nccwpck_require__(766); +const Colon = __nccwpck_require__(12946); +const Comma = __nccwpck_require__(59475); +const Comment = __nccwpck_require__(36227); +const Func = __nccwpck_require__(51773); +const Num = __nccwpck_require__(68339); +const Operator = __nccwpck_require__(86041); +const Paren = __nccwpck_require__(61586); +const Str = __nccwpck_require__(29275); +const UnicodeRange = __nccwpck_require__(73920); +const Value = __nccwpck_require__(78167); +const Word = __nccwpck_require__(43410); - if (code === CHAR_RIGHT_CURLY_BRACE) { - braces--; +let parser = function (source, options) { + return new Parser(source, options); +}; - if (braces === 0) { - braceEscaped = false; - isBrace = token.isBrace = true; - finished = true; - break; - } - } - } +parser.atword = function (opts) { + return new AtWord(opts); +}; - if (scanToEnd === true) { - continue; - } +parser.colon = function (opts) { + opts.value = opts.value || ':'; + return new Colon(opts); +}; - break; - } +parser.comma = function (opts) { + opts.value = opts.value || ','; + return new Comma(opts); +}; - if (code === CHAR_FORWARD_SLASH) { - slashes.push(index); - tokens.push(token); - token = { value: '', depth: 0, isGlob: false }; +parser.comment = function (opts) { + return new Comment(opts); +}; - if (finished === true) continue; - if (prev === CHAR_DOT && index === (start + 1)) { - start += 2; - continue; - } +parser.func = function (opts) { + return new Func(opts); +}; - lastIndex = index + 1; - continue; - } +parser.number = function (opts) { + return new Num(opts); +}; - if (opts.noext !== true) { - const isExtglobChar = code === CHAR_PLUS - || code === CHAR_AT - || code === CHAR_ASTERISK - || code === CHAR_QUESTION_MARK - || code === CHAR_EXCLAMATION_MARK; +parser.operator = function (opts) { + return new Operator(opts); +}; - if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; - isExtglob = token.isExtglob = true; - finished = true; - if (code === CHAR_EXCLAMATION_MARK && index === start) { - negatedExtglob = true; - } +parser.paren = function (opts) { + opts.value = opts.value || '('; + return new Paren(opts); +}; - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } +parser.string = function (opts) { + opts.quote = opts.quote || '\''; + return new Str(opts); +}; - if (code === CHAR_RIGHT_PARENTHESES) { - isGlob = token.isGlob = true; - finished = true; - break; - } - } - continue; - } - break; - } - } +parser.value = function (opts) { + return new Value(opts); +}; - if (code === CHAR_ASTERISK) { - if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; - isGlob = token.isGlob = true; - finished = true; +parser.word = function (opts) { + return new Word(opts); +}; - if (scanToEnd === true) { - continue; - } - break; - } +parser.unicodeRange = function (opts) { + return new UnicodeRange(opts); +}; - if (code === CHAR_QUESTION_MARK) { - isGlob = token.isGlob = true; - finished = true; +module.exports = parser; - if (scanToEnd === true) { - continue; - } - break; - } - if (code === CHAR_LEFT_SQUARE_BRACKET) { - while (eos() !== true && (next = advance())) { - if (next === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } +/***/ }), - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - isBracket = token.isBracket = true; - isGlob = token.isGlob = true; - finished = true; - break; - } - } +/***/ 35809: +/***/ ((module) => { - if (scanToEnd === true) { - continue; - } +"use strict"; - break; - } - if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { - negated = token.negated = true; - start++; - continue; - } +let cloneNode = function (obj, parent) { + let cloned = new obj.constructor(); - if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; + for (let i in obj) { + if (!obj.hasOwnProperty(i)) continue; - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_LEFT_PARENTHESES) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } + let value = obj[i], + type = typeof value; - if (code === CHAR_RIGHT_PARENTHESES) { - finished = true; - break; - } - } - continue; - } - break; + if (i === 'parent' && type === 'object') { + if (parent) cloned[i] = parent; + } + else if (i === 'source') { + cloned[i] = value; + } + else if (value instanceof Array) { + cloned[i] = value.map(j => cloneNode(j, cloned)); + } + else if (i !== 'before' && i !== 'after' && i !== 'between' && i !== 'semicolon') { + if (type === 'object' && value !== null) value = cloneNode(value); + cloned[i] = value; } + } - if (isGlob === true) { - finished = true; + return cloned; +}; - if (scanToEnd === true) { - continue; - } +module.exports = class Node { - break; + constructor (defaults) { + defaults = defaults || {}; + this.raws = { before: '', after: '' }; + + for (let name in defaults) { + this[name] = defaults[name]; } } - if (opts.noext === true) { - isExtglob = false; - isGlob = false; - } + remove () { + if (this.parent) { + this.parent.removeChild(this); + } - let base = str; - let prefix = ''; - let glob = ''; + this.parent = undefined; - if (start > 0) { - prefix = str.slice(0, start); - str = str.slice(start); - lastIndex -= start; + return this; } - if (base && isGlob === true && lastIndex > 0) { - base = str.slice(0, lastIndex); - glob = str.slice(lastIndex); - } else if (isGlob === true) { - base = ''; - glob = str; - } else { - base = str; + toString () { + return [ + this.raws.before, + String(this.value), + this.raws.after + ].join(''); } - if (base && base !== '' && base !== '/' && base !== str) { - if (isPathSeparator(base.charCodeAt(base.length - 1))) { - base = base.slice(0, -1); - } - } + clone (overrides) { + overrides = overrides || {}; - if (opts.unescape === true) { - if (glob) glob = utils.removeBackslashes(glob); + let cloned = cloneNode(this); - if (base && backslashes === true) { - base = utils.removeBackslashes(base); + for (let name in overrides) { + cloned[name] = overrides[name]; } + + return cloned; } - const state = { - prefix, - input, - start, - base, - glob, - isBrace, - isBracket, - isGlob, - isExtglob, - isGlobstar, - negated, - negatedExtglob - }; + cloneBefore (overrides) { + overrides = overrides || {}; - if (opts.tokens === true) { - state.maxDepth = 0; - if (!isPathSeparator(code)) { - tokens.push(token); - } - state.tokens = tokens; + let cloned = this.clone(overrides); + + this.parent.insertBefore(this, cloned); + return cloned; } - if (opts.parts === true || opts.tokens === true) { - let prevIndex; + cloneAfter (overrides) { + overrides = overrides || {}; - for (let idx = 0; idx < slashes.length; idx++) { - const n = prevIndex ? prevIndex + 1 : start; - const i = slashes[idx]; - const value = input.slice(n, i); - if (opts.tokens) { - if (idx === 0 && start !== 0) { - tokens[idx].isPrefix = true; - tokens[idx].value = prefix; - } else { - tokens[idx].value = value; - } - depth(tokens[idx]); - state.maxDepth += tokens[idx].depth; - } - if (idx !== 0 || value !== '') { - parts.push(value); - } - prevIndex = i; - } + let cloned = this.clone(overrides); - if (prevIndex && prevIndex + 1 < input.length) { - const value = input.slice(prevIndex + 1); - parts.push(value); + this.parent.insertAfter(this, cloned); + return cloned; + } - if (opts.tokens) { - tokens[tokens.length - 1].value = value; - depth(tokens[tokens.length - 1]); - state.maxDepth += tokens[tokens.length - 1].depth; + replaceWith () { + let nodes = Array.prototype.slice.call(arguments); + + if (this.parent) { + for (let node of nodes) { + this.parent.insertBefore(this, node); } + + this.remove(); } - state.slashes = slashes; - state.parts = parts; + return this; } - return state; -}; + moveTo (container) { + this.cleanRaws(this.root() === container.root()); + this.remove(); -module.exports = scan; + container.append(this); + return this; + } -/***/ }), + moveBefore (node) { + this.cleanRaws(this.root() === node.root()); + this.remove(); -/***/ 30479: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + node.parent.insertBefore(node, this); -"use strict"; + return this; + } + moveAfter (node) { + this.cleanRaws(this.root() === node.root()); + this.remove(); + node.parent.insertAfter(node, this); + return this; + } -const path = __nccwpck_require__(71017); -const win32 = process.platform === 'win32'; -const { - REGEX_BACKSLASH, - REGEX_REMOVE_BACKSLASH, - REGEX_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_GLOBAL -} = __nccwpck_require__(16099); + next () { + let index = this.parent.index(this); -exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); -exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); -exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); -exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); -exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + return this.parent.nodes[index + 1]; + } -exports.removeBackslashes = str => { - return str.replace(REGEX_REMOVE_BACKSLASH, match => { - return match === '\\' ? '' : match; - }); -}; + prev () { + let index = this.parent.index(this); -exports.supportsLookbehinds = () => { - const segs = process.version.slice(1).split('.').map(Number); - if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { - return true; + return this.parent.nodes[index - 1]; } - return false; -}; -exports.isWindows = options => { - if (options && typeof options.windows === 'boolean') { - return options.windows; - } - return win32 === true || path.sep === '\\'; -}; + toJSON () { + let fixed = { }; -exports.escapeLast = (input, char, lastIdx) => { - const idx = input.lastIndexOf(char, lastIdx); - if (idx === -1) return input; - if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); - return `${input.slice(0, idx)}\\${input.slice(idx)}`; -}; + for (let name in this) { + if (!this.hasOwnProperty(name)) continue; + if (name === 'parent') continue; + let value = this[name]; -exports.removePrefix = (input, state = {}) => { - let output = input; - if (output.startsWith('./')) { - output = output.slice(2); - state.prefix = './'; + if (value instanceof Array) { + fixed[name] = value.map(i => { + if (typeof i === 'object' && i.toJSON) { + return i.toJSON(); + } + else { + return i; + } + }); + } + else if (typeof value === 'object' && value.toJSON) { + fixed[name] = value.toJSON(); + } + else { + fixed[name] = value; + } + } + + return fixed; } - return output; -}; -exports.wrapOutput = (input, state = {}, options = {}) => { - const prepend = options.contains ? '' : '^'; - const append = options.contains ? '' : '$'; + root () { + let result = this; - let output = `${prepend}(?:${input})${append}`; - if (state.negated === true) { - output = `(?:^(?!${output}).*$)`; - } - return output; -}; + while (result.parent) result = result.parent; + return result; + } -/***/ }), + cleanRaws (keepBetween) { + delete this.raws.before; + delete this.raws.after; + if (!keepBetween) delete this.raws.between; + } -/***/ 98098: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + positionInside (index) { + let string = this.toString(), + column = this.source.start.column, + line = this.source.start.line; -"use strict"; + for (let i = 0; i < index; i++) { + if (string[i] === '\n') { + column = 1; + line += 1; + } + else { + column += 1; + } + } -const path = __nccwpck_require__(71017); -const findUp = __nccwpck_require__(81812); + return { line, column }; + } -const pkgDir = async cwd => { - const filePath = await findUp('package.json', {cwd}); - return filePath && path.dirname(filePath); -}; + positionBy (opts) { + let pos = this.source.start; -module.exports = pkgDir; -// TODO: Remove this for the next major release -module.exports["default"] = pkgDir; + if (opts.index) { + pos = this.positionInside(opts.index); + } + else if (opts.word) { + let index = this.toString().indexOf(opts.word); + if (index !== -1) pos = this.positionInside(index); + } -module.exports.sync = cwd => { - const filePath = findUp.sync('package.json', {cwd}); - return filePath && path.dirname(filePath); + return pos; + } }; /***/ }), -/***/ 81812: +/***/ 68339: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __nccwpck_require__(71017); -const locatePath = __nccwpck_require__(5937); -const pathExists = __nccwpck_require__(96978); -const stop = Symbol('findUp.stop'); +const Container = __nccwpck_require__(93); +const Node = __nccwpck_require__(35809); -module.exports = async (name, options = {}) => { - let directory = path.resolve(options.cwd || ''); - const {root} = path.parse(directory); - const paths = [].concat(name); +class NumberNode extends Node { + constructor (opts) { + super(opts); + this.type = 'number'; + this.unit = opts.unit || ''; + } - const runMatcher = async locateOptions => { - if (typeof name !== 'function') { - return locatePath(paths, locateOptions); - } + toString () { + return [ + this.raws.before, + String(this.value), + this.unit, + this.raws.after + ].join(''); + } +}; - const foundPath = await name(locateOptions.cwd); - if (typeof foundPath === 'string') { - return locatePath([foundPath], locateOptions); - } +Container.registerWalker(NumberNode); - return foundPath; - }; +module.exports = NumberNode; - // eslint-disable-next-line no-constant-condition - while (true) { - // eslint-disable-next-line no-await-in-loop - const foundPath = await runMatcher({...options, cwd: directory}); - if (foundPath === stop) { - return; - } +/***/ }), - if (foundPath) { - return path.resolve(directory, foundPath); - } +/***/ 86041: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (directory === root) { - return; - } +"use strict"; - directory = path.dirname(directory); - } -}; -module.exports.sync = (name, options = {}) => { - let directory = path.resolve(options.cwd || ''); - const {root} = path.parse(directory); - const paths = [].concat(name); +const Container = __nccwpck_require__(93); +const Node = __nccwpck_require__(35809); - const runMatcher = locateOptions => { - if (typeof name !== 'function') { - return locatePath.sync(paths, locateOptions); - } +class Operator extends Node { + constructor (opts) { + super(opts); + this.type = 'operator'; + } +} - const foundPath = name(locateOptions.cwd); - if (typeof foundPath === 'string') { - return locatePath.sync([foundPath], locateOptions); - } +Container.registerWalker(Operator); - return foundPath; - }; +module.exports = Operator; - // eslint-disable-next-line no-constant-condition - while (true) { - const foundPath = runMatcher({...options, cwd: directory}); - if (foundPath === stop) { - return; - } +/***/ }), - if (foundPath) { - return path.resolve(directory, foundPath); - } +/***/ 61586: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (directory === root) { - return; - } +"use strict"; - directory = path.dirname(directory); - } -}; -module.exports.exists = pathExists; +const Container = __nccwpck_require__(93); +const Node = __nccwpck_require__(35809); -module.exports.sync.exists = pathExists.sync; +class Parenthesis extends Node { + constructor (opts) { + super(opts); + this.type = 'paren'; + this.parenType = ''; + } +} -module.exports.stop = stop; +Container.registerWalker(Parenthesis); + +module.exports = Parenthesis; /***/ }), -/***/ 5937: +/***/ 8281: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const path = __nccwpck_require__(71017); -const fs = __nccwpck_require__(57147); -const {promisify} = __nccwpck_require__(73837); -const pLocate = __nccwpck_require__(26249); -const fsStat = promisify(fs.stat); -const fsLStat = promisify(fs.lstat); - -const typeMappings = { - directory: 'isDirectory', - file: 'isFile' -}; +const Root = __nccwpck_require__(80543); +const Value = __nccwpck_require__(78167); -function checkType({type}) { - if (type in typeMappings) { - return; - } +const AtWord = __nccwpck_require__(766); +const Colon = __nccwpck_require__(12946); +const Comma = __nccwpck_require__(59475); +const Comment = __nccwpck_require__(36227); +const Func = __nccwpck_require__(51773); +const Numbr = __nccwpck_require__(68339); +const Operator = __nccwpck_require__(86041); +const Paren = __nccwpck_require__(61586); +const Str = __nccwpck_require__(29275); +const Word = __nccwpck_require__(43410); +const UnicodeRange = __nccwpck_require__(73920); - throw new Error(`Invalid type specified: ${type}`); -} - -const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); - -module.exports = async (paths, options) => { - options = { - cwd: process.cwd(), - type: 'file', - allowSymlinks: true, - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fsStat : fsLStat; - - return pLocate(paths, async path_ => { - try { - const stat = await statFn(path.resolve(options.cwd, path_)); - return matchType(options.type, stat); - } catch (_) { - return false; - } - }, options); -}; - -module.exports.sync = (paths, options) => { - options = { - cwd: process.cwd(), - allowSymlinks: true, - type: 'file', - ...options - }; - checkType(options); - const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; - - for (const path_ of paths) { - try { - const stat = statFn(path.resolve(options.cwd, path_)); - - if (matchType(options.type, stat)) { - return path_; - } - } catch (_) { - } - } -}; - - -/***/ }), - -/***/ 54752: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const pTry = __nccwpck_require__(80746); - -const pLimit = concurrency => { - if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { - return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); - } - - const queue = []; - let activeCount = 0; - - const next = () => { - activeCount--; - - if (queue.length > 0) { - queue.shift()(); - } - }; - - const run = (fn, resolve, ...args) => { - activeCount++; - - const result = pTry(fn, ...args); - - resolve(result); - - result.then(next, next); - }; - - const enqueue = (fn, resolve, ...args) => { - if (activeCount < concurrency) { - run(fn, resolve, ...args); - } else { - queue.push(run.bind(null, fn, resolve, ...args)); - } - }; - - const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.length - }, - clearQueue: { - value: () => { - queue.length = 0; - } - } - }); - - return generator; -}; - -module.exports = pLimit; -module.exports["default"] = pLimit; - - -/***/ }), - -/***/ 26249: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const pLimit = __nccwpck_require__(54752); - -class EndError extends Error { - constructor(value) { - super(); - this.value = value; - } -} - -// The input can also be a promise, so we await it -const testElement = async (element, tester) => tester(await element); - -// The input can also be a promise, so we `Promise.all()` them both -const finder = async element => { - const values = await Promise.all(element); - if (values[1] === true) { - throw new EndError(values[0]); - } - - return false; -}; - -const pLocate = async (iterable, tester, options) => { - options = { - concurrency: Infinity, - preserveOrder: true, - ...options - }; - - const limit = pLimit(options.concurrency); - - // Start all the promises concurrently with optional limit - const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); - - // Check the promises either serially or concurrently - const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); - - try { - await Promise.all(items.map(element => checkLimit(finder, element))); - } catch (error) { - if (error instanceof EndError) { - return error.value; - } - - throw error; - } -}; - -module.exports = pLocate; -// TODO: Remove this for the next major release -module.exports["default"] = pLocate; - - -/***/ }), - -/***/ 766: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Container = __nccwpck_require__(93); - -class AtWord extends Container { - constructor (opts) { - super(opts); - this.type = 'atword'; - } - - toString () { - let quote = this.quoted ? this.raws.quote : ''; - return [ - this.raws.before, - '@', - // we can't use String() here because it'll try using itself - // as the constructor - String.prototype.toString.call(this.value), - this.raws.after - ].join(''); - } -} - -Container.registerWalker(AtWord); - -module.exports = AtWord; - - -/***/ }), - -/***/ 12946: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Container = __nccwpck_require__(93); -const Node = __nccwpck_require__(35809); - -class Colon extends Node { - constructor (opts) { - super(opts); - this.type = 'colon'; - } -} - -Container.registerWalker(Colon); - -module.exports = Colon; - - -/***/ }), - -/***/ 59475: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Container = __nccwpck_require__(93); -const Node = __nccwpck_require__(35809); - -class Comma extends Node { - constructor (opts) { - super(opts); - this.type = 'comma'; - } -} - -Container.registerWalker(Comma); - -module.exports = Comma; - - -/***/ }), - -/***/ 36227: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Container = __nccwpck_require__(93); -const Node = __nccwpck_require__(35809); - -class Comment extends Node { - constructor (opts) { - super(opts); - this.type = 'comment'; - this.inline = opts.inline || false; - } - - toString () { - return [ - this.raws.before, - this.inline ? '//' : '/*', - String(this.value), - this.inline ? '' : '*/', - this.raws.after - ].join(''); - } -}; - -Container.registerWalker(Comment); - -module.exports = Comment; - - -/***/ }), - -/***/ 93: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Node = __nccwpck_require__(35809); - -class Container extends Node { - - constructor (opts) { - super(opts); - - if (!this.nodes) { - this.nodes = []; - } - } - - push (child) { - child.parent = this; - this.nodes.push(child); - return this; - } - - each (callback) { - if (!this.lastEach) this.lastEach = 0; - if (!this.indexes) this.indexes = { }; - - this.lastEach += 1; - - let id = this.lastEach, - index, - result; - - this.indexes[id] = 0; - - if (!this.nodes) return undefined; - - while (this.indexes[id] < this.nodes.length) { - index = this.indexes[id]; - result = callback(this.nodes[index], index); - if (result === false) break; - - this.indexes[id] += 1; - } - - delete this.indexes[id]; - - return result; - } - - walk (callback) { - return this.each((child, i) => { - let result = callback(child, i); - if (result !== false && child.walk) { - result = child.walk(callback); - } - return result; - }); - } - - walkType (type, callback) { - if (!type || !callback) { - throw new Error('Parameters {type} and {callback} are required.'); - } - - // allow users to pass a constructor, or node type string; eg. Word. - type = type.name && type.prototype ? type.name : type; - - return this.walk((node, index) => { - if (node.type === type) { - return callback.call(this, node, index); - } - }); - } - - append (node) { - node.parent = this; - this.nodes.push(node); - return this; - } - - prepend (node) { - node.parent = this; - this.nodes.unshift(node); - return this; - } - - cleanRaws (keepBetween) { - super.cleanRaws(keepBetween); - if (this.nodes) { - for (let node of this.nodes) node.cleanRaws(keepBetween); - } - } - - insertAfter (oldNode, newNode) { - let oldIndex = this.index(oldNode), - index; - - this.nodes.splice(oldIndex + 1, 0, newNode); - - for (let id in this.indexes) { - index = this.indexes[id]; - if (oldIndex <= index) { - this.indexes[id] = index + this.nodes.length; - } - } - - return this; - } - - insertBefore (oldNode, newNode) { - let oldIndex = this.index(oldNode), - index; - - this.nodes.splice(oldIndex, 0, newNode); - - for (let id in this.indexes) { - index = this.indexes[id]; - if (oldIndex <= index) { - this.indexes[id] = index + this.nodes.length; - } - } - - return this; - } - - removeChild (child) { - child = this.index(child); - this.nodes[child].parent = undefined; - this.nodes.splice(child, 1); - - let index; - for (let id in this.indexes) { - index = this.indexes[id]; - if (index >= child) { - this.indexes[id] = index - 1; - } - } - - return this; - } - - removeAll () { - for (let node of this.nodes) node.parent = undefined; - this.nodes = []; - return this; - } - - every (condition) { - return this.nodes.every(condition); - } - - some (condition) { - return this.nodes.some(condition); - } - - index (child) { - if (typeof child === 'number') { - return child; - } - else { - return this.nodes.indexOf(child); - } - } - - get first () { - if (!this.nodes) return undefined; - return this.nodes[0]; - } - - get last () { - if (!this.nodes) return undefined; - return this.nodes[this.nodes.length - 1]; - } - - toString () { - let result = this.nodes.map(String).join(''); - - if (this.value) { - result = this.value + result; - } - - if (this.raws.before) { - result = this.raws.before + result; - } - - if (this.raws.after) { - result += this.raws.after; - } - - return result; - } -} - -Container.registerWalker = (constructor) => { - let walkerName = 'walk' + constructor.name; - - // plural sugar - if (walkerName.lastIndexOf('s') !== walkerName.length - 1) { - walkerName += 's'; - } - - if (Container.prototype[walkerName]) { - return; - } - - // we need access to `this` so we can't use an arrow function - Container.prototype[walkerName] = function (callback) { - return this.walkType(constructor, callback); - }; -}; - -module.exports = Container; - - -/***/ }), - -/***/ 75118: -/***/ ((module) => { - -"use strict"; - - -class ParserError extends Error { - constructor(message) { - super(message); - - this.name = this.constructor.name; - this.message = message || 'An error ocurred while parsing.'; - - if (typeof Error.captureStackTrace === 'function') { - Error.captureStackTrace(this, this.constructor); - } - else { - this.stack = (new Error(message)).stack; - } - } -} - -module.exports = ParserError; - - -/***/ }), - -/***/ 36974: -/***/ ((module) => { - -"use strict"; - - -class TokenizeError extends Error { - constructor(message) { - super(message); - - this.name = this.constructor.name; - this.message = message || 'An error ocurred while tokzenizing.'; - - if (typeof Error.captureStackTrace === 'function') { - Error.captureStackTrace(this, this.constructor); - } - else { - this.stack = (new Error(message)).stack; - } - } -} - -module.exports = TokenizeError; - - -/***/ }), - -/***/ 51773: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Container = __nccwpck_require__(93); - -class FunctionNode extends Container { - constructor (opts) { - super(opts); - this.type = 'func'; - // start off at -1 so we know there haven't been any parens added - this.unbalanced = -1; - } -}; - -Container.registerWalker(FunctionNode); - -module.exports = FunctionNode; - - -/***/ }), - -/***/ 83184: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Parser = __nccwpck_require__(8281); -const AtWord = __nccwpck_require__(766); -const Colon = __nccwpck_require__(12946); -const Comma = __nccwpck_require__(59475); -const Comment = __nccwpck_require__(36227); -const Func = __nccwpck_require__(51773); -const Num = __nccwpck_require__(68339); -const Operator = __nccwpck_require__(86041); -const Paren = __nccwpck_require__(61586); -const Str = __nccwpck_require__(29275); -const UnicodeRange = __nccwpck_require__(73920); -const Value = __nccwpck_require__(78167); -const Word = __nccwpck_require__(43410); - -let parser = function (source, options) { - return new Parser(source, options); -}; - -parser.atword = function (opts) { - return new AtWord(opts); -}; - -parser.colon = function (opts) { - opts.value = opts.value || ':'; - return new Colon(opts); -}; - -parser.comma = function (opts) { - opts.value = opts.value || ','; - return new Comma(opts); -}; - -parser.comment = function (opts) { - return new Comment(opts); -}; - -parser.func = function (opts) { - return new Func(opts); -}; - -parser.number = function (opts) { - return new Num(opts); -}; - -parser.operator = function (opts) { - return new Operator(opts); -}; - -parser.paren = function (opts) { - opts.value = opts.value || '('; - return new Paren(opts); -}; - -parser.string = function (opts) { - opts.quote = opts.quote || '\''; - return new Str(opts); -}; - -parser.value = function (opts) { - return new Value(opts); -}; - -parser.word = function (opts) { - return new Word(opts); -}; - -parser.unicodeRange = function (opts) { - return new UnicodeRange(opts); -}; - -module.exports = parser; - - -/***/ }), - -/***/ 35809: -/***/ ((module) => { - -"use strict"; - - -let cloneNode = function (obj, parent) { - let cloned = new obj.constructor(); - - for (let i in obj) { - if (!obj.hasOwnProperty(i)) continue; - - let value = obj[i], - type = typeof value; - - if (i === 'parent' && type === 'object') { - if (parent) cloned[i] = parent; - } - else if (i === 'source') { - cloned[i] = value; - } - else if (value instanceof Array) { - cloned[i] = value.map(j => cloneNode(j, cloned)); - } - else if (i !== 'before' && i !== 'after' && i !== 'between' && i !== 'semicolon') { - if (type === 'object' && value !== null) value = cloneNode(value); - cloned[i] = value; - } - } - - return cloned; -}; - -module.exports = class Node { - - constructor (defaults) { - defaults = defaults || {}; - this.raws = { before: '', after: '' }; - - for (let name in defaults) { - this[name] = defaults[name]; - } - } - - remove () { - if (this.parent) { - this.parent.removeChild(this); - } - - this.parent = undefined; - - return this; - } - - toString () { - return [ - this.raws.before, - String(this.value), - this.raws.after - ].join(''); - } - - clone (overrides) { - overrides = overrides || {}; - - let cloned = cloneNode(this); - - for (let name in overrides) { - cloned[name] = overrides[name]; - } - - return cloned; - } - - cloneBefore (overrides) { - overrides = overrides || {}; - - let cloned = this.clone(overrides); - - this.parent.insertBefore(this, cloned); - return cloned; - } - - cloneAfter (overrides) { - overrides = overrides || {}; - - let cloned = this.clone(overrides); - - this.parent.insertAfter(this, cloned); - return cloned; - } - - replaceWith () { - let nodes = Array.prototype.slice.call(arguments); - - if (this.parent) { - for (let node of nodes) { - this.parent.insertBefore(this, node); - } - - this.remove(); - } - - return this; - } - - moveTo (container) { - this.cleanRaws(this.root() === container.root()); - this.remove(); - - container.append(this); - - return this; - } - - moveBefore (node) { - this.cleanRaws(this.root() === node.root()); - this.remove(); - - node.parent.insertBefore(node, this); - - return this; - } - - moveAfter (node) { - this.cleanRaws(this.root() === node.root()); - this.remove(); - node.parent.insertAfter(node, this); - return this; - } - - next () { - let index = this.parent.index(this); - - return this.parent.nodes[index + 1]; - } - - prev () { - let index = this.parent.index(this); - - return this.parent.nodes[index - 1]; - } - - toJSON () { - let fixed = { }; - - for (let name in this) { - if (!this.hasOwnProperty(name)) continue; - if (name === 'parent') continue; - let value = this[name]; - - if (value instanceof Array) { - fixed[name] = value.map(i => { - if (typeof i === 'object' && i.toJSON) { - return i.toJSON(); - } - else { - return i; - } - }); - } - else if (typeof value === 'object' && value.toJSON) { - fixed[name] = value.toJSON(); - } - else { - fixed[name] = value; - } - } - - return fixed; - } - - root () { - let result = this; - - while (result.parent) result = result.parent; - - return result; - } - - cleanRaws (keepBetween) { - delete this.raws.before; - delete this.raws.after; - if (!keepBetween) delete this.raws.between; - } - - positionInside (index) { - let string = this.toString(), - column = this.source.start.column, - line = this.source.start.line; - - for (let i = 0; i < index; i++) { - if (string[i] === '\n') { - column = 1; - line += 1; - } - else { - column += 1; - } - } - - return { line, column }; - } - - positionBy (opts) { - let pos = this.source.start; - - if (opts.index) { - pos = this.positionInside(opts.index); - } - else if (opts.word) { - let index = this.toString().indexOf(opts.word); - if (index !== -1) pos = this.positionInside(index); - } - - return pos; - } -}; - - -/***/ }), - -/***/ 68339: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Container = __nccwpck_require__(93); -const Node = __nccwpck_require__(35809); - -class NumberNode extends Node { - constructor (opts) { - super(opts); - this.type = 'number'; - this.unit = opts.unit || ''; - } - - toString () { - return [ - this.raws.before, - String(this.value), - this.unit, - this.raws.after - ].join(''); - } -}; - -Container.registerWalker(NumberNode); - -module.exports = NumberNode; - - -/***/ }), - -/***/ 86041: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Container = __nccwpck_require__(93); -const Node = __nccwpck_require__(35809); - -class Operator extends Node { - constructor (opts) { - super(opts); - this.type = 'operator'; - } -} - -Container.registerWalker(Operator); - -module.exports = Operator; - - -/***/ }), - -/***/ 61586: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Container = __nccwpck_require__(93); -const Node = __nccwpck_require__(35809); - -class Parenthesis extends Node { - constructor (opts) { - super(opts); - this.type = 'paren'; - this.parenType = ''; - } -} - -Container.registerWalker(Parenthesis); - -module.exports = Parenthesis; - - -/***/ }), - -/***/ 8281: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Root = __nccwpck_require__(80543); -const Value = __nccwpck_require__(78167); - -const AtWord = __nccwpck_require__(766); -const Colon = __nccwpck_require__(12946); -const Comma = __nccwpck_require__(59475); -const Comment = __nccwpck_require__(36227); -const Func = __nccwpck_require__(51773); -const Numbr = __nccwpck_require__(68339); -const Operator = __nccwpck_require__(86041); -const Paren = __nccwpck_require__(61586); -const Str = __nccwpck_require__(29275); -const Word = __nccwpck_require__(43410); -const UnicodeRange = __nccwpck_require__(73920); - -const tokenize = __nccwpck_require__(27492); +const tokenize = __nccwpck_require__(27492); const flatten = __nccwpck_require__(67630); const indexesOf = __nccwpck_require__(65977); @@ -249689,15 +250341,18 @@ var isArray = Array.isArray; var defaults = { allowDots: false, + allowEmptyArrays: false, allowPrototypes: false, allowSparse: false, arrayLimit: 20, charset: 'utf-8', charsetSentinel: false, comma: false, + decodeDotInKeys: true, decoder: utils.decode, delimiter: '&', depth: 5, + duplicates: 'combine', ignoreQueryPrefix: false, interpretNumericEntities: false, parameterLimit: 1000, @@ -249731,7 +250386,8 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') var parseValues = function parseQueryStringValues(str, options) { - var obj = {}; + var obj = { __proto__: null }; + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); @@ -249784,9 +250440,10 @@ var parseValues = function parseQueryStringValues(str, options) { val = isArray(val) ? [val] : val; } - if (has.call(obj, key)) { + var existing = has.call(obj, key); + if (existing && options.duplicates === 'combine') { obj[key] = utils.combine(obj[key], val); - } else { + } else if (!existing || options.duplicates === 'last') { obj[key] = val; } } @@ -249802,24 +250459,25 @@ var parseObject = function (chain, val, options, valuesParsed) { var root = chain[i]; if (root === '[]' && options.parseArrays) { - obj = [].concat(leaf); + obj = options.allowEmptyArrays && leaf === '' ? [] : [].concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; - var index = parseInt(cleanRoot, 10); - if (!options.parseArrays && cleanRoot === '') { + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; + var index = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === '') { obj = { 0: leaf }; } else if ( !isNaN(index) - && root !== cleanRoot - && String(index) === cleanRoot + && root !== decodedRoot + && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit) ) { obj = []; obj[index] = leaf; - } else if (cleanRoot !== '__proto__') { - obj[cleanRoot] = leaf; + } else if (decodedRoot !== '__proto__') { + obj[decodedRoot] = leaf; } } @@ -249888,7 +250546,15 @@ var normalizeParseOptions = function normalizeParseOptions(opts) { return defaults; } - if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { + throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } @@ -249897,18 +250563,29 @@ var normalizeParseOptions = function normalizeParseOptions(opts) { } var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; + + if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { + throw new TypeError('The duplicates option must be either combine, first, or last'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + return { - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, charset: charset, charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, // eslint-disable-next-line no-implicit-coercion, no-extra-parens depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + duplicates: duplicates, ignoreQueryPrefix: opts.ignoreQueryPrefix === true, interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, @@ -249983,10 +250660,13 @@ var defaultFormat = formats['default']; var defaults = { addQueryPrefix: false, allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', charset: 'utf-8', charsetSentinel: false, delimiter: '&', encode: true, + encodeDotInKeys: false, encoder: utils.encode, encodeValuesOnly: false, format: defaultFormat, @@ -250015,8 +250695,10 @@ var stringify = function stringify( prefix, generateArrayPrefix, commaRoundTrip, + allowEmptyArrays, strictNullHandling, skipNulls, + encodeDotInKeys, encoder, filter, sort, @@ -250098,7 +250780,13 @@ var stringify = function stringify( objKeys = sort ? keys.sort(sort) : keys; } - var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix; + var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix; + + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; + + if (allowEmptyArrays && isArray(obj) && obj.length === 0) { + return adjustedPrefix + '[]'; + } for (var j = 0; j < objKeys.length; ++j) { var key = objKeys[j]; @@ -250108,9 +250796,10 @@ var stringify = function stringify( continue; } + var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key; var keyPrefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix - : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']'); + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix + : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); sideChannel.set(object, step); var valueSideChannel = getSideChannel(); @@ -250120,8 +250809,10 @@ var stringify = function stringify( keyPrefix, generateArrayPrefix, commaRoundTrip, + allowEmptyArrays, strictNullHandling, skipNulls, + encodeDotInKeys, generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, filter, sort, @@ -250143,6 +250834,14 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { return defaults; } + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); + } + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } @@ -250166,13 +250865,32 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { filter = opts.filter; } + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; + } + + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + return { addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, charset: charset, charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: opts.commaRoundTrip, delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, filter: filter, @@ -250206,20 +250924,8 @@ module.exports = function (object, opts) { return ''; } - var arrayFormat; - if (opts && opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if (opts && 'indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = 'indices'; - } - - var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; - if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { - throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); - } - var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip; + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; if (!objKeys) { objKeys = Object.keys(obj); @@ -250241,8 +250947,10 @@ module.exports = function (object, opts) { key, generateArrayPrefix, commaRoundTrip, + options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, + options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, @@ -255349,35 +256057,43 @@ const coerce = (version, options) => { let match = null if (!options.rtl) { - match = version.match(re[t.COERCE]) + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : 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' + // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.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. + const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] let next - while ((next = re[t.COERCERTL].exec(version)) && + while ((next = coerceRtlRegex.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 + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 + coerceRtlRegex.lastIndex = -1 } if (match === null) { return null } - return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) + const major = match[2] + const minor = match[3] || '0' + const patch = match[4] || '0' + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' + const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' + + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options) } module.exports = coerce @@ -256069,12 +256785,17 @@ 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])' + +createToken('COERCEPLAIN', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) +createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) +createToken('COERCEFULL', src[t.COERCEPLAIN] + + `(?:${src[t.PRERELEASE]})?` + + `(?:${src[t.BUILD]})?` + `(?:$|[^\\d])`) createToken('COERCERTL', src[t.COERCE], true) +createToken('COERCERTLFULL', src[t.COERCEFULL], true) // Tilde ranges. // Meaning is "reasonably at or greater than" @@ -257514,6 +258235,56 @@ const validRange = (range, options) => { module.exports = validRange +/***/ }), + +/***/ 64056: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var GetIntrinsic = __nccwpck_require__(74538); +var define = __nccwpck_require__(54564); +var hasDescriptors = __nccwpck_require__(90176)(); +var gOPD = __nccwpck_require__(18501); + +var $TypeError = __nccwpck_require__(6361); +var $floor = GetIntrinsic('%Math.floor%'); + +/** @type {import('.')} */ +module.exports = function setFunctionLength(fn, length) { + if (typeof fn !== 'function') { + throw new $TypeError('`fn` is not a function'); + } + if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) { + throw new $TypeError('`length` must be a positive 32-bit integer'); + } + + var loose = arguments.length > 2 && !!arguments[2]; + + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ('length' in fn && gOPD) { + var desc = gOPD(fn, 'length'); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define(/** @type {Parameters[0]} */ (fn), 'length', length, true, true); + } else { + define(/** @type {Parameters[0]} */ (fn), 'length', length); + } + } + return fn; +}; + + /***/ }), /***/ 14334: @@ -257526,7 +258297,7 @@ var GetIntrinsic = __nccwpck_require__(74538); var callBound = __nccwpck_require__(28803); var inspect = __nccwpck_require__(20504); -var $TypeError = GetIntrinsic('%TypeError%'); +var $TypeError = __nccwpck_require__(6361); var $WeakMap = GetIntrinsic('%WeakMap%', true); var $Map = GetIntrinsic('%Map%', true); @@ -257538,49 +258309,58 @@ var $mapSet = callBound('Map.prototype.set', true); var $mapHas = callBound('Map.prototype.has', true); /* - * This function traverses the list returning the node corresponding to the - * given key. - * - * That node is also moved to the head of the list, so that if it's accessed - * again we don't need to traverse the whole list. By doing so, all the recently - * used nodes can be accessed relatively quickly. - */ +* This function traverses the list returning the node corresponding to the given key. +* +* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly. +*/ +/** @type {import('.').listGetNode} */ var listGetNode = function (list, key) { // eslint-disable-line consistent-return - for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { + /** @type {typeof list | NonNullable<(typeof list)['next']>} */ + var prev = list; + /** @type {(typeof list)['next']} */ + var curr; + for (; (curr = prev.next) !== null; prev = curr) { if (curr.key === key) { prev.next = curr.next; - curr.next = list.next; + // eslint-disable-next-line no-extra-parens + curr.next = /** @type {NonNullable} */ (list.next); list.next = curr; // eslint-disable-line no-param-reassign return curr; } } }; +/** @type {import('.').listGet} */ var listGet = function (objects, key) { var node = listGetNode(objects, key); return node && node.value; }; +/** @type {import('.').listSet} */ var listSet = function (objects, key, value) { var node = listGetNode(objects, key); if (node) { node.value = value; } else { // Prepend the new node to the beginning of the list - objects.next = { // eslint-disable-line no-param-reassign + objects.next = /** @type {import('.').ListNode} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens key: key, next: objects.next, value: value - }; + }); } }; +/** @type {import('.').listHas} */ var listHas = function (objects, key) { return !!listGetNode(objects, key); }; +/** @type {import('.')} */ module.exports = function getSideChannel() { - var $wm; - var $m; - var $o; + /** @type {WeakMap} */ var $wm; + /** @type {Map} */ var $m; + /** @type {import('.').RootNode} */ var $o; + + /** @type {import('.').Channel} */ var channel = { assert: function (key) { if (!channel.has(key)) { @@ -257631,11 +258411,7 @@ module.exports = function getSideChannel() { $mapSet($m, key, value); } else { if (!$o) { - /* - * Initialize the linked list as an empty node, so that we don't have - * to special-case handling of the first node: we can always refer to - * it as (previous node).next, instead of something like (list).head - */ + // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head $o = { key: {}, next: null }; } listSet($o, key, value); @@ -269800,8 +270576,8 @@ var ts = (() => { var init_corePublic = __esm({ "src/compiler/corePublic.ts"() { "use strict"; - versionMajorMinor = "5.1"; - version = "5.1.6"; + versionMajorMinor = "5.4"; + version = "5.4.2"; Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -271154,9 +271930,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; @@ -271164,9 +271940,6 @@ var ts = (() => { function tryRemoveSuffix(str, suffix) { return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : void 0; } - function stringContains(str, substring) { - return str.indexOf(substring) !== -1; - } function removeMinAndVersionNumbers(fileName) { let end = fileName.length; for (let pos = end - 1; pos > 0; pos--) { @@ -271230,8 +272003,8 @@ var ts = (() => { } return false; } - function createGetCanonicalFileName(useCaseSensitiveFileNames) { - return useCaseSensitiveFileNames ? identity : toFileNameLowerCase; + function createGetCanonicalFileName(useCaseSensitiveFileNames2) { + return useCaseSensitiveFileNames2 ? identity : toFileNameLowerCase; } function patternText({ prefix, suffix }) { return `${prefix}*${suffix}`; @@ -271252,8 +272025,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; @@ -271349,12 +272122,6 @@ var ts = (() => { } } } - function padLeft(s, length2, padString = " ") { - return length2 <= s.length ? s : padString.repeat(length2 - s.length) + s; - } - function padRight(s, length2, padString = " ") { - return length2 <= s.length ? s : s + padString.repeat(length2 - s.length); - } function takeWhile(array, predicate) { if (array) { const len = array.length; @@ -271375,19 +272142,10 @@ var ts = (() => { return array.slice(index); } } - function trimEndImpl(s) { - let end = s.length - 1; - while (end >= 0) { - if (!isWhiteSpaceLike(s.charCodeAt(end))) - break; - end--; - } - return s.slice(0, end + 1); - } function isNodeLikeSystem() { return typeof process !== "undefined" && !!process.nextTick && !process.browser && "object" === "object"; } - var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale, trimString, trimStringEnd, trimStringStart; + var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale; var init_core = __esm({ "src/compiler/core.ts"() { "use strict"; @@ -271412,7 +272170,7 @@ var ts = (() => { return void 0; }; hasOwnProperty = Object.prototype.hasOwnProperty; - fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g; + fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g; AssertionLevel = /* @__PURE__ */ ((AssertionLevel2) => { AssertionLevel2[AssertionLevel2["None"] = 0] = "None"; AssertionLevel2[AssertionLevel2["Normal"] = 1] = "Normal"; @@ -271420,11 +272178,8 @@ var ts = (() => { AssertionLevel2[AssertionLevel2["VeryAggressive"] = 3] = "VeryAggressive"; return AssertionLevel2; })(AssertionLevel || {}); - createUIStringComparer = (() => { - let defaultComparer; - let enUSComparer; - const stringComparerFactory = getStringComparerFactory(); - return createStringComparer; + createUIStringComparer = /* @__PURE__ */ (() => { + return createIntlCollatorStringComparer; function compareWithCallback(a, b, comparer) { if (a === b) return 0 /* EqualTo */; @@ -271439,45 +272194,7 @@ var ts = (() => { const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare; return (a, b) => compareWithCallback(a, b, comparer); } - function createLocaleCompareStringComparer(locale) { - if (locale !== void 0) - return createFallbackStringComparer(); - return (a, b) => compareWithCallback(a, b, compareStrings); - function compareStrings(a, b) { - return a.localeCompare(b); - } - } - function createFallbackStringComparer() { - return (a, b) => compareWithCallback(a, b, compareDictionaryOrder); - function compareDictionaryOrder(a, b) { - return compareStrings(a.toUpperCase(), b.toUpperCase()) || compareStrings(a, b); - } - function compareStrings(a, b) { - return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */; - } - } - function getStringComparerFactory() { - if (typeof Intl === "object" && typeof Intl.Collator === "function") { - return createIntlCollatorStringComparer; - } - if (typeof String.prototype.localeCompare === "function" && typeof String.prototype.toLocaleUpperCase === "function" && "a".localeCompare("B") < 0) { - return createLocaleCompareStringComparer; - } - return createFallbackStringComparer; - } - function createStringComparer(locale) { - if (locale === void 0) { - return defaultComparer || (defaultComparer = stringComparerFactory(locale)); - } else if (locale === "en-US") { - return enUSComparer || (enUSComparer = stringComparerFactory(locale)); - } else { - return stringComparerFactory(locale); - } - } })(); - trimString = !!String.prototype.trim ? (s) => s.trim() : (s) => trimStringEnd(trimStringStart(s)); - trimStringEnd = !!String.prototype.trimEnd ? (s) => s.trimEnd() : trimEndImpl; - trimStringStart = !!String.prototype.trimStart ? (s) => s.trimStart() : (s) => s.replace(/^\s+/g, ""); } }); @@ -271488,13 +272205,13 @@ var ts = (() => { "use strict"; init_ts2(); init_ts2(); - LogLevel = /* @__PURE__ */ ((LogLevel2) => { - LogLevel2[LogLevel2["Off"] = 0] = "Off"; - LogLevel2[LogLevel2["Error"] = 1] = "Error"; - LogLevel2[LogLevel2["Warning"] = 2] = "Warning"; - LogLevel2[LogLevel2["Info"] = 3] = "Info"; - LogLevel2[LogLevel2["Verbose"] = 4] = "Verbose"; - return LogLevel2; + 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 */; @@ -271514,10 +272231,10 @@ var ts = (() => { } Debug2.log = log; ((_log) => { - function error(s) { + function error2(s) { logMessage(1 /* Error */, s); } - _log.error = error; + _log.error = error2; function warn(s) { logMessage(2 /* Warning */, s); } @@ -271717,7 +272434,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`, return func.name; } else { const text = Function.prototype.toString.call(func); - const match = /^function\s+([\w\$]+)\s*\(/.exec(text); + const match = /^function\s+([\w$]+)\s*\(/.exec(text); return match ? match[1] : ""; } } @@ -271791,6 +272508,15 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`, ); } Debug2.formatSnippetKind = formatSnippetKind; + function formatScriptKind(kind) { + return formatEnum( + kind, + ScriptKind, + /*isFlags*/ + false + ); + } + Debug2.formatScriptKind = formatScriptKind; function formatNodeFlags(flags) { return formatEnum( flags, @@ -271921,17 +272647,21 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`, return `${flowHeader}${remainingFlags ? ` (${formatFlowFlags(remainingFlags)})` : ""}`; } }, - __debugFlowFlags: { get() { - return formatEnum( - this.flags, - FlowFlags, - /*isFlags*/ - true - ); - } }, - __debugToString: { value() { - return formatControlFlowGraph(this); - } } + __debugFlowFlags: { + get() { + return formatEnum( + this.flags, + FlowFlags, + /*isFlags*/ + true + ); + } + }, + __debugToString: { + value() { + return formatControlFlowGraph(this); + } + } }); } } @@ -271990,25 +272720,31 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`, return `${symbolHeader} '${symbolName(this)}'${remainingSymbolFlags ? ` (${formatSymbolFlags(remainingSymbolFlags)})` : ""}`; } }, - __debugFlags: { get() { - return formatSymbolFlags(this.flags); - } } + __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 & 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 & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}` : 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 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) : ""; - } }, + __debugFlags: { + get() { + return formatTypeFlags(this.flags); + } + }, + __debugObjectFlags: { + get() { + return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; + } + }, __debugTypeToString: { value() { let text = weakTypeTextMap.get(this); @@ -272021,13 +272757,17 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`, } }); 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); - } } + __debugFlags: { + get() { + return formatSignatureFlags(this.flags); + } + }, + __debugSignatureToString: { + value() { + var _a; + return (_a = this.checker) == null ? void 0 : _a.signatureToString(this); + } + } }); const nodeConstructors = [ objectAllocator.getNodeConstructor(), @@ -272045,24 +272785,36 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`, 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)); - } }, + __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)) @@ -272541,18 +273293,18 @@ ${lanes.join("\n")} } function parseRange(text) { const alternatives = []; - for (let range of trimString(text).split(logicalOrRegExp)) { + for (let range of text.trim().split(logicalOrRegExp)) { if (!range) continue; const comparators = []; - range = trimString(range); + 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(trimString(simple)); + const match2 = rangeRegExp.exec(simple.trim()); if (!match2 || !parseComparator(match2[1], match2[2], comparators)) return void 0; } @@ -272601,15 +273353,21 @@ ${lanes.join("\n")} switch (operator) { case "~": comparators.push(createComparator(">=", version2)); - comparators.push(createComparator("<", version2.increment( - isWildcard(minor) ? "major" : "minor" - ))); + 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" - ))); + comparators.push(createComparator( + "<", + version2.increment( + version2.major > 0 || isWildcard(minor) ? "major" : version2.minor > 0 || isWildcard(patch) ? "minor" : "patch" + ) + )); break; case "<": case ">=": @@ -272693,13 +273451,13 @@ ${lanes.join("\n")} "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; + 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 = class _Version { constructor(major, minor = 0, patch = 0, prerelease = "", build2 = "") { if (typeof major === "string") { const result = Debug.checkDefined(tryParseComponents(major), "Invalid version"); @@ -272763,16 +273521,16 @@ ${lanes.join("\n")} return result; } }; + _Version.zero = new _Version(0, 0, 0, ["0"]); Version = _Version; - Version.zero = new _Version(0, 0, 0, ["0"]); - VersionRange = class { + 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(""); + const range = new _VersionRange(""); range._alternatives = sets; return range; } @@ -272818,7 +273576,7 @@ ${lanes.join("\n")} function tryGetNodePerformanceHooks() { if (isNodeLikeSystem()) { try { - const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = __nccwpck_require__(4074); + 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. @@ -272852,7 +273610,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; } @@ -273017,7 +273775,7 @@ ${lanes.join("\n")} Debug.assert(!tracing, "Tracing already started"); if (fs === void 0) { try { - fs = __nccwpck_require__(57147); + fs = __nccwpck_require__(57147); } catch (e) { throw new Error(`tracing requires having fs (original error: ${e.message || e})`); @@ -273044,11 +273802,7 @@ ${lanes.join("\n")} 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") + "[\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; @@ -273285,7 +274039,7 @@ ${lanes.join("\n")} const name = DiagnosticCategory[d.category]; return lowerCase ? name.toLowerCase() : name; } - var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, IndexFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas; + var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, IndexFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, JSDocParsingMode; var init_types = __esm({ "src/compiler/types.ts"() { "use strict"; @@ -273450,210 +274204,213 @@ ${lanes.join("\n")} SyntaxKind5[SyntaxKind5["UndefinedKeyword"] = 157] = "UndefinedKeyword"; SyntaxKind5[SyntaxKind5["UniqueKeyword"] = 158] = "UniqueKeyword"; SyntaxKind5[SyntaxKind5["UnknownKeyword"] = 159] = "UnknownKeyword"; - SyntaxKind5[SyntaxKind5["FromKeyword"] = 160] = "FromKeyword"; - SyntaxKind5[SyntaxKind5["GlobalKeyword"] = 161] = "GlobalKeyword"; - SyntaxKind5[SyntaxKind5["BigIntKeyword"] = 162] = "BigIntKeyword"; - SyntaxKind5[SyntaxKind5["OverrideKeyword"] = 163] = "OverrideKeyword"; - SyntaxKind5[SyntaxKind5["OfKeyword"] = 164] = "OfKeyword"; - SyntaxKind5[SyntaxKind5["QualifiedName"] = 165] = "QualifiedName"; - SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 166] = "ComputedPropertyName"; - SyntaxKind5[SyntaxKind5["TypeParameter"] = 167] = "TypeParameter"; - SyntaxKind5[SyntaxKind5["Parameter"] = 168] = "Parameter"; - SyntaxKind5[SyntaxKind5["Decorator"] = 169] = "Decorator"; - SyntaxKind5[SyntaxKind5["PropertySignature"] = 170] = "PropertySignature"; - SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 171] = "PropertyDeclaration"; - SyntaxKind5[SyntaxKind5["MethodSignature"] = 172] = "MethodSignature"; - SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 173] = "MethodDeclaration"; - SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 174] = "ClassStaticBlockDeclaration"; - SyntaxKind5[SyntaxKind5["Constructor"] = 175] = "Constructor"; - SyntaxKind5[SyntaxKind5["GetAccessor"] = 176] = "GetAccessor"; - SyntaxKind5[SyntaxKind5["SetAccessor"] = 177] = "SetAccessor"; - SyntaxKind5[SyntaxKind5["CallSignature"] = 178] = "CallSignature"; - SyntaxKind5[SyntaxKind5["ConstructSignature"] = 179] = "ConstructSignature"; - SyntaxKind5[SyntaxKind5["IndexSignature"] = 180] = "IndexSignature"; - SyntaxKind5[SyntaxKind5["TypePredicate"] = 181] = "TypePredicate"; - SyntaxKind5[SyntaxKind5["TypeReference"] = 182] = "TypeReference"; - SyntaxKind5[SyntaxKind5["FunctionType"] = 183] = "FunctionType"; - SyntaxKind5[SyntaxKind5["ConstructorType"] = 184] = "ConstructorType"; - SyntaxKind5[SyntaxKind5["TypeQuery"] = 185] = "TypeQuery"; - SyntaxKind5[SyntaxKind5["TypeLiteral"] = 186] = "TypeLiteral"; - SyntaxKind5[SyntaxKind5["ArrayType"] = 187] = "ArrayType"; - SyntaxKind5[SyntaxKind5["TupleType"] = 188] = "TupleType"; - SyntaxKind5[SyntaxKind5["OptionalType"] = 189] = "OptionalType"; - SyntaxKind5[SyntaxKind5["RestType"] = 190] = "RestType"; - SyntaxKind5[SyntaxKind5["UnionType"] = 191] = "UnionType"; - SyntaxKind5[SyntaxKind5["IntersectionType"] = 192] = "IntersectionType"; - SyntaxKind5[SyntaxKind5["ConditionalType"] = 193] = "ConditionalType"; - SyntaxKind5[SyntaxKind5["InferType"] = 194] = "InferType"; - SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 195] = "ParenthesizedType"; - SyntaxKind5[SyntaxKind5["ThisType"] = 196] = "ThisType"; - SyntaxKind5[SyntaxKind5["TypeOperator"] = 197] = "TypeOperator"; - SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 198] = "IndexedAccessType"; - SyntaxKind5[SyntaxKind5["MappedType"] = 199] = "MappedType"; - SyntaxKind5[SyntaxKind5["LiteralType"] = 200] = "LiteralType"; - SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 201] = "NamedTupleMember"; - SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 202] = "TemplateLiteralType"; - SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 203] = "TemplateLiteralTypeSpan"; - SyntaxKind5[SyntaxKind5["ImportType"] = 204] = "ImportType"; - SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 205] = "ObjectBindingPattern"; - SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 206] = "ArrayBindingPattern"; - SyntaxKind5[SyntaxKind5["BindingElement"] = 207] = "BindingElement"; - SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 208] = "ArrayLiteralExpression"; - SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 209] = "ObjectLiteralExpression"; - SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 210] = "PropertyAccessExpression"; - SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 211] = "ElementAccessExpression"; - SyntaxKind5[SyntaxKind5["CallExpression"] = 212] = "CallExpression"; - SyntaxKind5[SyntaxKind5["NewExpression"] = 213] = "NewExpression"; - SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 214] = "TaggedTemplateExpression"; - SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 215] = "TypeAssertionExpression"; - SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 216] = "ParenthesizedExpression"; - SyntaxKind5[SyntaxKind5["FunctionExpression"] = 217] = "FunctionExpression"; - SyntaxKind5[SyntaxKind5["ArrowFunction"] = 218] = "ArrowFunction"; - SyntaxKind5[SyntaxKind5["DeleteExpression"] = 219] = "DeleteExpression"; - SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 220] = "TypeOfExpression"; - SyntaxKind5[SyntaxKind5["VoidExpression"] = 221] = "VoidExpression"; - SyntaxKind5[SyntaxKind5["AwaitExpression"] = 222] = "AwaitExpression"; - SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 223] = "PrefixUnaryExpression"; - SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 224] = "PostfixUnaryExpression"; - SyntaxKind5[SyntaxKind5["BinaryExpression"] = 225] = "BinaryExpression"; - SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 226] = "ConditionalExpression"; - SyntaxKind5[SyntaxKind5["TemplateExpression"] = 227] = "TemplateExpression"; - SyntaxKind5[SyntaxKind5["YieldExpression"] = 228] = "YieldExpression"; - SyntaxKind5[SyntaxKind5["SpreadElement"] = 229] = "SpreadElement"; - SyntaxKind5[SyntaxKind5["ClassExpression"] = 230] = "ClassExpression"; - SyntaxKind5[SyntaxKind5["OmittedExpression"] = 231] = "OmittedExpression"; - SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 232] = "ExpressionWithTypeArguments"; - SyntaxKind5[SyntaxKind5["AsExpression"] = 233] = "AsExpression"; - SyntaxKind5[SyntaxKind5["NonNullExpression"] = 234] = "NonNullExpression"; - SyntaxKind5[SyntaxKind5["MetaProperty"] = 235] = "MetaProperty"; - SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 236] = "SyntheticExpression"; - SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 237] = "SatisfiesExpression"; - SyntaxKind5[SyntaxKind5["TemplateSpan"] = 238] = "TemplateSpan"; - SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 239] = "SemicolonClassElement"; - SyntaxKind5[SyntaxKind5["Block"] = 240] = "Block"; - SyntaxKind5[SyntaxKind5["EmptyStatement"] = 241] = "EmptyStatement"; - SyntaxKind5[SyntaxKind5["VariableStatement"] = 242] = "VariableStatement"; - SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 243] = "ExpressionStatement"; - SyntaxKind5[SyntaxKind5["IfStatement"] = 244] = "IfStatement"; - SyntaxKind5[SyntaxKind5["DoStatement"] = 245] = "DoStatement"; - SyntaxKind5[SyntaxKind5["WhileStatement"] = 246] = "WhileStatement"; - SyntaxKind5[SyntaxKind5["ForStatement"] = 247] = "ForStatement"; - SyntaxKind5[SyntaxKind5["ForInStatement"] = 248] = "ForInStatement"; - SyntaxKind5[SyntaxKind5["ForOfStatement"] = 249] = "ForOfStatement"; - SyntaxKind5[SyntaxKind5["ContinueStatement"] = 250] = "ContinueStatement"; - SyntaxKind5[SyntaxKind5["BreakStatement"] = 251] = "BreakStatement"; - SyntaxKind5[SyntaxKind5["ReturnStatement"] = 252] = "ReturnStatement"; - SyntaxKind5[SyntaxKind5["WithStatement"] = 253] = "WithStatement"; - SyntaxKind5[SyntaxKind5["SwitchStatement"] = 254] = "SwitchStatement"; - SyntaxKind5[SyntaxKind5["LabeledStatement"] = 255] = "LabeledStatement"; - SyntaxKind5[SyntaxKind5["ThrowStatement"] = 256] = "ThrowStatement"; - SyntaxKind5[SyntaxKind5["TryStatement"] = 257] = "TryStatement"; - SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 258] = "DebuggerStatement"; - SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 259] = "VariableDeclaration"; - SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 260] = "VariableDeclarationList"; - SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 261] = "FunctionDeclaration"; - SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 262] = "ClassDeclaration"; - SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 263] = "InterfaceDeclaration"; - SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 264] = "TypeAliasDeclaration"; - SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 265] = "EnumDeclaration"; - SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 266] = "ModuleDeclaration"; - SyntaxKind5[SyntaxKind5["ModuleBlock"] = 267] = "ModuleBlock"; - SyntaxKind5[SyntaxKind5["CaseBlock"] = 268] = "CaseBlock"; - SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 269] = "NamespaceExportDeclaration"; - SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 270] = "ImportEqualsDeclaration"; - SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 271] = "ImportDeclaration"; - SyntaxKind5[SyntaxKind5["ImportClause"] = 272] = "ImportClause"; - SyntaxKind5[SyntaxKind5["NamespaceImport"] = 273] = "NamespaceImport"; - SyntaxKind5[SyntaxKind5["NamedImports"] = 274] = "NamedImports"; - SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 275] = "ImportSpecifier"; - SyntaxKind5[SyntaxKind5["ExportAssignment"] = 276] = "ExportAssignment"; - SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 277] = "ExportDeclaration"; - SyntaxKind5[SyntaxKind5["NamedExports"] = 278] = "NamedExports"; - SyntaxKind5[SyntaxKind5["NamespaceExport"] = 279] = "NamespaceExport"; - SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 280] = "ExportSpecifier"; - SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 281] = "MissingDeclaration"; - SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 282] = "ExternalModuleReference"; - SyntaxKind5[SyntaxKind5["JsxElement"] = 283] = "JsxElement"; - SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 284] = "JsxSelfClosingElement"; - SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 285] = "JsxOpeningElement"; - SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 286] = "JsxClosingElement"; - SyntaxKind5[SyntaxKind5["JsxFragment"] = 287] = "JsxFragment"; - SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 288] = "JsxOpeningFragment"; - SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 289] = "JsxClosingFragment"; - SyntaxKind5[SyntaxKind5["JsxAttribute"] = 290] = "JsxAttribute"; - SyntaxKind5[SyntaxKind5["JsxAttributes"] = 291] = "JsxAttributes"; - SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 292] = "JsxSpreadAttribute"; - SyntaxKind5[SyntaxKind5["JsxExpression"] = 293] = "JsxExpression"; - SyntaxKind5[SyntaxKind5["JsxNamespacedName"] = 294] = "JsxNamespacedName"; - SyntaxKind5[SyntaxKind5["CaseClause"] = 295] = "CaseClause"; - SyntaxKind5[SyntaxKind5["DefaultClause"] = 296] = "DefaultClause"; - SyntaxKind5[SyntaxKind5["HeritageClause"] = 297] = "HeritageClause"; - SyntaxKind5[SyntaxKind5["CatchClause"] = 298] = "CatchClause"; - SyntaxKind5[SyntaxKind5["AssertClause"] = 299] = "AssertClause"; - SyntaxKind5[SyntaxKind5["AssertEntry"] = 300] = "AssertEntry"; - SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 301] = "ImportTypeAssertionContainer"; - SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 302] = "PropertyAssignment"; - SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 303] = "ShorthandPropertyAssignment"; - SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 304] = "SpreadAssignment"; - SyntaxKind5[SyntaxKind5["EnumMember"] = 305] = "EnumMember"; - SyntaxKind5[SyntaxKind5["UnparsedPrologue"] = 306] = "UnparsedPrologue"; - SyntaxKind5[SyntaxKind5["UnparsedPrepend"] = 307] = "UnparsedPrepend"; - SyntaxKind5[SyntaxKind5["UnparsedText"] = 308] = "UnparsedText"; - SyntaxKind5[SyntaxKind5["UnparsedInternalText"] = 309] = "UnparsedInternalText"; - SyntaxKind5[SyntaxKind5["UnparsedSyntheticReference"] = 310] = "UnparsedSyntheticReference"; - SyntaxKind5[SyntaxKind5["SourceFile"] = 311] = "SourceFile"; - SyntaxKind5[SyntaxKind5["Bundle"] = 312] = "Bundle"; - SyntaxKind5[SyntaxKind5["UnparsedSource"] = 313] = "UnparsedSource"; - SyntaxKind5[SyntaxKind5["InputFiles"] = 314] = "InputFiles"; - SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 315] = "JSDocTypeExpression"; - SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 316] = "JSDocNameReference"; - SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 317] = "JSDocMemberName"; - SyntaxKind5[SyntaxKind5["JSDocAllType"] = 318] = "JSDocAllType"; - SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 319] = "JSDocUnknownType"; - SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 320] = "JSDocNullableType"; - SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 321] = "JSDocNonNullableType"; - SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 322] = "JSDocOptionalType"; - SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 323] = "JSDocFunctionType"; - SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 324] = "JSDocVariadicType"; - SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 325] = "JSDocNamepathType"; - SyntaxKind5[SyntaxKind5["JSDoc"] = 326] = "JSDoc"; - SyntaxKind5[SyntaxKind5["JSDocComment"] = 326 /* JSDoc */] = "JSDocComment"; - SyntaxKind5[SyntaxKind5["JSDocText"] = 327] = "JSDocText"; - SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 328] = "JSDocTypeLiteral"; - SyntaxKind5[SyntaxKind5["JSDocSignature"] = 329] = "JSDocSignature"; - SyntaxKind5[SyntaxKind5["JSDocLink"] = 330] = "JSDocLink"; - SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 331] = "JSDocLinkCode"; - SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 332] = "JSDocLinkPlain"; - SyntaxKind5[SyntaxKind5["JSDocTag"] = 333] = "JSDocTag"; - SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 334] = "JSDocAugmentsTag"; - SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 335] = "JSDocImplementsTag"; - SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 336] = "JSDocAuthorTag"; - SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 337] = "JSDocDeprecatedTag"; - SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 338] = "JSDocClassTag"; - SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 339] = "JSDocPublicTag"; - SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 340] = "JSDocPrivateTag"; - SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 341] = "JSDocProtectedTag"; - SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 342] = "JSDocReadonlyTag"; - SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 343] = "JSDocOverrideTag"; - SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 344] = "JSDocCallbackTag"; - SyntaxKind5[SyntaxKind5["JSDocOverloadTag"] = 345] = "JSDocOverloadTag"; - SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 346] = "JSDocEnumTag"; - SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 347] = "JSDocParameterTag"; - SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 348] = "JSDocReturnTag"; - SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 349] = "JSDocThisTag"; - SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 350] = "JSDocTypeTag"; - SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 351] = "JSDocTemplateTag"; - SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 352] = "JSDocTypedefTag"; - SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 353] = "JSDocSeeTag"; - SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 354] = "JSDocPropertyTag"; - SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 355] = "JSDocThrowsTag"; - SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 356] = "JSDocSatisfiesTag"; - SyntaxKind5[SyntaxKind5["SyntaxList"] = 357] = "SyntaxList"; - SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 358] = "NotEmittedStatement"; - SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 359] = "PartiallyEmittedExpression"; - SyntaxKind5[SyntaxKind5["CommaListExpression"] = 360] = "CommaListExpression"; - SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 361] = "SyntheticReferenceExpression"; - SyntaxKind5[SyntaxKind5["Count"] = 362] = "Count"; + SyntaxKind5[SyntaxKind5["UsingKeyword"] = 160] = "UsingKeyword"; + SyntaxKind5[SyntaxKind5["FromKeyword"] = 161] = "FromKeyword"; + SyntaxKind5[SyntaxKind5["GlobalKeyword"] = 162] = "GlobalKeyword"; + SyntaxKind5[SyntaxKind5["BigIntKeyword"] = 163] = "BigIntKeyword"; + SyntaxKind5[SyntaxKind5["OverrideKeyword"] = 164] = "OverrideKeyword"; + SyntaxKind5[SyntaxKind5["OfKeyword"] = 165] = "OfKeyword"; + SyntaxKind5[SyntaxKind5["QualifiedName"] = 166] = "QualifiedName"; + SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 167] = "ComputedPropertyName"; + SyntaxKind5[SyntaxKind5["TypeParameter"] = 168] = "TypeParameter"; + SyntaxKind5[SyntaxKind5["Parameter"] = 169] = "Parameter"; + SyntaxKind5[SyntaxKind5["Decorator"] = 170] = "Decorator"; + SyntaxKind5[SyntaxKind5["PropertySignature"] = 171] = "PropertySignature"; + SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 172] = "PropertyDeclaration"; + SyntaxKind5[SyntaxKind5["MethodSignature"] = 173] = "MethodSignature"; + SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 174] = "MethodDeclaration"; + SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration"; + SyntaxKind5[SyntaxKind5["Constructor"] = 176] = "Constructor"; + SyntaxKind5[SyntaxKind5["GetAccessor"] = 177] = "GetAccessor"; + SyntaxKind5[SyntaxKind5["SetAccessor"] = 178] = "SetAccessor"; + SyntaxKind5[SyntaxKind5["CallSignature"] = 179] = "CallSignature"; + SyntaxKind5[SyntaxKind5["ConstructSignature"] = 180] = "ConstructSignature"; + SyntaxKind5[SyntaxKind5["IndexSignature"] = 181] = "IndexSignature"; + SyntaxKind5[SyntaxKind5["TypePredicate"] = 182] = "TypePredicate"; + SyntaxKind5[SyntaxKind5["TypeReference"] = 183] = "TypeReference"; + SyntaxKind5[SyntaxKind5["FunctionType"] = 184] = "FunctionType"; + SyntaxKind5[SyntaxKind5["ConstructorType"] = 185] = "ConstructorType"; + SyntaxKind5[SyntaxKind5["TypeQuery"] = 186] = "TypeQuery"; + SyntaxKind5[SyntaxKind5["TypeLiteral"] = 187] = "TypeLiteral"; + SyntaxKind5[SyntaxKind5["ArrayType"] = 188] = "ArrayType"; + SyntaxKind5[SyntaxKind5["TupleType"] = 189] = "TupleType"; + SyntaxKind5[SyntaxKind5["OptionalType"] = 190] = "OptionalType"; + SyntaxKind5[SyntaxKind5["RestType"] = 191] = "RestType"; + SyntaxKind5[SyntaxKind5["UnionType"] = 192] = "UnionType"; + SyntaxKind5[SyntaxKind5["IntersectionType"] = 193] = "IntersectionType"; + SyntaxKind5[SyntaxKind5["ConditionalType"] = 194] = "ConditionalType"; + SyntaxKind5[SyntaxKind5["InferType"] = 195] = "InferType"; + SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 196] = "ParenthesizedType"; + SyntaxKind5[SyntaxKind5["ThisType"] = 197] = "ThisType"; + SyntaxKind5[SyntaxKind5["TypeOperator"] = 198] = "TypeOperator"; + SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 199] = "IndexedAccessType"; + SyntaxKind5[SyntaxKind5["MappedType"] = 200] = "MappedType"; + SyntaxKind5[SyntaxKind5["LiteralType"] = 201] = "LiteralType"; + SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 202] = "NamedTupleMember"; + SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 203] = "TemplateLiteralType"; + SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan"; + SyntaxKind5[SyntaxKind5["ImportType"] = 205] = "ImportType"; + SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 206] = "ObjectBindingPattern"; + SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 207] = "ArrayBindingPattern"; + SyntaxKind5[SyntaxKind5["BindingElement"] = 208] = "BindingElement"; + SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression"; + SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression"; + SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 211] = "PropertyAccessExpression"; + SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 212] = "ElementAccessExpression"; + SyntaxKind5[SyntaxKind5["CallExpression"] = 213] = "CallExpression"; + SyntaxKind5[SyntaxKind5["NewExpression"] = 214] = "NewExpression"; + SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression"; + SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 216] = "TypeAssertionExpression"; + SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 217] = "ParenthesizedExpression"; + SyntaxKind5[SyntaxKind5["FunctionExpression"] = 218] = "FunctionExpression"; + SyntaxKind5[SyntaxKind5["ArrowFunction"] = 219] = "ArrowFunction"; + SyntaxKind5[SyntaxKind5["DeleteExpression"] = 220] = "DeleteExpression"; + SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 221] = "TypeOfExpression"; + SyntaxKind5[SyntaxKind5["VoidExpression"] = 222] = "VoidExpression"; + SyntaxKind5[SyntaxKind5["AwaitExpression"] = 223] = "AwaitExpression"; + SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 224] = "PrefixUnaryExpression"; + SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 225] = "PostfixUnaryExpression"; + SyntaxKind5[SyntaxKind5["BinaryExpression"] = 226] = "BinaryExpression"; + SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 227] = "ConditionalExpression"; + SyntaxKind5[SyntaxKind5["TemplateExpression"] = 228] = "TemplateExpression"; + SyntaxKind5[SyntaxKind5["YieldExpression"] = 229] = "YieldExpression"; + SyntaxKind5[SyntaxKind5["SpreadElement"] = 230] = "SpreadElement"; + SyntaxKind5[SyntaxKind5["ClassExpression"] = 231] = "ClassExpression"; + SyntaxKind5[SyntaxKind5["OmittedExpression"] = 232] = "OmittedExpression"; + SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 233] = "ExpressionWithTypeArguments"; + SyntaxKind5[SyntaxKind5["AsExpression"] = 234] = "AsExpression"; + SyntaxKind5[SyntaxKind5["NonNullExpression"] = 235] = "NonNullExpression"; + SyntaxKind5[SyntaxKind5["MetaProperty"] = 236] = "MetaProperty"; + SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 237] = "SyntheticExpression"; + SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 238] = "SatisfiesExpression"; + SyntaxKind5[SyntaxKind5["TemplateSpan"] = 239] = "TemplateSpan"; + SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 240] = "SemicolonClassElement"; + SyntaxKind5[SyntaxKind5["Block"] = 241] = "Block"; + SyntaxKind5[SyntaxKind5["EmptyStatement"] = 242] = "EmptyStatement"; + SyntaxKind5[SyntaxKind5["VariableStatement"] = 243] = "VariableStatement"; + SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 244] = "ExpressionStatement"; + SyntaxKind5[SyntaxKind5["IfStatement"] = 245] = "IfStatement"; + SyntaxKind5[SyntaxKind5["DoStatement"] = 246] = "DoStatement"; + SyntaxKind5[SyntaxKind5["WhileStatement"] = 247] = "WhileStatement"; + SyntaxKind5[SyntaxKind5["ForStatement"] = 248] = "ForStatement"; + SyntaxKind5[SyntaxKind5["ForInStatement"] = 249] = "ForInStatement"; + SyntaxKind5[SyntaxKind5["ForOfStatement"] = 250] = "ForOfStatement"; + SyntaxKind5[SyntaxKind5["ContinueStatement"] = 251] = "ContinueStatement"; + SyntaxKind5[SyntaxKind5["BreakStatement"] = 252] = "BreakStatement"; + SyntaxKind5[SyntaxKind5["ReturnStatement"] = 253] = "ReturnStatement"; + SyntaxKind5[SyntaxKind5["WithStatement"] = 254] = "WithStatement"; + SyntaxKind5[SyntaxKind5["SwitchStatement"] = 255] = "SwitchStatement"; + SyntaxKind5[SyntaxKind5["LabeledStatement"] = 256] = "LabeledStatement"; + SyntaxKind5[SyntaxKind5["ThrowStatement"] = 257] = "ThrowStatement"; + SyntaxKind5[SyntaxKind5["TryStatement"] = 258] = "TryStatement"; + SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 259] = "DebuggerStatement"; + SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 260] = "VariableDeclaration"; + SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 261] = "VariableDeclarationList"; + SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 262] = "FunctionDeclaration"; + SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 263] = "ClassDeclaration"; + SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 264] = "InterfaceDeclaration"; + SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 265] = "TypeAliasDeclaration"; + SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 266] = "EnumDeclaration"; + SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 267] = "ModuleDeclaration"; + SyntaxKind5[SyntaxKind5["ModuleBlock"] = 268] = "ModuleBlock"; + SyntaxKind5[SyntaxKind5["CaseBlock"] = 269] = "CaseBlock"; + SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 270] = "NamespaceExportDeclaration"; + SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 271] = "ImportEqualsDeclaration"; + SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 272] = "ImportDeclaration"; + SyntaxKind5[SyntaxKind5["ImportClause"] = 273] = "ImportClause"; + SyntaxKind5[SyntaxKind5["NamespaceImport"] = 274] = "NamespaceImport"; + SyntaxKind5[SyntaxKind5["NamedImports"] = 275] = "NamedImports"; + SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 276] = "ImportSpecifier"; + SyntaxKind5[SyntaxKind5["ExportAssignment"] = 277] = "ExportAssignment"; + SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 278] = "ExportDeclaration"; + SyntaxKind5[SyntaxKind5["NamedExports"] = 279] = "NamedExports"; + SyntaxKind5[SyntaxKind5["NamespaceExport"] = 280] = "NamespaceExport"; + SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 281] = "ExportSpecifier"; + SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 282] = "MissingDeclaration"; + SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 283] = "ExternalModuleReference"; + SyntaxKind5[SyntaxKind5["JsxElement"] = 284] = "JsxElement"; + SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 285] = "JsxSelfClosingElement"; + SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 286] = "JsxOpeningElement"; + SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 287] = "JsxClosingElement"; + SyntaxKind5[SyntaxKind5["JsxFragment"] = 288] = "JsxFragment"; + SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 289] = "JsxOpeningFragment"; + SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 290] = "JsxClosingFragment"; + SyntaxKind5[SyntaxKind5["JsxAttribute"] = 291] = "JsxAttribute"; + SyntaxKind5[SyntaxKind5["JsxAttributes"] = 292] = "JsxAttributes"; + SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 293] = "JsxSpreadAttribute"; + SyntaxKind5[SyntaxKind5["JsxExpression"] = 294] = "JsxExpression"; + SyntaxKind5[SyntaxKind5["JsxNamespacedName"] = 295] = "JsxNamespacedName"; + SyntaxKind5[SyntaxKind5["CaseClause"] = 296] = "CaseClause"; + SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause"; + SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause"; + SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause"; + SyntaxKind5[SyntaxKind5["ImportAttributes"] = 300] = "ImportAttributes"; + SyntaxKind5[SyntaxKind5["ImportAttribute"] = 301] = "ImportAttribute"; + SyntaxKind5[SyntaxKind5["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause"; + SyntaxKind5[SyntaxKind5["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry"; + SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer"; + SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment"; + SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment"; + SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 305] = "SpreadAssignment"; + SyntaxKind5[SyntaxKind5["EnumMember"] = 306] = "EnumMember"; + SyntaxKind5[SyntaxKind5["UnparsedPrologue"] = 307] = "UnparsedPrologue"; + SyntaxKind5[SyntaxKind5["UnparsedPrepend"] = 308] = "UnparsedPrepend"; + SyntaxKind5[SyntaxKind5["UnparsedText"] = 309] = "UnparsedText"; + SyntaxKind5[SyntaxKind5["UnparsedInternalText"] = 310] = "UnparsedInternalText"; + SyntaxKind5[SyntaxKind5["UnparsedSyntheticReference"] = 311] = "UnparsedSyntheticReference"; + SyntaxKind5[SyntaxKind5["SourceFile"] = 312] = "SourceFile"; + SyntaxKind5[SyntaxKind5["Bundle"] = 313] = "Bundle"; + SyntaxKind5[SyntaxKind5["UnparsedSource"] = 314] = "UnparsedSource"; + SyntaxKind5[SyntaxKind5["InputFiles"] = 315] = "InputFiles"; + SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 316] = "JSDocTypeExpression"; + SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 317] = "JSDocNameReference"; + SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 318] = "JSDocMemberName"; + SyntaxKind5[SyntaxKind5["JSDocAllType"] = 319] = "JSDocAllType"; + SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 320] = "JSDocUnknownType"; + SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 321] = "JSDocNullableType"; + SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 322] = "JSDocNonNullableType"; + SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 323] = "JSDocOptionalType"; + SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 324] = "JSDocFunctionType"; + SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 325] = "JSDocVariadicType"; + SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 326] = "JSDocNamepathType"; + SyntaxKind5[SyntaxKind5["JSDoc"] = 327] = "JSDoc"; + SyntaxKind5[SyntaxKind5["JSDocComment"] = 327 /* JSDoc */] = "JSDocComment"; + SyntaxKind5[SyntaxKind5["JSDocText"] = 328] = "JSDocText"; + SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 329] = "JSDocTypeLiteral"; + SyntaxKind5[SyntaxKind5["JSDocSignature"] = 330] = "JSDocSignature"; + SyntaxKind5[SyntaxKind5["JSDocLink"] = 331] = "JSDocLink"; + SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 332] = "JSDocLinkCode"; + SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 333] = "JSDocLinkPlain"; + SyntaxKind5[SyntaxKind5["JSDocTag"] = 334] = "JSDocTag"; + SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 335] = "JSDocAugmentsTag"; + SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 336] = "JSDocImplementsTag"; + SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 337] = "JSDocAuthorTag"; + SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 338] = "JSDocDeprecatedTag"; + SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 339] = "JSDocClassTag"; + SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 340] = "JSDocPublicTag"; + SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 341] = "JSDocPrivateTag"; + SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 342] = "JSDocProtectedTag"; + SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 343] = "JSDocReadonlyTag"; + SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 344] = "JSDocOverrideTag"; + SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 345] = "JSDocCallbackTag"; + SyntaxKind5[SyntaxKind5["JSDocOverloadTag"] = 346] = "JSDocOverloadTag"; + SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 347] = "JSDocEnumTag"; + SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 348] = "JSDocParameterTag"; + SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 349] = "JSDocReturnTag"; + SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 350] = "JSDocThisTag"; + SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 351] = "JSDocTypeTag"; + SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 352] = "JSDocTemplateTag"; + SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 353] = "JSDocTypedefTag"; + SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 354] = "JSDocSeeTag"; + SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 355] = "JSDocPropertyTag"; + SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 356] = "JSDocThrowsTag"; + SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 357] = "JSDocSatisfiesTag"; + SyntaxKind5[SyntaxKind5["SyntaxList"] = 358] = "SyntaxList"; + SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 359] = "NotEmittedStatement"; + SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 360] = "PartiallyEmittedExpression"; + SyntaxKind5[SyntaxKind5["CommaListExpression"] = 361] = "CommaListExpression"; + SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 362] = "SyntheticReferenceExpression"; + SyntaxKind5[SyntaxKind5["Count"] = 363] = "Count"; SyntaxKind5[SyntaxKind5["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment"; SyntaxKind5[SyntaxKind5["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment"; SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment"; @@ -273661,15 +274418,15 @@ ${lanes.join("\n")} SyntaxKind5[SyntaxKind5["FirstReservedWord"] = 83 /* BreakKeyword */] = "FirstReservedWord"; SyntaxKind5[SyntaxKind5["LastReservedWord"] = 118 /* WithKeyword */] = "LastReservedWord"; SyntaxKind5[SyntaxKind5["FirstKeyword"] = 83 /* BreakKeyword */] = "FirstKeyword"; - SyntaxKind5[SyntaxKind5["LastKeyword"] = 164 /* OfKeyword */] = "LastKeyword"; + SyntaxKind5[SyntaxKind5["LastKeyword"] = 165 /* OfKeyword */] = "LastKeyword"; SyntaxKind5[SyntaxKind5["FirstFutureReservedWord"] = 119 /* ImplementsKeyword */] = "FirstFutureReservedWord"; SyntaxKind5[SyntaxKind5["LastFutureReservedWord"] = 127 /* YieldKeyword */] = "LastFutureReservedWord"; - SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 181 /* TypePredicate */] = "FirstTypeNode"; - SyntaxKind5[SyntaxKind5["LastTypeNode"] = 204 /* ImportType */] = "LastTypeNode"; + SyntaxKind5[SyntaxKind5["FirstTypeNode"] = 182 /* TypePredicate */] = "FirstTypeNode"; + SyntaxKind5[SyntaxKind5["LastTypeNode"] = 205 /* ImportType */] = "LastTypeNode"; SyntaxKind5[SyntaxKind5["FirstPunctuation"] = 19 /* OpenBraceToken */] = "FirstPunctuation"; SyntaxKind5[SyntaxKind5["LastPunctuation"] = 79 /* CaretEqualsToken */] = "LastPunctuation"; SyntaxKind5[SyntaxKind5["FirstToken"] = 0 /* Unknown */] = "FirstToken"; - SyntaxKind5[SyntaxKind5["LastToken"] = 164 /* LastKeyword */] = "LastToken"; + SyntaxKind5[SyntaxKind5["LastToken"] = 165 /* LastKeyword */] = "LastToken"; SyntaxKind5[SyntaxKind5["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken"; SyntaxKind5[SyntaxKind5["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken"; SyntaxKind5[SyntaxKind5["FirstLiteralToken"] = 9 /* NumericLiteral */] = "FirstLiteralToken"; @@ -273678,86 +274435,100 @@ ${lanes.join("\n")} SyntaxKind5[SyntaxKind5["LastTemplateToken"] = 18 /* TemplateTail */] = "LastTemplateToken"; SyntaxKind5[SyntaxKind5["FirstBinaryOperator"] = 30 /* LessThanToken */] = "FirstBinaryOperator"; SyntaxKind5[SyntaxKind5["LastBinaryOperator"] = 79 /* CaretEqualsToken */] = "LastBinaryOperator"; - SyntaxKind5[SyntaxKind5["FirstStatement"] = 242 /* VariableStatement */] = "FirstStatement"; - SyntaxKind5[SyntaxKind5["LastStatement"] = 258 /* DebuggerStatement */] = "LastStatement"; - SyntaxKind5[SyntaxKind5["FirstNode"] = 165 /* QualifiedName */] = "FirstNode"; - SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 315 /* JSDocTypeExpression */] = "FirstJSDocNode"; - SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 356 /* JSDocSatisfiesTag */] = "LastJSDocNode"; - SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 333 /* JSDocTag */] = "FirstJSDocTagNode"; - SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 356 /* JSDocSatisfiesTag */] = "LastJSDocTagNode"; + SyntaxKind5[SyntaxKind5["FirstStatement"] = 243 /* VariableStatement */] = "FirstStatement"; + SyntaxKind5[SyntaxKind5["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement"; + SyntaxKind5[SyntaxKind5["FirstNode"] = 166 /* QualifiedName */] = "FirstNode"; + SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 316 /* JSDocTypeExpression */] = "FirstJSDocNode"; + SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 357 /* JSDocSatisfiesTag */] = "LastJSDocNode"; + SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 334 /* JSDocTag */] = "FirstJSDocTagNode"; + SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 357 /* JSDocSatisfiesTag */] = "LastJSDocTagNode"; SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword"; - SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 164 /* OfKeyword */] = "LastContextualKeyword"; + SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword"; return SyntaxKind5; })(SyntaxKind || {}); NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { NodeFlags3[NodeFlags3["None"] = 0] = "None"; NodeFlags3[NodeFlags3["Let"] = 1] = "Let"; NodeFlags3[NodeFlags3["Const"] = 2] = "Const"; - NodeFlags3[NodeFlags3["NestedNamespace"] = 4] = "NestedNamespace"; - NodeFlags3[NodeFlags3["Synthesized"] = 8] = "Synthesized"; - NodeFlags3[NodeFlags3["Namespace"] = 16] = "Namespace"; - NodeFlags3[NodeFlags3["OptionalChain"] = 32] = "OptionalChain"; - NodeFlags3[NodeFlags3["ExportContext"] = 64] = "ExportContext"; - NodeFlags3[NodeFlags3["ContainsThis"] = 128] = "ContainsThis"; - NodeFlags3[NodeFlags3["HasImplicitReturn"] = 256] = "HasImplicitReturn"; - NodeFlags3[NodeFlags3["HasExplicitReturn"] = 512] = "HasExplicitReturn"; - NodeFlags3[NodeFlags3["GlobalAugmentation"] = 1024] = "GlobalAugmentation"; - NodeFlags3[NodeFlags3["HasAsyncFunctions"] = 2048] = "HasAsyncFunctions"; - NodeFlags3[NodeFlags3["DisallowInContext"] = 4096] = "DisallowInContext"; - NodeFlags3[NodeFlags3["YieldContext"] = 8192] = "YieldContext"; - NodeFlags3[NodeFlags3["DecoratorContext"] = 16384] = "DecoratorContext"; - NodeFlags3[NodeFlags3["AwaitContext"] = 32768] = "AwaitContext"; - NodeFlags3[NodeFlags3["DisallowConditionalTypesContext"] = 65536] = "DisallowConditionalTypesContext"; - NodeFlags3[NodeFlags3["ThisNodeHasError"] = 131072] = "ThisNodeHasError"; - NodeFlags3[NodeFlags3["JavaScriptFile"] = 262144] = "JavaScriptFile"; - NodeFlags3[NodeFlags3["ThisNodeOrAnySubNodesHasError"] = 524288] = "ThisNodeOrAnySubNodesHasError"; - NodeFlags3[NodeFlags3["HasAggregatedChildData"] = 1048576] = "HasAggregatedChildData"; - NodeFlags3[NodeFlags3["PossiblyContainsDynamicImport"] = 2097152] = "PossiblyContainsDynamicImport"; - NodeFlags3[NodeFlags3["PossiblyContainsImportMeta"] = 4194304] = "PossiblyContainsImportMeta"; - NodeFlags3[NodeFlags3["JSDoc"] = 8388608] = "JSDoc"; - NodeFlags3[NodeFlags3["Ambient"] = 16777216] = "Ambient"; - NodeFlags3[NodeFlags3["InWithStatement"] = 33554432] = "InWithStatement"; - NodeFlags3[NodeFlags3["JsonFile"] = 67108864] = "JsonFile"; - NodeFlags3[NodeFlags3["TypeCached"] = 134217728] = "TypeCached"; - NodeFlags3[NodeFlags3["Deprecated"] = 268435456] = "Deprecated"; - NodeFlags3[NodeFlags3["BlockScoped"] = 3] = "BlockScoped"; - NodeFlags3[NodeFlags3["ReachabilityCheckFlags"] = 768] = "ReachabilityCheckFlags"; - NodeFlags3[NodeFlags3["ReachabilityAndEmitFlags"] = 2816] = "ReachabilityAndEmitFlags"; - NodeFlags3[NodeFlags3["ContextFlags"] = 50720768] = "ContextFlags"; - NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; - NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; - NodeFlags3[NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape"; - NodeFlags3[NodeFlags3["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace"; + NodeFlags3[NodeFlags3["Using"] = 4] = "Using"; + NodeFlags3[NodeFlags3["AwaitUsing"] = 6] = "AwaitUsing"; + NodeFlags3[NodeFlags3["NestedNamespace"] = 8] = "NestedNamespace"; + NodeFlags3[NodeFlags3["Synthesized"] = 16] = "Synthesized"; + NodeFlags3[NodeFlags3["Namespace"] = 32] = "Namespace"; + NodeFlags3[NodeFlags3["OptionalChain"] = 64] = "OptionalChain"; + NodeFlags3[NodeFlags3["ExportContext"] = 128] = "ExportContext"; + NodeFlags3[NodeFlags3["ContainsThis"] = 256] = "ContainsThis"; + NodeFlags3[NodeFlags3["HasImplicitReturn"] = 512] = "HasImplicitReturn"; + NodeFlags3[NodeFlags3["HasExplicitReturn"] = 1024] = "HasExplicitReturn"; + NodeFlags3[NodeFlags3["GlobalAugmentation"] = 2048] = "GlobalAugmentation"; + NodeFlags3[NodeFlags3["HasAsyncFunctions"] = 4096] = "HasAsyncFunctions"; + NodeFlags3[NodeFlags3["DisallowInContext"] = 8192] = "DisallowInContext"; + NodeFlags3[NodeFlags3["YieldContext"] = 16384] = "YieldContext"; + NodeFlags3[NodeFlags3["DecoratorContext"] = 32768] = "DecoratorContext"; + NodeFlags3[NodeFlags3["AwaitContext"] = 65536] = "AwaitContext"; + NodeFlags3[NodeFlags3["DisallowConditionalTypesContext"] = 131072] = "DisallowConditionalTypesContext"; + NodeFlags3[NodeFlags3["ThisNodeHasError"] = 262144] = "ThisNodeHasError"; + NodeFlags3[NodeFlags3["JavaScriptFile"] = 524288] = "JavaScriptFile"; + NodeFlags3[NodeFlags3["ThisNodeOrAnySubNodesHasError"] = 1048576] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags3[NodeFlags3["HasAggregatedChildData"] = 2097152] = "HasAggregatedChildData"; + NodeFlags3[NodeFlags3["PossiblyContainsDynamicImport"] = 4194304] = "PossiblyContainsDynamicImport"; + NodeFlags3[NodeFlags3["PossiblyContainsImportMeta"] = 8388608] = "PossiblyContainsImportMeta"; + NodeFlags3[NodeFlags3["JSDoc"] = 16777216] = "JSDoc"; + NodeFlags3[NodeFlags3["Ambient"] = 33554432] = "Ambient"; + NodeFlags3[NodeFlags3["InWithStatement"] = 67108864] = "InWithStatement"; + NodeFlags3[NodeFlags3["JsonFile"] = 134217728] = "JsonFile"; + NodeFlags3[NodeFlags3["TypeCached"] = 268435456] = "TypeCached"; + NodeFlags3[NodeFlags3["Deprecated"] = 536870912] = "Deprecated"; + NodeFlags3[NodeFlags3["BlockScoped"] = 7] = "BlockScoped"; + NodeFlags3[NodeFlags3["Constant"] = 6] = "Constant"; + NodeFlags3[NodeFlags3["ReachabilityCheckFlags"] = 1536] = "ReachabilityCheckFlags"; + NodeFlags3[NodeFlags3["ReachabilityAndEmitFlags"] = 5632] = "ReachabilityAndEmitFlags"; + NodeFlags3[NodeFlags3["ContextFlags"] = 101441536] = "ContextFlags"; + NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 81920] = "TypeExcludesFlags"; + NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 12582912] = "PermanentlySetIncrementalFlags"; + NodeFlags3[NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 256 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape"; + NodeFlags3[NodeFlags3["IdentifierIsInJSDocNamespace"] = 4096 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace"; return NodeFlags3; })(NodeFlags || {}); ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => { ModifierFlags3[ModifierFlags3["None"] = 0] = "None"; - ModifierFlags3[ModifierFlags3["Export"] = 1] = "Export"; - ModifierFlags3[ModifierFlags3["Ambient"] = 2] = "Ambient"; - ModifierFlags3[ModifierFlags3["Public"] = 4] = "Public"; - ModifierFlags3[ModifierFlags3["Private"] = 8] = "Private"; - ModifierFlags3[ModifierFlags3["Protected"] = 16] = "Protected"; - ModifierFlags3[ModifierFlags3["Static"] = 32] = "Static"; - ModifierFlags3[ModifierFlags3["Readonly"] = 64] = "Readonly"; - ModifierFlags3[ModifierFlags3["Accessor"] = 128] = "Accessor"; - ModifierFlags3[ModifierFlags3["Abstract"] = 256] = "Abstract"; - ModifierFlags3[ModifierFlags3["Async"] = 512] = "Async"; - ModifierFlags3[ModifierFlags3["Default"] = 1024] = "Default"; - ModifierFlags3[ModifierFlags3["Const"] = 2048] = "Const"; - ModifierFlags3[ModifierFlags3["HasComputedJSDocModifiers"] = 4096] = "HasComputedJSDocModifiers"; - ModifierFlags3[ModifierFlags3["Deprecated"] = 8192] = "Deprecated"; - ModifierFlags3[ModifierFlags3["Override"] = 16384] = "Override"; - ModifierFlags3[ModifierFlags3["In"] = 32768] = "In"; - ModifierFlags3[ModifierFlags3["Out"] = 65536] = "Out"; - ModifierFlags3[ModifierFlags3["Decorator"] = 131072] = "Decorator"; + ModifierFlags3[ModifierFlags3["Public"] = 1] = "Public"; + ModifierFlags3[ModifierFlags3["Private"] = 2] = "Private"; + ModifierFlags3[ModifierFlags3["Protected"] = 4] = "Protected"; + ModifierFlags3[ModifierFlags3["Readonly"] = 8] = "Readonly"; + ModifierFlags3[ModifierFlags3["Override"] = 16] = "Override"; + ModifierFlags3[ModifierFlags3["Export"] = 32] = "Export"; + ModifierFlags3[ModifierFlags3["Abstract"] = 64] = "Abstract"; + ModifierFlags3[ModifierFlags3["Ambient"] = 128] = "Ambient"; + ModifierFlags3[ModifierFlags3["Static"] = 256] = "Static"; + ModifierFlags3[ModifierFlags3["Accessor"] = 512] = "Accessor"; + ModifierFlags3[ModifierFlags3["Async"] = 1024] = "Async"; + ModifierFlags3[ModifierFlags3["Default"] = 2048] = "Default"; + ModifierFlags3[ModifierFlags3["Const"] = 4096] = "Const"; + ModifierFlags3[ModifierFlags3["In"] = 8192] = "In"; + ModifierFlags3[ModifierFlags3["Out"] = 16384] = "Out"; + ModifierFlags3[ModifierFlags3["Decorator"] = 32768] = "Decorator"; + ModifierFlags3[ModifierFlags3["Deprecated"] = 65536] = "Deprecated"; + ModifierFlags3[ModifierFlags3["JSDocPublic"] = 8388608] = "JSDocPublic"; + ModifierFlags3[ModifierFlags3["JSDocPrivate"] = 16777216] = "JSDocPrivate"; + ModifierFlags3[ModifierFlags3["JSDocProtected"] = 33554432] = "JSDocProtected"; + ModifierFlags3[ModifierFlags3["JSDocReadonly"] = 67108864] = "JSDocReadonly"; + ModifierFlags3[ModifierFlags3["JSDocOverride"] = 134217728] = "JSDocOverride"; + ModifierFlags3[ModifierFlags3["SyntacticOrJSDocModifiers"] = 31] = "SyntacticOrJSDocModifiers"; + ModifierFlags3[ModifierFlags3["SyntacticOnlyModifiers"] = 65504] = "SyntacticOnlyModifiers"; + ModifierFlags3[ModifierFlags3["SyntacticModifiers"] = 65535] = "SyntacticModifiers"; + ModifierFlags3[ModifierFlags3["JSDocCacheOnlyModifiers"] = 260046848] = "JSDocCacheOnlyModifiers"; + ModifierFlags3[ModifierFlags3["JSDocOnlyModifiers"] = 65536 /* Deprecated */] = "JSDocOnlyModifiers"; + ModifierFlags3[ModifierFlags3["NonCacheOnlyModifiers"] = 131071] = "NonCacheOnlyModifiers"; + ModifierFlags3[ModifierFlags3["HasComputedJSDocModifiers"] = 268435456] = "HasComputedJSDocModifiers"; ModifierFlags3[ModifierFlags3["HasComputedFlags"] = 536870912] = "HasComputedFlags"; - ModifierFlags3[ModifierFlags3["AccessibilityModifier"] = 28] = "AccessibilityModifier"; - ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] = 16476] = "ParameterPropertyModifier"; - ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier"; - ModifierFlags3[ModifierFlags3["TypeScriptModifier"] = 117086] = "TypeScriptModifier"; - ModifierFlags3[ModifierFlags3["ExportDefault"] = 1025] = "ExportDefault"; - ModifierFlags3[ModifierFlags3["All"] = 258047] = "All"; - ModifierFlags3[ModifierFlags3["Modifier"] = 126975] = "Modifier"; + ModifierFlags3[ModifierFlags3["AccessibilityModifier"] = 7] = "AccessibilityModifier"; + ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] = 31] = "ParameterPropertyModifier"; + ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] = 6] = "NonPublicAccessibilityModifier"; + ModifierFlags3[ModifierFlags3["TypeScriptModifier"] = 28895] = "TypeScriptModifier"; + ModifierFlags3[ModifierFlags3["ExportDefault"] = 2080] = "ExportDefault"; + ModifierFlags3[ModifierFlags3["All"] = 131071] = "All"; + ModifierFlags3[ModifierFlags3["Modifier"] = 98303] = "Modifier"; return ModifierFlags3; })(ModifierFlags || {}); JsxFlags = /* @__PURE__ */ ((JsxFlags2) => { @@ -273768,6 +274539,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"; @@ -273936,6 +274708,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"; @@ -273955,7 +274728,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) => { @@ -274031,7 +274804,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"; @@ -274120,6 +274893,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) => { @@ -274140,15 +274915,13 @@ ${lanes.join("\n")} NodeCheckFlags2[NodeCheckFlags2["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding"; NodeCheckFlags2[NodeCheckFlags2["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding"; NodeCheckFlags2[NodeCheckFlags2["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop"; - NodeCheckFlags2[NodeCheckFlags2["ClassWithBodyScopedClassBinding"] = 65536] = "ClassWithBodyScopedClassBinding"; - NodeCheckFlags2[NodeCheckFlags2["BodyScopedClassBinding"] = 131072] = "BodyScopedClassBinding"; - NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] = 262144] = "NeedsLoopOutParameter"; - NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] = 524288] = "AssignmentsMarked"; - NodeCheckFlags2[NodeCheckFlags2["ClassWithConstructorReference"] = 1048576] = "ClassWithConstructorReference"; - NodeCheckFlags2[NodeCheckFlags2["ConstructorReferenceInClass"] = 2097152] = "ConstructorReferenceInClass"; - NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] = 4194304] = "ContainsClassWithPrivateIdentifiers"; - NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 8388608] = "ContainsSuperPropertyInStaticInitializer"; - NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 16777216] = "InCheckIdentifier"; + NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] = 65536] = "NeedsLoopOutParameter"; + NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] = 131072] = "AssignmentsMarked"; + NodeCheckFlags2[NodeCheckFlags2["ContainsConstructorReference"] = 262144] = "ContainsConstructorReference"; + NodeCheckFlags2[NodeCheckFlags2["ConstructorReference"] = 536870912] = "ConstructorReference"; + NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers"; + NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer"; + NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 4194304] = "InCheckIdentifier"; return NodeCheckFlags2; })(NodeCheckFlags || {}); TypeFlags = /* @__PURE__ */ ((TypeFlags2) => { @@ -274181,6 +274954,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"; @@ -274208,7 +274982,7 @@ ${lanes.join("\n")} TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable"; TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; - TypeFlags2[TypeFlags2["ObjectFlagsType"] = 138117121] = "ObjectFlagsType"; + TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable"; TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton"; TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable"; @@ -274218,6 +274992,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 || {}); @@ -274247,6 +275022,7 @@ ${lanes.join("\n")} ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface"; ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening"; ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags"; + ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 96] = "InstantiatedMapped"; ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask"; ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread"; ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType"; @@ -274263,6 +275039,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) => { @@ -274329,7 +275106,8 @@ ${lanes.join("\n")} SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain"; SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile"; SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable"; - SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 39] = "PropagatingFlags"; + SignatureFlags5[SignatureFlags5["IsSignatureCandidateForOverloadFailure"] = 128] = "IsSignatureCandidateForOverloadFailure"; + SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 167] = "PropagatingFlags"; SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags"; return SignatureFlags5; })(SignatureFlags || {}); @@ -274399,14 +275177,14 @@ ${lanes.join("\n")} DiagnosticCategory2[DiagnosticCategory2["Message"] = 3] = "Message"; return DiagnosticCategory2; })(DiagnosticCategory || {}); - ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => { - ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic"; - ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs"; - ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10"; - ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16"; - ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext"; - ModuleResolutionKind2[ModuleResolutionKind2["Bundler"] = 100] = "Bundler"; - return ModuleResolutionKind2; + ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind3) => { + ModuleResolutionKind3[ModuleResolutionKind3["Classic"] = 1] = "Classic"; + ModuleResolutionKind3[ModuleResolutionKind3["NodeJs"] = 2] = "NodeJs"; + ModuleResolutionKind3[ModuleResolutionKind3["Node10"] = 2] = "Node10"; + ModuleResolutionKind3[ModuleResolutionKind3["Node16"] = 3] = "Node16"; + ModuleResolutionKind3[ModuleResolutionKind3["NodeNext"] = 99] = "NodeNext"; + ModuleResolutionKind3[ModuleResolutionKind3["Bundler"] = 100] = "Bundler"; + return ModuleResolutionKind3; })(ModuleResolutionKind || {}); ModuleDetectionKind = /* @__PURE__ */ ((ModuleDetectionKind2) => { ModuleDetectionKind2[ModuleDetectionKind2["Legacy"] = 1] = "Legacy"; @@ -274414,51 +275192,52 @@ ${lanes.join("\n")} ModuleDetectionKind2[ModuleDetectionKind2["Force"] = 3] = "Force"; return ModuleDetectionKind2; })(ModuleDetectionKind || {}); - WatchFileKind = /* @__PURE__ */ ((WatchFileKind2) => { - WatchFileKind2[WatchFileKind2["FixedPollingInterval"] = 0] = "FixedPollingInterval"; - WatchFileKind2[WatchFileKind2["PriorityPollingInterval"] = 1] = "PriorityPollingInterval"; - WatchFileKind2[WatchFileKind2["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling"; - WatchFileKind2[WatchFileKind2["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling"; - WatchFileKind2[WatchFileKind2["UseFsEvents"] = 4] = "UseFsEvents"; - WatchFileKind2[WatchFileKind2["UseFsEventsOnParentDirectory"] = 5] = "UseFsEventsOnParentDirectory"; - return WatchFileKind2; + WatchFileKind = /* @__PURE__ */ ((WatchFileKind3) => { + WatchFileKind3[WatchFileKind3["FixedPollingInterval"] = 0] = "FixedPollingInterval"; + WatchFileKind3[WatchFileKind3["PriorityPollingInterval"] = 1] = "PriorityPollingInterval"; + WatchFileKind3[WatchFileKind3["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling"; + WatchFileKind3[WatchFileKind3["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling"; + WatchFileKind3[WatchFileKind3["UseFsEvents"] = 4] = "UseFsEvents"; + WatchFileKind3[WatchFileKind3["UseFsEventsOnParentDirectory"] = 5] = "UseFsEventsOnParentDirectory"; + return WatchFileKind3; })(WatchFileKind || {}); - WatchDirectoryKind = /* @__PURE__ */ ((WatchDirectoryKind2) => { - WatchDirectoryKind2[WatchDirectoryKind2["UseFsEvents"] = 0] = "UseFsEvents"; - WatchDirectoryKind2[WatchDirectoryKind2["FixedPollingInterval"] = 1] = "FixedPollingInterval"; - WatchDirectoryKind2[WatchDirectoryKind2["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling"; - WatchDirectoryKind2[WatchDirectoryKind2["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling"; - return WatchDirectoryKind2; + WatchDirectoryKind = /* @__PURE__ */ ((WatchDirectoryKind3) => { + WatchDirectoryKind3[WatchDirectoryKind3["UseFsEvents"] = 0] = "UseFsEvents"; + WatchDirectoryKind3[WatchDirectoryKind3["FixedPollingInterval"] = 1] = "FixedPollingInterval"; + WatchDirectoryKind3[WatchDirectoryKind3["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling"; + WatchDirectoryKind3[WatchDirectoryKind3["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling"; + return WatchDirectoryKind3; })(WatchDirectoryKind || {}); - PollingWatchKind = /* @__PURE__ */ ((PollingWatchKind2) => { - PollingWatchKind2[PollingWatchKind2["FixedInterval"] = 0] = "FixedInterval"; - PollingWatchKind2[PollingWatchKind2["PriorityInterval"] = 1] = "PriorityInterval"; - PollingWatchKind2[PollingWatchKind2["DynamicPriority"] = 2] = "DynamicPriority"; - PollingWatchKind2[PollingWatchKind2["FixedChunkSize"] = 3] = "FixedChunkSize"; - return PollingWatchKind2; + PollingWatchKind = /* @__PURE__ */ ((PollingWatchKind3) => { + PollingWatchKind3[PollingWatchKind3["FixedInterval"] = 0] = "FixedInterval"; + PollingWatchKind3[PollingWatchKind3["PriorityInterval"] = 1] = "PriorityInterval"; + PollingWatchKind3[PollingWatchKind3["DynamicPriority"] = 2] = "DynamicPriority"; + PollingWatchKind3[PollingWatchKind3["FixedChunkSize"] = 3] = "FixedChunkSize"; + return PollingWatchKind3; })(PollingWatchKind || {}); - ModuleKind = /* @__PURE__ */ ((ModuleKind2) => { - ModuleKind2[ModuleKind2["None"] = 0] = "None"; - ModuleKind2[ModuleKind2["CommonJS"] = 1] = "CommonJS"; - ModuleKind2[ModuleKind2["AMD"] = 2] = "AMD"; - ModuleKind2[ModuleKind2["UMD"] = 3] = "UMD"; - ModuleKind2[ModuleKind2["System"] = 4] = "System"; - ModuleKind2[ModuleKind2["ES2015"] = 5] = "ES2015"; - ModuleKind2[ModuleKind2["ES2020"] = 6] = "ES2020"; - ModuleKind2[ModuleKind2["ES2022"] = 7] = "ES2022"; - ModuleKind2[ModuleKind2["ESNext"] = 99] = "ESNext"; - ModuleKind2[ModuleKind2["Node16"] = 100] = "Node16"; - ModuleKind2[ModuleKind2["NodeNext"] = 199] = "NodeNext"; - return ModuleKind2; + ModuleKind = /* @__PURE__ */ ((ModuleKind3) => { + ModuleKind3[ModuleKind3["None"] = 0] = "None"; + ModuleKind3[ModuleKind3["CommonJS"] = 1] = "CommonJS"; + ModuleKind3[ModuleKind3["AMD"] = 2] = "AMD"; + ModuleKind3[ModuleKind3["UMD"] = 3] = "UMD"; + ModuleKind3[ModuleKind3["System"] = 4] = "System"; + ModuleKind3[ModuleKind3["ES2015"] = 5] = "ES2015"; + ModuleKind3[ModuleKind3["ES2020"] = 6] = "ES2020"; + ModuleKind3[ModuleKind3["ES2022"] = 7] = "ES2022"; + 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__ */ ((JsxEmit2) => { - JsxEmit2[JsxEmit2["None"] = 0] = "None"; - JsxEmit2[JsxEmit2["Preserve"] = 1] = "Preserve"; - JsxEmit2[JsxEmit2["React"] = 2] = "React"; - JsxEmit2[JsxEmit2["ReactNative"] = 3] = "ReactNative"; - JsxEmit2[JsxEmit2["ReactJSX"] = 4] = "ReactJSX"; - JsxEmit2[JsxEmit2["ReactJSXDev"] = 5] = "ReactJSXDev"; - return JsxEmit2; + JsxEmit = /* @__PURE__ */ ((JsxEmit3) => { + JsxEmit3[JsxEmit3["None"] = 0] = "None"; + JsxEmit3[JsxEmit3["Preserve"] = 1] = "Preserve"; + JsxEmit3[JsxEmit3["React"] = 2] = "React"; + JsxEmit3[JsxEmit3["ReactNative"] = 3] = "ReactNative"; + JsxEmit3[JsxEmit3["ReactJSX"] = 4] = "ReactJSX"; + JsxEmit3[JsxEmit3["ReactJSXDev"] = 5] = "ReactJSXDev"; + return JsxEmit3; })(JsxEmit || {}); ImportsNotUsedAsValues = /* @__PURE__ */ ((ImportsNotUsedAsValues2) => { ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Remove"] = 0] = "Remove"; @@ -274466,37 +275245,37 @@ ${lanes.join("\n")} ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Error"] = 2] = "Error"; return ImportsNotUsedAsValues2; })(ImportsNotUsedAsValues || {}); - NewLineKind = /* @__PURE__ */ ((NewLineKind2) => { - NewLineKind2[NewLineKind2["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; - NewLineKind2[NewLineKind2["LineFeed"] = 1] = "LineFeed"; - return NewLineKind2; + NewLineKind = /* @__PURE__ */ ((NewLineKind3) => { + NewLineKind3[NewLineKind3["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; + NewLineKind3[NewLineKind3["LineFeed"] = 1] = "LineFeed"; + return NewLineKind3; })(NewLineKind || {}); - ScriptKind = /* @__PURE__ */ ((ScriptKind5) => { - ScriptKind5[ScriptKind5["Unknown"] = 0] = "Unknown"; - ScriptKind5[ScriptKind5["JS"] = 1] = "JS"; - ScriptKind5[ScriptKind5["JSX"] = 2] = "JSX"; - ScriptKind5[ScriptKind5["TS"] = 3] = "TS"; - ScriptKind5[ScriptKind5["TSX"] = 4] = "TSX"; - ScriptKind5[ScriptKind5["External"] = 5] = "External"; - ScriptKind5[ScriptKind5["JSON"] = 6] = "JSON"; - ScriptKind5[ScriptKind5["Deferred"] = 7] = "Deferred"; - return ScriptKind5; + ScriptKind = /* @__PURE__ */ ((ScriptKind7) => { + ScriptKind7[ScriptKind7["Unknown"] = 0] = "Unknown"; + ScriptKind7[ScriptKind7["JS"] = 1] = "JS"; + ScriptKind7[ScriptKind7["JSX"] = 2] = "JSX"; + ScriptKind7[ScriptKind7["TS"] = 3] = "TS"; + ScriptKind7[ScriptKind7["TSX"] = 4] = "TSX"; + ScriptKind7[ScriptKind7["External"] = 5] = "External"; + ScriptKind7[ScriptKind7["JSON"] = 6] = "JSON"; + ScriptKind7[ScriptKind7["Deferred"] = 7] = "Deferred"; + return ScriptKind7; })(ScriptKind || {}); - ScriptTarget = /* @__PURE__ */ ((ScriptTarget10) => { - ScriptTarget10[ScriptTarget10["ES3"] = 0] = "ES3"; - ScriptTarget10[ScriptTarget10["ES5"] = 1] = "ES5"; - ScriptTarget10[ScriptTarget10["ES2015"] = 2] = "ES2015"; - ScriptTarget10[ScriptTarget10["ES2016"] = 3] = "ES2016"; - ScriptTarget10[ScriptTarget10["ES2017"] = 4] = "ES2017"; - ScriptTarget10[ScriptTarget10["ES2018"] = 5] = "ES2018"; - ScriptTarget10[ScriptTarget10["ES2019"] = 6] = "ES2019"; - ScriptTarget10[ScriptTarget10["ES2020"] = 7] = "ES2020"; - ScriptTarget10[ScriptTarget10["ES2021"] = 8] = "ES2021"; - ScriptTarget10[ScriptTarget10["ES2022"] = 9] = "ES2022"; - ScriptTarget10[ScriptTarget10["ESNext"] = 99] = "ESNext"; - ScriptTarget10[ScriptTarget10["JSON"] = 100] = "JSON"; - ScriptTarget10[ScriptTarget10["Latest"] = 99 /* ESNext */] = "Latest"; - return ScriptTarget10; + ScriptTarget = /* @__PURE__ */ ((ScriptTarget11) => { + ScriptTarget11[ScriptTarget11["ES3"] = 0] = "ES3"; + ScriptTarget11[ScriptTarget11["ES5"] = 1] = "ES5"; + ScriptTarget11[ScriptTarget11["ES2015"] = 2] = "ES2015"; + ScriptTarget11[ScriptTarget11["ES2016"] = 3] = "ES2016"; + ScriptTarget11[ScriptTarget11["ES2017"] = 4] = "ES2017"; + ScriptTarget11[ScriptTarget11["ES2018"] = 5] = "ES2018"; + ScriptTarget11[ScriptTarget11["ES2019"] = 6] = "ES2019"; + ScriptTarget11[ScriptTarget11["ES2020"] = 7] = "ES2020"; + ScriptTarget11[ScriptTarget11["ES2021"] = 8] = "ES2021"; + ScriptTarget11[ScriptTarget11["ES2022"] = 9] = "ES2022"; + ScriptTarget11[ScriptTarget11["ESNext"] = 99] = "ESNext"; + ScriptTarget11[ScriptTarget11["JSON"] = 100] = "JSON"; + ScriptTarget11[ScriptTarget11["Latest"] = 99 /* ESNext */] = "Latest"; + return ScriptTarget11; })(ScriptTarget || {}); LanguageVariant = /* @__PURE__ */ ((LanguageVariant4) => { LanguageVariant4[LanguageVariant4["Standard"] = 0] = "Standard"; @@ -274534,7 +275313,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"; @@ -274795,8 +275573,9 @@ ${lanes.join("\n")} ExternalEmitHelpers2[ExternalEmitHelpers2["CreateBinding"] = 4194304] = "CreateBinding"; ExternalEmitHelpers2[ExternalEmitHelpers2["SetFunctionName"] = 8388608] = "SetFunctionName"; ExternalEmitHelpers2[ExternalEmitHelpers2["PropKey"] = 16777216] = "PropKey"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AddDisposableResourceAndDisposeResources"] = 33554432] = "AddDisposableResourceAndDisposeResources"; ExternalEmitHelpers2[ExternalEmitHelpers2["FirstEmitHelper"] = 1 /* Extends */] = "FirstEmitHelper"; - ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 16777216 /* PropKey */] = "LastEmitHelper"; + ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 33554432 /* AddDisposableResourceAndDisposeResources */] = "LastEmitHelper"; ExternalEmitHelpers2[ExternalEmitHelpers2["ForOfIncludes"] = 256 /* Values */] = "ForOfIncludes"; ExternalEmitHelpers2[ExternalEmitHelpers2["ForAwaitOfIncludes"] = 16384 /* AsyncValues */] = "ForAwaitOfIncludes"; ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; @@ -274812,6 +275591,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) => { @@ -274885,7 +275665,8 @@ ${lanes.join("\n")} ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements"; ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements"; ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties"; - ListFormat2[ListFormat2["ImportClauseEntries"] = 526226] = "ImportClauseEntries"; + ListFormat2[ListFormat2["ImportAttributes"] = 526226] = "ImportAttributes"; + ListFormat2[ListFormat2["ImportClauseEntries"] = 526226 /* ImportAttributes */] = "ImportClauseEntries"; ListFormat2[ListFormat2["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements"; ListFormat2[ListFormat2["CommaListElements"] = 528] = "CommaListElements"; ListFormat2[ListFormat2["CallExpressionArguments"] = 2576] = "CallExpressionArguments"; @@ -274966,6 +275747,13 @@ ${lanes.join("\n")} kind: 4 /* MultiLine */ } }; + JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode6) => { + JSDocParsingMode6[JSDocParsingMode6["ParseAll"] = 0] = "ParseAll"; + JSDocParsingMode6[JSDocParsingMode6["ParseNone"] = 1] = "ParseNone"; + JSDocParsingMode6[JSDocParsingMode6["ParseForTypeErrors"] = 2] = "ParseForTypeErrors"; + JSDocParsingMode6[JSDocParsingMode6["ParseForTypeInfo"] = 3] = "ParseForTypeInfo"; + return JSDocParsingMode6; + })(JSDocParsingMode || {}); } }); @@ -275177,10 +275965,10 @@ ${lanes.join("\n")} pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval)); } } - function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) { + function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) { const fileWatcherCallbacks = createMultiMap(); const dirWatchers = /* @__PURE__ */ new Map(); - const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames); + const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2); return nonPollingWatchFile; function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) { const filePath = toCanonicalName(fileName); @@ -275256,8 +276044,8 @@ ${lanes.join("\n")} pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */, "pollQueue"); } } - function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) { - const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); + function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, callback, createWatcher) { + const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); const path = toCanonicalFileName(name); const existing = cache.get(path); if (existing) { @@ -275307,7 +276095,7 @@ ${lanes.join("\n")} } function createDirectoryWatcherSupportingRecursive({ watchDirectory, - useCaseSensitiveFileNames, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, getCurrentDirectory, getAccessibleSortedChildDirectories, fileSystemEntryExists, @@ -275319,8 +276107,8 @@ ${lanes.join("\n")} const callbackCache = createMultiMap(); const cacheToUpdateChildWatches = /* @__PURE__ */ new Map(); let timerToUpdateChildWatches; - const filePathComparer = getStringComparer(!useCaseSensitiveFileNames); - const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames); + const filePathComparer = getStringComparer(!useCaseSensitiveFileNames2); + const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames2); return (dirName, callback, recursive, options) => recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options); function createDirectoryWatcher(dirName, options, callback) { const dirPath = toCanonicalFilePath(dirName); @@ -275487,14 +276275,14 @@ ${lanes.join("\n")} } } function isIgnoredPath(path, options) { - return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames, getCurrentDirectory); + return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory); } function isInPath(path, searchPath) { - if (stringContains(path, searchPath)) + if (path.includes(searchPath)) return true; - if (useCaseSensitiveFileNames) + if (useCaseSensitiveFileNames2) return false; - return stringContains(toCanonicalFilePath(path), searchPath); + return toCanonicalFilePath(path).includes(searchPath); } } function createFileWatcherCallback(callback) { @@ -275510,14 +276298,14 @@ ${lanes.join("\n")} } }; } - function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames, getCurrentDirectory) { - return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames, getCurrentDirectory())); + function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames2, getCurrentDirectory) { + return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames2, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2, getCurrentDirectory())); } - function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory) { + function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory) { return (eventName, relativeFileName) => { if (eventName === "rename") { const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName)); - if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames, getCurrentDirectory)) { + if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) { callback(fileName); } } @@ -275530,7 +276318,7 @@ ${lanes.join("\n")} clearTimeout: clearTimeout2, fsWatchWorker, fileSystemEntryExists, - useCaseSensitiveFileNames, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, getCurrentDirectory, fsSupportsRecursiveFsWatch, getAccessibleSortedChildDirectories, @@ -275539,6 +276327,7 @@ ${lanes.join("\n")} useNonPollingWatchers, tscWatchDirectory, inodeWatching, + fsWatchWithTimestamp, sysLog: sysLog2 }) { const pollingWatches = /* @__PURE__ */ new Map(); @@ -275602,7 +276391,7 @@ ${lanes.join("\n")} ); case 5 /* UseFsEventsOnParentDirectory */: if (!nonPollingWatchFile) { - nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames); + nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2); } return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options)); default: @@ -275651,7 +276440,7 @@ ${lanes.join("\n")} return fsWatch( directoryName, 1 /* Directory */, - createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory), + createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory), recursive, 500 /* Medium */, getFallbackOptions(options) @@ -275659,7 +276448,7 @@ ${lanes.join("\n")} } if (!hostRecursiveDirectoryWatcher) { hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({ - useCaseSensitiveFileNames, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, getCurrentDirectory, fileSystemEntryExists, getAccessibleSortedChildDirectories, @@ -275705,7 +276494,7 @@ ${lanes.join("\n")} return fsWatch( directoryName, 1 /* Directory */, - createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory), + createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory), recursive, 500 /* Medium */, getFallbackOptions(watchDirectoryOptions) @@ -275733,7 +276522,7 @@ ${lanes.join("\n")} function pollingWatchFile(fileName, callback, pollingInterval, options) { return createSingleWatcherPerName( pollingWatches, - useCaseSensitiveFileNames, + useCaseSensitiveFileNames2, fileName, callback, (cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options) @@ -275742,7 +276531,7 @@ ${lanes.join("\n")} function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) { return createSingleWatcherPerName( recursive ? fsWatchesRecursive : fsWatches, - useCaseSensitiveFileNames, + useCaseSensitiveFileNames2, fileOrDirectory, callback, (cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions) @@ -275777,7 +276566,7 @@ ${lanes.join("\n")} return watchPresentFileSystemEntryWithFsWatchFile(); } try { - const presentWatcher = fsWatchWorker( + const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)( fileOrDirectory, recursive, inodeWatching ? callbackChangingToMissingFileSystemEntry : callback @@ -275840,6 +276629,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; @@ -275887,24 +276688,25 @@ ${lanes.join("\n")} const byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { const nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/; - const _fs = __nccwpck_require__(57147); - const _path = __nccwpck_require__(71017); - const _os = __nccwpck_require__(22037); + const _fs = __nccwpck_require__(57147); + const _path = __nccwpck_require__(71017); + const _os = __nccwpck_require__(22037); let _crypto; try { - _crypto = __nccwpck_require__(6113); + _crypto = __nccwpck_require__(6113); } catch { _crypto = void 0; } let activeSession; let profilePath = "./profile.cpuprofile"; - const Buffer2 = (__nccwpck_require__(14300).Buffer); - const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; + const Buffer2 = (__nccwpck_require__(14300).Buffer); + const isMacOs = process.platform === "darwin"; + const isLinuxOrMacOs = process.platform === "linux" || isMacOs; const platform = _os.platform(); - const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); + 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, @@ -275912,7 +276714,7 @@ ${lanes.join("\n")} setTimeout, clearTimeout, fsWatchWorker, - useCaseSensitiveFileNames, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, getCurrentDirectory, fileSystemEntryExists, // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows @@ -275924,12 +276726,13 @@ ${lanes.join("\n")} useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER, tscWatchDirectory: process.env.TSC_WATCHDIRECTORY, inodeWatching: isLinuxOrMacOs, + fsWatchWithTimestamp: isMacOs, sysLog }); const nodeSystem = { args: process.argv.slice(2), newLine: _os.EOL, - useCaseSensitiveFileNames, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, write(s) { process.stdout.write(s); }, @@ -275946,6 +276749,7 @@ ${lanes.join("\n")} resolvePath: (path) => _path.resolve(path), fileExists, directoryExists, + getAccessibleFileSystemEntries, createDirectory(directoryName) { if (!nodeSystem.directoryExists(directoryName)) { try { @@ -275994,10 +276798,10 @@ ${lanes.join("\n")} disableCPUProfiler, cpuProfilingEnabled: () => !!activeSession || contains(process.execArgv, "--cpu-prof") || contains(process.execArgv, "--prof"), realpath, - debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv, (arg) => /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg)), + 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 { - (__nccwpck_require__(9249).install)(); + (__nccwpck_require__(9249).install)(); } catch { } }, @@ -276019,9 +276823,9 @@ ${lanes.join("\n")} require: (baseDir, moduleName) => { try { const modulePath = resolveJSModule(moduleName, baseDir, nodeSystem); - return { module: require(modulePath), modulePath, error: void 0 }; - } catch (error) { - return { module: void 0, modulePath: void 0, error }; + return { module: require(modulePath), modulePath, error: void 0 }; + } catch (error2) { + return { module: void 0, modulePath: void 0, error: error2 }; } } }; @@ -276034,7 +276838,7 @@ ${lanes.join("\n")} cb(); return false; } - const inspector = __nccwpck_require__(31405); + const inspector = __nccwpck_require__(31405); if (!inspector || !inspector.Session) { cb(); return false; @@ -276058,12 +276862,12 @@ ${lanes.join("\n")} for (const node of profile.nodes) { if (node.callFrame.url) { const url = normalizeSlashes(node.callFrame.url); - if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames)) { + if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames2)) { node.callFrame.url = getRelativePathToDirectoryOrUrl( fileUrlRoot, url, fileUrlRoot, - createGetCanonicalFileName(useCaseSensitiveFileNames), + createGetCanonicalFileName(useCaseSensitiveFileNames2), /*isAbsolutePathAnUrl*/ true ); @@ -276243,7 +277047,7 @@ ${lanes.join("\n")} } } function readDirectory(path, extensions, excludes, includes, depth) { - return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); + return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); } function fileSystemEntryExists(path, entryKind) { const originalStackTraceLimit = Error.stackTraceLimit; @@ -276329,7 +277133,9 @@ ${lanes.join("\n")} })(); if (sys && sys.getEnvironmentVariable) { setCustomPollingValues(sys); - Debug.setAssertionLevel(/^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */); + Debug.setAssertionLevel( + /^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */ + ); } if (sys && sys.debugMode) { Debug.isDebugging = true; @@ -276361,7 +277167,7 @@ ${lanes.join("\n")} return !pathIsAbsolute(path) && !pathIsRelative(path); } function hasExtension(fileName) { - return stringContains(getBaseFileName(fileName), "."); + return getBaseFileName(fileName).includes("."); } function fileExtensionIs(path, extension) { return path.length > extension.length && endsWith(path, extension); @@ -276506,7 +277312,7 @@ ${lanes.join("\n")} return root + pathComponents2.slice(1, length2).join(directorySeparator); } function normalizeSlashes(path) { - return path.indexOf("\\") !== -1 ? path.replace(backslashRegExp, directorySeparator) : path; + return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path; } function reducePathComponents(components) { if (!some(components)) @@ -276601,6 +277407,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 */; @@ -276819,6 +277632,7 @@ ${lanes.join("\n")} Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: diag(1062, 1 /* Error */, "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."), An_export_assignment_cannot_be_used_in_a_namespace: diag(1063, 1 /* Error */, "An_export_assignment_cannot_be_used_in_a_namespace_1063", "An export assignment cannot be used in a namespace."), The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0: diag(1064, 1 /* Error */, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064", "The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise<{0}>'?"), + The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: diag(1065, 1 /* Error */, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1065", "The return type of an async function or method must be the global Promise type."), In_ambient_enum_declarations_member_initializer_must_be_constant_expression: diag(1066, 1 /* Error */, "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", "In ambient enum declarations member initializer must be constant expression."), Unexpected_token_A_constructor_method_accessor_or_property_was_expected: diag(1068, 1 /* Error */, "Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068", "Unexpected token. A constructor, method, accessor, or property was expected."), Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: diag(1069, 1 /* Error */, "Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069", "Unexpected token. A type parameter name was expected without curly braces."), @@ -276848,6 +277662,7 @@ ${lanes.join("\n")} A_return_statement_can_only_be_used_within_a_function_body: diag(1108, 1 /* Error */, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."), Expression_expected: diag(1109, 1 /* Error */, "Expression_expected_1109", "Expression expected."), Type_expected: diag(1110, 1 /* Error */, "Type_expected_1110", "Type expected."), + Private_field_0_must_be_declared_in_an_enclosing_class: diag(1111, 1 /* Error */, "Private_field_0_must_be_declared_in_an_enclosing_class_1111", "Private field '{0}' must be declared in an enclosing class."), A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, 1 /* Error */, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."), Duplicate_label_0: diag(1114, 1 /* Error */, "Duplicate_label_0_1114", "Duplicate label '{0}'."), A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, 1 /* Error */, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."), @@ -276882,9 +277697,8 @@ ${lanes.join("\n")} Import_declarations_in_a_namespace_cannot_reference_a_module: diag(1147, 1 /* Error */, "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", "Import declarations in a namespace cannot reference a module."), Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: diag(1148, 1 /* Error */, "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", "Cannot use imports, exports, or module augmentations when '--module' is 'none'."), File_name_0_differs_from_already_included_file_name_1_only_in_casing: diag(1149, 1 /* Error */, "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", "File name '{0}' differs from already included file name '{1}' only in casing."), - const_declarations_must_be_initialized: diag(1155, 1 /* Error */, "const_declarations_must_be_initialized_1155", "'const' declarations must be initialized."), - const_declarations_can_only_be_declared_inside_a_block: diag(1156, 1 /* Error */, "const_declarations_can_only_be_declared_inside_a_block_1156", "'const' declarations can only be declared inside a block."), - let_declarations_can_only_be_declared_inside_a_block: diag(1157, 1 /* Error */, "let_declarations_can_only_be_declared_inside_a_block_1157", "'let' declarations can only be declared inside a block."), + _0_declarations_must_be_initialized: diag(1155, 1 /* Error */, "_0_declarations_must_be_initialized_1155", "'{0}' declarations must be initialized."), + _0_declarations_can_only_be_declared_inside_a_block: diag(1156, 1 /* Error */, "_0_declarations_can_only_be_declared_inside_a_block_1156", "'{0}' declarations can only be declared inside a block."), Unterminated_template_literal: diag(1160, 1 /* Error */, "Unterminated_template_literal_1160", "Unterminated template literal."), Unterminated_regular_expression_literal: diag(1161, 1 /* Error */, "Unterminated_regular_expression_literal_1161", "Unterminated regular expression literal."), An_object_member_cannot_be_declared_optional: diag(1162, 1 /* Error */, "An_object_member_cannot_be_declared_optional_1162", "An object member cannot be declared optional."), @@ -277006,6 +277820,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."), @@ -277066,12 +277884,10 @@ ${lanes.join("\n")} Class_constructor_may_not_be_a_generator: diag(1368, 1 /* Error */, "Class_constructor_may_not_be_a_generator_1368", "Class constructor may not be a generator."), Did_you_mean_0: diag(1369, 3 /* Message */, "Did_you_mean_0_1369", "Did you mean '{0}'?"), This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, 1 /* Error */, "This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371", "This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."), - Convert_to_type_only_import: diag(1373, 3 /* Message */, "Convert_to_type_only_import_1373", "Convert to type-only import"), - Convert_all_imports_not_used_as_a_value_to_type_only_imports: diag(1374, 3 /* Message */, "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374", "Convert all imports not used as a value to type-only imports"), 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 `}`?"), @@ -277122,7 +277938,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}'?"), @@ -277138,9 +277954,8 @@ ${lanes.join("\n")} _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."), Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."), - Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"), + Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"), 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: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "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"), - resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, 1 /* Error */, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."), resolution_mode_should_be_either_require_or_import: diag(1453, 1 /* Error */, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."), resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, 1 /* Error */, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."), resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."), @@ -277150,6 +277965,8 @@ ${lanes.join("\n")} File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: diag(1459, 3 /* Message */, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`), File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, 3 /* Message */, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`), File_is_CommonJS_module_because_package_json_was_not_found: diag(1461, 3 /* Message */, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"), + resolution_mode_is_the_only_valid_key_for_type_import_attributes: diag(1463, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463", "'resolution-mode' is the only valid key for type import attributes."), + Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1464, 1 /* Error */, "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464", "Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."), The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, 1 /* Error */, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."), Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead: diag(1471, 1 /* Error */, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."), catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."), @@ -277171,6 +277988,12 @@ ${lanes.join("\n")} Escape_sequence_0_is_not_allowed: diag(1488, 1 /* Error */, "Escape_sequence_0_is_not_allowed_1488", "Escape sequence '{0}' is not allowed."), Decimals_with_leading_zeros_are_not_allowed: diag(1489, 1 /* Error */, "Decimals_with_leading_zeros_are_not_allowed_1489", "Decimals with leading zeros are not allowed."), File_appears_to_be_binary: diag(1490, 1 /* Error */, "File_appears_to_be_binary_1490", "File appears to be binary."), + _0_modifier_cannot_appear_on_a_using_declaration: diag(1491, 1 /* Error */, "_0_modifier_cannot_appear_on_a_using_declaration_1491", "'{0}' modifier cannot appear on a 'using' declaration."), + _0_declarations_may_not_have_binding_patterns: diag(1492, 1 /* Error */, "_0_declarations_may_not_have_binding_patterns_1492", "'{0}' declarations may not have binding patterns."), + The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."), + The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."), + _0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."), + Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal, or number literal expected."), The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag( @@ -277265,7 +278088,6 @@ ${lanes.join("\n")} This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343", "This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."), Type_0_does_not_satisfy_the_constraint_1: diag(2344, 1 /* Error */, "Type_0_does_not_satisfy_the_constraint_1_2344", "Type '{0}' does not satisfy the constraint '{1}'."), Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: diag(2345, 1 /* Error */, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", "Argument of type '{0}' is not assignable to parameter of type '{1}'."), - Call_target_does_not_contain_any_signatures: diag(2346, 1 /* Error */, "Call_target_does_not_contain_any_signatures_2346", "Call target does not contain any signatures."), Untyped_function_calls_may_not_accept_type_arguments: diag(2347, 1 /* Error */, "Untyped_function_calls_may_not_accept_type_arguments_2347", "Untyped function calls may not accept type arguments."), Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: diag(2348, 1 /* Error */, "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348", "Value of type '{0}' is not callable. Did you mean to include 'new'?"), This_expression_is_not_callable: diag(2349, 1 /* Error */, "This_expression_is_not_callable_2349", "This expression is not callable."), @@ -277278,7 +278100,7 @@ ${lanes.join("\n")} An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2356, 1 /* Error */, "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."), The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, 1 /* Error */, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."), The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, 1 /* Error */, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."), - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, 1 /* Error */, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."), + The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method: diag(2359, 1 /* Error */, "The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_2359", "The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method."), The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, 1 /* Error */, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, 1 /* Error */, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, 1 /* Error */, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."), @@ -277699,17 +278521,17 @@ ${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_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}'?"), - Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, 1 /* Error */, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."), + 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}'?"), + Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2836, 1 /* Error */, "Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836", "Import assertions are not allowed on statements that compile to CommonJS 'require' calls."), Import_assertion_values_must_be_string_literal_expressions: diag(2837, 1 /* Error */, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."), All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."), This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."), - An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"), - The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, 1 /* Error */, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."), + An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types_2840", "An interface cannot extend a primitive type like '{0}'. It can only extend other named object types."), _0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1 /* Error */, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"), We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."), Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), @@ -277717,6 +278539,25 @@ ${lanes.join("\n")} A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead: diag(2846, 1 /* Error */, "A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846", "A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?"), The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression: diag(2848, 1 /* Error */, "The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression_2848", "The right-hand side of an 'instanceof' expression must not be an instantiation expression."), Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1: diag(2849, 1 /* Error */, "Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1_2849", "Target signature provides too few arguments. Expected {0} or more, but got {1}."), + The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined: diag(2850, 1 /* Error */, "The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_n_2850", "The initializer of a 'using' declaration must be either an object with a '[Symbol.dispose]()' method, or be 'null' or 'undefined'."), + 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_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."), + Import_attribute_values_must_be_string_literal_expressions: diag(2858, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."), + Excessive_complexity_comparing_types_0_and_1: diag(2859, 1 /* Error */, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."), + The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method: diag(2860, 1 /* Error */, "The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860", "The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."), + An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression: diag(2861, 1 /* Error */, "An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861", "An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."), + 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}'."), @@ -277825,7 +278666,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'."), - resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, 1 /* Error */, "resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "'resolution-mode' assertions are 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}'."), @@ -277857,7 +278699,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."), @@ -277870,7 +278712,6 @@ ${lanes.join("\n")} Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, 1 /* Error */, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, 1 /* Error */, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), Cannot_read_file_0: diag(5083, 1 /* Error */, "Cannot_read_file_0_5083", "Cannot read file '{0}'."), - Tuple_members_must_all_have_names_or_all_not_have_names: diag(5084, 1 /* Error */, "Tuple_members_must_all_have_names_or_all_not_have_names_5084", "Tuple members must all have names or all not have names."), A_tuple_member_cannot_be_both_optional_and_rest: diag(5085, 1 /* Error */, "A_tuple_member_cannot_be_both_optional_and_rest_5085", "A tuple member cannot be both optional and rest."), A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, 1 /* Error */, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, 1 /* Error */, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."), @@ -277881,7 +278722,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'."), @@ -277893,6 +278734,8 @@ ${lanes.join("\n")} Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."), Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1 /* Error */, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`), Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."), + Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1: diag(5109, 1 /* Error */, "Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109", "Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."), + Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1: diag(5110, 1 /* Error */, "Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110", "Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -277959,7 +278802,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"), @@ -278180,6 +279022,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}'."), @@ -278273,6 +279117,8 @@ ${lanes.join("\n")} Resolved_under_condition_0: diag(6414, 3 /* Message */, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."), Failed_to_resolve_under_condition_0: diag(6415, 3 /* Message */, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."), Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."), + Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0: diag(6417, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417", "Searching all ancestor node_modules directories for preferred extensions: {0}."), + Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), @@ -278511,6 +279357,7 @@ ${lanes.join("\n")} Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, 1 /* Error */, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."), Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, 1 /* Error */, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."), Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, 1 /* Error */, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."), + Signature_declarations_can_only_be_used_in_TypeScript_files: diag(8017, 1 /* Error */, "Signature_declarations_can_only_be_used_in_TypeScript_files_8017", "Signature declarations can only be used in TypeScript files."), Report_errors_in_js_files: diag(8019, 3 /* Message */, "Report_errors_in_js_files_8019", "Report errors in .js files."), JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, 1 /* Error */, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."), JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, 1 /* Error */, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."), @@ -278554,6 +279401,7 @@ ${lanes.join("\n")} Unknown_type_acquisition_option_0_Did_you_mean_1: diag(17018, 1 /* Error */, "Unknown_type_acquisition_option_0_Did_you_mean_1_17018", "Unknown type acquisition option '{0}'. Did you mean '{1}'?"), _0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1: diag(17019, 1 /* Error */, "_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17019", "'{0}' at the end of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"), _0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1: diag(17020, 1 /* Error */, "_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17020", "'{0}' at the start of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"), + Unicode_escape_sequence_cannot_appear_here: diag(17021, 1 /* Error */, "Unicode_escape_sequence_cannot_appear_here_17021", "Unicode escape sequence cannot appear here."), Circularity_detected_while_resolving_configuration_Colon_0: diag(18e3, 1 /* Error */, "Circularity_detected_while_resolving_configuration_Colon_0_18000", "Circularity detected while resolving configuration: {0}"), The_files_list_in_config_file_0_is_empty: diag(18002, 1 /* Error */, "The_files_list_in_config_file_0_is_empty_18002", "The 'files' list in config file '{0}' is empty."), No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: diag(18003, 1 /* Error */, "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."), @@ -278759,7 +279607,7 @@ ${lanes.join("\n")} Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"), Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"), Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"), - Can_only_convert_string_concatenation: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenation_95154", "Can only convert string concatenation"), + Can_only_convert_string_concatenations_and_string_literals: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenations_and_string_literals_95154", "Can only convert string concatenations and string literals"), Selection_is_not_a_valid_statement_or_statements: diag(95155, 3 /* Message */, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"), Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"), Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"), @@ -278785,6 +279633,20 @@ ${lanes.join("\n")} Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."), Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"), Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"), + Use_import_type: diag(95180, 3 /* Message */, "Use_import_type_95180", "Use 'import type'"), + Use_type_0: diag(95181, 3 /* Message */, "Use_type_0_95181", "Use 'type {0}'"), + Fix_all_with_type_only_imports: diag(95182, 3 /* Message */, "Fix_all_with_type_only_imports_95182", "Fix all with type-only imports"), + Cannot_move_statements_to_the_selected_file: diag(95183, 3 /* Message */, "Cannot_move_statements_to_the_selected_file_95183", "Cannot move statements to the selected file"), + Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"), + 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?"), @@ -278811,8 +279673,8 @@ ${lanes.join("\n")} Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment: diag(18034, 3 /* Message */, "Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034", "Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."), Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(18035, 1 /* Error */, "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035", "Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."), Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator: diag(18036, 1 /* Error */, "Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036", "Class decorators can't be used with static private identifier. Consider removing the experimental decorator."), - Await_expression_cannot_be_used_inside_a_class_static_block: diag(18037, 1 /* Error */, "Await_expression_cannot_be_used_inside_a_class_static_block_18037", "Await expression cannot be used inside a class static block."), - For_await_loops_cannot_be_used_inside_a_class_static_block: diag(18038, 1 /* Error */, "For_await_loops_cannot_be_used_inside_a_class_static_block_18038", "'For await' loops cannot be used inside a class static block."), + await_expression_cannot_be_used_inside_a_class_static_block: diag(18037, 1 /* Error */, "await_expression_cannot_be_used_inside_a_class_static_block_18037", "'await' expression cannot be used inside a class static block."), + for_await_loops_cannot_be_used_inside_a_class_static_block: diag(18038, 1 /* Error */, "for_await_loops_cannot_be_used_inside_a_class_static_block_18038", "'for await' loops cannot be used inside a class static block."), Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block: diag(18039, 1 /* Error */, "Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039", "Invalid use of '{0}'. It cannot be used inside a class static block."), A_return_statement_cannot_be_used_inside_a_class_static_block: diag(18041, 1 /* Error */, "A_return_statement_cannot_be_used_inside_a_class_static_block_18041", "A 'return' statement cannot be used inside a class static block."), _0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation: diag(18042, 1 /* Error */, "_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042", "'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."), @@ -278826,7 +279688,8 @@ ${lanes.join("\n")} The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."), Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."), Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"), - Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type.") + Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."), + await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.") }; } }); @@ -279103,9 +279966,9 @@ ${lanes.join("\n")} } return false; } - function scanConflictMarkerTrivia(text, pos, error) { - if (error) { - error(Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); + function scanConflictMarkerTrivia(text, pos, error2) { + if (error2) { + error2(Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); } const ch = text.charCodeAt(pos); const len = text.length; @@ -279341,6 +280204,8 @@ ${lanes.join("\n")} var tokenFlags; var commentDirectives; var inJSDocType = 0; + var scriptKind = 0 /* Unknown */; + var jsDocParsingMode = 0 /* ParseAll */; setText(text, start, length2); var scanner2 = { getTokenFullStart: () => fullStartPos, @@ -279384,6 +280249,8 @@ ${lanes.join("\n")} setText, setScriptTarget, setLanguageVariant, + setScriptKind, + setJSDocParsingMode, setOnError, resetTokenState, setTextPos: resetTokenState, @@ -279401,7 +280268,7 @@ ${lanes.join("\n")} }); } return scanner2; - function error(message, errPos = pos, length3, arg0) { + function error2(message, errPos = pos, length3, arg0) { if (onError) { const oldPos = pos; pos = errPos; @@ -279425,9 +280292,9 @@ ${lanes.join("\n")} } else { tokenFlags |= 16384 /* ContainsInvalidSeparator */; if (isPreviousTokenSeparator) { - error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + error2(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); } else { - error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); } } pos++; @@ -279444,7 +280311,7 @@ ${lanes.join("\n")} } if (text.charCodeAt(pos - 1) === 95 /* _ */) { tokenFlags |= 16384 /* ContainsInvalidSeparator */; - error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); } return result + text.substring(start2, pos); } @@ -279455,7 +280322,7 @@ ${lanes.join("\n")} pos++; if (text.charCodeAt(pos) === 95 /* _ */) { tokenFlags |= 512 /* ContainsSeparator */ | 16384 /* ContainsInvalidSeparator */; - error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); pos--; mainFragment = scanNumberFragment(); } else if (!scanDigits()) { @@ -279470,8 +280337,8 @@ ${lanes.join("\n")} const literal = (withMinus ? "-" : "") + "0o" + (+tokenValue).toString(8); if (withMinus) start2--; - error(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start2, pos - start2, literal); - return { type: 9 /* NumericLiteral */, value: tokenValue }; + error2(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start2, pos - start2, literal); + return 9 /* NumericLiteral */; } } else { mainFragment = scanNumberFragment(); @@ -279491,7 +280358,7 @@ ${lanes.join("\n")} const preNumericPart = pos; const finalFragment = scanNumberFragment(); if (!finalFragment) { - error(Diagnostics.Digit_expected); + error2(Diagnostics.Digit_expected); } else { scientificFragment = text.substring(end2, preNumericPart) + finalFragment; end2 = pos; @@ -279510,21 +280377,19 @@ ${lanes.join("\n")} result = text.substring(start2, end2); } if (tokenFlags & 8192 /* ContainsLeadingZero */) { - error(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start2, end2 - start2); - return { type: 9 /* NumericLiteral */, value: "" + +result }; + error2(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start2, end2 - start2); + tokenValue = "" + +result; + return 9 /* NumericLiteral */; } if (decimalFragment !== void 0 || tokenFlags & 16 /* Scientific */) { checkForIdentifierStartAfterNumericLiteral(start2, decimalFragment === void 0 && !!(tokenFlags & 16 /* Scientific */)); - return { - type: 9 /* NumericLiteral */, - value: "" + +result - // if value is not an integer, it can be safely coerced to a number - }; + tokenValue = "" + +result; + return 9 /* NumericLiteral */; } else { tokenValue = result; const type = checkBigIntSuffix(); checkForIdentifierStartAfterNumericLiteral(start2); - return { type, value: tokenValue }; + return type; } } function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) { @@ -279535,12 +280400,12 @@ ${lanes.join("\n")} const { length: length3 } = scanIdentifierParts(); if (length3 === 1 && text[identifierStart] === "n") { if (isScientific) { - error(Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1); + error2(Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1); } else { - error(Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1); + error2(Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1); } } else { - error(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length3); + error2(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length3); pos = identifierStart; } } @@ -279587,9 +280452,9 @@ ${lanes.join("\n")} allowSeparator = false; isPreviousTokenSeparator = true; } else if (isPreviousTokenSeparator) { - error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + error2(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); } else { - error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); } pos++; continue; @@ -279608,7 +280473,7 @@ ${lanes.join("\n")} valueChars = []; } if (text.charCodeAt(pos - 1) === 95 /* _ */) { - error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); } return String.fromCharCode(...valueChars); } @@ -279621,7 +280486,7 @@ ${lanes.join("\n")} if (pos >= end) { result += text.substring(start2, pos); tokenFlags |= 4 /* Unterminated */; - error(Diagnostics.Unterminated_string_literal); + error2(Diagnostics.Unterminated_string_literal); break; } const ch = text.charCodeAt(pos); @@ -279639,10 +280504,10 @@ ${lanes.join("\n")} start2 = pos; continue; } - if (isLineBreak(ch) && !jsxAttributeString) { + if ((ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */) && !jsxAttributeString) { result += text.substring(start2, pos); tokenFlags |= 4 /* Unterminated */; - error(Diagnostics.Unterminated_string_literal); + error2(Diagnostics.Unterminated_string_literal); break; } pos++; @@ -279659,7 +280524,7 @@ ${lanes.join("\n")} if (pos >= end) { contents += text.substring(start2, pos); tokenFlags |= 4 /* Unterminated */; - error(Diagnostics.Unterminated_template_literal); + error2(Diagnostics.Unterminated_template_literal); resultingToken = startedWithBacktick ? 15 /* NoSubstitutionTemplateLiteral */ : 18 /* TemplateTail */; break; } @@ -279702,7 +280567,7 @@ ${lanes.join("\n")} const start2 = pos; pos++; if (pos >= end) { - error(Diagnostics.Unexpected_end_of_text); + error2(Diagnostics.Unexpected_end_of_text); return ""; } const ch = text.charCodeAt(pos); @@ -279728,7 +280593,7 @@ ${lanes.join("\n")} tokenFlags |= 2048 /* ContainsInvalidEscape */; if (shouldEmitInvalidEscapeError) { const code = parseInt(text.substring(start2 + 1, pos), 8); - error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + padLeft(code.toString(16), 2, "0")); + error2(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + code.toString(16).padStart(2, "0")); return String.fromCharCode(code); } return text.substring(start2, pos); @@ -279736,7 +280601,7 @@ ${lanes.join("\n")} case 57 /* _9 */: tokenFlags |= 2048 /* ContainsInvalidEscape */; if (shouldEmitInvalidEscapeError) { - error(Diagnostics.Escape_sequence_0_is_not_allowed, start2, pos - start2, text.substring(start2, pos)); + error2(Diagnostics.Escape_sequence_0_is_not_allowed, start2, pos - start2, text.substring(start2, pos)); return String.fromCharCode(ch); } return text.substring(start2, pos); @@ -279768,28 +280633,28 @@ ${lanes.join("\n")} if (escapedValue < 0) { tokenFlags |= 2048 /* ContainsInvalidEscape */; if (shouldEmitInvalidEscapeError) { - error(Diagnostics.Hexadecimal_digit_expected); + error2(Diagnostics.Hexadecimal_digit_expected); } return text.substring(start2, pos); } if (!isCodePoint(escapedValue)) { tokenFlags |= 2048 /* ContainsInvalidEscape */; if (shouldEmitInvalidEscapeError) { - error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); + error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); } return text.substring(start2, pos); } if (pos >= end) { tokenFlags |= 2048 /* ContainsInvalidEscape */; if (shouldEmitInvalidEscapeError) { - error(Diagnostics.Unexpected_end_of_text); + error2(Diagnostics.Unexpected_end_of_text); } return text.substring(start2, pos); } if (text.charCodeAt(pos) !== 125 /* closeBrace */) { tokenFlags |= 2048 /* ContainsInvalidEscape */; if (shouldEmitInvalidEscapeError) { - error(Diagnostics.Unterminated_Unicode_escape_sequence); + error2(Diagnostics.Unterminated_Unicode_escape_sequence); } return text.substring(start2, pos); } @@ -279801,7 +280666,7 @@ ${lanes.join("\n")} if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) { tokenFlags |= 2048 /* ContainsInvalidEscape */; if (shouldEmitInvalidEscapeError) { - error(Diagnostics.Hexadecimal_digit_expected); + error2(Diagnostics.Hexadecimal_digit_expected); } return text.substring(start2, pos); } @@ -279813,7 +280678,7 @@ ${lanes.join("\n")} if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) { tokenFlags |= 2048 /* ContainsInvalidEscape */; if (shouldEmitInvalidEscapeError) { - error(Diagnostics.Hexadecimal_digit_expected); + error2(Diagnostics.Hexadecimal_digit_expected); } return text.substring(start2, pos); } @@ -279841,19 +280706,19 @@ ${lanes.join("\n")} const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; let isInvalidExtendedEscape = false; if (escapedValue < 0) { - error(Diagnostics.Hexadecimal_digit_expected); + error2(Diagnostics.Hexadecimal_digit_expected); isInvalidExtendedEscape = true; } else if (escapedValue > 1114111) { - error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); + error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); isInvalidExtendedEscape = true; } if (pos >= end) { - error(Diagnostics.Unexpected_end_of_text); + error2(Diagnostics.Unexpected_end_of_text); isInvalidExtendedEscape = true; } else if (text.charCodeAt(pos) === 125 /* closeBrace */) { pos++; } else { - error(Diagnostics.Unterminated_Unicode_escape_sequence); + error2(Diagnostics.Unterminated_Unicode_escape_sequence); isInvalidExtendedEscape = true; } if (isInvalidExtendedEscape) { @@ -279947,9 +280812,9 @@ ${lanes.join("\n")} separatorAllowed = false; isPreviousTokenSeparator = true; } else if (isPreviousTokenSeparator) { - error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + error2(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); } else { - error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); } pos++; continue; @@ -279963,7 +280828,7 @@ ${lanes.join("\n")} isPreviousTokenSeparator = false; } if (text.charCodeAt(pos - 1) === 95 /* _ */) { - error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + error2(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); } return value; } @@ -279992,8 +280857,8 @@ ${lanes.join("\n")} } const ch = codePointAt(text, pos); if (pos === 0) { - if (ch === 65533 /* replacementCharacter */) { - error(Diagnostics.File_appears_to_be_binary); + if (text.slice(0, 256).includes("\uFFFD")) { + error2(Diagnostics.File_appears_to_be_binary); pos = end; return token = 8 /* NonTextFileMarkerTrivia */; } @@ -280133,7 +280998,7 @@ ${lanes.join("\n")} return token = 41 /* MinusToken */; case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = scanNumber().value; + scanNumber(); return token = 9 /* NumericLiteral */; } if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { @@ -280164,9 +281029,7 @@ ${lanes.join("\n")} } if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { pos += 2; - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) !== 47 /* slash */) { - tokenFlags |= 2 /* PrecedingJSDocComment */; - } + const isJSDoc2 = text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) !== 47 /* slash */; let commentClosed = false; let lastLineStart = tokenStart; while (pos < end) { @@ -280182,9 +281045,12 @@ ${lanes.join("\n")} tokenFlags |= 1 /* PrecedingLineBreak */; } } + if (isJSDoc2 && shouldParseJSDoc()) { + tokenFlags |= 2 /* PrecedingJSDocComment */; + } commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart); if (!commentClosed) { - error(Diagnostics.Asterisk_Slash_expected); + error2(Diagnostics.Asterisk_Slash_expected); } if (skipTrivia2) { continue; @@ -280209,7 +281075,7 @@ ${lanes.join("\n")} true ); if (!tokenValue) { - error(Diagnostics.Hexadecimal_digit_expected); + error2(Diagnostics.Hexadecimal_digit_expected); tokenValue = "0"; } tokenValue = "0x" + tokenValue; @@ -280222,7 +281088,7 @@ ${lanes.join("\n")} 2 ); if (!tokenValue) { - error(Diagnostics.Binary_digit_expected); + error2(Diagnostics.Binary_digit_expected); tokenValue = "0"; } tokenValue = "0b" + tokenValue; @@ -280235,7 +281101,7 @@ ${lanes.join("\n")} 8 ); if (!tokenValue) { - error(Diagnostics.Octal_digit_expected); + error2(Diagnostics.Octal_digit_expected); tokenValue = "0"; } tokenValue = "0o" + tokenValue; @@ -280251,8 +281117,7 @@ ${lanes.join("\n")} case 55 /* _7 */: case 56 /* _8 */: case 57 /* _9 */: - ({ type: token, value: tokenValue } = scanNumber()); - return token; + return token = scanNumber(); case 58 /* colon */: pos++; return token = 59 /* ColonToken */; @@ -280261,7 +281126,7 @@ ${lanes.join("\n")} return token = 27 /* SemicolonToken */; case 60 /* lessThan */: if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error); + pos = scanConflictMarkerTrivia(text, pos, error2); if (skipTrivia2) { continue; } else { @@ -280284,7 +281149,7 @@ ${lanes.join("\n")} return token = 30 /* LessThanToken */; case 61 /* equals */: if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error); + pos = scanConflictMarkerTrivia(text, pos, error2); if (skipTrivia2) { continue; } else { @@ -280304,7 +281169,7 @@ ${lanes.join("\n")} return token = 64 /* EqualsToken */; case 62 /* greaterThan */: if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error); + pos = scanConflictMarkerTrivia(text, pos, error2); if (skipTrivia2) { continue; } else { @@ -280342,7 +281207,7 @@ ${lanes.join("\n")} return token = 19 /* OpenBraceToken */; case 124 /* bar */: if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error); + pos = scanConflictMarkerTrivia(text, pos, error2); if (skipTrivia2) { continue; } else { @@ -280384,12 +281249,12 @@ ${lanes.join("\n")} tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); return token = getIdentifierToken(); } - error(Diagnostics.Invalid_character); + error2(Diagnostics.Invalid_character); pos++; return token = 0 /* Unknown */; case 35 /* hash */: if (pos !== 0 && text[pos + 1] === "!") { - error(Diagnostics.can_only_be_used_at_the_start_of_a_file); + error2(Diagnostics.can_only_be_used_at_the_start_of_a_file); pos++; return token = 0 /* Unknown */; } @@ -280417,7 +281282,7 @@ ${lanes.join("\n")} scanIdentifier(charAfterHash, languageVersion); } else { tokenValue = "#"; - error(Diagnostics.Invalid_character, pos++, charSize(ch)); + error2(Diagnostics.Invalid_character, pos++, charSize(ch)); } return token = 81 /* PrivateIdentifier */; default: @@ -280433,12 +281298,27 @@ ${lanes.join("\n")} continue; } const size = charSize(ch); - error(Diagnostics.Invalid_character, pos, size); + error2(Diagnostics.Invalid_character, pos, size); pos += size; return token = 0 /* Unknown */; } } } + function shouldParseJSDoc() { + switch (jsDocParsingMode) { + case 0 /* ParseAll */: + return true; + case 1 /* ParseNone */: + return false; + } + if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) { + return true; + } + if (jsDocParsingMode === 3 /* ParseForTypeInfo */) { + return false; + } + return jsDocSeeOrLink.test(text.slice(fullStartPos, pos)); + } function reScanInvalidIdentifier() { Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."); pos = tokenStart = fullStartPos; @@ -280499,13 +281379,13 @@ ${lanes.join("\n")} while (true) { if (p >= end) { tokenFlags |= 4 /* Unterminated */; - error(Diagnostics.Unterminated_regular_expression_literal); + error2(Diagnostics.Unterminated_regular_expression_literal); break; } const ch = text.charCodeAt(p); if (isLineBreak(ch)) { tokenFlags |= 4 /* Unterminated */; - error(Diagnostics.Unterminated_regular_expression_literal); + error2(Diagnostics.Unterminated_regular_expression_literal); break; } if (inEscape) { @@ -280532,7 +281412,7 @@ ${lanes.join("\n")} return token; } function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) { - const type = getDirectiveFromComment(trimStringStart(text2), commentDirectiveRegEx); + const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx); if (type === void 0) { return commentDirectives2; } @@ -280617,16 +281497,16 @@ ${lanes.join("\n")} } if (char === 60 /* lessThan */) { if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error); + pos = scanConflictMarkerTrivia(text, pos, error2); return token = 7 /* ConflictMarkerTrivia */; } break; } if (char === 62 /* greaterThan */) { - error(Diagnostics.Unexpected_token_Did_you_mean_or_gt, pos, 1); + error2(Diagnostics.Unexpected_token_Did_you_mean_or_gt, pos, 1); } if (char === 125 /* closeBrace */) { - error(Diagnostics.Unexpected_token_Did_you_mean_or_rbrace, pos, 1); + error2(Diagnostics.Unexpected_token_Did_you_mean_or_rbrace, pos, 1); } if (isLineBreak(char) && firstNonWhitespace === 0) { firstNonWhitespace = -1; @@ -280853,6 +281733,12 @@ ${lanes.join("\n")} function setLanguageVariant(variant) { languageVariant = variant; } + function setScriptKind(kind) { + scriptKind = kind; + } + function setJSDocParsingMode(kind) { + jsDocParsingMode = kind; + } function resetTokenState(position) { Debug.assert(position >= 0); pos = position; @@ -280866,6 +281752,9 @@ ${lanes.join("\n")} inJSDocType += inType ? 1 : -1; } } + function codePointAt(s, i) { + return s.codePointAt(i); + } function charSize(ch) { if (ch >= 65536) { return 2; @@ -280884,7 +281773,7 @@ ${lanes.join("\n")} function utf16EncodeAsString(codePoint) { return utf16EncodeAsStringWorker(codePoint); } - var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, codePointAt, utf16EncodeAsStringWorker; + var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, jsDocSeeOrLink, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker; var init_scanner = __esm({ "src/compiler/scanner.ts"() { "use strict"; @@ -280896,7 +281785,7 @@ ${lanes.join("\n")} as: 130 /* AsKeyword */, asserts: 131 /* AssertsKeyword */, assert: 132 /* AssertKeyword */, - bigint: 162 /* BigIntKeyword */, + bigint: 163 /* BigIntKeyword */, boolean: 136 /* BooleanKeyword */, break: 83 /* BreakKeyword */, case: 84 /* CaseKeyword */, @@ -280917,7 +281806,7 @@ ${lanes.join("\n")} false: 97 /* FalseKeyword */, finally: 98 /* FinallyKeyword */, for: 99 /* ForKeyword */, - from: 160 /* FromKeyword */, + from: 161 /* FromKeyword */, function: 100 /* FunctionKeyword */, get: 139 /* GetKeyword */, if: 101 /* IfKeyword */, @@ -280942,11 +281831,11 @@ ${lanes.join("\n")} private: 123 /* PrivateKeyword */, protected: 124 /* ProtectedKeyword */, public: 125 /* PublicKeyword */, - override: 163 /* OverrideKeyword */, + override: 164 /* OverrideKeyword */, out: 147 /* OutKeyword */, readonly: 148 /* ReadonlyKeyword */, require: 149 /* RequireKeyword */, - global: 161 /* GlobalKeyword */, + global: 162 /* GlobalKeyword */, return: 107 /* ReturnKeyword */, satisfies: 152 /* SatisfiesKeyword */, set: 153 /* SetKeyword */, @@ -280964,6 +281853,7 @@ ${lanes.join("\n")} undefined: 157 /* UndefinedKeyword */, unique: 158 /* UniqueKeyword */, unknown: 159 /* UnknownKeyword */, + using: 160 /* UsingKeyword */, var: 115 /* VarKeyword */, void: 116 /* VoidKeyword */, while: 117 /* WhileKeyword */, @@ -280971,7 +281861,7 @@ ${lanes.join("\n")} yield: 127 /* YieldKeyword */, async: 134 /* AsyncKeyword */, await: 135 /* AwaitKeyword */, - of: 164 /* OfKeyword */ + of: 165 /* OfKeyword */ }; textToKeyword = new Map(Object.entries(textToKeywordObj)); textToToken = new Map(Object.entries({ @@ -281046,23 +281936,10 @@ ${lanes.join("\n")} unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/; commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/; + jsDocSeeOrLink = /@(?:see|link)/i; tokenStrings = makeReverseMap(textToToken); mergeConflictMarkerLength = "<<<<<<<".length; shebangTriviaRegex = /^#!.*/; - codePointAt = String.prototype.codePointAt ? (s, i) => s.codePointAt(i) : function codePointAt2(str, i) { - const size = str.length; - if (i < 0 || i >= size) { - return void 0; - } - const first2 = str.charCodeAt(i); - if (first2 >= 55296 && first2 <= 56319 && size > i + 1) { - const second = str.charCodeAt(i + 1); - if (second >= 56320 && second <= 57343) { - return (first2 - 55296) * 1024 + second - 56320 + 65536; - } - } - return first2; - }; utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fromCodePoint(codePoint) : utf16EncodeAsStringFallback; } }); @@ -281193,16 +282070,16 @@ ${lanes.join("\n")} ); } function getTypeParameterOwner(d) { - if (d && d.kind === 167 /* TypeParameter */) { + if (d && d.kind === 168 /* TypeParameter */) { for (let current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 263 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 264 /* InterfaceDeclaration */) { return current; } } } } function isParameterPropertyDeclaration(node, parent2) { - return isParameter(node) && hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent2.kind === 175 /* Constructor */; + return isParameter(node) && hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) && parent2.kind === 176 /* Constructor */; } function isEmptyBindingPattern(node) { if (isBindingPattern(node)) { @@ -281228,14 +282105,14 @@ ${lanes.join("\n")} node = walkUpBindingElementsAndPatterns(node); } let flags = getFlags(node); - if (node.kind === 259 /* VariableDeclaration */) { + if (node.kind === 260 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 260 /* VariableDeclarationList */) { + if (node && node.kind === 261 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 242 /* VariableStatement */) { + if (node && node.kind === 243 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -281247,11 +282124,14 @@ ${lanes.join("\n")} return getCombinedFlags(node, getEffectiveModifierFlagsAlwaysIncludeJSDoc); } function getCombinedNodeFlags(node) { - return getCombinedFlags(node, (n) => n.flags); + return getCombinedFlags(node, getNodeFlags); + } + function getNodeFlags(node) { + return node.flags; } function validateLocaleAndSetLanguage(locale, sys2, errors) { const lowerCaseLocale = locale.toLowerCase(); - const matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(lowerCaseLocale); + const matchResult = /^([a-z]+)([_-]([a-z]+))?$/.exec(lowerCaseLocale); if (!matchResult) { if (errors) { errors.push(createCompilerDiagnostic(Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp")); @@ -281324,7 +282204,7 @@ ${lanes.join("\n")} return void 0; } function isParseTreeNode(node) { - return (node.flags & 8 /* Synthesized */) === 0; + return (node.flags & 16 /* Synthesized */) === 0; } function getParseTreeNode(node, nodeTest) { if (node === void 0 || isParseTreeNode(node)) { @@ -281367,30 +282247,30 @@ ${lanes.join("\n")} return getDeclarationIdentifier(hostNode); } switch (hostNode.kind) { - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: let expr = hostNode.expression; - if (expr.kind === 225 /* BinaryExpression */ && expr.operatorToken.kind === 64 /* EqualsToken */) { + if (expr.kind === 226 /* BinaryExpression */ && expr.operatorToken.kind === 64 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return expr.name; - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: const arg = expr.argumentExpression; if (isIdentifier(arg)) { return arg; } } break; - case 216 /* ParenthesizedExpression */: { + case 217 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 255 /* LabeledStatement */: { + case 256 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -281421,16 +282301,16 @@ ${lanes.join("\n")} switch (declaration.kind) { case 80 /* Identifier */: return declaration; - case 354 /* JSDocPropertyTag */: - case 347 /* JSDocParameterTag */: { + case 355 /* JSDocPropertyTag */: + case 348 /* JSDocParameterTag */: { const { name } = declaration; - if (name.kind === 165 /* QualifiedName */) { + if (name.kind === 166 /* QualifiedName */) { return name.right; } break; } - case 212 /* CallExpression */: - case 225 /* BinaryExpression */: { + case 213 /* CallExpression */: + case 226 /* BinaryExpression */: { const expr2 = declaration; switch (getAssignmentDeclarationKind(expr2)) { case 1 /* ExportsProperty */: @@ -281446,15 +282326,15 @@ ${lanes.join("\n")} return void 0; } } - case 352 /* JSDocTypedefTag */: + case 353 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 346 /* JSDocEnumTag */: + case 347 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 276 /* ExportAssignment */: { + case 277 /* ExportAssignment */: { const { expression } = declaration; return isIdentifier(expression) ? expression : void 0; } - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: const expr = declaration; if (isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -281488,7 +282368,7 @@ ${lanes.join("\n")} } } function getModifiers(node) { - if (hasSyntacticModifier(node, 126975 /* Modifier */)) { + if (hasSyntacticModifier(node, 98303 /* Modifier */)) { return filter(node.modifiers, isModifier); } } @@ -281701,10 +282581,10 @@ ${lanes.join("\n")} return getJSDocTags(node).filter((doc) => doc.kind === kind); } function getTextOfJSDocComment(comment) { - return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 327 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); + return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 328 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); } function formatJSDocLink(link) { - const kind = link.kind === 330 /* JSDocLink */ ? "link" : link.kind === 331 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; + const kind = link.kind === 331 /* JSDocLink */ ? "link" : link.kind === 332 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; const name = link.name ? entityNameToString(link.name) : ""; const space = link.name && link.text.startsWith("://") ? "" : " "; return `{@${kind} ${name}${space}${link.text}}`; @@ -281720,7 +282600,7 @@ ${lanes.join("\n")} return emptyArray; } if (isJSDocTypeAlias(node)) { - Debug.assert(node.parent.kind === 326 /* JSDoc */); + Debug.assert(node.parent.kind === 327 /* JSDoc */); return flatMap(node.parent.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0); } if (node.typeParameters) { @@ -281748,20 +282628,20 @@ ${lanes.join("\n")} return node.kind === 80 /* Identifier */ || node.kind === 81 /* PrivateIdentifier */; } function isGetOrSetAccessorDeclaration(node) { - return node.kind === 177 /* SetAccessor */ || node.kind === 176 /* GetAccessor */; + return node.kind === 178 /* SetAccessor */ || node.kind === 177 /* GetAccessor */; } function isPropertyAccessChain(node) { - return isPropertyAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */); + return isPropertyAccessExpression(node) && !!(node.flags & 64 /* OptionalChain */); } function isElementAccessChain(node) { - return isElementAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */); + return isElementAccessExpression(node) && !!(node.flags & 64 /* OptionalChain */); } function isCallChain(node) { - return isCallExpression(node) && !!(node.flags & 32 /* OptionalChain */); + return isCallExpression(node) && !!(node.flags & 64 /* OptionalChain */); } function isOptionalChain(node) { const kind = node.kind; - return !!(node.flags & 32 /* OptionalChain */) && (kind === 210 /* PropertyAccessExpression */ || kind === 211 /* ElementAccessExpression */ || kind === 212 /* CallExpression */ || kind === 234 /* NonNullExpression */); + return !!(node.flags & 64 /* OptionalChain */) && (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */ || kind === 213 /* CallExpression */ || kind === 235 /* NonNullExpression */); } function isOptionalChainRoot(node) { return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; @@ -281773,7 +282653,7 @@ ${lanes.join("\n")} return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression; } function isNullishCoalesce(node) { - return node.kind === 225 /* BinaryExpression */ && node.operatorToken.kind === 61 /* QuestionQuestionToken */; + return node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 61 /* QuestionQuestionToken */; } function isConstTypeReference(node) { return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments; @@ -281782,37 +282662,37 @@ ${lanes.join("\n")} return skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */); } function isNonNullChain(node) { - return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */); + return isNonNullExpression(node) && !!(node.flags & 64 /* OptionalChain */); } function isBreakOrContinueStatement(node) { - return node.kind === 251 /* BreakStatement */ || node.kind === 250 /* ContinueStatement */; + return node.kind === 252 /* BreakStatement */ || node.kind === 251 /* ContinueStatement */; } function isNamedExportBindings(node) { - return node.kind === 279 /* NamespaceExport */ || node.kind === 278 /* NamedExports */; + return node.kind === 280 /* NamespaceExport */ || node.kind === 279 /* NamedExports */; } function isUnparsedTextLike(node) { switch (node.kind) { - case 308 /* UnparsedText */: - case 309 /* UnparsedInternalText */: + case 309 /* UnparsedText */: + case 310 /* UnparsedInternalText */: return true; default: return false; } } function isUnparsedNode(node) { - return isUnparsedTextLike(node) || node.kind === 306 /* UnparsedPrologue */ || node.kind === 310 /* UnparsedSyntheticReference */; + return isUnparsedTextLike(node) || node.kind === 307 /* UnparsedPrologue */ || node.kind === 311 /* UnparsedSyntheticReference */; } function isJSDocPropertyLikeTag(node) { - return node.kind === 354 /* JSDocPropertyTag */ || node.kind === 347 /* JSDocParameterTag */; + return node.kind === 355 /* JSDocPropertyTag */ || node.kind === 348 /* JSDocParameterTag */; } function isNode(node) { return isNodeKind(node.kind); } function isNodeKind(kind) { - return kind >= 165 /* FirstNode */; + return kind >= 166 /* FirstNode */; } function isTokenKind(kind) { - return kind >= 0 /* FirstToken */ && kind <= 164 /* LastToken */; + return kind >= 0 /* FirstToken */ && kind <= 165 /* LastToken */; } function isToken(n) { return isTokenKind(n.kind); @@ -281828,11 +282708,11 @@ ${lanes.join("\n")} } function isLiteralExpressionOfObject(node) { switch (node.kind) { - case 209 /* ObjectLiteralExpression */: - case 208 /* ArrayLiteralExpression */: + case 210 /* ObjectLiteralExpression */: + case 209 /* ArrayLiteralExpression */: case 14 /* RegularExpressionLiteral */: - case 217 /* FunctionExpression */: - case 230 /* ClassExpression */: + case 218 /* FunctionExpression */: + case 231 /* ClassExpression */: return true; } return false; @@ -281852,23 +282732,23 @@ ${lanes.join("\n")} } function isTypeOnlyImportDeclaration(node) { switch (node.kind) { - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: return node.isTypeOnly || node.parent.parent.isTypeOnly; - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: return node.parent.isTypeOnly; - case 272 /* ImportClause */: - case 270 /* ImportEqualsDeclaration */: + case 273 /* ImportClause */: + case 271 /* ImportEqualsDeclaration */: return node.isTypeOnly; } return false; } function isTypeOnlyExportDeclaration(node) { switch (node.kind) { - case 280 /* ExportSpecifier */: + case 281 /* ExportSpecifier */: return node.isTypeOnly || node.parent.parent.isTypeOnly; - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause; - case 279 /* NamespaceExport */: + case 280 /* NamespaceExport */: return node.parent.isTypeOnly; } return false; @@ -281876,12 +282756,12 @@ ${lanes.join("\n")} function isTypeOnlyImportOrExportDeclaration(node) { return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node); } - function isAssertionKey(node) { - return isStringLiteral(node) || isIdentifier(node); - } function isStringTextContainingNode(node) { return node.kind === 11 /* StringLiteral */ || isTemplateLiteralKind(node.kind); } + function isImportAttributeName(node) { + return isStringLiteral(node) || isIdentifier(node); + } function isGeneratedIdentifier(node) { var _a; return isIdentifier(node) && ((_a = node.emitNode) == null ? void 0 : _a.autoGenerate) !== void 0; @@ -281890,6 +282770,10 @@ ${lanes.join("\n")} var _a; return isPrivateIdentifier(node) && ((_a = node.emitNode) == null ? void 0 : _a.autoGenerate) !== void 0; } + function isFileLevelReservedGeneratedIdentifier(node) { + const flags = node.emitNode.autoGenerate.flags; + return !!(flags & 32 /* FileLevel */) && !!(flags & 16 /* Optimistic */) && !!(flags & 8 /* ReservedInNestedScopes */); + } function isPrivateIdentifierClassElementDeclaration(node) { return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name); } @@ -281912,31 +282796,31 @@ ${lanes.join("\n")} case 148 /* ReadonlyKeyword */: case 126 /* StaticKeyword */: case 147 /* OutKeyword */: - case 163 /* OverrideKeyword */: + case 164 /* OverrideKeyword */: return true; } return false; } function isParameterPropertyModifier(kind) { - return !!(modifierToFlag(kind) & 16476 /* ParameterPropertyModifier */); + return !!(modifierToFlag(kind) & 31 /* ParameterPropertyModifier */); } function isClassMemberModifier(idToken) { - return isParameterPropertyModifier(idToken) || idToken === 126 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 129 /* AccessorKeyword */; + return isParameterPropertyModifier(idToken) || idToken === 126 /* StaticKeyword */ || idToken === 164 /* OverrideKeyword */ || idToken === 129 /* AccessorKeyword */; } function isModifier(node) { return isModifierKind(node.kind); } function isEntityName(node) { const kind = node.kind; - return kind === 165 /* QualifiedName */ || kind === 80 /* Identifier */; + return kind === 166 /* QualifiedName */ || kind === 80 /* Identifier */; } function isPropertyName(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 81 /* PrivateIdentifier */ || kind === 11 /* StringLiteral */ || kind === 9 /* NumericLiteral */ || kind === 166 /* ComputedPropertyName */; + return kind === 80 /* Identifier */ || kind === 81 /* PrivateIdentifier */ || kind === 11 /* StringLiteral */ || kind === 9 /* NumericLiteral */ || kind === 167 /* ComputedPropertyName */; } function isBindingName(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 205 /* ObjectBindingPattern */ || kind === 206 /* ArrayBindingPattern */; + return kind === 80 /* Identifier */ || kind === 206 /* ObjectBindingPattern */ || kind === 207 /* ArrayBindingPattern */; } function isFunctionLike(node) { return !!node && isFunctionLikeKind(node.kind); @@ -281952,13 +282836,13 @@ ${lanes.join("\n")} } function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 261 /* FunctionDeclaration */: - case 173 /* MethodDeclaration */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return true; default: return false; @@ -281966,14 +282850,14 @@ ${lanes.join("\n")} } function isFunctionLikeKind(kind) { switch (kind) { - case 172 /* MethodSignature */: - case 178 /* CallSignature */: - case 329 /* JSDocSignature */: - case 179 /* ConstructSignature */: - case 180 /* IndexSignature */: - case 183 /* FunctionType */: - case 323 /* JSDocFunctionType */: - case 184 /* ConstructorType */: + case 173 /* MethodSignature */: + case 179 /* CallSignature */: + case 330 /* JSDocSignature */: + case 180 /* ConstructSignature */: + case 181 /* IndexSignature */: + case 184 /* FunctionType */: + case 324 /* JSDocFunctionType */: + case 185 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -281984,22 +282868,32 @@ ${lanes.join("\n")} } function isClassElement(node) { const kind = node.kind; - return kind === 175 /* Constructor */ || kind === 171 /* PropertyDeclaration */ || kind === 173 /* MethodDeclaration */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */ || kind === 180 /* IndexSignature */ || kind === 174 /* ClassStaticBlockDeclaration */ || kind === 239 /* SemicolonClassElement */; + return kind === 176 /* Constructor */ || kind === 172 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 240 /* SemicolonClassElement */; } function isClassLike(node) { - return node && (node.kind === 262 /* ClassDeclaration */ || node.kind === 230 /* ClassExpression */); + return node && (node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */); } function isAccessor(node) { - return node && (node.kind === 176 /* GetAccessor */ || node.kind === 177 /* SetAccessor */); + return node && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */); } function isAutoAccessorPropertyDeclaration(node) { return isPropertyDeclaration(node) && hasAccessorModifier(node); } + function isClassInstanceProperty(node) { + if (isInJSFile(node) && isExpandoPropertyDeclaration(node)) { + return (!isBindableStaticAccessExpression(node) || !isPrototypeAccess(node.expression)) && !isBindableStaticNameExpression( + node, + /*excludeThisKeyword*/ + true + ); + } + return node.parent && isClassLike(node.parent) && isPropertyDeclaration(node) && !hasAccessorModifier(node); + } function isMethodOrAccessor(node) { switch (node.kind) { - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return true; default: return false; @@ -282007,10 +282901,10 @@ ${lanes.join("\n")} } function isNamedClassElement(node) { switch (node.kind) { - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 171 /* PropertyDeclaration */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 172 /* PropertyDeclaration */: return true; default: return false; @@ -282021,22 +282915,22 @@ ${lanes.join("\n")} } function isTypeElement(node) { const kind = node.kind; - return kind === 179 /* ConstructSignature */ || kind === 178 /* CallSignature */ || kind === 170 /* PropertySignature */ || kind === 172 /* MethodSignature */ || kind === 180 /* IndexSignature */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */; + return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; } function isClassOrTypeElement(node) { return isTypeElement(node) || isClassElement(node); } function isObjectLiteralElementLike(node) { const kind = node.kind; - return kind === 302 /* PropertyAssignment */ || kind === 303 /* ShorthandPropertyAssignment */ || kind === 304 /* SpreadAssignment */ || kind === 173 /* MethodDeclaration */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */; + return kind === 303 /* PropertyAssignment */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 305 /* SpreadAssignment */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; } function isTypeNode(node) { return isTypeNodeKind(node.kind); } function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 183 /* FunctionType */: - case 184 /* ConstructorType */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: return true; } return false; @@ -282044,23 +282938,23 @@ ${lanes.join("\n")} function isBindingPattern(node) { if (node) { const kind = node.kind; - return kind === 206 /* ArrayBindingPattern */ || kind === 205 /* ObjectBindingPattern */; + return kind === 207 /* ArrayBindingPattern */ || kind === 206 /* ObjectBindingPattern */; } return false; } function isAssignmentPattern(node) { const kind = node.kind; - return kind === 208 /* ArrayLiteralExpression */ || kind === 209 /* ObjectLiteralExpression */; + return kind === 209 /* ArrayLiteralExpression */ || kind === 210 /* ObjectLiteralExpression */; } function isArrayBindingElement(node) { const kind = node.kind; - return kind === 207 /* BindingElement */ || kind === 231 /* OmittedExpression */; + return kind === 208 /* BindingElement */ || kind === 232 /* OmittedExpression */; } function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: - case 207 /* BindingElement */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: + case 208 /* BindingElement */: return true; } return false; @@ -282073,40 +282967,40 @@ ${lanes.join("\n")} } function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 205 /* ObjectBindingPattern */: - case 209 /* ObjectLiteralExpression */: + case 206 /* ObjectBindingPattern */: + case 210 /* ObjectLiteralExpression */: return true; } return false; } function isObjectBindingOrAssignmentElement(node) { switch (node.kind) { - case 207 /* BindingElement */: - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: - case 304 /* SpreadAssignment */: + case 208 /* BindingElement */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: + case 305 /* SpreadAssignment */: return true; } return false; } function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 206 /* ArrayBindingPattern */: - case 208 /* ArrayLiteralExpression */: + case 207 /* ArrayBindingPattern */: + case 209 /* ArrayLiteralExpression */: return true; } return false; } function isArrayBindingOrAssignmentElement(node) { switch (node.kind) { - case 207 /* BindingElement */: - case 231 /* OmittedExpression */: - case 229 /* SpreadElement */: - case 208 /* ArrayLiteralExpression */: - case 209 /* ObjectLiteralExpression */: + case 208 /* BindingElement */: + case 232 /* OmittedExpression */: + case 230 /* SpreadElement */: + case 209 /* ArrayLiteralExpression */: + case 210 /* ObjectLiteralExpression */: case 80 /* Identifier */: - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: return true; } return isAssignmentExpression( @@ -282117,50 +283011,53 @@ ${lanes.join("\n")} } function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { const kind = node.kind; - return kind === 210 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */ || kind === 204 /* ImportType */; + return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 205 /* ImportType */; } function isPropertyAccessOrQualifiedName(node) { const kind = node.kind; - return kind === 210 /* PropertyAccessExpression */ || kind === 165 /* QualifiedName */; + return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */; + } + function isCallLikeOrFunctionLikeExpression(node) { + return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node); } function isCallLikeExpression(node) { switch (node.kind) { - case 285 /* JsxOpeningElement */: - case 284 /* JsxSelfClosingElement */: - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 214 /* TaggedTemplateExpression */: - case 169 /* Decorator */: + case 286 /* JsxOpeningElement */: + case 285 /* JsxSelfClosingElement */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 215 /* TaggedTemplateExpression */: + case 170 /* Decorator */: return true; default: return false; } } function isCallOrNewExpression(node) { - return node.kind === 212 /* CallExpression */ || node.kind === 213 /* NewExpression */; + return node.kind === 213 /* CallExpression */ || node.kind === 214 /* NewExpression */; } function isTemplateLiteral(node) { const kind = node.kind; - return kind === 227 /* TemplateExpression */ || kind === 15 /* NoSubstitutionTemplateLiteral */; + return kind === 228 /* TemplateExpression */ || kind === 15 /* NoSubstitutionTemplateLiteral */; } function isLeftHandSideExpression(node) { return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind); } function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: - case 213 /* NewExpression */: - case 212 /* CallExpression */: - case 283 /* JsxElement */: - case 284 /* JsxSelfClosingElement */: - case 287 /* JsxFragment */: - case 214 /* TaggedTemplateExpression */: - case 208 /* ArrayLiteralExpression */: - case 216 /* ParenthesizedExpression */: - case 209 /* ObjectLiteralExpression */: - case 230 /* ClassExpression */: - case 217 /* FunctionExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: + case 214 /* NewExpression */: + case 213 /* CallExpression */: + case 284 /* JsxElement */: + case 285 /* JsxSelfClosingElement */: + case 288 /* JsxFragment */: + case 215 /* TaggedTemplateExpression */: + case 209 /* ArrayLiteralExpression */: + case 217 /* ParenthesizedExpression */: + case 210 /* ObjectLiteralExpression */: + case 231 /* ClassExpression */: + case 218 /* FunctionExpression */: case 80 /* Identifier */: case 81 /* PrivateIdentifier */: case 14 /* RegularExpressionLiteral */: @@ -282168,17 +283065,17 @@ ${lanes.join("\n")} case 10 /* BigIntLiteral */: case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 227 /* TemplateExpression */: + case 228 /* TemplateExpression */: case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 110 /* ThisKeyword */: case 112 /* TrueKeyword */: case 108 /* SuperKeyword */: - case 234 /* NonNullExpression */: - case 232 /* ExpressionWithTypeArguments */: - case 235 /* MetaProperty */: + case 235 /* NonNullExpression */: + case 233 /* ExpressionWithTypeArguments */: + case 236 /* MetaProperty */: case 102 /* ImportKeyword */: - case 281 /* MissingDeclaration */: + case 282 /* MissingDeclaration */: return true; default: return false; @@ -282189,13 +283086,13 @@ ${lanes.join("\n")} } function isUnaryExpressionKind(kind) { switch (kind) { - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: - case 219 /* DeleteExpression */: - case 220 /* TypeOfExpression */: - case 221 /* VoidExpression */: - case 222 /* AwaitExpression */: - case 215 /* TypeAssertionExpression */: + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: + case 220 /* DeleteExpression */: + case 221 /* TypeOfExpression */: + case 222 /* VoidExpression */: + case 223 /* AwaitExpression */: + case 216 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -282203,9 +283100,9 @@ ${lanes.join("\n")} } function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 224 /* PostfixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return true; - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: return expr.operator === 46 /* PlusPlusToken */ || expr.operator === 47 /* MinusMinusToken */; default: return false; @@ -282216,7 +283113,7 @@ ${lanes.join("\n")} case 106 /* NullKeyword */: case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: return true; default: return isLiteralExpression(node); @@ -282227,16 +283124,16 @@ ${lanes.join("\n")} } function isExpressionKind(kind) { switch (kind) { - case 226 /* ConditionalExpression */: - case 228 /* YieldExpression */: - case 218 /* ArrowFunction */: - case 225 /* BinaryExpression */: - case 229 /* SpreadElement */: - case 233 /* AsExpression */: - case 231 /* OmittedExpression */: - case 360 /* CommaListExpression */: - case 359 /* PartiallyEmittedExpression */: - case 237 /* SatisfiesExpression */: + case 227 /* ConditionalExpression */: + case 229 /* YieldExpression */: + case 219 /* ArrowFunction */: + case 226 /* BinaryExpression */: + case 230 /* SpreadElement */: + case 234 /* AsExpression */: + case 232 /* OmittedExpression */: + case 361 /* CommaListExpression */: + case 360 /* PartiallyEmittedExpression */: + case 238 /* SatisfiesExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -282244,20 +283141,20 @@ ${lanes.join("\n")} } function isAssertionExpression(node) { const kind = node.kind; - return kind === 215 /* TypeAssertionExpression */ || kind === 233 /* AsExpression */; + return kind === 216 /* TypeAssertionExpression */ || kind === 234 /* AsExpression */; } function isNotEmittedOrPartiallyEmittedNode(node) { return isNotEmittedStatement(node) || isPartiallyEmittedExpression(node); } function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 245 /* DoStatement */: - case 246 /* WhileStatement */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: return true; - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -282269,13 +283166,13 @@ ${lanes.join("\n")} return some(statements, isScopeMarker); } function needsScopeMarker(result) { - return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result, 1 /* Export */) && !isAmbientModule(result); + return !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasSyntacticModifier(result, 32 /* Export */) && !isAmbientModule(result); } function isExternalModuleIndicator(result) { - return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result, 1 /* Export */); + return isAnyImportOrReExport(result) || isExportAssignment(result) || hasSyntacticModifier(result, 32 /* Export */); } function isForInOrOfStatement(node) { - return node.kind === 248 /* ForInStatement */ || node.kind === 249 /* ForOfStatement */; + return node.kind === 249 /* ForInStatement */ || node.kind === 250 /* ForOfStatement */; } function isConciseBody(node) { return isBlock(node) || isExpression(node); @@ -282288,89 +283185,89 @@ ${lanes.join("\n")} } function isModuleBody(node) { const kind = node.kind; - return kind === 267 /* ModuleBlock */ || kind === 266 /* ModuleDeclaration */ || kind === 80 /* Identifier */; + return kind === 268 /* ModuleBlock */ || kind === 267 /* ModuleDeclaration */ || kind === 80 /* Identifier */; } function isNamespaceBody(node) { const kind = node.kind; - return kind === 267 /* ModuleBlock */ || kind === 266 /* ModuleDeclaration */; + return kind === 268 /* ModuleBlock */ || kind === 267 /* ModuleDeclaration */; } function isJSDocNamespaceBody(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 266 /* ModuleDeclaration */; + return kind === 80 /* Identifier */ || kind === 267 /* ModuleDeclaration */; } function isNamedImportBindings(node) { const kind = node.kind; - return kind === 274 /* NamedImports */ || kind === 273 /* NamespaceImport */; + return kind === 275 /* NamedImports */ || kind === 274 /* NamespaceImport */; } function isModuleOrEnumDeclaration(node) { - return node.kind === 266 /* ModuleDeclaration */ || node.kind === 265 /* EnumDeclaration */; + return node.kind === 267 /* ModuleDeclaration */ || node.kind === 266 /* EnumDeclaration */; } function canHaveSymbol(node) { switch (node.kind) { - case 218 /* ArrowFunction */: - case 225 /* BinaryExpression */: - case 207 /* BindingElement */: - case 212 /* CallExpression */: - case 178 /* CallSignature */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 174 /* ClassStaticBlockDeclaration */: - case 175 /* Constructor */: - case 184 /* ConstructorType */: - case 179 /* ConstructSignature */: - case 211 /* ElementAccessExpression */: - case 265 /* EnumDeclaration */: - case 305 /* EnumMember */: - case 276 /* ExportAssignment */: - case 277 /* ExportDeclaration */: - case 280 /* ExportSpecifier */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 183 /* FunctionType */: - case 176 /* GetAccessor */: + case 219 /* ArrowFunction */: + case 226 /* BinaryExpression */: + case 208 /* BindingElement */: + case 213 /* CallExpression */: + case 179 /* CallSignature */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 175 /* ClassStaticBlockDeclaration */: + case 176 /* Constructor */: + case 185 /* ConstructorType */: + case 180 /* ConstructSignature */: + case 212 /* ElementAccessExpression */: + case 266 /* EnumDeclaration */: + case 306 /* EnumMember */: + case 277 /* ExportAssignment */: + case 278 /* ExportDeclaration */: + case 281 /* ExportSpecifier */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 184 /* FunctionType */: + case 177 /* GetAccessor */: case 80 /* Identifier */: - case 272 /* ImportClause */: - case 270 /* ImportEqualsDeclaration */: - case 275 /* ImportSpecifier */: - case 180 /* IndexSignature */: - case 263 /* InterfaceDeclaration */: - case 344 /* JSDocCallbackTag */: - case 346 /* JSDocEnumTag */: - case 323 /* JSDocFunctionType */: - case 347 /* JSDocParameterTag */: - case 354 /* JSDocPropertyTag */: - case 329 /* JSDocSignature */: - case 352 /* JSDocTypedefTag */: - case 328 /* JSDocTypeLiteral */: - case 290 /* JsxAttribute */: - case 291 /* JsxAttributes */: - case 292 /* JsxSpreadAttribute */: - case 199 /* MappedType */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 266 /* ModuleDeclaration */: - case 201 /* NamedTupleMember */: - case 279 /* NamespaceExport */: - case 269 /* NamespaceExportDeclaration */: - case 273 /* NamespaceImport */: - case 213 /* NewExpression */: + case 273 /* ImportClause */: + case 271 /* ImportEqualsDeclaration */: + case 276 /* ImportSpecifier */: + case 181 /* IndexSignature */: + case 264 /* InterfaceDeclaration */: + case 345 /* JSDocCallbackTag */: + case 347 /* JSDocEnumTag */: + case 324 /* JSDocFunctionType */: + case 348 /* JSDocParameterTag */: + case 355 /* JSDocPropertyTag */: + case 330 /* JSDocSignature */: + case 353 /* JSDocTypedefTag */: + case 329 /* JSDocTypeLiteral */: + case 291 /* JsxAttribute */: + case 292 /* JsxAttributes */: + case 293 /* JsxSpreadAttribute */: + case 200 /* MappedType */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 267 /* ModuleDeclaration */: + case 202 /* NamedTupleMember */: + case 280 /* NamespaceExport */: + case 270 /* NamespaceExportDeclaration */: + case 274 /* NamespaceImport */: + case 214 /* NewExpression */: case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: - case 209 /* ObjectLiteralExpression */: - case 168 /* Parameter */: - case 210 /* PropertyAccessExpression */: - case 302 /* PropertyAssignment */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 177 /* SetAccessor */: - case 303 /* ShorthandPropertyAssignment */: - case 311 /* SourceFile */: - case 304 /* SpreadAssignment */: + case 210 /* ObjectLiteralExpression */: + case 169 /* Parameter */: + case 211 /* PropertyAccessExpression */: + case 303 /* PropertyAssignment */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 178 /* SetAccessor */: + case 304 /* ShorthandPropertyAssignment */: + case 312 /* SourceFile */: + case 305 /* SpreadAssignment */: case 11 /* StringLiteral */: - case 264 /* TypeAliasDeclaration */: - case 186 /* TypeLiteral */: - case 167 /* TypeParameter */: - case 259 /* VariableDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 187 /* TypeLiteral */: + case 168 /* TypeParameter */: + case 260 /* VariableDeclaration */: return true; default: return false; @@ -282378,53 +283275,53 @@ ${lanes.join("\n")} } function canHaveLocals(node) { switch (node.kind) { - case 218 /* ArrowFunction */: - case 240 /* Block */: - case 178 /* CallSignature */: - case 268 /* CaseBlock */: - case 298 /* CatchClause */: - case 174 /* ClassStaticBlockDeclaration */: - case 193 /* ConditionalType */: - case 175 /* Constructor */: - case 184 /* ConstructorType */: - case 179 /* ConstructSignature */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 183 /* FunctionType */: - case 176 /* GetAccessor */: - case 180 /* IndexSignature */: - case 344 /* JSDocCallbackTag */: - case 346 /* JSDocEnumTag */: - case 323 /* JSDocFunctionType */: - case 329 /* JSDocSignature */: - case 352 /* JSDocTypedefTag */: - case 199 /* MappedType */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 266 /* ModuleDeclaration */: - case 177 /* SetAccessor */: - case 311 /* SourceFile */: - case 264 /* TypeAliasDeclaration */: + case 219 /* ArrowFunction */: + case 241 /* Block */: + case 179 /* CallSignature */: + case 269 /* CaseBlock */: + case 299 /* CatchClause */: + case 175 /* ClassStaticBlockDeclaration */: + case 194 /* ConditionalType */: + case 176 /* Constructor */: + case 185 /* ConstructorType */: + case 180 /* ConstructSignature */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 184 /* FunctionType */: + case 177 /* GetAccessor */: + case 181 /* IndexSignature */: + case 345 /* JSDocCallbackTag */: + case 347 /* JSDocEnumTag */: + case 324 /* JSDocFunctionType */: + case 330 /* JSDocSignature */: + case 353 /* JSDocTypedefTag */: + case 200 /* MappedType */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 267 /* ModuleDeclaration */: + case 178 /* SetAccessor */: + case 312 /* SourceFile */: + case 265 /* TypeAliasDeclaration */: return true; default: return false; } } function isDeclarationKind(kind) { - return kind === 218 /* ArrowFunction */ || kind === 207 /* BindingElement */ || kind === 262 /* ClassDeclaration */ || kind === 230 /* ClassExpression */ || kind === 174 /* ClassStaticBlockDeclaration */ || kind === 175 /* Constructor */ || kind === 265 /* EnumDeclaration */ || kind === 305 /* EnumMember */ || kind === 280 /* ExportSpecifier */ || kind === 261 /* FunctionDeclaration */ || kind === 217 /* FunctionExpression */ || kind === 176 /* GetAccessor */ || kind === 272 /* ImportClause */ || kind === 270 /* ImportEqualsDeclaration */ || kind === 275 /* ImportSpecifier */ || kind === 263 /* InterfaceDeclaration */ || kind === 290 /* JsxAttribute */ || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 266 /* ModuleDeclaration */ || kind === 269 /* NamespaceExportDeclaration */ || kind === 273 /* NamespaceImport */ || kind === 279 /* NamespaceExport */ || kind === 168 /* Parameter */ || kind === 302 /* PropertyAssignment */ || kind === 171 /* PropertyDeclaration */ || kind === 170 /* PropertySignature */ || kind === 177 /* SetAccessor */ || kind === 303 /* ShorthandPropertyAssignment */ || kind === 264 /* TypeAliasDeclaration */ || kind === 167 /* TypeParameter */ || kind === 259 /* VariableDeclaration */ || kind === 352 /* JSDocTypedefTag */ || kind === 344 /* JSDocCallbackTag */ || kind === 354 /* JSDocPropertyTag */; + return kind === 219 /* ArrowFunction */ || kind === 208 /* BindingElement */ || kind === 263 /* ClassDeclaration */ || kind === 231 /* ClassExpression */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 176 /* Constructor */ || kind === 266 /* EnumDeclaration */ || kind === 306 /* EnumMember */ || kind === 281 /* ExportSpecifier */ || kind === 262 /* FunctionDeclaration */ || kind === 218 /* FunctionExpression */ || kind === 177 /* GetAccessor */ || kind === 273 /* ImportClause */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 276 /* ImportSpecifier */ || kind === 264 /* InterfaceDeclaration */ || kind === 291 /* JsxAttribute */ || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 267 /* ModuleDeclaration */ || kind === 270 /* NamespaceExportDeclaration */ || kind === 274 /* NamespaceImport */ || kind === 280 /* NamespaceExport */ || kind === 169 /* Parameter */ || kind === 303 /* PropertyAssignment */ || kind === 172 /* PropertyDeclaration */ || kind === 171 /* PropertySignature */ || kind === 178 /* SetAccessor */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 265 /* TypeAliasDeclaration */ || kind === 168 /* TypeParameter */ || kind === 260 /* VariableDeclaration */ || kind === 353 /* JSDocTypedefTag */ || kind === 345 /* JSDocCallbackTag */ || kind === 355 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 261 /* FunctionDeclaration */ || kind === 281 /* MissingDeclaration */ || kind === 262 /* ClassDeclaration */ || kind === 263 /* InterfaceDeclaration */ || kind === 264 /* TypeAliasDeclaration */ || kind === 265 /* EnumDeclaration */ || kind === 266 /* ModuleDeclaration */ || kind === 271 /* ImportDeclaration */ || kind === 270 /* ImportEqualsDeclaration */ || kind === 277 /* ExportDeclaration */ || kind === 276 /* ExportAssignment */ || kind === 269 /* NamespaceExportDeclaration */; + return kind === 262 /* FunctionDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 270 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 251 /* BreakStatement */ || kind === 250 /* ContinueStatement */ || kind === 258 /* DebuggerStatement */ || kind === 245 /* DoStatement */ || kind === 243 /* ExpressionStatement */ || kind === 241 /* EmptyStatement */ || kind === 248 /* ForInStatement */ || kind === 249 /* ForOfStatement */ || kind === 247 /* ForStatement */ || kind === 244 /* IfStatement */ || kind === 255 /* LabeledStatement */ || kind === 252 /* ReturnStatement */ || kind === 254 /* SwitchStatement */ || kind === 256 /* ThrowStatement */ || kind === 257 /* TryStatement */ || kind === 242 /* VariableStatement */ || kind === 246 /* WhileStatement */ || kind === 253 /* WithStatement */ || kind === 358 /* NotEmittedStatement */; + return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind === 359 /* NotEmittedStatement */; } function isDeclaration(node) { - if (node.kind === 167 /* TypeParameter */) { - return node.parent && node.parent.kind !== 351 /* JSDocTemplateTag */ || isInJSFile(node); + if (node.kind === 168 /* TypeParameter */) { + return node.parent && node.parent.kind !== 352 /* JSDocTemplateTag */ || isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -282439,10 +283336,10 @@ ${lanes.join("\n")} return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node); } function isBlockStatement(node) { - if (node.kind !== 240 /* Block */) + if (node.kind !== 241 /* Block */) return false; if (node.parent !== void 0) { - if (node.parent.kind === 257 /* TryStatement */ || node.parent.kind === 298 /* CatchClause */) { + if (node.parent.kind === 258 /* TryStatement */ || node.parent.kind === 299 /* CatchClause */) { return false; } } @@ -282450,50 +283347,50 @@ ${lanes.join("\n")} } function isStatementOrBlock(node) { const kind = node.kind; - return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 240 /* Block */; + return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 241 /* Block */; } function isModuleReference(node) { const kind = node.kind; - return kind === 282 /* ExternalModuleReference */ || kind === 165 /* QualifiedName */ || kind === 80 /* Identifier */; + return kind === 283 /* ExternalModuleReference */ || kind === 166 /* QualifiedName */ || kind === 80 /* Identifier */; } function isJsxTagNameExpression(node) { const kind = node.kind; - return kind === 110 /* ThisKeyword */ || kind === 80 /* Identifier */ || kind === 210 /* PropertyAccessExpression */ || kind === 294 /* JsxNamespacedName */; + return kind === 110 /* ThisKeyword */ || kind === 80 /* Identifier */ || kind === 211 /* PropertyAccessExpression */ || kind === 295 /* JsxNamespacedName */; } function isJsxChild(node) { const kind = node.kind; - return kind === 283 /* JsxElement */ || kind === 293 /* JsxExpression */ || kind === 284 /* JsxSelfClosingElement */ || kind === 12 /* JsxText */ || kind === 287 /* JsxFragment */; + return kind === 284 /* JsxElement */ || kind === 294 /* JsxExpression */ || kind === 285 /* JsxSelfClosingElement */ || kind === 12 /* JsxText */ || kind === 288 /* JsxFragment */; } function isJsxAttributeLike(node) { const kind = node.kind; - return kind === 290 /* JsxAttribute */ || kind === 292 /* JsxSpreadAttribute */; + return kind === 291 /* JsxAttribute */ || kind === 293 /* JsxSpreadAttribute */; } function isStringLiteralOrJsxExpression(node) { const kind = node.kind; - return kind === 11 /* StringLiteral */ || kind === 293 /* JsxExpression */; + return kind === 11 /* StringLiteral */ || kind === 294 /* JsxExpression */; } function isJsxOpeningLikeElement(node) { const kind = node.kind; - return kind === 285 /* JsxOpeningElement */ || kind === 284 /* JsxSelfClosingElement */; + return kind === 286 /* JsxOpeningElement */ || kind === 285 /* JsxSelfClosingElement */; } function isCaseOrDefaultClause(node) { const kind = node.kind; - return kind === 295 /* CaseClause */ || kind === 296 /* DefaultClause */; + return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */; } function isJSDocNode(node) { - return node.kind >= 315 /* FirstJSDocNode */ && node.kind <= 356 /* LastJSDocNode */; + return node.kind >= 316 /* FirstJSDocNode */ && node.kind <= 357 /* LastJSDocNode */; } function isJSDocCommentContainingNode(node) { - return node.kind === 326 /* JSDoc */ || node.kind === 325 /* JSDocNamepathType */ || node.kind === 327 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + return node.kind === 327 /* JSDoc */ || node.kind === 326 /* JSDocNamepathType */ || node.kind === 328 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); } function isJSDocTag(node) { - return node.kind >= 333 /* FirstJSDocTagNode */ && node.kind <= 356 /* LastJSDocTagNode */; + return node.kind >= 334 /* FirstJSDocTagNode */ && node.kind <= 357 /* LastJSDocTagNode */; } function isSetAccessor(node) { - return node.kind === 177 /* SetAccessor */; + return node.kind === 178 /* SetAccessor */; } function isGetAccessor(node) { - return node.kind === 176 /* GetAccessor */; + return node.kind === 177 /* GetAccessor */; } function hasJSDocNodes(node) { if (!canHaveJSDoc(node)) @@ -282509,22 +283406,22 @@ ${lanes.join("\n")} } function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: - case 207 /* BindingElement */: - case 171 /* PropertyDeclaration */: - case 302 /* PropertyAssignment */: - case 305 /* EnumMember */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: + case 208 /* BindingElement */: + case 172 /* PropertyDeclaration */: + case 303 /* PropertyAssignment */: + case 306 /* EnumMember */: return true; default: return false; } } function isObjectLiteralElement(node) { - return node.kind === 290 /* JsxAttribute */ || node.kind === 292 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 291 /* JsxAttribute */ || node.kind === 293 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } function isTypeReferenceType(node) { - return node.kind === 182 /* TypeReference */ || node.kind === 232 /* ExpressionWithTypeArguments */; + return node.kind === 183 /* TypeReference */ || node.kind === 233 /* ExpressionWithTypeArguments */; } function guessIndentation(lines) { let indentation = MAX_SMI_X86; @@ -282551,7 +283448,7 @@ ${lanes.join("\n")} return node.kind === 11 /* StringLiteral */ || node.kind === 15 /* NoSubstitutionTemplateLiteral */; } function isJSDocLinkLike(node) { - return node.kind === 330 /* JSDocLink */ || node.kind === 331 /* JSDocLinkCode */ || node.kind === 332 /* JSDocLinkPlain */; + return node.kind === 331 /* JSDocLink */ || node.kind === 332 /* JSDocLinkCode */ || node.kind === 333 /* JSDocLinkPlain */; } function hasRestParameter(s) { const last2 = lastOrUndefined(s.parameters); @@ -282559,7 +283456,46 @@ ${lanes.join("\n")} } function isRestParameter(node) { const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type; - return node.dotDotDotToken !== void 0 || !!type && type.kind === 324 /* JSDocVariadicType */; + 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({ @@ -282694,41 +283630,24 @@ ${lanes.join("\n")} function getFullWidth(node) { return node.end - node.pos; } - function getResolvedModule(sourceFile, moduleNameText, mode) { - var _a, _b; - return (_b = (_a = sourceFile == null ? void 0 : sourceFile.resolvedModules) == null ? void 0 : _a.get(moduleNameText, mode)) == null ? void 0 : _b.resolvedModule; - } - function setResolvedModule(sourceFile, moduleNameText, resolvedModule, mode) { - if (!sourceFile.resolvedModules) { - sourceFile.resolvedModules = createModeAwareCache(); - } - sourceFile.resolvedModules.set(moduleNameText, mode, resolvedModule); - } - function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective, mode) { - if (!sourceFile.resolvedTypeReferenceDirectiveNames) { - sourceFile.resolvedTypeReferenceDirectiveNames = createModeAwareCache(); - } - sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, mode, resolvedTypeReferenceDirective); - } - function getResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, mode) { - var _a, _b; - return (_b = (_a = sourceFile == null ? void 0 : sourceFile.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a.get(typeReferenceDirectiveName, mode)) == null ? void 0 : _b.resolvedTypeReferenceDirective; - } function projectReferenceIsEqualTo(oldRef, newRef) { 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, _b; - const node10Result = (_b = (_a = sourceFile.resolvedModules) == null ? void 0 : _a.get(moduleReference, mode)) == null ? void 0 : _b.node10Result; - const result = node10Result ? chainDiagnosticMessages( + var _a; + 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.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageName)}` : packageName + alternateResultMessage[0], + ...alternateResultMessage[1] ) : host.typesPackageExists(packageName) ? chainDiagnosticMessages( /*details*/ void 0, @@ -282764,14 +283683,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, oldResolutions, 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 = oldResolutions && oldResolutions.get(name, mode); + const oldResolution = getOldResolution(entry); const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution; if (changed) { return true; @@ -282781,19 +283698,19 @@ ${lanes.join("\n")} } function containsParseError(node) { aggregateChildData(node); - return (node.flags & 524288 /* ThisNodeOrAnySubNodesHasError */) !== 0; + return (node.flags & 1048576 /* ThisNodeOrAnySubNodesHasError */) !== 0; } function aggregateChildData(node) { - if (!(node.flags & 1048576 /* HasAggregatedChildData */)) { - const thisNodeOrAnySubNodesHasError = (node.flags & 131072 /* ThisNodeHasError */) !== 0 || forEachChild(node, containsParseError); + if (!(node.flags & 2097152 /* HasAggregatedChildData */)) { + const thisNodeOrAnySubNodesHasError = (node.flags & 262144 /* ThisNodeHasError */) !== 0 || forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { - node.flags |= 524288 /* ThisNodeOrAnySubNodesHasError */; + node.flags |= 1048576 /* ThisNodeOrAnySubNodesHasError */; } - node.flags |= 1048576 /* HasAggregatedChildData */; + node.flags |= 2097152 /* HasAggregatedChildData */; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 311 /* SourceFile */) { + while (node && node.kind !== 312 /* SourceFile */) { node = node.parent; } return node; @@ -282806,11 +283723,11 @@ ${lanes.join("\n")} } function isStatementWithLocals(node) { switch (node.kind) { - case 240 /* Block */: - case 268 /* CaseBlock */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: + case 241 /* Block */: + case 269 /* CaseBlock */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: return true; } return false; @@ -282969,7 +283886,7 @@ ${lanes.join("\n")} if (includeJsDoc && hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 357 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 358 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return skipTrivia( @@ -283004,7 +283921,7 @@ ${lanes.join("\n")} } let text = sourceText.substring(includeTrivia ? node.pos : skipTrivia(sourceText, node.pos), node.end); if (isJSDocTypeExpressionOrChild(node)) { - text = text.split(/\r\n|\n|\r/).map((line) => trimStringStart(line.replace(/^\s*\*/, ""))).join("\n"); + text = text.split(/\r\n|\n|\r/).map((line) => line.replace(/^\s*\*/, "").trimStart()).join("\n"); } return text; } @@ -283025,402 +283942,6 @@ ${lanes.join("\n")} const emitNode = node.emitNode; return emitNode && emitNode.internalFlags || 0; } - function getScriptTargetFeatures() { - return new Map(Object.entries({ - Array: new Map(Object.entries({ - es2015: [ - "find", - "findIndex", - "fill", - "copyWithin", - "entries", - "keys", - "values" - ], - es2016: [ - "includes" - ], - es2019: [ - "flat", - "flatMap" - ], - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Iterator: new Map(Object.entries({ - es2015: emptyArray - })), - AsyncIterator: new Map(Object.entries({ - es2015: emptyArray - })), - Atomics: new Map(Object.entries({ - es2017: emptyArray - })), - SharedArrayBuffer: new Map(Object.entries({ - es2017: emptyArray - })), - AsyncIterable: new Map(Object.entries({ - es2018: emptyArray - })), - AsyncIterableIterator: new Map(Object.entries({ - es2018: emptyArray - })), - AsyncGenerator: new Map(Object.entries({ - es2018: emptyArray - })), - AsyncGeneratorFunction: new Map(Object.entries({ - es2018: emptyArray - })), - RegExp: new Map(Object.entries({ - es2015: [ - "flags", - "sticky", - "unicode" - ], - es2018: [ - "dotAll" - ] - })), - Reflect: new Map(Object.entries({ - es2015: [ - "apply", - "construct", - "defineProperty", - "deleteProperty", - "get", - " getOwnPropertyDescriptor", - "getPrototypeOf", - "has", - "isExtensible", - "ownKeys", - "preventExtensions", - "set", - "setPrototypeOf" - ] - })), - ArrayConstructor: new Map(Object.entries({ - es2015: [ - "from", - "of" - ] - })), - ObjectConstructor: new Map(Object.entries({ - es2015: [ - "assign", - "getOwnPropertySymbols", - "keys", - "is", - "setPrototypeOf" - ], - es2017: [ - "values", - "entries", - "getOwnPropertyDescriptors" - ], - es2019: [ - "fromEntries" - ], - es2022: [ - "hasOwn" - ] - })), - NumberConstructor: new Map(Object.entries({ - es2015: [ - "isFinite", - "isInteger", - "isNaN", - "isSafeInteger", - "parseFloat", - "parseInt" - ] - })), - Math: new Map(Object.entries({ - es2015: [ - "clz32", - "imul", - "sign", - "log10", - "log2", - "log1p", - "expm1", - "cosh", - "sinh", - "tanh", - "acosh", - "asinh", - "atanh", - "hypot", - "trunc", - "fround", - "cbrt" - ] - })), - Map: new Map(Object.entries({ - es2015: [ - "entries", - "keys", - "values" - ] - })), - Set: new Map(Object.entries({ - es2015: [ - "entries", - "keys", - "values" - ] - })), - PromiseConstructor: new Map(Object.entries({ - es2015: [ - "all", - "race", - "reject", - "resolve" - ], - es2020: [ - "allSettled" - ], - es2021: [ - "any" - ] - })), - Symbol: new Map(Object.entries({ - es2015: [ - "for", - "keyFor" - ], - es2019: [ - "description" - ] - })), - WeakMap: new Map(Object.entries({ - es2015: [ - "entries", - "keys", - "values" - ] - })), - WeakSet: new Map(Object.entries({ - es2015: [ - "entries", - "keys", - "values" - ] - })), - String: new Map(Object.entries({ - es2015: [ - "codePointAt", - "includes", - "endsWith", - "normalize", - "repeat", - "startsWith", - "anchor", - "big", - "blink", - "bold", - "fixed", - "fontcolor", - "fontsize", - "italics", - "link", - "small", - "strike", - "sub", - "sup" - ], - es2017: [ - "padStart", - "padEnd" - ], - es2019: [ - "trimStart", - "trimEnd", - "trimLeft", - "trimRight" - ], - es2020: [ - "matchAll" - ], - es2021: [ - "replaceAll" - ], - es2022: [ - "at" - ] - })), - StringConstructor: new Map(Object.entries({ - es2015: [ - "fromCodePoint", - "raw" - ] - })), - DateTimeFormat: new Map(Object.entries({ - es2017: [ - "formatToParts" - ] - })), - Promise: new Map(Object.entries({ - es2015: emptyArray, - es2018: [ - "finally" - ] - })), - RegExpMatchArray: new Map(Object.entries({ - es2018: [ - "groups" - ] - })), - RegExpExecArray: new Map(Object.entries({ - es2018: [ - "groups" - ] - })), - Intl: new Map(Object.entries({ - es2018: [ - "PluralRules" - ] - })), - NumberFormat: new Map(Object.entries({ - es2018: [ - "formatToParts" - ] - })), - SymbolConstructor: new Map(Object.entries({ - es2020: [ - "matchAll" - ] - })), - DataView: new Map(Object.entries({ - es2020: [ - "setBigInt64", - "setBigUint64", - "getBigInt64", - "getBigUint64" - ] - })), - BigInt: new Map(Object.entries({ - es2020: emptyArray - })), - RelativeTimeFormat: new Map(Object.entries({ - es2020: [ - "format", - "formatToParts", - "resolvedOptions" - ] - })), - Int8Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Uint8Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Uint8ClampedArray: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Int16Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Uint16Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Int32Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Uint32Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Float32Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Float64Array: new Map(Object.entries({ - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - BigInt64Array: new Map(Object.entries({ - es2020: emptyArray, - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - BigUint64Array: new Map(Object.entries({ - es2020: emptyArray, - es2022: [ - "at" - ], - es2023: [ - "findLastIndex", - "findLast" - ] - })), - Error: new Map(Object.entries({ - es2022: [ - "cause" - ] - })) - })); - } function getLiteralText(node, sourceFile, flags) { if (sourceFile && canUseOriginalText(node, flags)) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); @@ -283484,11 +284005,11 @@ ${lanes.join("\n")} return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); } function isBlockOrCatchScoped(declaration) { - return (getCombinedNodeFlags(declaration) & 3 /* BlockScoped */) !== 0 || isCatchClauseVariableDeclarationOrBindingElement(declaration); + return (getCombinedNodeFlags(declaration) & 7 /* BlockScoped */) !== 0 || isCatchClauseVariableDeclarationOrBindingElement(declaration); } function isCatchClauseVariableDeclarationOrBindingElement(declaration) { const node = getRootDeclaration(declaration); - return node.kind === 259 /* VariableDeclaration */ && node.parent.kind === 298 /* CatchClause */; + return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */; } function isAmbientModule(node) { return isModuleDeclaration(node) && (node.name.kind === 11 /* StringLiteral */ || isGlobalScopeAugmentation(node)); @@ -283506,22 +284027,22 @@ ${lanes.join("\n")} return isShorthandAmbientModule(moduleSymbol.valueDeclaration); } function isShorthandAmbientModule(node) { - return !!node && node.kind === 266 /* ModuleDeclaration */ && !node.body; + return !!node && node.kind === 267 /* ModuleDeclaration */ && !node.body; } function isBlockScopedContainerTopLevel(node) { - return node.kind === 311 /* SourceFile */ || node.kind === 266 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node); + return node.kind === 312 /* SourceFile */ || node.kind === 267 /* ModuleDeclaration */ || isFunctionLikeOrClassStaticBlockDeclaration(node); } function isGlobalScopeAugmentation(module2) { - return !!(module2.flags & 1024 /* GlobalAugmentation */); + return !!(module2.flags & 2048 /* GlobalAugmentation */); } function isExternalModuleAugmentation(node) { return isAmbientModule(node) && isModuleAugmentationExternal(node); } function isModuleAugmentationExternal(node) { switch (node.parent.kind) { - case 311 /* SourceFile */: + case 312 /* SourceFile */: return isExternalModule(node.parent); - case 267 /* ModuleBlock */: + case 268 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent); } return false; @@ -283564,28 +284085,28 @@ ${lanes.join("\n")} return false; } function isAmbientPropertyDeclaration(node) { - return !!(node.flags & 16777216 /* Ambient */) || hasSyntacticModifier(node, 2 /* Ambient */); + return !!(node.flags & 33554432 /* Ambient */) || hasSyntacticModifier(node, 128 /* Ambient */); } function isBlockScope(node, parentNode) { switch (node.kind) { - case 311 /* SourceFile */: - case 268 /* CaseBlock */: - case 298 /* CatchClause */: - case 266 /* ModuleDeclaration */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 175 /* Constructor */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 171 /* PropertyDeclaration */: - case 174 /* ClassStaticBlockDeclaration */: + case 312 /* SourceFile */: + case 269 /* CaseBlock */: + case 299 /* CatchClause */: + case 267 /* ModuleDeclaration */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 176 /* Constructor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 172 /* PropertyDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: return true; - case 240 /* Block */: + case 241 /* Block */: return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode); } return false; @@ -283593,9 +284114,9 @@ ${lanes.join("\n")} function isDeclarationWithTypeParameters(node) { Debug.type(node); switch (node.kind) { - case 344 /* JSDocCallbackTag */: - case 352 /* JSDocTypedefTag */: - case 329 /* JSDocSignature */: + case 345 /* JSDocCallbackTag */: + case 353 /* JSDocTypedefTag */: + case 330 /* JSDocSignature */: return true; default: assertType(node); @@ -283605,25 +284126,25 @@ ${lanes.join("\n")} function isDeclarationWithTypeParameterChildren(node) { Debug.type(node); switch (node.kind) { - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 172 /* MethodSignature */: - case 180 /* IndexSignature */: - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 323 /* JSDocFunctionType */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 351 /* JSDocTemplateTag */: - case 261 /* FunctionDeclaration */: - case 173 /* MethodDeclaration */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 173 /* MethodSignature */: + case 181 /* IndexSignature */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 324 /* JSDocFunctionType */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 352 /* JSDocTemplateTag */: + case 262 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return true; default: assertType(node); @@ -283632,8 +284153,8 @@ ${lanes.join("\n")} } function isAnyImportSyntax(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: - case 270 /* ImportEqualsDeclaration */: + case 272 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: return true; default: return false; @@ -283644,15 +284165,15 @@ ${lanes.join("\n")} } function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: - case 270 /* ImportEqualsDeclaration */: - case 242 /* VariableStatement */: - case 262 /* ClassDeclaration */: - case 261 /* FunctionDeclaration */: - case 266 /* ModuleDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: + case 272 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 243 /* VariableStatement */: + case 263 /* ClassDeclaration */: + case 262 /* FunctionDeclaration */: + case 267 /* ModuleDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: return true; default: return false; @@ -283664,6 +284185,9 @@ ${lanes.join("\n")} function isAnyImportOrReExport(node) { return isAnyImportSyntax(node) || isExportDeclaration(node); } + function getEnclosingContainer(node) { + return findAncestor(node.parent, (n) => !!(getContainerFlags(n) & 1 /* IsContainer */)); + } function getEnclosingBlockScopeContainer(node) { return findAncestor(node.parent, (current) => isBlockScope(current, current.parent)); } @@ -283681,7 +284205,7 @@ ${lanes.join("\n")} return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : void 0; } function isComputedNonLiteralName(name) { - return name.kind === 166 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); + return name.kind === 167 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } function tryGetTextOfPropertyName(name) { var _a; @@ -283693,11 +284217,11 @@ ${lanes.join("\n")} case 9 /* NumericLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: return escapeLeadingUnderscores(name.text); - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return escapeLeadingUnderscores(name.expression.text); return void 0; - case 294 /* JsxNamespacedName */: + case 295 /* JsxNamespacedName */: return getEscapedTextOfJsxNamespacedName(name); default: return Debug.assertNever(name); @@ -283713,17 +284237,17 @@ ${lanes.join("\n")} case 81 /* PrivateIdentifier */: case 80 /* Identifier */: return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name); - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } else { return Debug.assertNever(name.name); } - case 317 /* JSDocMemberName */: + case 318 /* JSDocMemberName */: return entityNameToString(name.left) + entityNameToString(name.right); - case 294 /* JsxNamespacedName */: + case 295 /* JsxNamespacedName */: return entityNameToString(name.namespace) + ":" + entityNameToString(name.name); default: return Debug.assertNever(name); @@ -283749,16 +284273,14 @@ ${lanes.join("\n")} const start = skipTrivia(sourceFile.text, nodes.pos); return createFileDiagnosticFromMessageChain(sourceFile, start, nodes.end - start, messageChain, relatedInformation); } - function assertDiagnosticLocation(file, start, length2) { + function assertDiagnosticLocation(sourceText, start, length2) { Debug.assertGreaterThanOrEqual(start, 0); Debug.assertGreaterThanOrEqual(length2, 0); - if (file) { - Debug.assertLessThanOrEqual(start, file.text.length); - Debug.assertLessThanOrEqual(start + length2, file.text.length); - } + Debug.assertLessThanOrEqual(start, sourceText.length); + Debug.assertLessThanOrEqual(start + length2, sourceText.length); } function createFileDiagnosticFromMessageChain(file, start, length2, messageChain, relatedInformation) { - assertDiagnosticLocation(file, start, length2); + assertDiagnosticLocation(file.text, start, length2); return { file, start, @@ -283829,7 +284351,7 @@ ${lanes.join("\n")} } function getErrorSpanForArrowFunction(sourceFile, node) { const pos = skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 240 /* Block */) { + if (node.body && node.body.kind === 241 /* Block */) { const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos); const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end); if (startLine < endLine) { @@ -283841,7 +284363,7 @@ ${lanes.join("\n")} function getErrorSpanForNode(sourceFile, node) { let errorNode = node; switch (node.kind) { - case 311 /* SourceFile */: { + case 312 /* SourceFile */: { const pos2 = skipTrivia( sourceFile.text, 0, @@ -283853,43 +284375,43 @@ ${lanes.join("\n")} } return getSpanOfTokenAtPosition(sourceFile, pos2); } - case 259 /* VariableDeclaration */: - case 207 /* BindingElement */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 266 /* ModuleDeclaration */: - case 265 /* EnumDeclaration */: - case 305 /* EnumMember */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 264 /* TypeAliasDeclaration */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 273 /* NamespaceImport */: + case 260 /* VariableDeclaration */: + case 208 /* BindingElement */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 267 /* ModuleDeclaration */: + case 266 /* EnumDeclaration */: + case 306 /* EnumMember */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 265 /* TypeAliasDeclaration */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 274 /* NamespaceImport */: errorNode = node.name; break; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 295 /* CaseClause */: - case 296 /* DefaultClause */: { + case 296 /* CaseClause */: + case 297 /* DefaultClause */: { const start = skipTrivia(sourceFile.text, node.pos); const end = node.statements.length > 0 ? node.statements[0].pos : node.end; return createTextSpanFromBounds(start, end); } - case 252 /* ReturnStatement */: - case 228 /* YieldExpression */: { + case 253 /* ReturnStatement */: + case 229 /* YieldExpression */: { const pos2 = skipTrivia(sourceFile.text, node.pos); return getSpanOfTokenAtPosition(sourceFile, pos2); } - case 237 /* SatisfiesExpression */: { + case 238 /* SatisfiesExpression */: { const pos2 = skipTrivia(sourceFile.text, node.expression.end); return getSpanOfTokenAtPosition(sourceFile, pos2); } - case 356 /* JSDocSatisfiesTag */: { + case 357 /* JSDocSatisfiesTag */: { const pos2 = skipTrivia(sourceFile.text, node.tagName.pos); return getSpanOfTokenAtPosition(sourceFile, pos2); } @@ -283916,22 +284438,28 @@ ${lanes.join("\n")} return file.scriptKind === 6 /* JSON */; } function isEnumConst(node) { - return !!(getCombinedModifierFlags(node) & 2048 /* Const */); + return !!(getCombinedModifierFlags(node) & 4096 /* Const */); } function isDeclarationReadonly(declaration) { - return !!(getCombinedModifierFlags(declaration) & 64 /* Readonly */ && !isParameterPropertyDeclaration(declaration, declaration.parent)); + return !!(getCombinedModifierFlags(declaration) & 8 /* Readonly */ && !isParameterPropertyDeclaration(declaration, declaration.parent)); + } + function isVarAwaitUsing(node) { + return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 6 /* AwaitUsing */; + } + function isVarUsing(node) { + return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 4 /* Using */; } function isVarConst(node) { - return !!(getCombinedNodeFlags(node) & 2 /* Const */); + return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 2 /* Const */; } function isLet(node) { - return !!(getCombinedNodeFlags(node) & 1 /* Let */); + return (getCombinedNodeFlags(node) & 7 /* BlockScoped */) === 1 /* Let */; } function isSuperCall(n) { - return n.kind === 212 /* CallExpression */ && n.expression.kind === 108 /* SuperKeyword */; + return n.kind === 213 /* CallExpression */ && n.expression.kind === 108 /* SuperKeyword */; } function isImportCall(n) { - return n.kind === 212 /* CallExpression */ && n.expression.kind === 102 /* ImportKeyword */; + return n.kind === 213 /* CallExpression */ && n.expression.kind === 102 /* ImportKeyword */; } function isImportMeta(n) { return isMetaProperty(n) && n.keywordToken === 102 /* ImportKeyword */ && n.name.escapedText === "meta"; @@ -283940,7 +284468,7 @@ ${lanes.join("\n")} return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal); } function isPrologueDirective(node) { - return node.kind === 243 /* ExpressionStatement */ && node.expression.kind === 11 /* StringLiteral */; + return node.kind === 244 /* ExpressionStatement */ && node.expression.kind === 11 /* StringLiteral */; } function isCustomPrologue(node) { return !!(getEmitFlags(node) & 2097152 /* CustomPrologue */); @@ -283958,18 +284486,18 @@ ${lanes.join("\n")} return node.kind !== 12 /* JsxText */ ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : void 0; } function getJSDocCommentRanges(node, text) { - const commentRanges = node.kind === 168 /* Parameter */ || node.kind === 167 /* TypeParameter */ || node.kind === 217 /* FunctionExpression */ || node.kind === 218 /* ArrowFunction */ || node.kind === 216 /* ParenthesizedExpression */ || node.kind === 259 /* VariableDeclaration */ || node.kind === 280 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); + const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 260 /* VariableDeclaration */ || node.kind === 281 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); return filter(commentRanges, (comment) => text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */); } function isPartOfTypeNode(node) { - if (181 /* FirstTypeNode */ <= node.kind && node.kind <= 204 /* LastTypeNode */) { + if (182 /* FirstTypeNode */ <= node.kind && node.kind <= 205 /* LastTypeNode */) { return true; } switch (node.kind) { case 133 /* AnyKeyword */: case 159 /* UnknownKeyword */: case 150 /* NumberKeyword */: - case 162 /* BigIntKeyword */: + case 163 /* BigIntKeyword */: case 154 /* StringKeyword */: case 136 /* BooleanKeyword */: case 155 /* SymbolKeyword */: @@ -283979,70 +284507,70 @@ ${lanes.join("\n")} case 146 /* NeverKeyword */: return true; case 116 /* VoidKeyword */: - return node.parent.kind !== 221 /* VoidExpression */; - case 232 /* ExpressionWithTypeArguments */: - return isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 167 /* TypeParameter */: - return node.parent.kind === 199 /* MappedType */ || node.parent.kind === 194 /* InferType */; + return node.parent.kind !== 222 /* VoidExpression */; + case 233 /* ExpressionWithTypeArguments */: + return isPartOfTypeExpressionWithTypeArguments(node); + case 168 /* TypeParameter */: + return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */; case 80 /* Identifier */: - if (node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node) { node = node.parent; - } else if (node.parent.kind === 210 /* PropertyAccessExpression */ && node.parent.name === node) { + } else if (node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } - Debug.assert( - node.kind === 80 /* Identifier */ || node.kind === 165 /* QualifiedName */ || node.kind === 210 /* PropertyAccessExpression */, - "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'." - ); - case 165 /* QualifiedName */: - case 210 /* PropertyAccessExpression */: + Debug.assert(node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 166 /* QualifiedName */: + case 211 /* PropertyAccessExpression */: case 110 /* ThisKeyword */: { const { parent: parent2 } = node; - if (parent2.kind === 185 /* TypeQuery */) { + if (parent2.kind === 186 /* TypeQuery */) { return false; } - if (parent2.kind === 204 /* ImportType */) { + if (parent2.kind === 205 /* ImportType */) { return !parent2.isTypeOf; } - if (181 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 204 /* LastTypeNode */) { + if (182 /* FirstTypeNode */ <= parent2.kind && parent2.kind <= 205 /* LastTypeNode */) { return true; } switch (parent2.kind) { - case 232 /* ExpressionWithTypeArguments */: - return isHeritageClause(parent2.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent2); - case 167 /* TypeParameter */: + case 233 /* ExpressionWithTypeArguments */: + return isPartOfTypeExpressionWithTypeArguments(parent2); + case 168 /* TypeParameter */: return node === parent2.constraint; - case 351 /* JSDocTemplateTag */: + case 352 /* JSDocTemplateTag */: return node === parent2.constraint; - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 168 /* Parameter */: - case 259 /* VariableDeclaration */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 169 /* Parameter */: + case 260 /* VariableDeclaration */: return node === parent2.type; - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 175 /* Constructor */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 176 /* Constructor */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return node === parent2.type; - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 180 /* IndexSignature */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 181 /* IndexSignature */: return node === parent2.type; - case 215 /* TypeAssertionExpression */: + case 216 /* TypeAssertionExpression */: return node === parent2.type; - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 214 /* TaggedTemplateExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 215 /* TaggedTemplateExpression */: return contains(parent2.typeArguments, node); } } } 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) { @@ -284056,23 +284584,23 @@ ${lanes.join("\n")} return traverse(body); function traverse(node) { switch (node.kind) { - case 252 /* ReturnStatement */: + case 253 /* ReturnStatement */: return visitor(node); - case 268 /* CaseBlock */: - case 240 /* Block */: - case 244 /* IfStatement */: - case 245 /* DoStatement */: - case 246 /* WhileStatement */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 253 /* WithStatement */: - case 254 /* SwitchStatement */: - case 295 /* CaseClause */: - case 296 /* DefaultClause */: - case 255 /* LabeledStatement */: - case 257 /* TryStatement */: - case 298 /* CatchClause */: + case 269 /* CaseBlock */: + case 241 /* Block */: + 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 296 /* CaseClause */: + case 297 /* DefaultClause */: + case 256 /* LabeledStatement */: + case 258 /* TryStatement */: + case 299 /* CatchClause */: return forEachChild(node, traverse); } } @@ -284081,21 +284609,21 @@ ${lanes.join("\n")} return traverse(body); function traverse(node) { switch (node.kind) { - case 228 /* YieldExpression */: + case 229 /* YieldExpression */: visitor(node); const operand = node.expression; if (operand) { traverse(operand); } return; - case 265 /* EnumDeclaration */: - case 263 /* InterfaceDeclaration */: - case 266 /* ModuleDeclaration */: - case 264 /* TypeAliasDeclaration */: + case 266 /* EnumDeclaration */: + case 264 /* InterfaceDeclaration */: + case 267 /* ModuleDeclaration */: + case 265 /* TypeAliasDeclaration */: return; default: if (isFunctionLike(node)) { - if (node.name && node.name.kind === 166 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 167 /* ComputedPropertyName */) { traverse(node.name.expression); return; } @@ -284106,9 +284634,9 @@ ${lanes.join("\n")} } } function getRestParameterElementType(node) { - if (node && node.kind === 187 /* ArrayType */) { + if (node && node.kind === 188 /* ArrayType */) { return node.elementType; - } else if (node && node.kind === 182 /* TypeReference */) { + } else if (node && node.kind === 183 /* TypeReference */) { return singleOrUndefined(node.typeArguments); } else { return void 0; @@ -284116,26 +284644,26 @@ ${lanes.join("\n")} } function getMembersOfDeclaration(node) { switch (node.kind) { - case 263 /* InterfaceDeclaration */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 186 /* TypeLiteral */: + case 264 /* InterfaceDeclaration */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 187 /* TypeLiteral */: return node.members; - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return node.properties; } } function isVariableLike(node) { if (node) { switch (node.kind) { - case 207 /* BindingElement */: - case 305 /* EnumMember */: - case 168 /* Parameter */: - case 302 /* PropertyAssignment */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 303 /* ShorthandPropertyAssignment */: - case 259 /* VariableDeclaration */: + case 208 /* BindingElement */: + case 306 /* EnumMember */: + case 169 /* Parameter */: + case 303 /* PropertyAssignment */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 304 /* ShorthandPropertyAssignment */: + case 260 /* VariableDeclaration */: return true; } } @@ -284145,7 +284673,7 @@ ${lanes.join("\n")} return isVariableLike(node) || isAccessor(node); } function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 260 /* VariableDeclarationList */ && node.parent.parent.kind === 242 /* VariableStatement */; + return node.parent.kind === 261 /* VariableDeclarationList */ && node.parent.parent.kind === 243 /* VariableStatement */; } function isCommonJsExportedExpression(node) { if (!isInJSFile(node)) @@ -284162,13 +284690,13 @@ ${lanes.join("\n")} } function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: return true; } return false; @@ -284178,20 +284706,20 @@ ${lanes.join("\n")} if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 255 /* LabeledStatement */) { + if (node.statement.kind !== 256 /* LabeledStatement */) { return node.statement; } node = node.statement; } } function isFunctionBlock(node) { - return node && node.kind === 240 /* Block */ && isFunctionLike(node.parent); + return node && node.kind === 241 /* Block */ && isFunctionLike(node.parent); } function isObjectLiteralMethod(node) { - return node && node.kind === 173 /* MethodDeclaration */ && node.parent.kind === 209 /* ObjectLiteralExpression */; + return node && node.kind === 174 /* MethodDeclaration */ && node.parent.kind === 210 /* ObjectLiteralExpression */; } function isObjectLiteralOrClassExpressionMethodOrAccessor(node) { - return (node.kind === 173 /* MethodDeclaration */ || node.kind === 176 /* GetAccessor */ || node.kind === 177 /* SetAccessor */) && (node.parent.kind === 209 /* ObjectLiteralExpression */ || node.parent.kind === 230 /* ClassExpression */); + return (node.kind === 174 /* MethodDeclaration */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) && (node.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.kind === 231 /* ClassExpression */); } function isIdentifierTypePredicate(predicate) { return predicate && predicate.kind === 1 /* Identifier */; @@ -284208,11 +284736,7 @@ ${lanes.join("\n")} }); } function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) { - return forEachPropertyAssignment( - objectLiteral, - propKey, - (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0 - ); + return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0); } function getTsConfigObjectLiteralExpression(tsConfigSourceFile) { if (tsConfigSourceFile && tsConfigSourceFile.statements.length) { @@ -284246,64 +284770,68 @@ ${lanes.join("\n")} function getContainingFunctionOrClassStaticBlock(node) { return findAncestor(node.parent, isFunctionLikeOrClassStaticBlockDeclaration); } + function getContainingClassExcludingClassDecorators(node) { + const decorator = findAncestor(node.parent, (n) => isClassLike(n) ? "quit" : isDecorator(n)); + return decorator && isClassLike(decorator.parent) ? getContainingClass(decorator.parent) : getContainingClass(decorator ?? node); + } function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) { - Debug.assert(node.kind !== 311 /* SourceFile */); + Debug.assert(node.kind !== 312 /* SourceFile */); while (true) { node = node.parent; if (!node) { return Debug.fail(); } switch (node.kind) { - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: if (includeClassComputedPropertyName && isClassLike(node.parent.parent)) { return node; } node = node.parent.parent; break; - case 169 /* Decorator */: - if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) { + case 170 /* Decorator */: + if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; } break; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 266 /* ModuleDeclaration */: - case 174 /* ClassStaticBlockDeclaration */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 180 /* IndexSignature */: - case 265 /* EnumDeclaration */: - case 311 /* SourceFile */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 267 /* ModuleDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 181 /* IndexSignature */: + case 266 /* EnumDeclaration */: + case 312 /* SourceFile */: return node; } } } function isThisContainerOrFunctionBlock(node) { switch (node.kind) { - case 218 /* ArrowFunction */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 171 /* PropertyDeclaration */: + case 219 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 172 /* PropertyDeclaration */: return true; - case 240 /* Block */: + case 241 /* Block */: switch (node.parent.kind) { - case 175 /* Constructor */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 176 /* Constructor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return true; default: return false; @@ -284335,9 +284863,9 @@ ${lanes.join("\n")} ); if (container) { switch (container.kind) { - case 175 /* Constructor */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 176 /* Constructor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: return container; } } @@ -284350,26 +284878,26 @@ ${lanes.join("\n")} return void 0; } switch (node.kind) { - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: node = node.parent; break; - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: if (!stopOnFunctions) { continue; } - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 174 /* ClassStaticBlockDeclaration */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 175 /* ClassStaticBlockDeclaration */: return node; - case 169 /* Decorator */: - if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) { + case 170 /* Decorator */: + if (node.parent.kind === 169 /* Parameter */ && isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (isClassElement(node.parent)) { node = node.parent; @@ -284379,14 +284907,14 @@ ${lanes.join("\n")} } } function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 217 /* FunctionExpression */ || func.kind === 218 /* ArrowFunction */) { + if (func.kind === 218 /* FunctionExpression */ || func.kind === 219 /* ArrowFunction */) { let prev = func; let parent2 = func.parent; - while (parent2.kind === 216 /* ParenthesizedExpression */) { + while (parent2.kind === 217 /* ParenthesizedExpression */) { prev = parent2; parent2 = parent2.parent; } - if (parent2.kind === 212 /* CallExpression */ && parent2.expression === prev) { + if (parent2.kind === 213 /* CallExpression */ && parent2.expression === prev) { return parent2; } } @@ -284396,11 +284924,11 @@ ${lanes.join("\n")} } function isSuperProperty(node) { const kind = node.kind; - return (kind === 210 /* PropertyAccessExpression */ || kind === 211 /* ElementAccessExpression */) && node.expression.kind === 108 /* SuperKeyword */; + return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 108 /* SuperKeyword */; } function isThisProperty(node) { const kind = node.kind; - return (kind === 210 /* PropertyAccessExpression */ || kind === 211 /* ElementAccessExpression */) && node.expression.kind === 110 /* ThisKeyword */; + return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 110 /* ThisKeyword */; } function isThisInitializedDeclaration(node) { var _a; @@ -284411,23 +284939,25 @@ ${lanes.join("\n")} } function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 182 /* TypeReference */: + case 183 /* TypeReference */: return node.typeName; - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : void 0; case 80 /* Identifier */: - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: return node; } return void 0; } function getInvokedExpression(node) { switch (node.kind) { - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return node.tag; - case 285 /* JsxOpeningElement */: - case 284 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 285 /* JsxSelfClosingElement */: return node.tagName; + case 226 /* BinaryExpression */: + return node.right; default: return node.expression; } @@ -284437,20 +284967,20 @@ ${lanes.join("\n")} return false; } switch (node.kind) { - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return true; - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: return !useLegacyDecorators; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2) && !hasAbstractModifier(node) && !hasAmbientModifier(node)); - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 173 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: return node.body !== void 0 && parent2 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent2) : isClassLike(parent2)); - case 168 /* Parameter */: + case 169 /* Parameter */: if (!useLegacyDecorators) return false; - return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 175 /* Constructor */ || parent2.kind === 173 /* MethodDeclaration */ || parent2.kind === 177 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 262 /* ClassDeclaration */; + return parent2 !== void 0 && parent2.body !== void 0 && (parent2.kind === 176 /* Constructor */ || parent2.kind === 174 /* MethodDeclaration */ || parent2.kind === 178 /* SetAccessor */) && getThisParameter(parent2) !== node && grandparent !== void 0 && grandparent.kind === 263 /* ClassDeclaration */; } return false; } @@ -284462,13 +284992,13 @@ ${lanes.join("\n")} } function childIsDecorated(useLegacyDecorators, node, parent2) { switch (node.kind) { - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: return !useLegacyDecorators && some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2)); - case 173 /* MethodDeclaration */: - case 177 /* SetAccessor */: - case 175 /* Constructor */: + case 174 /* MethodDeclaration */: + case 178 /* SetAccessor */: + case 176 /* Constructor */: return some(node.parameters, (p) => nodeIsDecorated(useLegacyDecorators, p, node, parent2)); default: return false; @@ -284519,7 +285049,7 @@ ${lanes.join("\n")} } function isJSXTagName(node) { const { parent: parent2 } = node; - if (parent2.kind === 285 /* JsxOpeningElement */ || parent2.kind === 284 /* JsxSelfClosingElement */ || parent2.kind === 286 /* JsxClosingElement */) { + if (parent2.kind === 286 /* JsxOpeningElement */ || parent2.kind === 285 /* JsxSelfClosingElement */ || parent2.kind === 287 /* JsxClosingElement */) { return parent2.tagName === node; } return false; @@ -284531,54 +285061,54 @@ ${lanes.join("\n")} case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: case 14 /* RegularExpressionLiteral */: - case 208 /* ArrayLiteralExpression */: - case 209 /* ObjectLiteralExpression */: - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 214 /* TaggedTemplateExpression */: - case 233 /* AsExpression */: - case 215 /* TypeAssertionExpression */: - case 237 /* SatisfiesExpression */: - case 234 /* NonNullExpression */: - case 216 /* ParenthesizedExpression */: - case 217 /* FunctionExpression */: - case 230 /* ClassExpression */: - case 218 /* ArrowFunction */: - case 221 /* VoidExpression */: - case 219 /* DeleteExpression */: - case 220 /* TypeOfExpression */: - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: - case 225 /* BinaryExpression */: - case 226 /* ConditionalExpression */: - case 229 /* SpreadElement */: - case 227 /* TemplateExpression */: - case 231 /* OmittedExpression */: - case 283 /* JsxElement */: - case 284 /* JsxSelfClosingElement */: - case 287 /* JsxFragment */: - case 228 /* YieldExpression */: - case 222 /* AwaitExpression */: - case 235 /* MetaProperty */: + case 209 /* ArrayLiteralExpression */: + case 210 /* ObjectLiteralExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 215 /* TaggedTemplateExpression */: + case 234 /* AsExpression */: + case 216 /* TypeAssertionExpression */: + case 238 /* SatisfiesExpression */: + case 235 /* NonNullExpression */: + case 217 /* ParenthesizedExpression */: + case 218 /* FunctionExpression */: + case 231 /* ClassExpression */: + case 219 /* ArrowFunction */: + case 222 /* VoidExpression */: + case 220 /* DeleteExpression */: + case 221 /* TypeOfExpression */: + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: + case 226 /* BinaryExpression */: + case 227 /* ConditionalExpression */: + case 230 /* SpreadElement */: + case 228 /* TemplateExpression */: + case 232 /* OmittedExpression */: + case 284 /* JsxElement */: + case 285 /* JsxSelfClosingElement */: + case 288 /* JsxFragment */: + case 229 /* YieldExpression */: + case 223 /* AwaitExpression */: + case 236 /* MetaProperty */: return true; - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return !isHeritageClause(node.parent) && !isJSDocAugmentsTag(node.parent); - case 165 /* QualifiedName */: - while (node.parent.kind === 165 /* QualifiedName */) { + case 166 /* QualifiedName */: + while (node.parent.kind === 166 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 185 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); - case 317 /* JSDocMemberName */: + return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); + case 318 /* JSDocMemberName */: while (isJSDocMemberName(node.parent)) { node = node.parent; } - return node.parent.kind === 185 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); + return node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); case 81 /* PrivateIdentifier */: return isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 103 /* InKeyword */; case 80 /* Identifier */: - if (node.parent.kind === 185 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) { + if (node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) { return true; } case 9 /* NumericLiteral */: @@ -284594,64 +285124,64 @@ ${lanes.join("\n")} function isInExpressionContext(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 305 /* EnumMember */: - case 302 /* PropertyAssignment */: - case 207 /* BindingElement */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 306 /* EnumMember */: + case 303 /* PropertyAssignment */: + case 208 /* BindingElement */: return parent2.initializer === node; - case 243 /* ExpressionStatement */: - case 244 /* IfStatement */: - case 245 /* DoStatement */: - case 246 /* WhileStatement */: - case 252 /* ReturnStatement */: - case 253 /* WithStatement */: - case 254 /* SwitchStatement */: - case 295 /* CaseClause */: - case 256 /* ThrowStatement */: + case 244 /* ExpressionStatement */: + case 245 /* IfStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: + case 253 /* ReturnStatement */: + case 254 /* WithStatement */: + case 255 /* SwitchStatement */: + case 296 /* CaseClause */: + case 257 /* ThrowStatement */: return parent2.expression === node; - case 247 /* ForStatement */: + case 248 /* ForStatement */: const forStatement = parent2; - return forStatement.initializer === node && forStatement.initializer.kind !== 260 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node; - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - const forInStatement = parent2; - return forInStatement.initializer === node && forInStatement.initializer.kind !== 260 /* VariableDeclarationList */ || forInStatement.expression === node; - case 215 /* TypeAssertionExpression */: - case 233 /* AsExpression */: + return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node; + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + const forInOrOfStatement = parent2; + return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node; + case 216 /* TypeAssertionExpression */: + case 234 /* AsExpression */: return node === parent2.expression; - case 238 /* TemplateSpan */: + case 239 /* TemplateSpan */: return node === parent2.expression; - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: return node === parent2.expression; - case 169 /* Decorator */: - case 293 /* JsxExpression */: - case 292 /* JsxSpreadAttribute */: - case 304 /* SpreadAssignment */: + case 170 /* Decorator */: + case 294 /* JsxExpression */: + case 293 /* JsxSpreadAttribute */: + case 305 /* SpreadAssignment */: return true; - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return parent2.expression === node && !isPartOfTypeNode(parent2); - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return parent2.objectAssignmentInitializer === node; - case 237 /* SatisfiesExpression */: + case 238 /* SatisfiesExpression */: return node === parent2.expression; default: return isExpressionNode(parent2); } } function isPartOfTypeQuery(node) { - while (node.kind === 165 /* QualifiedName */ || node.kind === 80 /* Identifier */) { + while (node.kind === 166 /* QualifiedName */ || node.kind === 80 /* Identifier */) { node = node.parent; } - return node.kind === 185 /* TypeQuery */; + return node.kind === 186 /* TypeQuery */; } function isNamespaceReexportDeclaration(node) { return isNamespaceExport(node) && !!node.parent.moduleSpecifier; } function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 270 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 282 /* ExternalModuleReference */; + return node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */; } function getExternalModuleImportEqualsDeclarationExpression(node) { Debug.assert(isExternalModuleImportEqualsDeclaration(node)); @@ -284661,7 +285191,7 @@ ${lanes.join("\n")} return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0]; } function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 270 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 282 /* ExternalModuleReference */; + return node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 283 /* ExternalModuleReference */; } function isSourceFileJS(file) { return isInJSFile(file); @@ -284670,22 +285200,22 @@ ${lanes.join("\n")} return !isInJSFile(file); } function isInJSFile(node) { - return !!node && !!(node.flags & 262144 /* JavaScriptFile */); + return !!node && !!(node.flags & 524288 /* JavaScriptFile */); } function isInJsonFile(node) { - return !!node && !!(node.flags & 67108864 /* JsonFile */); + return !!node && !!(node.flags & 134217728 /* JsonFile */); } function isSourceFileNotJson(file) { return !isJsonSourceFile(file); } function isInJSDoc(node) { - return !!node && !!(node.flags & 8388608 /* JSDoc */); + return !!node && !!(node.flags & 16777216 /* JSDoc */); } function isJSDocIndexSignature(node) { return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && (node.typeArguments[0].kind === 154 /* StringKeyword */ || node.typeArguments[0].kind === 150 /* NumberKeyword */); } function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 212 /* CallExpression */) { + if (callExpression.kind !== 213 /* CallExpression */) { return false; } const { expression, arguments: args } = callExpression; @@ -284762,9 +285292,9 @@ ${lanes.join("\n")} function getExpandoInitializer(initializer, isPrototypeAssignment) { if (isCallExpression(initializer)) { const e = skipParentheses(initializer.expression); - return e.kind === 217 /* FunctionExpression */ || e.kind === 218 /* ArrowFunction */ ? initializer : void 0; + return e.kind === 218 /* FunctionExpression */ || e.kind === 219 /* ArrowFunction */ ? initializer : void 0; } - if (initializer.kind === 217 /* FunctionExpression */ || initializer.kind === 230 /* ClassExpression */ || initializer.kind === 218 /* ArrowFunction */) { + if (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 231 /* ClassExpression */ || initializer.kind === 219 /* ArrowFunction */) { return initializer; } if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -284955,11 +285485,11 @@ ${lanes.join("\n")} return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3 /* PrototypeProperty */; } function isSpecialPropertyDeclaration(expr) { - return isInJSFile(expr) && expr.parent && expr.parent.kind === 243 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent); + return isInJSFile(expr) && expr.parent && expr.parent.kind === 244 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent); } function setValueDeclaration(symbol, node) { const { valueDeclaration } = symbol; - if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !isInJSFile(node) && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { + if (!valueDeclaration || !(node.flags & 33554432 /* Ambient */ && !isInJSFile(node) && !(valueDeclaration.flags & 33554432 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { symbol.valueDeclaration = node; } } @@ -284968,30 +285498,33 @@ ${lanes.join("\n")} return false; } const decl = symbol.valueDeclaration; - return decl.kind === 261 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); + return decl.kind === 262 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); } function tryGetModuleSpecifierFromDeclaration(node) { var _a, _b; switch (node.kind) { - case 259 /* VariableDeclaration */: - case 207 /* BindingElement */: + case 260 /* VariableDeclaration */: + case 208 /* BindingElement */: return (_a = findAncestor(node.initializer, (node2) => isRequireCall( node2, /*requireStringLiteralLikeArgument*/ true ))) == null ? void 0 : _a.arguments[0]; - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: + case 278 /* ExportDeclaration */: return tryCast(node.moduleSpecifier, isStringLiteralLike); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike); - case 272 /* ImportClause */: - case 279 /* NamespaceExport */: + case 273 /* ImportClause */: + case 280 /* NamespaceExport */: return tryCast(node.parent.moduleSpecifier, isStringLiteralLike); - case 273 /* NamespaceImport */: - case 280 /* ExportSpecifier */: + case 274 /* NamespaceImport */: + case 281 /* ExportSpecifier */: return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike); - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike); + case 205 /* ImportType */: + return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; default: Debug.assertNever(node); } @@ -285001,18 +285534,18 @@ ${lanes.join("\n")} } function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 271 /* ImportDeclaration */: - case 277 /* ExportDeclaration */: + case 272 /* ImportDeclaration */: + case 278 /* ExportDeclaration */: return node.parent; - case 282 /* ExternalModuleReference */: + case 283 /* ExternalModuleReference */: return node.parent.parent; - case 212 /* CallExpression */: + case 213 /* CallExpression */: return isImportCall(node.parent) || isRequireCall( node.parent, /*requireStringLiteralLikeArgument*/ false ) ? node.parent : void 0; - case 200 /* LiteralType */: + case 201 /* LiteralType */: Debug.assert(isStringLiteral(node)); return tryCast(node.parent.parent, isImportTypeNode); default: @@ -285021,16 +285554,16 @@ ${lanes.join("\n")} } function getExternalModuleName(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: - case 277 /* ExportDeclaration */: + case 272 /* ImportDeclaration */: + case 278 /* ExportDeclaration */: return node.moduleSpecifier; - case 270 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 282 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; - case 204 /* ImportType */: + case 271 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; + case 205 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; - case 212 /* CallExpression */: + case 213 /* CallExpression */: return node.arguments[0]; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return node.name.kind === 11 /* StringLiteral */ ? node.name : void 0; default: return Debug.assertNever(node); @@ -285038,18 +285571,18 @@ ${lanes.join("\n")} } function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return node; - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: return node.exportClause && tryCast(node.exportClause, isNamespaceExport); default: return Debug.assertNever(node); } } function isDefaultImport(node) { - return node.kind === 271 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 272 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } function forEachImportClauseDeclaration(node, action) { if (node.name) { @@ -285066,13 +285599,13 @@ ${lanes.join("\n")} function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 168 /* Parameter */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 303 /* ShorthandPropertyAssignment */: - case 302 /* PropertyAssignment */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: + case 169 /* Parameter */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 304 /* ShorthandPropertyAssignment */: + case 303 /* PropertyAssignment */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: return node.questionToken !== void 0; } } @@ -285084,7 +285617,7 @@ ${lanes.join("\n")} return !!name && name.escapedText === "new"; } function isJSDocTypeAlias(node) { - return node.kind === 352 /* JSDocTypedefTag */ || node.kind === 344 /* JSDocCallbackTag */ || node.kind === 346 /* JSDocEnumTag */; + return node.kind === 353 /* JSDocTypedefTag */ || node.kind === 345 /* JSDocCallbackTag */ || node.kind === 347 /* JSDocEnumTag */; } function isTypeAlias(node) { return isJSDocTypeAlias(node) || isTypeAliasDeclaration(node); @@ -285097,12 +285630,12 @@ ${lanes.join("\n")} } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: const v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return node.initializer; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return node.initializer; } } @@ -285110,26 +285643,26 @@ ${lanes.join("\n")} return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0; } function getNestedModuleDeclaration(node) { - return isModuleDeclaration(node) && node.body && node.body.kind === 266 /* ModuleDeclaration */ ? node.body : void 0; + return isModuleDeclaration(node) && node.body && node.body.kind === 267 /* ModuleDeclaration */ ? node.body : void 0; } function canHaveFlowNode(node) { - if (node.kind >= 242 /* FirstStatement */ && node.kind <= 258 /* LastStatement */) { + if (node.kind >= 243 /* FirstStatement */ && node.kind <= 259 /* LastStatement */) { return true; } switch (node.kind) { case 80 /* Identifier */: case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: - case 165 /* QualifiedName */: - case 235 /* MetaProperty */: - case 211 /* ElementAccessExpression */: - case 210 /* PropertyAccessExpression */: - case 207 /* BindingElement */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 166 /* QualifiedName */: + case 236 /* MetaProperty */: + case 212 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 208 /* BindingElement */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return true; default: return false; @@ -285137,72 +285670,72 @@ ${lanes.join("\n")} } function canHaveJSDoc(node) { switch (node.kind) { - case 218 /* ArrowFunction */: - case 225 /* BinaryExpression */: - case 240 /* Block */: - case 251 /* BreakStatement */: - case 178 /* CallSignature */: - case 295 /* CaseClause */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 174 /* ClassStaticBlockDeclaration */: - case 175 /* Constructor */: - case 184 /* ConstructorType */: - case 179 /* ConstructSignature */: - case 250 /* ContinueStatement */: - case 258 /* DebuggerStatement */: - case 245 /* DoStatement */: - case 211 /* ElementAccessExpression */: - case 241 /* EmptyStatement */: + case 219 /* ArrowFunction */: + case 226 /* BinaryExpression */: + case 241 /* Block */: + case 252 /* BreakStatement */: + case 179 /* CallSignature */: + case 296 /* CaseClause */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 175 /* ClassStaticBlockDeclaration */: + case 176 /* Constructor */: + case 185 /* ConstructorType */: + case 180 /* ConstructSignature */: + case 251 /* ContinueStatement */: + case 259 /* DebuggerStatement */: + case 246 /* DoStatement */: + case 212 /* ElementAccessExpression */: + case 242 /* EmptyStatement */: case 1 /* EndOfFileToken */: - case 265 /* EnumDeclaration */: - case 305 /* EnumMember */: - case 276 /* ExportAssignment */: - case 277 /* ExportDeclaration */: - case 280 /* ExportSpecifier */: - case 243 /* ExpressionStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 247 /* ForStatement */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 183 /* FunctionType */: - case 176 /* GetAccessor */: + case 266 /* EnumDeclaration */: + case 306 /* EnumMember */: + case 277 /* ExportAssignment */: + case 278 /* ExportDeclaration */: + case 281 /* ExportSpecifier */: + case 244 /* ExpressionStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 248 /* ForStatement */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 184 /* FunctionType */: + case 177 /* GetAccessor */: case 80 /* Identifier */: - case 244 /* IfStatement */: - case 271 /* ImportDeclaration */: - case 270 /* ImportEqualsDeclaration */: - case 180 /* IndexSignature */: - case 263 /* InterfaceDeclaration */: - case 323 /* JSDocFunctionType */: - case 329 /* JSDocSignature */: - case 255 /* LabeledStatement */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 266 /* ModuleDeclaration */: - case 201 /* NamedTupleMember */: - case 269 /* NamespaceExportDeclaration */: - case 209 /* ObjectLiteralExpression */: - case 168 /* Parameter */: - case 216 /* ParenthesizedExpression */: - case 210 /* PropertyAccessExpression */: - case 302 /* PropertyAssignment */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 252 /* ReturnStatement */: - case 239 /* SemicolonClassElement */: - case 177 /* SetAccessor */: - case 303 /* ShorthandPropertyAssignment */: - case 304 /* SpreadAssignment */: - case 254 /* SwitchStatement */: - case 256 /* ThrowStatement */: - case 257 /* TryStatement */: - case 264 /* TypeAliasDeclaration */: - case 167 /* TypeParameter */: - case 259 /* VariableDeclaration */: - case 242 /* VariableStatement */: - case 246 /* WhileStatement */: - case 253 /* WithStatement */: + case 245 /* IfStatement */: + case 272 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 181 /* IndexSignature */: + case 264 /* InterfaceDeclaration */: + case 324 /* JSDocFunctionType */: + case 330 /* JSDocSignature */: + case 256 /* LabeledStatement */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 267 /* ModuleDeclaration */: + case 202 /* NamedTupleMember */: + case 270 /* NamespaceExportDeclaration */: + case 210 /* ObjectLiteralExpression */: + case 169 /* Parameter */: + case 217 /* ParenthesizedExpression */: + case 211 /* PropertyAccessExpression */: + case 303 /* PropertyAssignment */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 253 /* ReturnStatement */: + case 240 /* SemicolonClassElement */: + case 178 /* SetAccessor */: + case 304 /* ShorthandPropertyAssignment */: + case 305 /* SpreadAssignment */: + case 255 /* SwitchStatement */: + case 257 /* ThrowStatement */: + case 258 /* TryStatement */: + case 265 /* TypeAliasDeclaration */: + case 168 /* TypeParameter */: + case 260 /* VariableDeclaration */: + case 243 /* VariableStatement */: + case 247 /* WhileStatement */: + case 254 /* WithStatement */: return true; default: return false; @@ -285211,18 +285744,18 @@ ${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 === 168 /* Parameter */) { + if (node.kind === 169 /* Parameter */) { result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node)); break; } - if (node.kind === 167 /* TypeParameter */) { + if (node.kind === 168 /* TypeParameter */) { result = addRange(result, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node)); break; } @@ -285230,21 +285763,25 @@ ${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; } function getNextJSDocCommentLocation(node) { const parent2 = node.parent; - if (parent2.kind === 302 /* PropertyAssignment */ || parent2.kind === 276 /* ExportAssignment */ || parent2.kind === 171 /* PropertyDeclaration */ || parent2.kind === 243 /* ExpressionStatement */ && node.kind === 210 /* PropertyAccessExpression */ || parent2.kind === 252 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isBinaryExpression(node) && node.operatorToken.kind === 64 /* EqualsToken */) { + if (parent2.kind === 303 /* PropertyAssignment */ || parent2.kind === 277 /* ExportAssignment */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 244 /* ExpressionStatement */ && node.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 253 /* ReturnStatement */ || getNestedModuleDeclaration(parent2) || isAssignmentExpression(node)) { return parent2; - } else if (parent2.parent && (getSingleVariableOfVariableStatement(parent2.parent) === node || isBinaryExpression(parent2) && parent2.operatorToken.kind === 64 /* EqualsToken */)) { + } else if (parent2.parent && (getSingleVariableOfVariableStatement(parent2.parent) === node || isAssignmentExpression(parent2))) { return parent2.parent; } else if (parent2.parent && parent2.parent.parent && (getSingleVariableOfVariableStatement(parent2.parent.parent) || getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent2.parent.parent) === node || getSourceOfDefaultedAssignment(parent2.parent.parent))) { return parent2.parent.parent; @@ -285274,6 +285811,9 @@ ${lanes.join("\n")} } return getHostSignatureFromJSDoc(node); } + function getJSDocOverloadTags(node) { + return getAllJSDocTags(node, isJSDocOverloadTag); + } function getHostSignatureFromJSDoc(node) { const host = getEffectiveJSDocHost(node); if (host) { @@ -285308,68 +285848,100 @@ ${lanes.join("\n")} function hasTypeArguments(node) { return !!node.typeArguments; } - function getAssignmentTargetKind(node) { + function getAssignmentTarget(node) { let parent2 = node.parent; while (true) { switch (parent2.kind) { - case 225 /* BinaryExpression */: - const binaryOperator = parent2.operatorToken.kind; - return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: - const unaryOperator = parent2.operator; - return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 216 /* ParenthesizedExpression */: - case 208 /* ArrayLiteralExpression */: - case 229 /* SpreadElement */: - case 234 /* NonNullExpression */: + case 226 /* BinaryExpression */: + const binaryExpression = parent2; + const binaryOperator = binaryExpression.operatorToken.kind; + return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0; + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: + const unaryExpression = parent2; + const unaryOperator = unaryExpression.operator; + return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0; + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + const forInOrOfStatement = parent2; + return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0; + case 217 /* ParenthesizedExpression */: + case 209 /* ArrayLiteralExpression */: + case 230 /* SpreadElement */: + case 235 /* NonNullExpression */: node = parent2; break; - case 304 /* SpreadAssignment */: + case 305 /* SpreadAssignment */: node = parent2.parent; break; - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: if (parent2.name !== node) { - return 0 /* None */; + return void 0; } node = parent2.parent; break; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: if (parent2.name === node) { - return 0 /* None */; + return void 0; } node = parent2.parent; break; default: - return 0 /* None */; + return void 0; } parent2 = node.parent; } } + function getAssignmentTargetKind(node) { + const target = getAssignmentTarget(node); + if (!target) { + return 0 /* None */; + } + switch (target.kind) { + case 226 /* BinaryExpression */: + const binaryOperator = target.operatorToken.kind; + return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */; + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: + return 2 /* Compound */; + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + return 1 /* Definite */; + } + } function isAssignmentTarget(node) { - return getAssignmentTargetKind(node) !== 0 /* None */; + return !!getAssignmentTarget(node); + } + function isCompoundLikeAssignment(assignment) { + const right = skipParentheses(assignment.right); + return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind); + } + function isInCompoundLikeAssignment(node) { + const target = getAssignmentTarget(node); + return !!target && isAssignmentExpression( + target, + /*excludeCompoundAssignment*/ + true + ) && isCompoundLikeAssignment(target); } function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 240 /* Block */: - case 242 /* VariableStatement */: - case 253 /* WithStatement */: - case 244 /* IfStatement */: - case 254 /* SwitchStatement */: - case 268 /* CaseBlock */: - case 295 /* CaseClause */: - case 296 /* DefaultClause */: - case 255 /* LabeledStatement */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 245 /* DoStatement */: - case 246 /* WhileStatement */: - case 257 /* TryStatement */: - case 298 /* CatchClause */: + case 241 /* Block */: + case 243 /* VariableStatement */: + case 254 /* WithStatement */: + case 245 /* IfStatement */: + case 255 /* SwitchStatement */: + case 269 /* CaseBlock */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: + case 256 /* LabeledStatement */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: + case 258 /* TryStatement */: + case 299 /* CatchClause */: return true; } return false; @@ -285384,14 +285956,14 @@ ${lanes.join("\n")} return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 195 /* ParenthesizedType */); + return walkUp(node, 196 /* ParenthesizedType */); } function walkUpParenthesizedExpressions(node) { - return walkUp(node, 216 /* ParenthesizedExpression */); + return walkUp(node, 217 /* ParenthesizedExpression */); } function walkUpParenthesizedTypesAndGetParentAndChild(node) { let child; - while (node && node.kind === 195 /* ParenthesizedType */) { + while (node && node.kind === 196 /* ParenthesizedType */) { child = node; node = node.parent; } @@ -285407,11 +285979,11 @@ ${lanes.join("\n")} return skipOuterExpressions(node, flags); } function isDeleteTarget(node) { - if (node.kind !== 210 /* PropertyAccessExpression */ && node.kind !== 211 /* ElementAccessExpression */) { + if (node.kind !== 211 /* PropertyAccessExpression */ && node.kind !== 212 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 219 /* DeleteExpression */; + return node && node.kind === 220 /* DeleteExpression */; } function isNodeDescendantOf(node, ancestor) { while (node) { @@ -285449,55 +286021,55 @@ ${lanes.join("\n")} } } function isLiteralComputedPropertyDeclarationName(node) { - return isStringOrNumericLiteralLike(node) && node.parent.kind === 166 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); + return isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ && isDeclaration(node.parent.parent); } function isIdentifierName(node) { const parent2 = node.parent; switch (parent2.kind) { - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 305 /* EnumMember */: - case 302 /* PropertyAssignment */: - case 210 /* PropertyAccessExpression */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 306 /* EnumMember */: + case 303 /* PropertyAssignment */: + case 211 /* PropertyAccessExpression */: return parent2.name === node; - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: return parent2.right === node; - case 207 /* BindingElement */: - case 275 /* ImportSpecifier */: + case 208 /* BindingElement */: + case 276 /* ImportSpecifier */: return parent2.propertyName === node; - case 280 /* ExportSpecifier */: - case 290 /* JsxAttribute */: - case 284 /* JsxSelfClosingElement */: - case 285 /* JsxOpeningElement */: - case 286 /* JsxClosingElement */: + case 281 /* ExportSpecifier */: + case 291 /* JsxAttribute */: + case 285 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 287 /* JsxClosingElement */: return true; } return false; } function isAliasSymbolDeclaration(node) { - if (node.kind === 270 /* ImportEqualsDeclaration */ || node.kind === 269 /* NamespaceExportDeclaration */ || node.kind === 272 /* ImportClause */ && !!node.name || node.kind === 273 /* NamespaceImport */ || node.kind === 279 /* NamespaceExport */ || node.kind === 275 /* ImportSpecifier */ || node.kind === 280 /* ExportSpecifier */ || node.kind === 276 /* ExportAssignment */ && exportAssignmentIsAlias(node)) { + if (node.kind === 271 /* ImportEqualsDeclaration */ || node.kind === 270 /* NamespaceExportDeclaration */ || node.kind === 273 /* ImportClause */ && !!node.name || node.kind === 274 /* NamespaceImport */ || node.kind === 280 /* NamespaceExport */ || node.kind === 276 /* ImportSpecifier */ || node.kind === 281 /* ExportSpecifier */ || node.kind === 277 /* ExportAssignment */ && exportAssignmentIsAlias(node)) { return true; } return isInJSFile(node) && (isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isPropertyAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */ && isAliasableExpression(node.parent.right)); } function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 272 /* ImportClause */: - case 275 /* ImportSpecifier */: - case 273 /* NamespaceImport */: - case 280 /* ExportSpecifier */: - case 276 /* ExportAssignment */: - case 270 /* ImportEqualsDeclaration */: - case 279 /* NamespaceExport */: + case 273 /* ImportClause */: + case 276 /* ImportSpecifier */: + case 274 /* NamespaceImport */: + case 281 /* ExportSpecifier */: + case 277 /* ExportAssignment */: + case 271 /* ImportEqualsDeclaration */: + case 280 /* NamespaceExport */: return node.parent; - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 165 /* QualifiedName */); + } while (node.parent.kind === 166 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -285512,7 +286084,7 @@ ${lanes.join("\n")} return isExportAssignment(node) ? node.expression : node.right; } function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 303 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 302 /* PropertyAssignment */ ? node.initializer : node.parent.right; + return node.kind === 304 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 303 /* PropertyAssignment */ ? node.initializer : node.parent.right; } function getEffectiveBaseTypeNode(node) { const baseType = getClassExtendsHeritageElement(node); @@ -285563,7 +286135,7 @@ ${lanes.join("\n")} return void 0; } function isKeyword(token) { - return 83 /* FirstKeyword */ <= token && token <= 164 /* LastKeyword */; + return 83 /* FirstKeyword */ <= token && token <= 165 /* LastKeyword */; } function isPunctuation(token) { return 19 /* FirstPunctuation */ <= token && token <= 79 /* LastPunctuation */; @@ -285572,7 +286144,7 @@ ${lanes.join("\n")} return isKeyword(token) || isPunctuation(token); } function isContextualKeyword(token) { - return 128 /* FirstContextualKeyword */ <= token && token <= 164 /* LastContextualKeyword */; + return 128 /* FirstContextualKeyword */ <= token && token <= 165 /* LastContextualKeyword */; } function isNonContextualKeyword(token) { return isKeyword(token) && !isContextualKeyword(token); @@ -285601,14 +286173,14 @@ ${lanes.join("\n")} } let flags = 0 /* Normal */; switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 173 /* MethodDeclaration */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 174 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } - case 218 /* ArrowFunction */: - if (hasSyntacticModifier(node, 512 /* Async */)) { + case 219 /* ArrowFunction */: + if (hasSyntacticModifier(node, 1024 /* Async */)) { flags |= 2 /* Async */; } break; @@ -285620,11 +286192,11 @@ ${lanes.join("\n")} } function isAsyncFunction(node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: - return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 512 /* Async */); + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 1024 /* Async */); } return false; } @@ -285639,7 +286211,7 @@ ${lanes.join("\n")} return !!name && isDynamicName(name); } function isDynamicName(name) { - if (!(name.kind === 166 /* ComputedPropertyName */ || name.kind === 211 /* ElementAccessExpression */)) { + if (!(name.kind === 167 /* ComputedPropertyName */ || name.kind === 212 /* ElementAccessExpression */)) { return false; } const expr = isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; @@ -285651,9 +286223,10 @@ ${lanes.join("\n")} case 81 /* PrivateIdentifier */: return name.escapedText; case 11 /* StringLiteral */: + case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: return escapeLeadingUnderscores(name.text); - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: const nameExpression = name.expression; if (isStringOrNumericLiteralLike(nameExpression)) { return escapeLeadingUnderscores(nameExpression.text); @@ -285664,7 +286237,7 @@ ${lanes.join("\n")} return nameExpression.operand.text; } return void 0; - case 294 /* JsxNamespacedName */: + case 295 /* JsxNamespacedName */: return getEscapedTextOfJsxNamespacedName(name); default: return Debug.assertNever(name); @@ -285708,13 +286281,17 @@ ${lanes.join("\n")} function isAnonymousFunctionDefinition(node, cb) { node = skipOuterExpressions(node); switch (node.kind) { - case 230 /* ClassExpression */: - case 217 /* FunctionExpression */: + case 231 /* ClassExpression */: + if (classHasDeclaredOrExplicitlyAssignedName(node)) { + return false; + } + break; + case 218 /* FunctionExpression */: if (node.name) { return false; } break; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: break; default: return false; @@ -285723,19 +286300,19 @@ ${lanes.join("\n")} } function isNamedEvaluationSource(node) { switch (node.kind) { - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return !isProtoSetter(node.name); - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return !!node.objectAssignmentInitializer; - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return isIdentifier(node.name) && !!node.initializer; - case 168 /* Parameter */: + case 169 /* Parameter */: return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; - case 207 /* BindingElement */: + case 208 /* BindingElement */: return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return !!node.initializer; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 77 /* AmpersandAmpersandEqualsToken */: @@ -285744,7 +286321,7 @@ ${lanes.join("\n")} return isIdentifier(node.left); } break; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return true; } return false; @@ -285753,18 +286330,18 @@ ${lanes.join("\n")} if (!isNamedEvaluationSource(node)) return false; switch (node.kind) { - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return isAnonymousFunctionDefinition(node.initializer, cb); - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return isAnonymousFunctionDefinition(node.objectAssignmentInitializer, cb); - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: - case 207 /* BindingElement */: - case 171 /* PropertyDeclaration */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: + case 208 /* BindingElement */: + case 172 /* PropertyDeclaration */: return isAnonymousFunctionDefinition(node.initializer, cb); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return isAnonymousFunctionDefinition(node.right, cb); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return isAnonymousFunctionDefinition(node.expression, cb); } } @@ -285773,17 +286350,17 @@ ${lanes.join("\n")} } function isParameterDeclaration(node) { const root = getRootDeclaration(node); - return root.kind === 168 /* Parameter */; + return root.kind === 169 /* Parameter */; } function getRootDeclaration(node) { - while (node.kind === 207 /* BindingElement */) { + while (node.kind === 208 /* BindingElement */) { node = node.parent.parent; } return node; } function nodeStartsNewLexicalEnvironment(node) { const kind = node.kind; - return kind === 175 /* Constructor */ || kind === 217 /* FunctionExpression */ || kind === 261 /* FunctionDeclaration */ || kind === 218 /* ArrowFunction */ || kind === 173 /* MethodDeclaration */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */ || kind === 266 /* ModuleDeclaration */ || kind === 311 /* SourceFile */; + return kind === 176 /* Constructor */ || kind === 218 /* FunctionExpression */ || kind === 262 /* FunctionDeclaration */ || kind === 219 /* ArrowFunction */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 267 /* ModuleDeclaration */ || kind === 312 /* SourceFile */; } function nodeIsSynthesized(range) { return positionIsSynthesized(range.pos) || positionIsSynthesized(range.end); @@ -285793,22 +286370,22 @@ ${lanes.join("\n")} } function getExpressionAssociativity(expression) { const operator = getOperator(expression); - const hasArguments = expression.kind === 213 /* NewExpression */ && expression.arguments !== void 0; + const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0; return getOperatorAssociativity(expression.kind, operator, hasArguments); } function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 213 /* NewExpression */: + case 214 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 223 /* PrefixUnaryExpression */: - case 220 /* TypeOfExpression */: - case 221 /* VoidExpression */: - case 219 /* DeleteExpression */: - case 222 /* AwaitExpression */: - case 226 /* ConditionalExpression */: - case 228 /* YieldExpression */: + case 224 /* PrefixUnaryExpression */: + case 221 /* TypeOfExpression */: + case 222 /* VoidExpression */: + case 220 /* DeleteExpression */: + case 223 /* AwaitExpression */: + case 227 /* ConditionalExpression */: + case 229 /* YieldExpression */: return 1 /* Right */; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: switch (operator) { case 43 /* AsteriskAsteriskToken */: case 64 /* EqualsToken */: @@ -285834,13 +286411,13 @@ ${lanes.join("\n")} } function getExpressionPrecedence(expression) { const operator = getOperator(expression); - const hasArguments = expression.kind === 213 /* NewExpression */ && expression.arguments !== void 0; + const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0; return getOperatorPrecedence(expression.kind, operator, hasArguments); } function getOperator(expression) { - if (expression.kind === 225 /* BinaryExpression */) { + if (expression.kind === 226 /* BinaryExpression */) { return expression.operatorToken.kind; - } else if (expression.kind === 223 /* PrefixUnaryExpression */ || expression.kind === 224 /* PostfixUnaryExpression */) { + } else if (expression.kind === 224 /* PrefixUnaryExpression */ || expression.kind === 225 /* PostfixUnaryExpression */) { return expression.operator; } else { return expression.kind; @@ -285848,15 +286425,15 @@ ${lanes.join("\n")} } function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 360 /* CommaListExpression */: + case 361 /* CommaListExpression */: return 0 /* Comma */; - case 229 /* SpreadElement */: + case 230 /* SpreadElement */: return 1 /* Spread */; - case 228 /* YieldExpression */: + case 229 /* YieldExpression */: return 2 /* Yield */; - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: return 4 /* Conditional */; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: switch (operatorKind) { case 28 /* CommaToken */: return 0 /* Comma */; @@ -285880,27 +286457,27 @@ ${lanes.join("\n")} default: return getBinaryOperatorPrecedence(operatorKind); } - case 215 /* TypeAssertionExpression */: - case 234 /* NonNullExpression */: - case 223 /* PrefixUnaryExpression */: - case 220 /* TypeOfExpression */: - case 221 /* VoidExpression */: - case 219 /* DeleteExpression */: - case 222 /* AwaitExpression */: + case 216 /* TypeAssertionExpression */: + case 235 /* NonNullExpression */: + case 224 /* PrefixUnaryExpression */: + case 221 /* TypeOfExpression */: + case 222 /* VoidExpression */: + case 220 /* DeleteExpression */: + case 223 /* AwaitExpression */: return 16 /* Unary */; - case 224 /* PostfixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return 17 /* Update */; - case 212 /* CallExpression */: + case 213 /* CallExpression */: return 18 /* LeftHandSide */; - case 213 /* NewExpression */: + case 214 /* NewExpression */: return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; - case 214 /* TaggedTemplateExpression */: - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: - case 235 /* MetaProperty */: + case 215 /* TaggedTemplateExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: + case 236 /* MetaProperty */: return 19 /* Member */; - case 233 /* AsExpression */: - case 237 /* SatisfiesExpression */: + case 234 /* AsExpression */: + case 238 /* SatisfiesExpression */: return 11 /* Relational */; case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: @@ -285912,19 +286489,19 @@ ${lanes.join("\n")} case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: case 11 /* StringLiteral */: - case 208 /* ArrayLiteralExpression */: - case 209 /* ObjectLiteralExpression */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 230 /* ClassExpression */: + case 209 /* ArrayLiteralExpression */: + case 210 /* ObjectLiteralExpression */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 231 /* ClassExpression */: case 14 /* RegularExpressionLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 227 /* TemplateExpression */: - case 216 /* ParenthesizedExpression */: - case 231 /* OmittedExpression */: - case 283 /* JsxElement */: - case 284 /* JsxSelfClosingElement */: - case 287 /* JsxFragment */: + case 228 /* TemplateExpression */: + case 217 /* ParenthesizedExpression */: + case 232 /* OmittedExpression */: + case 284 /* JsxElement */: + case 285 /* JsxSelfClosingElement */: + case 288 /* JsxFragment */: return 20 /* Primary */; default: return -1 /* Invalid */; @@ -285977,7 +286554,7 @@ ${lanes.join("\n")} function getSemanticJsxChildren(children) { return filter(children, (i) => { switch (i.kind) { - case 293 /* JsxExpression */: + case 294 /* JsxExpression */: return !!i.expression; case 12 /* JsxText */: return !i.containsOnlyTriviaWhiteSpaces; @@ -286050,8 +286627,11 @@ ${lanes.join("\n")} function escapeTemplateSubstitution(str) { return str.replace(templateSubstitutionRegExp, "\\${"); } + function containsInvalidEscapeFlag(node) { + return !!((node.templateFlags || 0) & 2048 /* ContainsInvalidEscape */); + } function hasInvalidEscape(template) { - return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags)); + return template && !!(isNoSubstitutionTemplateLiteral(template) ? containsInvalidEscapeFlag(template) : containsInvalidEscapeFlag(template.head) || some(template.templateSpans, (span) => containsInvalidEscapeFlag(span.literal))); } function encodeUtf16EscapeSequence(charCode) { const hexCharCode = charCode.toString(16).toUpperCase(); @@ -286102,7 +286682,7 @@ ${lanes.join("\n")} } function isIntrinsicJsxName(name) { const ch = name.charCodeAt(0); - return ch >= 97 /* a */ && ch <= 122 /* z */ || stringContains(name, "-"); + return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-"); } function getIndentString(level) { const singleLevel = indentStrings[1]; @@ -286114,12 +286694,9 @@ ${lanes.join("\n")} function getIndentSize() { return indentStrings[1].length; } - function isNightly() { - return stringContains(version, "-dev") || stringContains(version, "-insiders"); - } function createTextWriter(newLine) { var output; - var indent2; + var indent3; var lineStart; var lineCount; var linePos; @@ -286137,7 +286714,7 @@ ${lanes.join("\n")} function writeText(s) { if (s && s.length) { if (lineStart) { - s = getIndentString(indent2) + s; + s = getIndentString(indent3) + s; lineStart = false; } output += s; @@ -286156,7 +286733,7 @@ ${lanes.join("\n")} } function reset2() { output = ""; - indent2 = 0; + indent3 = 0; lineStart = true; lineCount = 0; linePos = 0; @@ -286193,15 +286770,15 @@ ${lanes.join("\n")} writeLiteral, writeLine, increaseIndent: () => { - indent2++; + indent3++; }, decreaseIndent: () => { - indent2--; + indent3--; }, - getIndent: () => indent2, + getIndent: () => indent3, getTextPos: () => output.length, getLine: () => lineCount, - getColumn: () => lineStart ? indent2 * getIndentSize() : output.length - linePos, + getColumn: () => lineStart ? indent3 * getIndentSize() : output.length - linePos, getText: () => output, isAtStartOfLine: () => lineStart, hasTrailingComment: () => hasTrailingComment, @@ -286305,7 +286882,7 @@ ${lanes.join("\n")} return void 0; } const specifier = getExternalModuleName(declaration); - if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).indexOf(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory()))) === -1) { + if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) { return void 0; } return getResolvedExternalModuleName(host, file); @@ -286381,7 +286958,31 @@ ${lanes.join("\n")} } function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) { const options = host.getCompilerOptions(); - return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) && !sourceFile.isDeclarationFile && !host.isSourceFileFromExternalLibrary(sourceFile) && (forceDtsEmit || !(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) && !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName)); + if (options.noEmitForJsFiles && isSourceFileJS(sourceFile)) + return false; + if (sourceFile.isDeclarationFile) + return false; + if (host.isSourceFileFromExternalLibrary(sourceFile)) + return false; + if (forceDtsEmit) + return true; + if (host.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) + return false; + if (!isJsonSourceFile(sourceFile)) + return true; + if (host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) + return false; + if (outFile(options)) + return true; + if (!options.outDir) + return false; + if (options.rootDir || options.composite && options.configFilePath) { + const commonDir = getNormalizedAbsolutePath(getCommonSourceDirectory(options, () => [], host.getCurrentDirectory(), host.getCanonicalFileName), host.getCurrentDirectory()); + const outputPath = getSourceFilePathInNewDirWorker(sourceFile.fileName, options.outDir, host.getCurrentDirectory(), commonDir, host.getCanonicalFileName); + if (comparePaths(sourceFile.fileName, outputPath, host.getCurrentDirectory(), !host.useCaseSensitiveFileNames()) === 0 /* EqualTo */) + return false; + } + return true; } function getSourceFilePathInNewDir(fileName, host, newDirPath) { return getSourceFilePathInNewDirWorker(fileName, newDirPath, host.getCurrentDirectory(), host.getCommonSourceDirectory(), (f) => host.getCanonicalFileName(f)); @@ -286393,9 +286994,16 @@ ${lanes.join("\n")} return combinePaths(newDirPath, sourceFilePath); } function writeFile(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) { - host.writeFile(fileName, text, writeByteOrderMark, (hostErrorMessage) => { - diagnostics.add(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); - }, sourceFiles, data); + host.writeFile( + fileName, + text, + writeByteOrderMark, + (hostErrorMessage) => { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + }, + sourceFiles, + data + ); } function ensureDirectoriesExist(directoryPath, createDirectory, directoryExists) { if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { @@ -286446,6 +287054,12 @@ ${lanes.join("\n")} function isThisIdentifier(node) { return !!node && node.kind === 80 /* Identifier */ && identifierIsThisKeyword(node); } + function isInTypeQuery(node) { + return !!findAncestor( + node, + (n) => n.kind === 186 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 166 /* QualifiedName */ ? false : "quit" + ); + } function isThisInTypeQuery(node) { if (!isThisIdentifier(node)) { return false; @@ -286453,7 +287067,7 @@ ${lanes.join("\n")} while (isQualifiedName(node.parent) && node.parent.left === node) { node = node.parent; } - return node.parent.kind === 185 /* TypeQuery */; + return node.parent.kind === 186 /* TypeQuery */; } function identifierIsThisKeyword(id) { return id.escapedText === "this"; @@ -286465,9 +287079,9 @@ ${lanes.join("\n")} let setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 176 /* GetAccessor */) { + if (accessor.kind === 177 /* GetAccessor */) { getAccessor = accessor; - } else if (accessor.kind === 177 /* SetAccessor */) { + } else if (accessor.kind === 178 /* SetAccessor */) { setAccessor = accessor; } else { Debug.fail("Accessor has wrong kind"); @@ -286483,10 +287097,10 @@ ${lanes.join("\n")} } else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 176 /* GetAccessor */ && !getAccessor) { + if (member.kind === 177 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 177 /* SetAccessor */ && !setAccessor) { + if (member.kind === 178 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -286518,7 +287132,7 @@ ${lanes.join("\n")} return flatMap(getJSDocTags(node), (tag) => isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0); } function isNonTypeAliasTemplate(tag) { - return isJSDocTemplateTag(tag) && !(tag.parent.kind === 326 /* JSDoc */ && (tag.parent.tags.some(isJSDocTypeAlias) || tag.parent.tags.some(isJSDocOverloadTag))); + return isJSDocTemplateTag(tag) && !(tag.parent.kind === 327 /* JSDoc */ && (tag.parent.tags.some(isJSDocTypeAlias) || tag.parent.tags.some(isJSDocOverloadTag))); } function getEffectiveSetAccessorTypeAnnotationNode(node) { const parameter = getSetAccessorValueParameter(node); @@ -286644,7 +287258,7 @@ ${lanes.join("\n")} } function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) { const end = Math.min(commentEnd, nextLineStart - 1); - const currentLineText = trimString(text.substring(pos, end)); + const currentLineText = text.substring(pos, end).trim(); if (currentLineText) { writer.writeComment(currentLineText); if (end !== commentEnd) { @@ -286681,25 +287295,25 @@ ${lanes.join("\n")} return isClassElement(node) && hasStaticModifier(node) || isClassStaticBlockDeclaration(node); } function hasStaticModifier(node) { - return hasSyntacticModifier(node, 32 /* Static */); + return hasSyntacticModifier(node, 256 /* Static */); } function hasOverrideModifier(node) { - return hasEffectiveModifier(node, 16384 /* Override */); + return hasEffectiveModifier(node, 16 /* Override */); } function hasAbstractModifier(node) { - return hasSyntacticModifier(node, 256 /* Abstract */); + return hasSyntacticModifier(node, 64 /* Abstract */); } function hasAmbientModifier(node) { - return hasSyntacticModifier(node, 2 /* Ambient */); + return hasSyntacticModifier(node, 128 /* Ambient */); } function hasAccessorModifier(node) { - return hasSyntacticModifier(node, 128 /* Accessor */); + return hasSyntacticModifier(node, 512 /* Accessor */); } function hasEffectiveReadonlyModifier(node) { - return hasEffectiveModifier(node, 64 /* Readonly */); + return hasEffectiveModifier(node, 8 /* Readonly */); } function hasDecorators(node) { - return hasSyntacticModifier(node, 131072 /* Decorator */); + return hasSyntacticModifier(node, 32768 /* Decorator */); } function getSelectedEffectiveModifierFlags(node, flags) { return getEffectiveModifierFlags(node) & flags; @@ -286708,16 +287322,19 @@ ${lanes.join("\n")} return getSyntacticModifierFlags(node) & flags; } function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 164 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 165 /* LastToken */) { return 0 /* None */; } if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912 /* HasComputedFlags */; } - if (includeJSDoc && !(node.modifierFlagsCache & 4096 /* HasComputedJSDocModifiers */) && (alwaysIncludeJSDoc || isInJSFile(node)) && node.parent) { - node.modifierFlagsCache |= getJSDocModifierFlagsNoCache(node) | 4096 /* HasComputedJSDocModifiers */; + if (alwaysIncludeJSDoc || includeJSDoc && isInJSFile(node)) { + if (!(node.modifierFlagsCache & 268435456 /* HasComputedJSDocModifiers */) && node.parent) { + node.modifierFlagsCache |= getRawJSDocModifierFlagsNoCache(node) | 268435456 /* HasComputedJSDocModifiers */; + } + return selectEffectiveModifierFlags(node.modifierFlagsCache); } - return node.modifierFlagsCache & ~(536870912 /* HasComputedFlags */ | 4096 /* HasComputedJSDocModifiers */); + return selectSyntacticModifierFlags(node.modifierFlagsCache); } function getEffectiveModifierFlags(node) { return getModifierFlagsWorker( @@ -286742,33 +287359,42 @@ ${lanes.join("\n")} false ); } - function getJSDocModifierFlagsNoCache(node) { + function getRawJSDocModifierFlagsNoCache(node) { let flags = 0 /* None */; if (!!node.parent && !isParameter(node)) { if (isInJSFile(node)) { if (getJSDocPublicTagNoCache(node)) - flags |= 4 /* Public */; + flags |= 8388608 /* JSDocPublic */; if (getJSDocPrivateTagNoCache(node)) - flags |= 8 /* Private */; + flags |= 16777216 /* JSDocPrivate */; if (getJSDocProtectedTagNoCache(node)) - flags |= 16 /* Protected */; + flags |= 33554432 /* JSDocProtected */; if (getJSDocReadonlyTagNoCache(node)) - flags |= 64 /* Readonly */; + flags |= 67108864 /* JSDocReadonly */; if (getJSDocOverrideTagNoCache(node)) - flags |= 16384 /* Override */; + flags |= 134217728 /* JSDocOverride */; } if (getJSDocDeprecatedTagNoCache(node)) - flags |= 8192 /* Deprecated */; + flags |= 65536 /* Deprecated */; } return flags; } + function selectSyntacticModifierFlags(flags) { + return flags & 65535 /* SyntacticModifiers */; + } + function selectEffectiveModifierFlags(flags) { + return flags & 131071 /* NonCacheOnlyModifiers */ | (flags & 260046848 /* JSDocCacheOnlyModifiers */) >>> 23; + } + function getJSDocModifierFlagsNoCache(node) { + return selectEffectiveModifierFlags(getRawJSDocModifierFlagsNoCache(node)); + } function getEffectiveModifierFlagsNoCache(node) { return getSyntacticModifierFlagsNoCache(node) | getJSDocModifierFlagsNoCache(node); } function getSyntacticModifierFlagsNoCache(node) { let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */; - if (node.flags & 4 /* NestedNamespace */ || node.kind === 80 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { - flags |= 1 /* Export */; + if (node.flags & 8 /* NestedNamespace */ || node.kind === 80 /* Identifier */ && node.flags & 4096 /* IdentifierIsInJSDocNamespace */) { + flags |= 32 /* Export */; } return flags; } @@ -286784,37 +287410,37 @@ ${lanes.join("\n")} function modifierToFlag(token) { switch (token) { case 126 /* StaticKeyword */: - return 32 /* Static */; + return 256 /* Static */; case 125 /* PublicKeyword */: - return 4 /* Public */; + return 1 /* Public */; case 124 /* ProtectedKeyword */: - return 16 /* Protected */; + return 4 /* Protected */; case 123 /* PrivateKeyword */: - return 8 /* Private */; + return 2 /* Private */; case 128 /* AbstractKeyword */: - return 256 /* Abstract */; + return 64 /* Abstract */; case 129 /* AccessorKeyword */: - return 128 /* Accessor */; + return 512 /* Accessor */; case 95 /* ExportKeyword */: - return 1 /* Export */; + return 32 /* Export */; case 138 /* DeclareKeyword */: - return 2 /* Ambient */; + return 128 /* Ambient */; case 87 /* ConstKeyword */: - return 2048 /* Const */; + return 4096 /* Const */; case 90 /* DefaultKeyword */: - return 1024 /* Default */; + return 2048 /* Default */; case 134 /* AsyncKeyword */: - return 512 /* Async */; + return 1024 /* Async */; case 148 /* ReadonlyKeyword */: - return 64 /* Readonly */; - case 163 /* OverrideKeyword */: - return 16384 /* Override */; + return 8 /* Readonly */; + case 164 /* OverrideKeyword */: + return 16 /* Override */; case 103 /* InKeyword */: - return 32768 /* In */; + return 8192 /* In */; case 147 /* OutKeyword */: - return 65536 /* Out */; - case 169 /* Decorator */: - return 131072 /* Decorator */; + return 16384 /* Out */; + case 170 /* Decorator */: + return 32768 /* Decorator */; } return 0 /* None */; } @@ -286870,7 +287496,7 @@ ${lanes.join("\n")} true )) { const kind = node.left.kind; - return kind === 209 /* ObjectLiteralExpression */ || kind === 208 /* ArrayLiteralExpression */; + return kind === 210 /* ObjectLiteralExpression */ || kind === 209 /* ArrayLiteralExpression */; } return false; } @@ -286884,12 +287510,12 @@ ${lanes.join("\n")} switch (node.kind) { case 80 /* Identifier */: return node; - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: do { node = node.left; } while (node.kind !== 80 /* Identifier */); return node; - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 80 /* Identifier */); @@ -286897,7 +287523,7 @@ ${lanes.join("\n")} } } function isDottedName(node) { - return node.kind === 80 /* Identifier */ || node.kind === 110 /* ThisKeyword */ || node.kind === 108 /* SuperKeyword */ || node.kind === 235 /* MetaProperty */ || node.kind === 210 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 216 /* ParenthesizedExpression */ && isDottedName(node.expression); + return node.kind === 80 /* Identifier */ || node.kind === 110 /* ThisKeyword */ || node.kind === 108 /* SuperKeyword */ || node.kind === 236 /* MetaProperty */ || node.kind === 211 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 217 /* ParenthesizedExpression */ && isDottedName(node.expression); } function isPropertyAccessEntityNameExpression(node) { return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression); @@ -286924,19 +287550,25 @@ ${lanes.join("\n")} return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype"; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return node.parent.kind === 165 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 210 /* PropertyAccessExpression */ && node.parent.name === node; + return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 236 /* MetaProperty */ && node.parent.name === node; } function isRightSideOfAccessExpression(node) { - return isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node; + return !!node.parent && (isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node); } function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) { return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node; } + function isInstanceOfExpression(node) { + return isBinaryExpression(node) && node.operatorToken.kind === 104 /* InstanceOfKeyword */; + } + function isRightSideOfInstanceofExpression(node) { + return isInstanceOfExpression(node.parent) && node === node.parent.right; + } function isEmptyObjectLiteral(expression) { - return expression.kind === 209 /* ObjectLiteralExpression */ && expression.properties.length === 0; + return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0; } function isEmptyArrayLiteral(expression) { - return expression.kind === 208 /* ArrayLiteralExpression */ && expression.elements.length === 0; + return expression.kind === 209 /* ArrayLiteralExpression */ && expression.elements.length === 0; } function getLocalSymbolForExportDefault(symbol) { if (!isExportDefaultSymbol(symbol) || !symbol.declarations) @@ -286948,7 +287580,7 @@ ${lanes.join("\n")} return void 0; } function isExportDefaultSymbol(symbol) { - return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0], 1024 /* Default */); + return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0], 2048 /* Default */); } function tryExtractTSExtension(fileName) { return find(supportedTSExtensionsForExtractExtension, (extension) => fileExtensionIs(fileName, extension)); @@ -287070,6 +287702,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); } @@ -287202,8 +287841,8 @@ ${lanes.join("\n")} const parseNode = getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 265 /* EnumDeclaration */: - case 266 /* ModuleDeclaration */: + case 266 /* EnumDeclaration */: + case 267 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -287228,16 +287867,16 @@ ${lanes.join("\n")} if (s.valueDeclaration) { const declaration = isWrite && s.declarations && find(s.declarations, isSetAccessorDeclaration) || s.flags & 32768 /* GetAccessor */ && find(s.declarations, isGetAccessorDeclaration) || s.valueDeclaration; const flags = getCombinedModifierFlags(declaration); - return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~28 /* AccessibilityModifier */; + return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~7 /* AccessibilityModifier */; } if (getCheckFlags(s) & 6 /* Synthetic */) { const checkFlags = s.links.checkFlags; - const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 8 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 4 /* Public */ : 16 /* Protected */; - const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 32 /* Static */ : 0; + const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 2 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 1 /* Public */ : 4 /* Protected */; + const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 256 /* Static */ : 0; return accessModifier | staticModifier; } if (s.flags & 4194304 /* Prototype */) { - return 4 /* Public */ | 32 /* Static */; + return 1 /* Public */ | 256 /* Static */; } return 0; } @@ -287256,24 +287895,24 @@ ${lanes.join("\n")} function accessKind(node) { const { parent: parent2 } = node; switch (parent2 == null ? void 0 : parent2.kind) { - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return accessKind(parent2); - case 224 /* PostfixUnaryExpression */: - case 223 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: const { operator } = parent2; return operator === 46 /* PlusPlusToken */ || operator === 47 /* MinusMinusToken */ ? 2 /* ReadWrite */ : 0 /* Read */; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: const { left, operatorToken } = parent2; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 64 /* EqualsToken */ ? 1 /* Write */ : 2 /* ReadWrite */ : 0 /* Read */; - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return parent2.name !== node ? 0 /* Read */ : accessKind(parent2); - case 302 /* PropertyAssignment */: { + case 303 /* PropertyAssignment */: { const parentAccess = accessKind(parent2.parent); return node === parent2.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return accessKind(parent2); default: return 0 /* Read */; @@ -287315,19 +287954,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)); } @@ -287336,7 +287975,7 @@ ${lanes.join("\n")} function isAbstractConstructorSymbol(symbol) { if (symbol.flags & 32 /* Class */) { const declaration = getClassLikeDeclarationOfSymbol(symbol); - return !!declaration && hasSyntacticModifier(declaration, 256 /* Abstract */); + return !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */); } return false; } @@ -287345,7 +287984,7 @@ ${lanes.join("\n")} return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike); } function getObjectFlags(type) { - return type.flags & 138117121 /* ObjectFlagsType */ ? type.objectFlags : 0; + return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0; } function forSomeAncestorDirectory(directory, callback) { return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0); @@ -287358,21 +287997,17 @@ ${lanes.join("\n")} } function getLastChild(node) { let lastChild; - forEachChild( - node, - (child) => { - if (nodeIsPresent(child)) - lastChild = child; - }, - (children) => { - for (let i = children.length - 1; i >= 0; i--) { - if (nodeIsPresent(children[i])) { - lastChild = children[i]; - break; - } + forEachChild(node, (child) => { + if (nodeIsPresent(child)) + lastChild = child; + }, (children) => { + for (let i = children.length - 1; i >= 0; i--) { + if (nodeIsPresent(children[i])) { + lastChild = children[i]; + break; } } - ); + }); return lastChild; } function addToSeen(seen, key, value = true) { @@ -287386,16 +288021,16 @@ ${lanes.join("\n")} return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node); } function isTypeNodeKind(kind) { - return kind >= 181 /* FirstTypeNode */ && kind <= 204 /* LastTypeNode */ || kind === 133 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 150 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 151 /* ObjectKeyword */ || kind === 136 /* BooleanKeyword */ || kind === 154 /* StringKeyword */ || kind === 155 /* SymbolKeyword */ || kind === 116 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 146 /* NeverKeyword */ || kind === 141 /* IntrinsicKeyword */ || kind === 232 /* ExpressionWithTypeArguments */ || kind === 318 /* JSDocAllType */ || kind === 319 /* JSDocUnknownType */ || kind === 320 /* JSDocNullableType */ || kind === 321 /* JSDocNonNullableType */ || kind === 322 /* JSDocOptionalType */ || kind === 323 /* JSDocFunctionType */ || kind === 324 /* JSDocVariadicType */; + return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 133 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 150 /* NumberKeyword */ || kind === 163 /* BigIntKeyword */ || kind === 151 /* ObjectKeyword */ || kind === 136 /* BooleanKeyword */ || kind === 154 /* StringKeyword */ || kind === 155 /* SymbolKeyword */ || kind === 116 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 146 /* NeverKeyword */ || kind === 141 /* IntrinsicKeyword */ || kind === 233 /* ExpressionWithTypeArguments */ || kind === 319 /* JSDocAllType */ || kind === 320 /* JSDocUnknownType */ || kind === 321 /* JSDocNullableType */ || kind === 322 /* JSDocNonNullableType */ || kind === 323 /* JSDocOptionalType */ || kind === 324 /* JSDocFunctionType */ || kind === 325 /* JSDocVariadicType */; } function isAccessExpression(node) { - return node.kind === 210 /* PropertyAccessExpression */ || node.kind === 211 /* ElementAccessExpression */; + return node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */; } function getNameOfAccessExpression(node) { - if (node.kind === 210 /* PropertyAccessExpression */) { + if (node.kind === 211 /* PropertyAccessExpression */) { return node.name; } - Debug.assert(node.kind === 211 /* ElementAccessExpression */); + Debug.assert(node.kind === 212 /* ElementAccessExpression */); return node.argumentExpression; } function isBundleFileTextLike(section) { @@ -287408,7 +288043,7 @@ ${lanes.join("\n")} } } function isNamedImportsOrExports(node) { - return node.kind === 274 /* NamedImports */ || node.kind === 278 /* NamedExports */; + return node.kind === 275 /* NamedImports */ || node.kind === 279 /* NamedExports */; } function getLeftmostAccessExpression(expr) { while (isAccessExpression(expr)) { @@ -287421,12 +288056,12 @@ ${lanes.join("\n")} return walkAccessExpression(name.parent); } function walkAccessExpression(access) { - if (access.kind === 210 /* PropertyAccessExpression */) { + if (access.kind === 211 /* PropertyAccessExpression */) { const res = action(access.name); if (res !== void 0) { return res; } - } else if (access.kind === 211 /* ElementAccessExpression */) { + } else if (access.kind === 212 /* ElementAccessExpression */) { if (isIdentifier(access.argumentExpression) || isStringLiteralLike(access.argumentExpression)) { const res = action(access.argumentExpression); if (res !== void 0) { @@ -287448,28 +288083,28 @@ ${lanes.join("\n")} function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 224 /* PostfixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: node = node.operand; continue; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: node = node.left; continue; - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: node = node.condition; continue; - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: node = node.tag; continue; - case 212 /* CallExpression */: + case 213 /* CallExpression */: if (stopAtCallExpressions) { return node; } - case 233 /* AsExpression */: - case 211 /* ElementAccessExpression */: - case 210 /* PropertyAccessExpression */: - case 234 /* NonNullExpression */: - case 359 /* PartiallyEmittedExpression */: - case 237 /* SatisfiesExpression */: + case 234 /* AsExpression */: + case 212 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 235 /* NonNullExpression */: + case 360 /* PartiallyEmittedExpression */: + case 238 /* SatisfiesExpression */: node = node.expression; continue; } @@ -287489,7 +288124,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) { @@ -287550,8 +288185,8 @@ ${lanes.join("\n")} Object.assign(objectAllocator, alloc); forEach(objectAllocatorPatchers, (fn) => fn(objectAllocator)); } - function formatStringFromArgs(text, args, baseIndex = 0) { - return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index + baseIndex])); + function formatStringFromArgs(text, args) { + return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index])); } function setLocalizedDiagnosticMessages(messages) { localizedDiagnosticMessages = messages; @@ -287564,16 +288199,14 @@ ${lanes.join("\n")} function getLocaleSpecificMessage(message) { return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message; } - function createDetachedDiagnostic(fileName, start, length2, message) { - assertDiagnosticLocation( - /*file*/ - void 0, - start, - length2 - ); + function createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args) { + if (start + length2 > sourceText.length) { + length2 = sourceText.length - start; + } + assertDiagnosticLocation(sourceText, start, length2); let text = getLocaleSpecificMessage(message); - if (arguments.length > 4) { - text = formatStringFromArgs(text, arguments, 4); + if (some(args)) { + text = formatStringFromArgs(text, args); } return { file: void 0, @@ -287625,11 +288258,11 @@ ${lanes.join("\n")} } return diagnosticsWithLocation; } - function createFileDiagnostic(file, start, length2, message) { - assertDiagnosticLocation(file, start, length2); + function createFileDiagnostic(file, start, length2, message, ...args) { + assertDiagnosticLocation(file.text, start, length2); let text = getLocaleSpecificMessage(message); - if (arguments.length > 4) { - text = formatStringFromArgs(text, arguments, 4); + if (some(args)) { + text = formatStringFromArgs(text, args); } return { file, @@ -287642,17 +288275,17 @@ ${lanes.join("\n")} reportsDeprecated: message.reportsDeprecated }; } - function formatMessage(_dummy, message) { + function formatMessage(message, ...args) { let text = getLocaleSpecificMessage(message); - if (arguments.length > 2) { - text = formatStringFromArgs(text, arguments, 2); + if (some(args)) { + text = formatStringFromArgs(text, args); } return text; } - function createCompilerDiagnostic(message) { + function createCompilerDiagnostic(message, ...args) { let text = getLocaleSpecificMessage(message); - if (arguments.length > 1) { - text = formatStringFromArgs(text, arguments, 1); + if (some(args)) { + text = formatStringFromArgs(text, args); } return { file: void 0, @@ -287676,10 +288309,10 @@ ${lanes.join("\n")} relatedInformation }; } - function chainDiagnosticMessages(details, message) { + function chainDiagnosticMessages(details, message, ...args) { let text = getLocaleSpecificMessage(message); - if (arguments.length > 2) { - text = formatStringFromArgs(text, arguments, 2); + if (some(args)) { + text = formatStringFromArgs(text, args); } return { messageText: text, @@ -287786,55 +288419,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; @@ -287845,87 +288443,14 @@ ${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 */; } function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { return optionsHaveChanges(oldOptions, newOptions, semanticDiagnosticsOptionDeclarations); @@ -287937,7 +288462,7 @@ ${lanes.join("\n")} return optionsHaveChanges(oldOptions, newOptions, affectsDeclarationPathOptionDeclarations); } function getCompilerOptionValue(options, option) { - return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name]; + return option.strictFlag ? getStrictOptionValue(options, option.name) : option.allowJsFlag ? getAllowJSCompilerOption(options) : options[option.name]; } function getJSXTransformEnabled(options) { const jsx = options.jsx; @@ -287979,19 +288504,16 @@ ${lanes.join("\n")} if (!containsIgnoredPath(symlinkPath)) { symlinkPath = ensureTrailingDirectorySeparator(symlinkPath); if (real !== false && !(symlinkedDirectories == null ? void 0 : symlinkedDirectories.has(symlinkPath))) { - (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(ensureTrailingDirectorySeparator(real.realPath), symlink); + (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(real.realPath, symlink); } (symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real); } }, - setSymlinksFromResolutions(files, typeReferenceDirectives) { - var _a, _b; + setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) { Debug.assert(!hasProcessedResolutions); hasProcessedResolutions = true; - for (const file of files) { - (_a = file.resolvedModules) == null ? void 0 : _a.forEach((resolution) => processResolution(this, resolution.resolvedModule)); - (_b = file.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _b.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)); - } + forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule)); + forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)); typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)); }, hasProcessedResolutions: () => hasProcessedResolutions @@ -288005,7 +288527,10 @@ ${lanes.join("\n")} if (commonResolved && commonOriginal) { cache.setSymlinkedDirectory( commonOriginal, - { real: commonResolved, realPath: toPath(commonResolved, cwd, getCanonicalFileName) } + { + real: ensureTrailingDirectorySeparator(commonResolved), + realPath: ensureTrailingDirectorySeparator(toPath(commonResolved, cwd, getCanonicalFileName)) + } ); } } @@ -288059,7 +288584,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); @@ -288112,7 +288637,7 @@ ${lanes.join("\n")} function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; } - function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) { + function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) { path = normalizePath(path); currentDirectory = normalizePath(currentDirectory); const absolutePath = combinePaths(currentDirectory, path); @@ -288121,22 +288646,22 @@ ${lanes.join("\n")} includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), - basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames) + basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames2) }; } - function getRegexFromPattern(pattern, useCaseSensitiveFileNames) { - return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i"); + function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) { + return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i"); } - function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) { + function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) { path = normalizePath(path); currentDirectory = normalizePath(currentDirectory); - const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); - const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames)); - const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames); - const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames); + const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory); + const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames2)); + const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2); + const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames2); const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]]; const visited = /* @__PURE__ */ new Map(); - const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames); + const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames2); for (const basePath of patterns.basePaths) { visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth); } @@ -288178,7 +288703,7 @@ ${lanes.join("\n")} } } } - function getBasePaths(path, includes, useCaseSensitiveFileNames) { + function getBasePaths(path, includes, useCaseSensitiveFileNames2) { const basePaths = [path]; if (includes) { const includeBasePaths = []; @@ -288186,9 +288711,9 @@ ${lanes.join("\n")} const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include)); includeBasePaths.push(getIncludeBasePath(absolute)); } - includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames)); + includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2)); for (const includeBasePath of includeBasePaths) { - if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames))) { + if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames2))) { basePaths.push(includeBasePath); } } @@ -288235,7 +288760,7 @@ ${lanes.join("\n")} const flatBuiltins = flatten(builtins); const extensions = [ ...builtins, - ...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.indexOf(x.extension) === -1 ? [x.extension] : void 0) + ...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0) ]; return extensions; } @@ -288261,7 +288786,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 */; } @@ -288279,16 +288806,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; } } @@ -288547,39 +289077,39 @@ ${lanes.join("\n")} return success && result === 10 /* BigIntLiteral */ && scanner2.getTokenEnd() === s.length + 1 && !(flags & 512 /* ContainsSeparator */) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner2.getTokenValue()) })); } function isValidTypeOnlyAliasUseSite(useSite) { - return !!(useSite.flags & 16777216 /* Ambient */) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite)); + return !!(useSite.flags & 33554432 /* Ambient */) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite)); } function isShorthandPropertyNameUseSite(useSite) { return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite; } function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 80 /* Identifier */ || node.kind === 210 /* PropertyAccessExpression */) { + while (node.kind === 80 /* Identifier */ || node.kind === 211 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 166 /* ComputedPropertyName */) { + if (node.kind !== 167 /* ComputedPropertyName */) { return false; } - if (hasSyntacticModifier(node.parent, 256 /* Abstract */)) { + if (hasSyntacticModifier(node.parent, 64 /* Abstract */)) { return true; } const containerKind = node.parent.parent.kind; - return containerKind === 263 /* InterfaceDeclaration */ || containerKind === 186 /* TypeLiteral */; + return containerKind === 264 /* InterfaceDeclaration */ || containerKind === 187 /* TypeLiteral */; } function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 80 /* Identifier */) return false; const heritageClause = findAncestor(node.parent, (parent2) => { switch (parent2.kind) { - case 297 /* HeritageClause */: + case 298 /* HeritageClause */: return true; - case 210 /* PropertyAccessExpression */: - case 232 /* ExpressionWithTypeArguments */: + case 211 /* PropertyAccessExpression */: + case 233 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause == null ? void 0 : heritageClause.token) === 119 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 263 /* InterfaceDeclaration */; + return (heritageClause == null ? void 0 : heritageClause.token) === 119 /* ImplementsKeyword */ || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 264 /* InterfaceDeclaration */; } function isIdentifierTypeReference(node) { return isTypeReferenceNode(node) && isIdentifier(node.typeName); @@ -288685,26 +289215,26 @@ ${lanes.join("\n")} } } function containsIgnoredPath(path) { - return some(ignoredPaths, (p) => stringContains(path, p)); + return some(ignoredPaths, (p) => path.includes(p)); } function getContainingNodeArray(node) { if (!node.parent) return void 0; switch (node.kind) { - case 167 /* TypeParameter */: + case 168 /* TypeParameter */: const { parent: parent3 } = node; - return parent3.kind === 194 /* InferType */ ? void 0 : parent3.typeParameters; - case 168 /* Parameter */: + return parent3.kind === 195 /* InferType */ ? void 0 : parent3.typeParameters; + case 169 /* Parameter */: return node.parent.parameters; - case 203 /* TemplateLiteralTypeSpan */: + case 204 /* TemplateLiteralTypeSpan */: return node.parent.templateSpans; - case 238 /* TemplateSpan */: + case 239 /* TemplateSpan */: return node.parent.templateSpans; - case 169 /* Decorator */: { + case 170 /* Decorator */: { const { parent: parent4 } = node; return canHaveDecorators(parent4) ? parent4.modifiers : void 0; } - case 297 /* HeritageClause */: + case 298 /* HeritageClause */: return node.parent.heritageClauses; } const { parent: parent2 } = node; @@ -288712,43 +289242,43 @@ ${lanes.join("\n")} return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags; } switch (parent2.kind) { - case 186 /* TypeLiteral */: - case 263 /* InterfaceDeclaration */: + case 187 /* TypeLiteral */: + case 264 /* InterfaceDeclaration */: return isTypeElement(node) ? parent2.members : void 0; - case 191 /* UnionType */: - case 192 /* IntersectionType */: + case 192 /* UnionType */: + case 193 /* IntersectionType */: return parent2.types; - case 188 /* TupleType */: - case 208 /* ArrayLiteralExpression */: - case 360 /* CommaListExpression */: - case 274 /* NamedImports */: - case 278 /* NamedExports */: + case 189 /* TupleType */: + case 209 /* ArrayLiteralExpression */: + case 361 /* CommaListExpression */: + case 275 /* NamedImports */: + case 279 /* NamedExports */: return parent2.elements; - case 209 /* ObjectLiteralExpression */: - case 291 /* JsxAttributes */: + case 210 /* ObjectLiteralExpression */: + case 292 /* JsxAttributes */: return parent2.properties; - case 212 /* CallExpression */: - case 213 /* NewExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: return isTypeNode(node) ? parent2.typeArguments : parent2.expression === node ? void 0 : parent2.arguments; - case 283 /* JsxElement */: - case 287 /* JsxFragment */: + case 284 /* JsxElement */: + case 288 /* JsxFragment */: return isJsxChild(node) ? parent2.children : void 0; - case 285 /* JsxOpeningElement */: - case 284 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 285 /* JsxSelfClosingElement */: return isTypeNode(node) ? parent2.typeArguments : void 0; - case 240 /* Block */: - case 295 /* CaseClause */: - case 296 /* DefaultClause */: - case 267 /* ModuleBlock */: + case 241 /* Block */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: + case 268 /* ModuleBlock */: return parent2.statements; - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: return parent2.clauses; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: return isClassElement(node) ? parent2.members : void 0; - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: return isEnumMember(node) ? parent2.members : void 0; - case 311 /* SourceFile */: + case 312 /* SourceFile */: return parent2.statements; } } @@ -288757,7 +289287,7 @@ ${lanes.join("\n")} if (some(node.parameters, (p) => !getEffectiveTypeAnnotationNode(p))) { return true; } - if (node.kind !== 218 /* ArrowFunction */) { + if (node.kind !== 219 /* ArrowFunction */) { const parameter = firstOrUndefined(node.parameters); if (!(parameter && parameterIsThisKeyword(parameter))) { return true; @@ -288770,14 +289300,10 @@ ${lanes.join("\n")} return name === "Infinity" || name === "-Infinity" || name === "NaN"; } function isCatchClauseVariableDeclaration(node) { - return node.kind === 259 /* VariableDeclaration */ && node.parent.kind === 298 /* CatchClause */; - } - function isParameterOrCatchClauseVariable(symbol) { - const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration); - return !!declaration && (isParameter(declaration) || isCatchClauseVariableDeclaration(declaration)); + return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 217 /* FunctionExpression */ || node.kind === 218 /* ArrowFunction */; + return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */; } function escapeSnippetText(text) { return text.replace(/\$/gm, () => "\\$"); @@ -288785,8 +289311,9 @@ ${lanes.join("\n")} function isNumericLiteralName(name) { return (+name).toString() === name; } - function createPropertyNameNodeForIdentifierOrLiteral(name, target, singleQuote, stringNamed) { - return isIdentifierText(name, target) ? factory.createIdentifier(name) : !stringNamed && isNumericLiteralName(name) && +name >= 0 ? factory.createNumericLiteral(+name) : factory.createStringLiteral(name, !!singleQuote); + function createPropertyNameNodeForIdentifierOrLiteral(name, target, singleQuote, stringNamed, isMethod) { + const isMethodNamedNew = isMethod && name === "new"; + return !isMethodNamedNew && isIdentifierText(name, target) ? factory.createIdentifier(name) : !stringNamed && !isMethodNamedNew && isNumericLiteralName(name) && +name >= 0 ? factory.createNumericLiteral(+name) : factory.createStringLiteral(name, !!singleQuote); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -288840,23 +289367,23 @@ ${lanes.join("\n")} } function getParameterTypeNode(parameter) { var _a; - return parameter.kind === 347 /* JSDocParameterTag */ ? (_a = parameter.typeExpression) == null ? void 0 : _a.type : parameter.type; + return parameter.kind === 348 /* JSDocParameterTag */ ? (_a = parameter.typeExpression) == null ? void 0 : _a.type : parameter.type; } function isTypeDeclaration(node) { switch (node.kind) { - case 167 /* TypeParameter */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 265 /* EnumDeclaration */: - case 352 /* JSDocTypedefTag */: - case 344 /* JSDocCallbackTag */: - case 346 /* JSDocEnumTag */: + case 168 /* TypeParameter */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 266 /* EnumDeclaration */: + case 353 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: + case 347 /* JSDocEnumTag */: return true; - case 272 /* ImportClause */: + case 273 /* ImportClause */: return node.isTypeOnly; - case 275 /* ImportSpecifier */: - case 280 /* ExportSpecifier */: + case 276 /* ImportSpecifier */: + case 281 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -288870,7 +289397,7 @@ ${lanes.join("\n")} return false; } const { isBracketed, typeExpression } = node; - return isBracketed || !!typeExpression && typeExpression.type.kind === 322 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 323 /* JSDocOptionalType */; } function canUsePropertyAccess(name, languageVersion) { if (name.length === 0) { @@ -288885,17 +289412,17 @@ ${lanes.join("\n")} } function isJSDocOptionalParameter(node) { return isInJSFile(node) && // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - (node.type && node.type.kind === 322 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 322 /* JSDocOptionalType */)); + (node.type && node.type.kind === 323 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 323 /* JSDocOptionalType */)); } function isOptionalDeclaration(declaration) { switch (declaration.kind) { - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: return !!declaration.questionToken; - case 168 /* Parameter */: + case 169 /* Parameter */: return !!declaration.questionToken || isJSDocOptionalParameter(declaration); - case 354 /* JSDocPropertyTag */: - case 347 /* JSDocParameterTag */: + case 355 /* JSDocPropertyTag */: + case 348 /* JSDocParameterTag */: return isOptionalJSDocPropertyLikeTag(declaration); default: return false; @@ -288903,7 +289430,7 @@ ${lanes.join("\n")} } function isNonNullAccess(node) { const kind = node.kind; - return (kind === 210 /* PropertyAccessExpression */ || kind === 211 /* ElementAccessExpression */) && isNonNullExpression(node.expression); + return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && isNonNullExpression(node.expression); } function isJSDocSatisfiesExpression(node) { return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node); @@ -288923,7 +289450,7 @@ ${lanes.join("\n")} } function isJsxAttributeName(node) { const kind = node.kind; - return kind === 80 /* Identifier */ || kind === 294 /* JsxNamespacedName */; + return kind === 80 /* Identifier */ || kind === 295 /* JsxNamespacedName */; } function getEscapedTextOfJsxNamespacedName(node) { return `${node.namespace.escapedText}:${idText(node.name)}`; @@ -288934,7 +289461,34 @@ ${lanes.join("\n")} function intrinsicTagNameToString(node) { return isIdentifier(node) ? idText(node) : getTextOfJsxNamespacedName(node); } - var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, 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 isTypeUsableAsPropertyName(type) { + return !!(type.flags & 8576 /* StringOrNumberLiteralOrUnique */); + } + function getPropertyNameFromType(type) { + if (type.flags & 8192 /* UniqueESSymbol */) { + return type.escapedName; + } + if (type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) { + return escapeLeadingUnderscores("" + type.value); + } + return Debug.fail(); + } + function isExpandoPropertyDeclaration(declaration) { + return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration)); + } + function hasResolutionModeOverride(node) { + if (node === void 0) { + return false; + } + return !!getResolutionModeOverride(node.attributes); + } + 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"; @@ -288944,6 +289498,402 @@ ${lanes.join("\n")} defaultMaximumTruncationLength = 160; noTruncationMaximumTruncationLength = 1e6; stringWriter = createSingleLineStringWriter(); + getScriptTargetFeatures = /* @__PURE__ */ memoize( + () => new Map(Object.entries({ + Array: new Map(Object.entries({ + es2015: [ + "find", + "findIndex", + "fill", + "copyWithin", + "entries", + "keys", + "values" + ], + es2016: [ + "includes" + ], + es2019: [ + "flat", + "flatMap" + ], + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Iterator: new Map(Object.entries({ + es2015: emptyArray + })), + AsyncIterator: new Map(Object.entries({ + es2015: emptyArray + })), + Atomics: new Map(Object.entries({ + es2017: emptyArray + })), + SharedArrayBuffer: new Map(Object.entries({ + es2017: emptyArray + })), + AsyncIterable: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncIterableIterator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGenerator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGeneratorFunction: new Map(Object.entries({ + es2018: emptyArray + })), + RegExp: new Map(Object.entries({ + es2015: [ + "flags", + "sticky", + "unicode" + ], + es2018: [ + "dotAll" + ] + })), + Reflect: new Map(Object.entries({ + es2015: [ + "apply", + "construct", + "defineProperty", + "deleteProperty", + "get", + "getOwnPropertyDescriptor", + "getPrototypeOf", + "has", + "isExtensible", + "ownKeys", + "preventExtensions", + "set", + "setPrototypeOf" + ] + })), + ArrayConstructor: new Map(Object.entries({ + es2015: [ + "from", + "of" + ] + })), + ObjectConstructor: new Map(Object.entries({ + es2015: [ + "assign", + "getOwnPropertySymbols", + "keys", + "is", + "setPrototypeOf" + ], + es2017: [ + "values", + "entries", + "getOwnPropertyDescriptors" + ], + es2019: [ + "fromEntries" + ], + es2022: [ + "hasOwn" + ] + })), + NumberConstructor: new Map(Object.entries({ + es2015: [ + "isFinite", + "isInteger", + "isNaN", + "isSafeInteger", + "parseFloat", + "parseInt" + ] + })), + Math: new Map(Object.entries({ + es2015: [ + "clz32", + "imul", + "sign", + "log10", + "log2", + "log1p", + "expm1", + "cosh", + "sinh", + "tanh", + "acosh", + "asinh", + "atanh", + "hypot", + "trunc", + "fround", + "cbrt" + ] + })), + Map: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + Set: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + PromiseConstructor: new Map(Object.entries({ + es2015: [ + "all", + "race", + "reject", + "resolve" + ], + es2020: [ + "allSettled" + ], + es2021: [ + "any" + ] + })), + Symbol: new Map(Object.entries({ + es2015: [ + "for", + "keyFor" + ], + es2019: [ + "description" + ] + })), + WeakMap: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + WeakSet: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + String: new Map(Object.entries({ + es2015: [ + "codePointAt", + "includes", + "endsWith", + "normalize", + "repeat", + "startsWith", + "anchor", + "big", + "blink", + "bold", + "fixed", + "fontcolor", + "fontsize", + "italics", + "link", + "small", + "strike", + "sub", + "sup" + ], + es2017: [ + "padStart", + "padEnd" + ], + es2019: [ + "trimStart", + "trimEnd", + "trimLeft", + "trimRight" + ], + es2020: [ + "matchAll" + ], + es2021: [ + "replaceAll" + ], + es2022: [ + "at" + ] + })), + StringConstructor: new Map(Object.entries({ + es2015: [ + "fromCodePoint", + "raw" + ] + })), + DateTimeFormat: new Map(Object.entries({ + es2017: [ + "formatToParts" + ] + })), + Promise: new Map(Object.entries({ + es2015: emptyArray, + es2018: [ + "finally" + ] + })), + RegExpMatchArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + RegExpExecArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + Intl: new Map(Object.entries({ + es2018: [ + "PluralRules" + ] + })), + NumberFormat: new Map(Object.entries({ + es2018: [ + "formatToParts" + ] + })), + SymbolConstructor: new Map(Object.entries({ + es2020: [ + "matchAll" + ] + })), + DataView: new Map(Object.entries({ + es2020: [ + "setBigInt64", + "setBigUint64", + "getBigInt64", + "getBigUint64" + ] + })), + BigInt: new Map(Object.entries({ + es2020: emptyArray + })), + RelativeTimeFormat: new Map(Object.entries({ + es2020: [ + "format", + "formatToParts", + "resolvedOptions" + ] + })), + Int8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8ClampedArray: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float64Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigInt64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigUint64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Error: new Map(Object.entries({ + es2022: [ + "cause" + ] + })) + })) + ); GetLiteralTextFlags = /* @__PURE__ */ ((GetLiteralTextFlags2) => { GetLiteralTextFlags2[GetLiteralTextFlags2["None"] = 0] = "None"; GetLiteralTextFlags2[GetLiteralTextFlags2["NeverAsciiEscape"] = 1] = "NeverAsciiEscape"; @@ -289006,9 +289956,9 @@ ${lanes.join("\n")} return OperatorPrecedence2; })(OperatorPrecedence || {}); templateSubstitutionRegExp = /\$\{/g; - doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - backtickQuoteEscapedCharsRegExp = /\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g; + doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g; escapedCharsMap = new Map(Object.entries({ " ": "\\t", "\v": "\\v", @@ -289030,8 +289980,8 @@ ${lanes.join("\n")} // special case for CRLFs in backticks })); nonAsciiCharacters = /[^\u0000-\u007F]/g; - jsxDoubleQuoteEscapedCharsRegExp = /[\"\u0000-\u001f\u2028\u2029\u0085]/g; - jsxSingleQuoteEscapedCharsRegExp = /[\'\u0000-\u001f\u2028\u2029\u0085]/g; + jsxDoubleQuoteEscapedCharsRegExp = /["\u0000-\u001f\u2028\u2029\u0085]/g; + jsxSingleQuoteEscapedCharsRegExp = /['\u0000-\u001f\u2028\u2029\u0085]/g; jsxEscapedCharsMap = new Map(Object.entries({ '"': """, "'": "'" @@ -289052,7 +290002,230 @@ ${lanes.join("\n")} getSourceMapSourceConstructor: () => SourceMapSource }; objectAllocatorPatchers = []; - reservedCharacterPattern = /[^\w\s\/]/g; + 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"]; implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`; @@ -289113,6 +290286,7 @@ ${lanes.join("\n")} files: emptyArray, directories: emptyArray }; + stringReplace = String.prototype.replace; } }); @@ -289243,16 +290417,16 @@ ${lanes.join("\n")} return parenthesizerRule; } function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - const binaryOperatorPrecedence = getOperatorPrecedence(225 /* BinaryExpression */, binaryOperator); - const binaryOperatorAssociativity = getOperatorAssociativity(225 /* BinaryExpression */, binaryOperator); + const binaryOperatorPrecedence = getOperatorPrecedence(226 /* BinaryExpression */, binaryOperator); + const binaryOperatorAssociativity = getOperatorAssociativity(226 /* BinaryExpression */, binaryOperator); const emittedOperand = skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 218 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { + if (!isLeftSideOfBinary && operand.kind === 219 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { return true; } const operandPrecedence = getExpressionPrecedence(emittedOperand); switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) { case -1 /* LessThan */: - if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 228 /* YieldExpression */) { + if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 229 /* YieldExpression */) { return false; } return true; @@ -289286,7 +290460,7 @@ ${lanes.join("\n")} if (isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 225 /* BinaryExpression */ && node.operatorToken.kind === 40 /* PlusToken */) { + if (node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 40 /* PlusToken */) { if (node.cachedLiteralKind !== void 0) { return node.cachedLiteralKind; } @@ -289299,7 +290473,7 @@ ${lanes.join("\n")} } function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { const skipped = skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 216 /* ParenthesizedExpression */) { + if (skipped.kind === 217 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand; @@ -289325,7 +290499,7 @@ ${lanes.join("\n")} return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression; } function parenthesizeConditionOfConditionalExpression(condition) { - const conditionalPrecedence = getOperatorPrecedence(226 /* ConditionalExpression */, 58 /* QuestionToken */); + const conditionalPrecedence = getOperatorPrecedence(227 /* ConditionalExpression */, 58 /* QuestionToken */); const emittedCondition = skipPartiallyEmittedExpressions(condition); const conditionPrecedence = getExpressionPrecedence(emittedCondition); if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -289346,8 +290520,8 @@ ${lanes.join("\n")} /*stopAtCallExpressions*/ false ).kind) { - case 230 /* ClassExpression */: - case 217 /* FunctionExpression */: + case 231 /* ClassExpression */: + case 218 /* FunctionExpression */: needsParens = true; } } @@ -289360,16 +290534,16 @@ ${lanes.join("\n")} true ); switch (leftmostExpr.kind) { - case 212 /* CallExpression */: + case 213 /* CallExpression */: return factory2.createParenthesizedExpression(expression); - case 213 /* NewExpression */: + case 214 /* NewExpression */: return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression; } return parenthesizeLeftSideOfAccess(expression); } function parenthesizeLeftSideOfAccess(expression, optionalChain) { const emittedExpression = skipPartiallyEmittedExpressions(expression); - if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 213 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) { + if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) { return expression; } return setTextRange(factory2.createParenthesizedExpression(expression), expression); @@ -289387,7 +290561,7 @@ ${lanes.join("\n")} function parenthesizeExpressionForDisallowedComma(expression) { const emittedExpression = skipPartiallyEmittedExpressions(expression); const expressionPrecedence = getExpressionPrecedence(emittedExpression); - const commaPrecedence = getOperatorPrecedence(225 /* BinaryExpression */, 28 /* CommaToken */); + const commaPrecedence = getOperatorPrecedence(226 /* BinaryExpression */, 28 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression); } function parenthesizeExpressionOfExpressionStatement(expression) { @@ -289395,7 +290569,7 @@ ${lanes.join("\n")} if (isCallExpression(emittedExpression)) { const callee = emittedExpression.expression; const kind = skipPartiallyEmittedExpressions(callee).kind; - if (kind === 217 /* FunctionExpression */ || kind === 218 /* ArrowFunction */) { + if (kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */) { const updated = factory2.updateCallExpression( emittedExpression, setTextRange(factory2.createParenthesizedExpression(callee), callee), @@ -289410,7 +290584,7 @@ ${lanes.join("\n")} /*stopAtCallExpressions*/ false ).kind; - if (leftmostExpressionKind === 209 /* ObjectLiteralExpression */ || leftmostExpressionKind === 217 /* FunctionExpression */) { + if (leftmostExpressionKind === 210 /* ObjectLiteralExpression */ || leftmostExpressionKind === 218 /* FunctionExpression */) { return setTextRange(factory2.createParenthesizedExpression(expression), expression); } return expression; @@ -289420,31 +290594,31 @@ ${lanes.join("\n")} body, /*stopAtCallExpressions*/ false - ).kind === 209 /* ObjectLiteralExpression */)) { + ).kind === 210 /* ObjectLiteralExpression */)) { return setTextRange(factory2.createParenthesizedExpression(body), body); } return body; } function parenthesizeCheckTypeOfConditionalType(checkType) { switch (checkType.kind) { - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 193 /* ConditionalType */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 194 /* ConditionalType */: return factory2.createParenthesizedType(checkType); } return checkType; } function parenthesizeExtendsTypeOfConditionalType(extendsType) { switch (extendsType.kind) { - case 193 /* ConditionalType */: + case 194 /* ConditionalType */: return factory2.createParenthesizedType(extendsType); } return extendsType; } function parenthesizeConstituentTypeOfUnionType(type) { switch (type.kind) { - case 191 /* UnionType */: - case 192 /* IntersectionType */: + case 192 /* UnionType */: + case 193 /* IntersectionType */: return factory2.createParenthesizedType(type); } return parenthesizeCheckTypeOfConditionalType(type); @@ -289454,8 +290628,8 @@ ${lanes.join("\n")} } function parenthesizeConstituentTypeOfIntersectionType(type) { switch (type.kind) { - case 191 /* UnionType */: - case 192 /* IntersectionType */: + case 192 /* UnionType */: + case 193 /* IntersectionType */: return factory2.createParenthesizedType(type); } return parenthesizeConstituentTypeOfUnionType(type); @@ -289465,23 +290639,23 @@ ${lanes.join("\n")} } function parenthesizeOperandOfTypeOperator(type) { switch (type.kind) { - case 192 /* IntersectionType */: + case 193 /* IntersectionType */: return factory2.createParenthesizedType(type); } return parenthesizeConstituentTypeOfIntersectionType(type); } function parenthesizeOperandOfReadonlyTypeOperator(type) { switch (type.kind) { - case 197 /* TypeOperator */: + case 198 /* TypeOperator */: return factory2.createParenthesizedType(type); } return parenthesizeOperandOfTypeOperator(type); } function parenthesizeNonArrayTypeOfPostfixType(type) { switch (type.kind) { - case 194 /* InferType */: - case 197 /* TypeOperator */: - case 185 /* TypeQuery */: + case 195 /* InferType */: + case 198 /* TypeOperator */: + case 186 /* TypeQuery */: return factory2.createParenthesizedType(type); } return parenthesizeOperandOfTypeOperator(type); @@ -289573,6 +290747,7 @@ ${lanes.join("\n")} return { convertToFunctionBlock, convertToFunctionExpression, + convertToClassExpression, convertToArrayAssignmentElement, convertToObjectAssignmentElement, convertToAssignmentPattern, @@ -289590,10 +290765,11 @@ ${lanes.join("\n")} return body; } function convertToFunctionExpression(node) { + var _a; if (!node.body) return Debug.fail(`Cannot convert a FunctionDeclaration without a body`); const updated = factory2.createFunctionExpression( - getModifiers(node), + (_a = getModifiers(node)) == null ? void 0 : _a.filter((modifier) => !isExportModifier(modifier) && !isDefaultModifier(modifier)), node.asteriskToken, node.name, node.typeParameters, @@ -289612,6 +290788,26 @@ ${lanes.join("\n")} } return updated; } + function convertToClassExpression(node) { + var _a; + const updated = factory2.createClassExpression( + (_a = node.modifiers) == null ? void 0 : _a.filter((modifier) => !isExportModifier(modifier) && !isDefaultModifier(modifier)), + node.name, + node.typeParameters, + node.heritageClauses, + node.members + ); + setOriginalNode(updated, node); + setTextRange(updated, node); + if (getStartsOnNewLine(node)) { + setStartsOnNewLine( + updated, + /*newLine*/ + true + ); + } + return updated; + } function convertToArrayAssignmentElement(element) { if (isBindingElement(element)) { if (element.dotDotDotToken) { @@ -289646,11 +290842,11 @@ ${lanes.join("\n")} } function convertToAssignmentPattern(node) { switch (node.kind) { - case 206 /* ArrayBindingPattern */: - case 208 /* ArrayLiteralExpression */: + case 207 /* ArrayBindingPattern */: + case 209 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 205 /* ObjectBindingPattern */: - case 209 /* ObjectLiteralExpression */: + case 206 /* ObjectBindingPattern */: + case 210 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -289693,6 +290889,7 @@ ${lanes.join("\n")} nullNodeConverters = { convertToFunctionBlock: notImplemented, convertToFunctionExpression: notImplemented, + convertToClassExpression: notImplemented, convertToArrayAssignmentElement: notImplemented, convertToObjectAssignmentElement: notImplemented, convertToAssignmentPattern: notImplemented, @@ -289708,7 +290905,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)); @@ -289984,6 +291181,10 @@ ${lanes.join("\n")} updateAssertEntry, createImportTypeAssertionContainer, updateImportTypeAssertionContainer, + createImportAttributes, + updateImportAttributes, + createImportAttribute, + updateImportAttribute, createNamespaceImport, updateNamespaceImport, createNamespaceExport, @@ -290005,40 +291206,40 @@ ${lanes.join("\n")} updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure get createJSDocAllType() { - return getJSDocPrimaryTypeCreateFunction(318 /* JSDocAllType */); + return getJSDocPrimaryTypeCreateFunction(319 /* JSDocAllType */); }, get createJSDocUnknownType() { - return getJSDocPrimaryTypeCreateFunction(319 /* JSDocUnknownType */); + return getJSDocPrimaryTypeCreateFunction(320 /* JSDocUnknownType */); }, get createJSDocNonNullableType() { - return getJSDocPrePostfixUnaryTypeCreateFunction(321 /* JSDocNonNullableType */); + return getJSDocPrePostfixUnaryTypeCreateFunction(322 /* JSDocNonNullableType */); }, get updateJSDocNonNullableType() { - return getJSDocPrePostfixUnaryTypeUpdateFunction(321 /* JSDocNonNullableType */); + return getJSDocPrePostfixUnaryTypeUpdateFunction(322 /* JSDocNonNullableType */); }, get createJSDocNullableType() { - return getJSDocPrePostfixUnaryTypeCreateFunction(320 /* JSDocNullableType */); + return getJSDocPrePostfixUnaryTypeCreateFunction(321 /* JSDocNullableType */); }, get updateJSDocNullableType() { - return getJSDocPrePostfixUnaryTypeUpdateFunction(320 /* JSDocNullableType */); + return getJSDocPrePostfixUnaryTypeUpdateFunction(321 /* JSDocNullableType */); }, get createJSDocOptionalType() { - return getJSDocUnaryTypeCreateFunction(322 /* JSDocOptionalType */); + return getJSDocUnaryTypeCreateFunction(323 /* JSDocOptionalType */); }, get updateJSDocOptionalType() { - return getJSDocUnaryTypeUpdateFunction(322 /* JSDocOptionalType */); + return getJSDocUnaryTypeUpdateFunction(323 /* JSDocOptionalType */); }, get createJSDocVariadicType() { - return getJSDocUnaryTypeCreateFunction(324 /* JSDocVariadicType */); + return getJSDocUnaryTypeCreateFunction(325 /* JSDocVariadicType */); }, get updateJSDocVariadicType() { - return getJSDocUnaryTypeUpdateFunction(324 /* JSDocVariadicType */); + return getJSDocUnaryTypeUpdateFunction(325 /* JSDocVariadicType */); }, get createJSDocNamepathType() { - return getJSDocUnaryTypeCreateFunction(325 /* JSDocNamepathType */); + return getJSDocUnaryTypeCreateFunction(326 /* JSDocNamepathType */); }, get updateJSDocNamepathType() { - return getJSDocUnaryTypeUpdateFunction(325 /* JSDocNamepathType */); + return getJSDocUnaryTypeUpdateFunction(326 /* JSDocNamepathType */); }, createJSDocFunctionType, updateJSDocFunctionType, @@ -290078,82 +291279,82 @@ ${lanes.join("\n")} updateJSDocLinkPlain, // lazily load factory members for JSDoc tags with similar structure get createJSDocTypeTag() { - return getJSDocTypeLikeTagCreateFunction(350 /* JSDocTypeTag */); + return getJSDocTypeLikeTagCreateFunction(351 /* JSDocTypeTag */); }, get updateJSDocTypeTag() { - return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocTypeTag */); + return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocTypeTag */); }, get createJSDocReturnTag() { - return getJSDocTypeLikeTagCreateFunction(348 /* JSDocReturnTag */); + return getJSDocTypeLikeTagCreateFunction(349 /* JSDocReturnTag */); }, get updateJSDocReturnTag() { - return getJSDocTypeLikeTagUpdateFunction(348 /* JSDocReturnTag */); + return getJSDocTypeLikeTagUpdateFunction(349 /* JSDocReturnTag */); }, get createJSDocThisTag() { - return getJSDocTypeLikeTagCreateFunction(349 /* JSDocThisTag */); + return getJSDocTypeLikeTagCreateFunction(350 /* JSDocThisTag */); }, get updateJSDocThisTag() { - return getJSDocTypeLikeTagUpdateFunction(349 /* JSDocThisTag */); + return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocThisTag */); }, get createJSDocAuthorTag() { - return getJSDocSimpleTagCreateFunction(336 /* JSDocAuthorTag */); + return getJSDocSimpleTagCreateFunction(337 /* JSDocAuthorTag */); }, get updateJSDocAuthorTag() { - return getJSDocSimpleTagUpdateFunction(336 /* JSDocAuthorTag */); + return getJSDocSimpleTagUpdateFunction(337 /* JSDocAuthorTag */); }, get createJSDocClassTag() { - return getJSDocSimpleTagCreateFunction(338 /* JSDocClassTag */); + return getJSDocSimpleTagCreateFunction(339 /* JSDocClassTag */); }, get updateJSDocClassTag() { - return getJSDocSimpleTagUpdateFunction(338 /* JSDocClassTag */); + return getJSDocSimpleTagUpdateFunction(339 /* JSDocClassTag */); }, get createJSDocPublicTag() { - return getJSDocSimpleTagCreateFunction(339 /* JSDocPublicTag */); + return getJSDocSimpleTagCreateFunction(340 /* JSDocPublicTag */); }, get updateJSDocPublicTag() { - return getJSDocSimpleTagUpdateFunction(339 /* JSDocPublicTag */); + return getJSDocSimpleTagUpdateFunction(340 /* JSDocPublicTag */); }, get createJSDocPrivateTag() { - return getJSDocSimpleTagCreateFunction(340 /* JSDocPrivateTag */); + return getJSDocSimpleTagCreateFunction(341 /* JSDocPrivateTag */); }, get updateJSDocPrivateTag() { - return getJSDocSimpleTagUpdateFunction(340 /* JSDocPrivateTag */); + return getJSDocSimpleTagUpdateFunction(341 /* JSDocPrivateTag */); }, get createJSDocProtectedTag() { - return getJSDocSimpleTagCreateFunction(341 /* JSDocProtectedTag */); + return getJSDocSimpleTagCreateFunction(342 /* JSDocProtectedTag */); }, get updateJSDocProtectedTag() { - return getJSDocSimpleTagUpdateFunction(341 /* JSDocProtectedTag */); + return getJSDocSimpleTagUpdateFunction(342 /* JSDocProtectedTag */); }, get createJSDocReadonlyTag() { - return getJSDocSimpleTagCreateFunction(342 /* JSDocReadonlyTag */); + return getJSDocSimpleTagCreateFunction(343 /* JSDocReadonlyTag */); }, get updateJSDocReadonlyTag() { - return getJSDocSimpleTagUpdateFunction(342 /* JSDocReadonlyTag */); + return getJSDocSimpleTagUpdateFunction(343 /* JSDocReadonlyTag */); }, get createJSDocOverrideTag() { - return getJSDocSimpleTagCreateFunction(343 /* JSDocOverrideTag */); + return getJSDocSimpleTagCreateFunction(344 /* JSDocOverrideTag */); }, get updateJSDocOverrideTag() { - return getJSDocSimpleTagUpdateFunction(343 /* JSDocOverrideTag */); + return getJSDocSimpleTagUpdateFunction(344 /* JSDocOverrideTag */); }, get createJSDocDeprecatedTag() { - return getJSDocSimpleTagCreateFunction(337 /* JSDocDeprecatedTag */); + return getJSDocSimpleTagCreateFunction(338 /* JSDocDeprecatedTag */); }, get updateJSDocDeprecatedTag() { - return getJSDocSimpleTagUpdateFunction(337 /* JSDocDeprecatedTag */); + return getJSDocSimpleTagUpdateFunction(338 /* JSDocDeprecatedTag */); }, get createJSDocThrowsTag() { - return getJSDocTypeLikeTagCreateFunction(355 /* JSDocThrowsTag */); + return getJSDocTypeLikeTagCreateFunction(356 /* JSDocThrowsTag */); }, get updateJSDocThrowsTag() { - return getJSDocTypeLikeTagUpdateFunction(355 /* JSDocThrowsTag */); + return getJSDocTypeLikeTagUpdateFunction(356 /* JSDocThrowsTag */); }, get createJSDocSatisfiesTag() { - return getJSDocTypeLikeTagCreateFunction(356 /* JSDocSatisfiesTag */); + return getJSDocTypeLikeTagCreateFunction(357 /* JSDocSatisfiesTag */); }, get updateJSDocSatisfiesTag() { - return getJSDocTypeLikeTagUpdateFunction(356 /* JSDocSatisfiesTag */); + return getJSDocTypeLikeTagUpdateFunction(357 /* JSDocSatisfiesTag */); }, createJSDocEnumTag, updateJSDocEnumTag, @@ -290328,6 +291529,7 @@ ${lanes.join("\n")} createExportDefault, createExternalModuleExport, createTypeCheck, + createIsNotTypeCheck, createMethodCall, createGlobalMethodCall, createFunctionBindCall, @@ -290359,7 +291561,9 @@ ${lanes.join("\n")} ensureUseStrict, liftToBlock, mergeLexicalEnvironment, - updateModifiers + replaceModifiers, + replaceDecoratorsAndModifiers, + replacePropertyName }; forEach(nodeFactoryPatchers, (fn) => fn(factory2)); return factory2; @@ -290408,8 +291612,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 */; @@ -290517,11 +291723,11 @@ ${lanes.join("\n")} } const node = createBaseIdentifier(escapeLeadingUnderscores(text)); if (hasExtendedUnicodeEscape) - node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */; + node.flags |= 256 /* IdentifierHasExtendedUnicodeEscape */; if (node.escapedText === "await") { node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */; } - if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { + if (node.flags & 256 /* IdentifierHasExtendedUnicodeEscape */) { node.transformFlags |= 1024 /* ContainsES2015 */; } return node; @@ -290616,7 +291822,7 @@ ${lanes.join("\n")} return baseFactory2.createBaseTokenNode(kind); } function createToken(token) { - Debug.assert(token >= 0 /* FirstToken */ && token <= 164 /* LastToken */, "Invalid token"); + Debug.assert(token >= 0 /* FirstToken */ && token <= 165 /* LastToken */, "Invalid token"); Debug.assert(token <= 15 /* FirstTemplateToken */ || token >= 18 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); Debug.assert(token <= 9 /* FirstLiteralToken */ || token >= 15 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); Debug.assert(token !== 80 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers"); @@ -290626,6 +291832,9 @@ ${lanes.join("\n")} case 134 /* AsyncKeyword */: transformFlags = 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */; break; + case 160 /* UsingKeyword */: + transformFlags = 4 /* ContainsESNext */; + break; case 125 /* PublicKeyword */: case 123 /* PrivateKeyword */: case 124 /* ProtectedKeyword */: @@ -290635,12 +291844,12 @@ ${lanes.join("\n")} case 87 /* ConstKeyword */: case 133 /* AnyKeyword */: case 150 /* NumberKeyword */: - case 162 /* BigIntKeyword */: + case 163 /* BigIntKeyword */: case 146 /* NeverKeyword */: case 151 /* ObjectKeyword */: case 103 /* InKeyword */: case 147 /* OutKeyword */: - case 163 /* OverrideKeyword */: + case 164 /* OverrideKeyword */: case 154 /* StringKeyword */: case 136 /* BooleanKeyword */: case 155 /* SymbolKeyword */: @@ -290689,40 +291898,40 @@ ${lanes.join("\n")} } function createModifiersFromModifierFlags(flags2) { const result = []; - if (flags2 & 1 /* Export */) + if (flags2 & 32 /* Export */) result.push(createModifier(95 /* ExportKeyword */)); - if (flags2 & 2 /* Ambient */) + if (flags2 & 128 /* Ambient */) result.push(createModifier(138 /* DeclareKeyword */)); - if (flags2 & 1024 /* Default */) + if (flags2 & 2048 /* Default */) result.push(createModifier(90 /* DefaultKeyword */)); - if (flags2 & 2048 /* Const */) + if (flags2 & 4096 /* Const */) result.push(createModifier(87 /* ConstKeyword */)); - if (flags2 & 4 /* Public */) + if (flags2 & 1 /* Public */) result.push(createModifier(125 /* PublicKeyword */)); - if (flags2 & 8 /* Private */) + if (flags2 & 2 /* Private */) result.push(createModifier(123 /* PrivateKeyword */)); - if (flags2 & 16 /* Protected */) + if (flags2 & 4 /* Protected */) result.push(createModifier(124 /* ProtectedKeyword */)); - if (flags2 & 256 /* Abstract */) + if (flags2 & 64 /* Abstract */) result.push(createModifier(128 /* AbstractKeyword */)); - if (flags2 & 32 /* Static */) + if (flags2 & 256 /* Static */) result.push(createModifier(126 /* StaticKeyword */)); - if (flags2 & 16384 /* Override */) - result.push(createModifier(163 /* OverrideKeyword */)); - if (flags2 & 64 /* Readonly */) + if (flags2 & 16 /* Override */) + result.push(createModifier(164 /* OverrideKeyword */)); + if (flags2 & 8 /* Readonly */) result.push(createModifier(148 /* ReadonlyKeyword */)); - if (flags2 & 128 /* Accessor */) + if (flags2 & 512 /* Accessor */) result.push(createModifier(129 /* AccessorKeyword */)); - if (flags2 & 512 /* Async */) + if (flags2 & 1024 /* Async */) result.push(createModifier(134 /* AsyncKeyword */)); - if (flags2 & 32768 /* In */) + if (flags2 & 8192 /* In */) result.push(createModifier(103 /* InKeyword */)); - if (flags2 & 65536 /* Out */) + if (flags2 & 16384 /* Out */) result.push(createModifier(147 /* OutKeyword */)); return result.length ? result : void 0; } function createQualifiedName(left, right) { - const node = createBaseNode(165 /* QualifiedName */); + const node = createBaseNode(166 /* QualifiedName */); node.left = left; node.right = asName(right); node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right); @@ -290733,7 +291942,7 @@ ${lanes.join("\n")} return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node; } function createComputedPropertyName(expression) { - const node = createBaseNode(166 /* ComputedPropertyName */); + const node = createBaseNode(167 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */; return node; @@ -290742,7 +291951,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node; } function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) { - const node = createBaseDeclaration(167 /* TypeParameter */); + const node = createBaseDeclaration(168 /* TypeParameter */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.constraint = constraint; @@ -290756,7 +291965,7 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node; } function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) { - const node = createBaseDeclaration(168 /* Parameter */); + const node = createBaseDeclaration(169 /* Parameter */); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; node.name = asName(name); @@ -290766,7 +291975,7 @@ ${lanes.join("\n")} if (isThisIdentifier(node.name)) { node.transformFlags = 1 /* ContainsTypeScript */; } else { - node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (node.questionToken ?? node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (node.dotDotDotToken ?? node.initializer ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */); + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (node.questionToken ?? node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (node.dotDotDotToken ?? node.initializer ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 31 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */); } node.jsDoc = void 0; return node; @@ -290775,7 +291984,7 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node; } function createDecorator(expression) { - const node = createBaseNode(169 /* Decorator */); + const node = createBaseNode(170 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -290788,7 +291997,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createDecorator(expression), node) : node; } function createPropertySignature(modifiers, name, questionToken, type) { - const node = createBaseDeclaration(170 /* PropertySignature */); + const node = createBaseDeclaration(171 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.type = type; @@ -290808,15 +292017,15 @@ ${lanes.join("\n")} return update(updated, original); } function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) { - const node = createBaseDeclaration(171 /* PropertyDeclaration */); + const node = createBaseDeclaration(172 /* PropertyDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionOrExclamationToken && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; node.type = type; node.initializer = asInitializer(initializer); - const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */; - node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */; + const isAmbient = node.flags & 33554432 /* Ambient */ || modifiersToFlags(node.modifiers) & 128 /* Ambient */; + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 256 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */; node.jsDoc = void 0; return node; } @@ -290824,7 +292033,7 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.name !== name || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type || node.initializer !== initializer ? update(createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { - const node = createBaseDeclaration(172 /* MethodSignature */); + const node = createBaseDeclaration(173 /* MethodSignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -290842,7 +292051,7 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; } function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(173 /* MethodDeclaration */); + const node = createBaseDeclaration(174 /* MethodDeclaration */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -290855,7 +292064,7 @@ ${lanes.join("\n")} if (!node.body) { node.transformFlags = 1 /* ContainsTypeScript */; } else { - const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; + const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */; const isGenerator = !!node.asteriskToken; const isAsyncGenerator = isAsync && isGenerator; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.questionToken || node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */; @@ -290879,7 +292088,7 @@ ${lanes.join("\n")} return update(updated, original); } function createClassStaticBlockDeclaration(body) { - const node = createBaseDeclaration(174 /* ClassStaticBlockDeclaration */); + const node = createBaseDeclaration(175 /* ClassStaticBlockDeclaration */); node.body = body; node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; node.modifiers = void 0; @@ -290900,7 +292109,7 @@ ${lanes.join("\n")} return update(updated, original); } function createConstructorDeclaration(modifiers, parameters, body) { - const node = createBaseDeclaration(175 /* Constructor */); + const node = createBaseDeclaration(176 /* Constructor */); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); node.body = body; @@ -290926,7 +292135,7 @@ ${lanes.join("\n")} return finishUpdateBaseSignatureDeclaration(updated, original); } function createGetAccessorDeclaration(modifiers, name, parameters, type, body) { - const node = createBaseDeclaration(176 /* GetAccessor */); + const node = createBaseDeclaration(177 /* GetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.parameters = createNodeArray(parameters); @@ -290957,7 +292166,7 @@ ${lanes.join("\n")} return finishUpdateBaseSignatureDeclaration(updated, original); } function createSetAccessorDeclaration(modifiers, name, parameters, body) { - const node = createBaseDeclaration(177 /* SetAccessor */); + const node = createBaseDeclaration(178 /* SetAccessor */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.parameters = createNodeArray(parameters); @@ -290989,7 +292198,7 @@ ${lanes.join("\n")} return finishUpdateBaseSignatureDeclaration(updated, original); } function createCallSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(178 /* CallSignature */); + const node = createBaseDeclaration(179 /* CallSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; @@ -291004,7 +292213,7 @@ ${lanes.join("\n")} return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node; } function createConstructSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(179 /* ConstructSignature */); + const node = createBaseDeclaration(180 /* ConstructSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; @@ -291019,7 +292228,7 @@ ${lanes.join("\n")} return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node; } function createIndexSignature(modifiers, parameters, type) { - const node = createBaseDeclaration(180 /* IndexSignature */); + const node = createBaseDeclaration(181 /* IndexSignature */); node.modifiers = asNodeArray(modifiers); node.parameters = asNodeArray(parameters); node.type = type; @@ -291034,7 +292243,7 @@ ${lanes.join("\n")} return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node; } function createTemplateLiteralTypeSpan(type, literal) { - const node = createBaseNode(203 /* TemplateLiteralTypeSpan */); + const node = createBaseNode(204 /* TemplateLiteralTypeSpan */); node.type = type; node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; @@ -291047,7 +292256,7 @@ ${lanes.join("\n")} return createToken(kind); } function createTypePredicateNode(assertsModifier, parameterName, type) { - const node = createBaseNode(181 /* TypePredicate */); + const node = createBaseNode(182 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -291058,7 +292267,7 @@ ${lanes.join("\n")} return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node; } function createTypeReferenceNode(typeName, typeArguments) { - const node = createBaseNode(182 /* TypeReference */); + const node = createBaseNode(183 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; @@ -291068,7 +292277,7 @@ ${lanes.join("\n")} return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node; } function createFunctionTypeNode(typeParameters, parameters, type) { - const node = createBaseDeclaration(183 /* FunctionType */); + const node = createBaseDeclaration(184 /* FunctionType */); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; @@ -291093,7 +292302,7 @@ ${lanes.join("\n")} return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); } function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) { - const node = createBaseDeclaration(184 /* ConstructorType */); + const node = createBaseDeclaration(185 /* ConstructorType */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); @@ -291124,7 +292333,7 @@ ${lanes.join("\n")} return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type); } function createTypeQueryNode(exprName, typeArguments) { - const node = createBaseNode(185 /* TypeQuery */); + const node = createBaseNode(186 /* TypeQuery */); node.exprName = exprName; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags = 1 /* ContainsTypeScript */; @@ -291134,7 +292343,7 @@ ${lanes.join("\n")} return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node; } function createTypeLiteralNode(members) { - const node = createBaseDeclaration(186 /* TypeLiteral */); + const node = createBaseDeclaration(187 /* TypeLiteral */); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -291143,7 +292352,7 @@ ${lanes.join("\n")} return node.members !== members ? update(createTypeLiteralNode(members), node) : node; } function createArrayTypeNode(elementType) { - const node = createBaseNode(187 /* ArrayType */); + const node = createBaseNode(188 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -291152,7 +292361,7 @@ ${lanes.join("\n")} return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node; } function createTupleTypeNode(elements) { - const node = createBaseNode(188 /* TupleType */); + const node = createBaseNode(189 /* TupleType */); node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -291161,7 +292370,7 @@ ${lanes.join("\n")} return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node; } function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - const node = createBaseDeclaration(201 /* NamedTupleMember */); + const node = createBaseDeclaration(202 /* NamedTupleMember */); node.dotDotDotToken = dotDotDotToken; node.name = name; node.questionToken = questionToken; @@ -291174,7 +292383,7 @@ ${lanes.join("\n")} return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node; } function createOptionalTypeNode(type) { - const node = createBaseNode(189 /* OptionalType */); + const node = createBaseNode(190 /* OptionalType */); node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -291183,7 +292392,7 @@ ${lanes.join("\n")} return node.type !== type ? update(createOptionalTypeNode(type), node) : node; } function createRestTypeNode(type) { - const node = createBaseNode(190 /* RestType */); + const node = createBaseNode(191 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -291201,19 +292410,19 @@ ${lanes.join("\n")} return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node; } function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(191 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); + return createUnionOrIntersectionTypeNode(192 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } function updateUnionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); } function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(192 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); + return createUnionOrIntersectionTypeNode(193 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } function updateIntersectionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - const node = createBaseNode(193 /* ConditionalType */); + const node = createBaseNode(194 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); node.trueType = trueType; @@ -291227,7 +292436,7 @@ ${lanes.join("\n")} return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node; } function createInferTypeNode(typeParameter) { - const node = createBaseNode(194 /* InferType */); + const node = createBaseNode(195 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -291236,7 +292445,7 @@ ${lanes.join("\n")} return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node; } function createTemplateLiteralType(head, templateSpans) { - const node = createBaseNode(202 /* TemplateLiteralType */); + const node = createBaseNode(203 /* TemplateLiteralType */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags = 1 /* ContainsTypeScript */; @@ -291245,21 +292454,24 @@ ${lanes.join("\n")} function updateTemplateLiteralType(node, head, templateSpans) { return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node; } - function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf = false) { - const node = createBaseNode(204 /* ImportType */); + function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) { + const node = createBaseNode(205 /* ImportType */); node.argument = argument; - node.assertions = assertions; + node.attributes = attributes; + if (node.assertions && node.assertions.assertClause && node.attributes) { + node.assertions.assertClause = node.attributes; + } node.qualifier = qualifier; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.isTypeOf = isTypeOf; node.transformFlags = 1 /* ContainsTypeScript */; return node; } - function updateImportTypeNode(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) { - return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node; + function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) { + return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node; } function createParenthesizedType(type) { - const node = createBaseNode(195 /* ParenthesizedType */); + const node = createBaseNode(196 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -291268,12 +292480,12 @@ ${lanes.join("\n")} return node.type !== type ? update(createParenthesizedType(type), node) : node; } function createThisTypeNode() { - const node = createBaseNode(196 /* ThisType */); + const node = createBaseNode(197 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } function createTypeOperatorNode(operator, type) { - const node = createBaseNode(197 /* TypeOperator */); + const node = createBaseNode(198 /* TypeOperator */); node.operator = operator; node.type = operator === 148 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -291283,7 +292495,7 @@ ${lanes.join("\n")} return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node; } function createIndexedAccessTypeNode(objectType, indexType) { - const node = createBaseNode(198 /* IndexedAccessType */); + const node = createBaseNode(199 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; @@ -291293,7 +292505,7 @@ ${lanes.join("\n")} return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node; } function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) { - const node = createBaseDeclaration(199 /* MappedType */); + const node = createBaseDeclaration(200 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.nameType = nameType; @@ -291309,7 +292521,7 @@ ${lanes.join("\n")} return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; } function createLiteralTypeNode(literal) { - const node = createBaseNode(200 /* LiteralType */); + const node = createBaseNode(201 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -291318,7 +292530,7 @@ ${lanes.join("\n")} return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node; } function createObjectBindingPattern(elements) { - const node = createBaseNode(205 /* ObjectBindingPattern */); + const node = createBaseNode(206 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { @@ -291330,7 +292542,7 @@ ${lanes.join("\n")} return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node; } function createArrayBindingPattern(elements) { - const node = createBaseNode(206 /* ArrayBindingPattern */); + const node = createBaseNode(207 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; return node; @@ -291339,7 +292551,7 @@ ${lanes.join("\n")} return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node; } function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - const node = createBaseDeclaration(207 /* BindingElement */); + const node = createBaseDeclaration(208 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -291352,7 +292564,7 @@ ${lanes.join("\n")} return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node; } function createArrayLiteralExpression(elements, multiLine) { - const node = createBaseNode(208 /* ArrayLiteralExpression */); + const node = createBaseNode(209 /* ArrayLiteralExpression */); const lastElement = elements && lastOrUndefined(elements); const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); @@ -291364,7 +292576,7 @@ ${lanes.join("\n")} return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node; } function createObjectLiteralExpression(properties, multiLine) { - const node = createBaseDeclaration(209 /* ObjectLiteralExpression */); + const node = createBaseDeclaration(210 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); @@ -291375,7 +292587,7 @@ ${lanes.join("\n")} return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node; } function createBasePropertyAccessExpression(expression, questionDotToken, name) { - const node = createBaseDeclaration(210 /* PropertyAccessExpression */); + const node = createBaseDeclaration(211 /* PropertyAccessExpression */); node.expression = expression; node.questionDotToken = questionDotToken; node.name = name; @@ -291416,16 +292628,16 @@ ${lanes.join("\n")} questionDotToken, asName(name) ); - node.flags |= 32 /* OptionalChain */; + node.flags |= 64 /* OptionalChain */; node.transformFlags |= 32 /* ContainsES2020 */; return node; } function updatePropertyAccessChain(node, expression, questionDotToken, name) { - Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."); + Debug.assert(!!(node.flags & 64 /* OptionalChain */), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."); return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node; } function createBaseElementAccessExpression(expression, questionDotToken, argumentExpression) { - const node = createBaseDeclaration(211 /* ElementAccessExpression */); + const node = createBaseDeclaration(212 /* ElementAccessExpression */); node.expression = expression; node.questionDotToken = questionDotToken; node.argumentExpression = argumentExpression; @@ -291466,16 +292678,16 @@ ${lanes.join("\n")} questionDotToken, asExpression(index) ); - node.flags |= 32 /* OptionalChain */; + node.flags |= 64 /* OptionalChain */; node.transformFlags |= 32 /* ContainsES2020 */; return node; } function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) { - Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."); + Debug.assert(!!(node.flags & 64 /* OptionalChain */), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."); return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node; } function createBaseCallExpression(expression, questionDotToken, typeArguments, argumentsArray) { - const node = createBaseDeclaration(212 /* CallExpression */); + const node = createBaseDeclaration(213 /* CallExpression */); node.expression = expression; node.questionDotToken = questionDotToken; node.typeArguments = typeArguments; @@ -291523,16 +292735,16 @@ ${lanes.join("\n")} asNodeArray(typeArguments), parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) ); - node.flags |= 32 /* OptionalChain */; + node.flags |= 64 /* OptionalChain */; node.transformFlags |= 32 /* ContainsES2020 */; return node; } function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) { - Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a CallExpression using updateCallChain. Use updateCall instead."); + Debug.assert(!!(node.flags & 64 /* OptionalChain */), "Cannot update a CallExpression using updateCallChain. Use updateCall instead."); return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node; } function createNewExpression(expression, typeArguments, argumentsArray) { - const node = createBaseDeclaration(213 /* NewExpression */); + const node = createBaseDeclaration(214 /* NewExpression */); node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0; @@ -291546,7 +292758,7 @@ ${lanes.join("\n")} return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node; } function createTaggedTemplateExpression(tag, typeArguments, template) { - const node = createBaseNode(214 /* TaggedTemplateExpression */); + const node = createBaseNode(215 /* TaggedTemplateExpression */); node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess( tag, /*optionalChain*/ @@ -291567,7 +292779,7 @@ ${lanes.join("\n")} return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node; } function createTypeAssertion(type, expression) { - const node = createBaseNode(215 /* TypeAssertionExpression */); + const node = createBaseNode(216 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; @@ -291577,7 +292789,7 @@ ${lanes.join("\n")} return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node; } function createParenthesizedExpression(expression) { - const node = createBaseNode(216 /* ParenthesizedExpression */); + const node = createBaseNode(217 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); node.jsDoc = void 0; @@ -291587,7 +292799,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node; } function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(217 /* FunctionExpression */); + const node = createBaseDeclaration(218 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -291595,7 +292807,7 @@ ${lanes.join("\n")} node.parameters = createNodeArray(parameters); node.type = type; node.body = body; - const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; + const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */; const isGenerator = !!node.asteriskToken; const isAsyncGenerator = isAsync && isGenerator; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; @@ -291612,14 +292824,14 @@ ${lanes.join("\n")} return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; } function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - const node = createBaseDeclaration(218 /* ArrowFunction */); + const node = createBaseDeclaration(219 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; node.equalsGreaterThanToken = equalsGreaterThanToken ?? createToken(39 /* EqualsGreaterThanToken */); node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body); - const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; + const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */; node.typeArguments = void 0; node.jsDoc = void 0; @@ -291634,7 +292846,7 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; } function createDeleteExpression(expression) { - const node = createBaseNode(219 /* DeleteExpression */); + const node = createBaseNode(220 /* DeleteExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -291643,7 +292855,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createDeleteExpression(expression), node) : node; } function createTypeOfExpression(expression) { - const node = createBaseNode(220 /* TypeOfExpression */); + const node = createBaseNode(221 /* TypeOfExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -291652,7 +292864,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node; } function createVoidExpression(expression) { - const node = createBaseNode(221 /* VoidExpression */); + const node = createBaseNode(222 /* VoidExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -291661,7 +292873,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createVoidExpression(expression), node) : node; } function createAwaitExpression(expression) { - const node = createBaseNode(222 /* AwaitExpression */); + const node = createBaseNode(223 /* AwaitExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */; return node; @@ -291670,7 +292882,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createAwaitExpression(expression), node) : node; } function createPrefixUnaryExpression(operator, operand) { - const node = createBaseNode(223 /* PrefixUnaryExpression */); + const node = createBaseNode(224 /* PrefixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -291683,7 +292895,7 @@ ${lanes.join("\n")} return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node; } function createPostfixUnaryExpression(operand, operator) { - const node = createBaseNode(224 /* PostfixUnaryExpression */); + const node = createBaseNode(225 /* PostfixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -291696,7 +292908,7 @@ ${lanes.join("\n")} return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node; } function createBinaryExpression(left, operator, right) { - const node = createBaseDeclaration(225 /* BinaryExpression */); + const node = createBaseDeclaration(226 /* BinaryExpression */); const operatorToken = asToken(operator); const operatorKind = operatorToken.kind; node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); @@ -291729,7 +292941,7 @@ ${lanes.join("\n")} return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node; } function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { - const node = createBaseNode(226 /* ConditionalExpression */); + const node = createBaseNode(227 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); node.questionToken = questionToken ?? createToken(58 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); @@ -291742,7 +292954,7 @@ ${lanes.join("\n")} return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node; } function createTemplateExpression(head, templateSpans) { - const node = createBaseNode(227 /* TemplateExpression */); + const node = createBaseNode(228 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */; @@ -291817,7 +293029,7 @@ ${lanes.join("\n")} } function createYieldExpression(asteriskToken, expression) { Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - const node = createBaseNode(228 /* YieldExpression */); + const node = createBaseNode(229 /* YieldExpression */); node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.asteriskToken = asteriskToken; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */; @@ -291827,7 +293039,7 @@ ${lanes.join("\n")} return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node; } function createSpreadElement(expression) { - const node = createBaseNode(229 /* SpreadElement */); + const node = createBaseNode(230 /* SpreadElement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */; return node; @@ -291836,7 +293048,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createSpreadElement(expression), node) : node; } function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(230 /* ClassExpression */); + const node = createBaseDeclaration(231 /* ClassExpression */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -291850,10 +293062,10 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createOmittedExpression() { - return createBaseNode(231 /* OmittedExpression */); + return createBaseNode(232 /* OmittedExpression */); } function createExpressionWithTypeArguments(expression, typeArguments) { - const node = createBaseNode(232 /* ExpressionWithTypeArguments */); + const node = createBaseNode(233 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -291867,7 +293079,7 @@ ${lanes.join("\n")} return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node; } function createAsExpression(expression, type) { - const node = createBaseNode(233 /* AsExpression */); + const node = createBaseNode(234 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; @@ -291877,7 +293089,7 @@ ${lanes.join("\n")} return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node; } function createNonNullExpression(expression) { - const node = createBaseNode(234 /* NonNullExpression */); + const node = createBaseNode(235 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -291893,7 +293105,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createNonNullExpression(expression), node) : node; } function createSatisfiesExpression(expression, type) { - const node = createBaseNode(237 /* SatisfiesExpression */); + const node = createBaseNode(238 /* SatisfiesExpression */); node.expression = expression; node.type = type; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; @@ -291903,8 +293115,8 @@ ${lanes.join("\n")} return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node; } function createNonNullChain(expression) { - const node = createBaseNode(234 /* NonNullExpression */); - node.flags |= 32 /* OptionalChain */; + const node = createBaseNode(235 /* NonNullExpression */); + node.flags |= 64 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( expression, /*optionalChain*/ @@ -291914,11 +293126,11 @@ ${lanes.join("\n")} return node; } function updateNonNullChain(node, expression) { - Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); + Debug.assert(!!(node.flags & 64 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); return node.expression !== expression ? update(createNonNullChain(expression), node) : node; } function createMetaProperty(keywordToken, name) { - const node = createBaseNode(235 /* MetaProperty */); + const node = createBaseNode(236 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; node.transformFlags |= propagateChildFlags(node.name); @@ -291939,7 +293151,7 @@ ${lanes.join("\n")} return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node; } function createTemplateSpan(expression, literal) { - const node = createBaseNode(238 /* TemplateSpan */); + const node = createBaseNode(239 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */; @@ -291949,12 +293161,12 @@ ${lanes.join("\n")} return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node; } function createSemicolonClassElement() { - const node = createBaseNode(239 /* SemicolonClassElement */); + const node = createBaseNode(240 /* SemicolonClassElement */); node.transformFlags |= 1024 /* ContainsES2015 */; return node; } function createBlock(statements, multiLine) { - const node = createBaseNode(240 /* Block */); + const node = createBaseNode(241 /* Block */); node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); @@ -291967,11 +293179,11 @@ ${lanes.join("\n")} return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node; } function createVariableStatement(modifiers, declarationList) { - const node = createBaseNode(242 /* VariableStatement */); + const node = createBaseNode(243 /* VariableStatement */); node.modifiers = asNodeArray(modifiers); node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); - if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { + if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } node.jsDoc = void 0; @@ -291982,12 +293194,12 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node; } function createEmptyStatement() { - const node = createBaseNode(241 /* EmptyStatement */); + const node = createBaseNode(242 /* EmptyStatement */); node.jsDoc = void 0; return node; } function createExpressionStatement(expression) { - const node = createBaseNode(243 /* ExpressionStatement */); + const node = createBaseNode(244 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; @@ -291998,7 +293210,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createExpressionStatement(expression), node) : node; } function createIfStatement(expression, thenStatement, elseStatement) { - const node = createBaseNode(244 /* IfStatement */); + const node = createBaseNode(245 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -292011,7 +293223,7 @@ ${lanes.join("\n")} return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node; } function createDoStatement(statement, expression) { - const node = createBaseNode(245 /* DoStatement */); + const node = createBaseNode(246 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); @@ -292023,7 +293235,7 @@ ${lanes.join("\n")} return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node; } function createWhileStatement(expression, statement) { - const node = createBaseNode(246 /* WhileStatement */); + const node = createBaseNode(247 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); @@ -292035,7 +293247,7 @@ ${lanes.join("\n")} return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node; } function createForStatement(initializer, condition, incrementor, statement) { - const node = createBaseNode(247 /* ForStatement */); + const node = createBaseNode(248 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -292051,7 +293263,7 @@ ${lanes.join("\n")} return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update(createForStatement(initializer, condition, incrementor, statement), node) : node; } function createForInStatement(initializer, expression, statement) { - const node = createBaseNode(248 /* ForInStatement */); + const node = createBaseNode(249 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -292066,7 +293278,7 @@ ${lanes.join("\n")} return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForInStatement(initializer, expression, statement), node) : node; } function createForOfStatement(awaitModifier, initializer, expression, statement) { - const node = createBaseNode(249 /* ForOfStatement */); + const node = createBaseNode(250 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); @@ -292084,7 +293296,7 @@ ${lanes.join("\n")} return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node; } function createContinueStatement(label) { - const node = createBaseNode(250 /* ContinueStatement */); + const node = createBaseNode(251 /* ContinueStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; @@ -292095,7 +293307,7 @@ ${lanes.join("\n")} return node.label !== label ? update(createContinueStatement(label), node) : node; } function createBreakStatement(label) { - const node = createBaseNode(251 /* BreakStatement */); + const node = createBaseNode(252 /* BreakStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; @@ -292106,7 +293318,7 @@ ${lanes.join("\n")} return node.label !== label ? update(createBreakStatement(label), node) : node; } function createReturnStatement(expression) { - const node = createBaseNode(252 /* ReturnStatement */); + const node = createBaseNode(253 /* ReturnStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; node.jsDoc = void 0; @@ -292117,7 +293329,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createReturnStatement(expression), node) : node; } function createWithStatement(expression, statement) { - const node = createBaseNode(253 /* WithStatement */); + const node = createBaseNode(254 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); @@ -292129,7 +293341,7 @@ ${lanes.join("\n")} return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node; } function createSwitchStatement(expression, caseBlock) { - const node = createBaseNode(254 /* SwitchStatement */); + const node = createBaseNode(255 /* SwitchStatement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.caseBlock = caseBlock; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); @@ -292142,7 +293354,7 @@ ${lanes.join("\n")} return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node; } function createLabeledStatement(label, statement) { - const node = createBaseNode(255 /* LabeledStatement */); + const node = createBaseNode(256 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); @@ -292154,7 +293366,7 @@ ${lanes.join("\n")} return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node; } function createThrowStatement(expression) { - const node = createBaseNode(256 /* ThrowStatement */); + const node = createBaseNode(257 /* ThrowStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.jsDoc = void 0; @@ -292165,7 +293377,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createThrowStatement(expression), node) : node; } function createTryStatement(tryBlock, catchClause, finallyBlock) { - const node = createBaseNode(257 /* TryStatement */); + const node = createBaseNode(258 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -292178,13 +293390,13 @@ ${lanes.join("\n")} return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; } function createDebuggerStatement() { - const node = createBaseNode(258 /* DebuggerStatement */); + const node = createBaseNode(259 /* DebuggerStatement */); node.jsDoc = void 0; node.flowNode = void 0; return node; } function createVariableDeclaration(name, exclamationToken, type, initializer) { - const node = createBaseDeclaration(259 /* VariableDeclaration */); + const node = createBaseDeclaration(260 /* VariableDeclaration */); node.name = asName(name); node.exclamationToken = exclamationToken; node.type = type; @@ -292197,20 +293409,23 @@ ${lanes.join("\n")} return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node) : node; } function createVariableDeclarationList(declarations, flags2 = 0 /* None */) { - const node = createBaseNode(260 /* VariableDeclarationList */); - node.flags |= flags2 & 3 /* BlockScoped */; + const node = createBaseNode(261 /* VariableDeclarationList */); + node.flags |= flags2 & 7 /* BlockScoped */; node.declarations = createNodeArray(declarations); node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; - if (flags2 & 3 /* BlockScoped */) { + if (flags2 & 7 /* BlockScoped */) { node.transformFlags |= 1024 /* ContainsES2015 */ | 262144 /* ContainsBlockScopedBinding */; } + if (flags2 & 4 /* Using */) { + node.transformFlags |= 4 /* ContainsESNext */; + } return node; } function updateVariableDeclarationList(node, declarations) { return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node; } function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - const node = createBaseDeclaration(261 /* FunctionDeclaration */); + const node = createBaseDeclaration(262 /* FunctionDeclaration */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -292218,10 +293433,10 @@ ${lanes.join("\n")} node.parameters = createNodeArray(parameters); node.type = type; node.body = body; - if (!node.body || modifiersToFlags(node.modifiers) & 2 /* Ambient */) { + if (!node.body || modifiersToFlags(node.modifiers) & 128 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } else { - const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */; + const isAsync = modifiersToFlags(node.modifiers) & 1024 /* Async */; const isGenerator = !!node.asteriskToken; const isAsyncGenerator = isAsync && isGenerator; node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; @@ -292246,13 +293461,13 @@ ${lanes.join("\n")} return finishUpdateBaseSignatureDeclaration(updated, original); } function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(262 /* ClassDeclaration */); + const node = createBaseDeclaration(263 /* ClassDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); node.heritageClauses = asNodeArray(heritageClauses); node.members = createNodeArray(members); - if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { + if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } else { node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */; @@ -292267,7 +293482,7 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) { - const node = createBaseDeclaration(263 /* InterfaceDeclaration */); + const node = createBaseDeclaration(264 /* InterfaceDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -292281,7 +293496,7 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; } function createTypeAliasDeclaration(modifiers, name, typeParameters, type) { - const node = createBaseDeclaration(264 /* TypeAliasDeclaration */); + const node = createBaseDeclaration(265 /* TypeAliasDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.typeParameters = asNodeArray(typeParameters); @@ -292296,7 +293511,7 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? update(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; } function createEnumDeclaration(modifiers, name, members) { - const node = createBaseDeclaration(265 /* EnumDeclaration */); + const node = createBaseDeclaration(266 /* EnumDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.members = createNodeArray(members); @@ -292309,12 +293524,12 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createEnumDeclaration(modifiers, name, members), node) : node; } function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) { - const node = createBaseDeclaration(266 /* ModuleDeclaration */); + const node = createBaseDeclaration(267 /* ModuleDeclaration */); node.modifiers = asNodeArray(modifiers); - node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); + node.flags |= flags2 & (32 /* Namespace */ | 8 /* NestedNamespace */ | 2048 /* GlobalAugmentation */); node.name = name; node.body = body; - if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { + if (modifiersToFlags(node.modifiers) & 128 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } else { node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */; @@ -292329,7 +293544,7 @@ ${lanes.join("\n")} return node.modifiers !== modifiers || node.name !== name || node.body !== body ? update(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; } function createModuleBlock(statements) { - const node = createBaseNode(267 /* ModuleBlock */); + const node = createBaseNode(268 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); node.jsDoc = void 0; @@ -292339,7 +293554,7 @@ ${lanes.join("\n")} return node.statements !== statements ? update(createModuleBlock(statements), node) : node; } function createCaseBlock(clauses) { - const node = createBaseNode(268 /* CaseBlock */); + const node = createBaseNode(269 /* CaseBlock */); node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); node.locals = void 0; @@ -292350,7 +293565,7 @@ ${lanes.join("\n")} return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node; } function createNamespaceExportDeclaration(name) { - const node = createBaseDeclaration(269 /* NamespaceExportDeclaration */); + const node = createBaseDeclaration(270 /* NamespaceExportDeclaration */); node.name = asName(name); node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */; node.modifiers = void 0; @@ -292367,7 +293582,7 @@ ${lanes.join("\n")} return update(updated, original); } function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) { - const node = createBaseDeclaration(270 /* ImportEqualsDeclaration */); + const node = createBaseDeclaration(271 /* ImportEqualsDeclaration */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.isTypeOnly = isTypeOnly; @@ -292383,22 +293598,22 @@ ${lanes.join("\n")} function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) { return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; } - function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) { - const node = createBaseNode(271 /* ImportDeclaration */); + function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) { + const node = createBaseNode(272 /* ImportDeclaration */); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; - node.assertClause = assertClause; + node.attributes = node.assertClause = attributes; node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; node.jsDoc = void 0; return node; } - function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; + function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) { + return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node; } function createImportClause(isTypeOnly, name, namedBindings) { - const node = createBaseDeclaration(272 /* ImportClause */); + const node = createBaseDeclaration(273 /* ImportClause */); node.isTypeOnly = isTypeOnly; node.name = name; node.namedBindings = namedBindings; @@ -292413,9 +293628,10 @@ ${lanes.join("\n")} return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? update(createImportClause(isTypeOnly, name, namedBindings), node) : node; } function createAssertClause(elements, multiLine) { - const node = createBaseNode(299 /* AssertClause */); + const node = createBaseNode(300 /* AssertClause */); node.elements = createNodeArray(elements); node.multiLine = multiLine; + node.token = 132 /* AssertKeyword */; node.transformFlags |= 4 /* ContainsESNext */; return node; } @@ -292423,7 +293639,7 @@ ${lanes.join("\n")} return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node; } function createAssertEntry(name, value) { - const node = createBaseNode(300 /* AssertEntry */); + const node = createBaseNode(301 /* AssertEntry */); node.name = name; node.value = value; node.transformFlags |= 4 /* ContainsESNext */; @@ -292433,7 +293649,7 @@ ${lanes.join("\n")} return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node; } function createImportTypeAssertionContainer(clause, multiLine) { - const node = createBaseNode(301 /* ImportTypeAssertionContainer */); + const node = createBaseNode(302 /* ImportTypeAssertionContainer */); node.assertClause = clause; node.multiLine = multiLine; return node; @@ -292441,8 +293657,29 @@ ${lanes.join("\n")} function updateImportTypeAssertionContainer(node, clause, multiLine) { return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node; } + function createImportAttributes(elements, multiLine, token) { + const node = createBaseNode(300 /* ImportAttributes */); + node.token = token ?? 118 /* WithKeyword */; + node.elements = createNodeArray(elements); + node.multiLine = multiLine; + node.transformFlags |= 4 /* ContainsESNext */; + return node; + } + function updateImportAttributes(node, elements, multiLine) { + return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node; + } + function createImportAttribute(name, value) { + const node = createBaseNode(301 /* ImportAttribute */); + node.name = name; + node.value = value; + node.transformFlags |= 4 /* ContainsESNext */; + return node; + } + function updateImportAttribute(node, name, value) { + return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node; + } function createNamespaceImport(name) { - const node = createBaseDeclaration(273 /* NamespaceImport */); + const node = createBaseDeclaration(274 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -292452,7 +293689,7 @@ ${lanes.join("\n")} return node.name !== name ? update(createNamespaceImport(name), node) : node; } function createNamespaceExport(name) { - const node = createBaseDeclaration(279 /* NamespaceExport */); + const node = createBaseDeclaration(280 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | 32 /* ContainsES2020 */; node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -292462,7 +293699,7 @@ ${lanes.join("\n")} return node.name !== name ? update(createNamespaceExport(name), node) : node; } function createNamedImports(elements) { - const node = createBaseNode(274 /* NamedImports */); + const node = createBaseNode(275 /* NamedImports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -292472,7 +293709,7 @@ ${lanes.join("\n")} return node.elements !== elements ? update(createNamedImports(elements), node) : node; } function createImportSpecifier(isTypeOnly, propertyName, name) { - const node = createBaseDeclaration(275 /* ImportSpecifier */); + const node = createBaseDeclaration(276 /* ImportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = propertyName; node.name = name; @@ -292484,7 +293721,7 @@ ${lanes.join("\n")} return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier(isTypeOnly, propertyName, name), node) : node; } function createExportAssignment2(modifiers, isExportEquals, expression) { - const node = createBaseDeclaration(276 /* ExportAssignment */); + const node = createBaseDeclaration(277 /* ExportAssignment */); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary( @@ -292501,20 +293738,20 @@ ${lanes.join("\n")} function updateExportAssignment(node, modifiers, expression) { return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node; } - function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - const node = createBaseDeclaration(277 /* ExportDeclaration */); + function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) { + const node = createBaseDeclaration(278 /* ExportDeclaration */); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; - node.assertClause = assertClause; + node.attributes = node.assertClause = attributes; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; node.jsDoc = void 0; return node; } - function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { - return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node; + function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes), node) : node; } function finishUpdateExportDeclaration(updated, original) { if (updated !== original) { @@ -292525,7 +293762,7 @@ ${lanes.join("\n")} return update(updated, original); } function createNamedExports(elements) { - const node = createBaseNode(278 /* NamedExports */); + const node = createBaseNode(279 /* NamedExports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -292535,7 +293772,7 @@ ${lanes.join("\n")} return node.elements !== elements ? update(createNamedExports(elements), node) : node; } function createExportSpecifier(isTypeOnly, propertyName, name) { - const node = createBaseNode(280 /* ExportSpecifier */); + const node = createBaseNode(281 /* ExportSpecifier */); node.isTypeOnly = isTypeOnly; node.propertyName = asName(propertyName); node.name = asName(name); @@ -292548,12 +293785,12 @@ ${lanes.join("\n")} return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node; } function createMissingDeclaration() { - const node = createBaseDeclaration(281 /* MissingDeclaration */); + const node = createBaseDeclaration(282 /* MissingDeclaration */); node.jsDoc = void 0; return node; } function createExternalModuleReference(expression) { - const node = createBaseNode(282 /* ExternalModuleReference */); + const node = createBaseNode(283 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; @@ -292585,7 +293822,7 @@ ${lanes.join("\n")} return node.type !== type ? update(createJSDocUnaryTypeWorker(kind, type), node) : node; } function createJSDocFunctionType(parameters, type) { - const node = createBaseDeclaration(323 /* JSDocFunctionType */); + const node = createBaseDeclaration(324 /* JSDocFunctionType */); node.parameters = asNodeArray(parameters); node.type = type; node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */); @@ -292599,7 +293836,7 @@ ${lanes.join("\n")} return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node; } function createJSDocTypeLiteral(propertyTags, isArrayType = false) { - const node = createBaseDeclaration(328 /* JSDocTypeLiteral */); + const node = createBaseDeclaration(329 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; @@ -292608,7 +293845,7 @@ ${lanes.join("\n")} return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; } function createJSDocTypeExpression(type) { - const node = createBaseNode(315 /* JSDocTypeExpression */); + const node = createBaseNode(316 /* JSDocTypeExpression */); node.type = type; return node; } @@ -292616,7 +293853,7 @@ ${lanes.join("\n")} return node.type !== type ? update(createJSDocTypeExpression(type), node) : node; } function createJSDocSignature(typeParameters, parameters, type) { - const node = createBaseDeclaration(329 /* JSDocSignature */); + const node = createBaseDeclaration(330 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; @@ -292645,7 +293882,7 @@ ${lanes.join("\n")} return node; } function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - const node = createBaseJSDocTag(351 /* JSDocTemplateTag */, tagName ?? createIdentifier("template"), comment); + const node = createBaseJSDocTag(352 /* JSDocTemplateTag */, tagName ?? createIdentifier("template"), comment); node.constraint = constraint; node.typeParameters = createNodeArray(typeParameters); return node; @@ -292654,7 +293891,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node; } function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(352 /* JSDocTypedefTag */, tagName ?? createIdentifier("typedef"), comment); + const node = createBaseJSDocTagDeclaration(353 /* JSDocTypedefTag */, tagName ?? createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -292666,7 +293903,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node; } function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(347 /* JSDocParameterTag */, tagName ?? createIdentifier("param"), comment); + const node = createBaseJSDocTagDeclaration(348 /* JSDocParameterTag */, tagName ?? createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -292677,7 +293914,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - const node = createBaseJSDocTagDeclaration(354 /* JSDocPropertyTag */, tagName ?? createIdentifier("prop"), comment); + const node = createBaseJSDocTagDeclaration(355 /* JSDocPropertyTag */, tagName ?? createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -292688,7 +293925,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; } function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { - const node = createBaseJSDocTagDeclaration(344 /* JSDocCallbackTag */, tagName ?? createIdentifier("callback"), comment); + const node = createBaseJSDocTagDeclaration(345 /* JSDocCallbackTag */, tagName ?? createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = getJSDocTypeAliasName(fullName); @@ -292700,7 +293937,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node; } function createJSDocOverloadTag(tagName, typeExpression, comment) { - const node = createBaseJSDocTag(345 /* JSDocOverloadTag */, tagName ?? createIdentifier("overload"), comment); + const node = createBaseJSDocTag(346 /* JSDocOverloadTag */, tagName ?? createIdentifier("overload"), comment); node.typeExpression = typeExpression; return node; } @@ -292708,7 +293945,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocOverloadTag(tagName, typeExpression, comment), node) : node; } function createJSDocAugmentsTag(tagName, className, comment) { - const node = createBaseJSDocTag(334 /* JSDocAugmentsTag */, tagName ?? createIdentifier("augments"), comment); + const node = createBaseJSDocTag(335 /* JSDocAugmentsTag */, tagName ?? createIdentifier("augments"), comment); node.class = className; return node; } @@ -292716,12 +293953,12 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag(tagName, className, comment), node) : node; } function createJSDocImplementsTag(tagName, className, comment) { - const node = createBaseJSDocTag(335 /* JSDocImplementsTag */, tagName ?? createIdentifier("implements"), comment); + const node = createBaseJSDocTag(336 /* JSDocImplementsTag */, tagName ?? createIdentifier("implements"), comment); node.class = className; return node; } function createJSDocSeeTag(tagName, name, comment) { - const node = createBaseJSDocTag(353 /* JSDocSeeTag */, tagName ?? createIdentifier("see"), comment); + const node = createBaseJSDocTag(354 /* JSDocSeeTag */, tagName ?? createIdentifier("see"), comment); node.name = name; return node; } @@ -292729,7 +293966,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node; } function createJSDocNameReference(name) { - const node = createBaseNode(316 /* JSDocNameReference */); + const node = createBaseNode(317 /* JSDocNameReference */); node.name = name; return node; } @@ -292737,7 +293974,7 @@ ${lanes.join("\n")} return node.name !== name ? update(createJSDocNameReference(name), node) : node; } function createJSDocMemberName(left, right) { - const node = createBaseNode(317 /* JSDocMemberName */); + const node = createBaseNode(318 /* JSDocMemberName */); node.left = left; node.right = right; node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right); @@ -292747,7 +293984,7 @@ ${lanes.join("\n")} return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node; } function createJSDocLink(name, text) { - const node = createBaseNode(330 /* JSDocLink */); + const node = createBaseNode(331 /* JSDocLink */); node.name = name; node.text = text; return node; @@ -292756,7 +293993,7 @@ ${lanes.join("\n")} return node.name !== name ? update(createJSDocLink(name, text), node) : node; } function createJSDocLinkCode(name, text) { - const node = createBaseNode(331 /* JSDocLinkCode */); + const node = createBaseNode(332 /* JSDocLinkCode */); node.name = name; node.text = text; return node; @@ -292765,7 +294002,7 @@ ${lanes.join("\n")} return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node; } function createJSDocLinkPlain(name, text) { - const node = createBaseNode(332 /* JSDocLinkPlain */); + const node = createBaseNode(333 /* JSDocLinkPlain */); node.name = name; node.text = text; return node; @@ -292792,14 +294029,14 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node; } function createJSDocUnknownTag(tagName, comment) { - const node = createBaseJSDocTag(333 /* JSDocTag */, tagName, comment); + const node = createBaseJSDocTag(334 /* JSDocTag */, tagName, comment); return node; } function updateJSDocUnknownTag(node, tagName, comment) { return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node; } function createJSDocEnumTag(tagName, typeExpression, comment) { - const node = createBaseJSDocTagDeclaration(346 /* JSDocEnumTag */, tagName ?? createIdentifier(getDefaultTagNameForKind(346 /* JSDocEnumTag */)), comment); + const node = createBaseJSDocTagDeclaration(347 /* JSDocEnumTag */, tagName ?? createIdentifier(getDefaultTagNameForKind(347 /* JSDocEnumTag */)), comment); node.typeExpression = typeExpression; node.locals = void 0; node.nextContainer = void 0; @@ -292809,7 +294046,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node; } function createJSDocText(text) { - const node = createBaseNode(327 /* JSDocText */); + const node = createBaseNode(328 /* JSDocText */); node.text = text; return node; } @@ -292817,7 +294054,7 @@ ${lanes.join("\n")} return node.text !== text ? update(createJSDocText(text), node) : node; } function createJSDocComment(comment, tags) { - const node = createBaseNode(326 /* JSDoc */); + const node = createBaseNode(327 /* JSDoc */); node.comment = comment; node.tags = asNodeArray(tags); return node; @@ -292826,7 +294063,7 @@ ${lanes.join("\n")} return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node; } function createJsxElement(openingElement, children, closingElement) { - const node = createBaseNode(283 /* JsxElement */); + const node = createBaseNode(284 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -292837,7 +294074,7 @@ ${lanes.join("\n")} return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement(openingElement, children, closingElement), node) : node; } function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - const node = createBaseNode(284 /* JsxSelfClosingElement */); + const node = createBaseNode(285 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -292851,7 +294088,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node; } function createJsxOpeningElement(tagName, typeArguments, attributes) { - const node = createBaseNode(285 /* JsxOpeningElement */); + const node = createBaseNode(286 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -292865,7 +294102,7 @@ ${lanes.join("\n")} return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; } function createJsxClosingElement(tagName) { - const node = createBaseNode(286 /* JsxClosingElement */); + const node = createBaseNode(287 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */; return node; @@ -292874,7 +294111,7 @@ ${lanes.join("\n")} return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node; } function createJsxFragment(openingFragment, children, closingFragment) { - const node = createBaseNode(287 /* JsxFragment */); + const node = createBaseNode(288 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -292895,17 +294132,17 @@ ${lanes.join("\n")} return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; } function createJsxOpeningFragment() { - const node = createBaseNode(288 /* JsxOpeningFragment */); + const node = createBaseNode(289 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } function createJsxJsxClosingFragment() { - const node = createBaseNode(289 /* JsxClosingFragment */); + const node = createBaseNode(290 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } function createJsxAttribute(name, initializer) { - const node = createBaseDeclaration(290 /* JsxAttribute */); + const node = createBaseDeclaration(291 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */; @@ -292915,7 +294152,7 @@ ${lanes.join("\n")} return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node; } function createJsxAttributes(properties) { - const node = createBaseDeclaration(291 /* JsxAttributes */); + const node = createBaseDeclaration(292 /* JsxAttributes */); node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */; return node; @@ -292924,7 +294161,7 @@ ${lanes.join("\n")} return node.properties !== properties ? update(createJsxAttributes(properties), node) : node; } function createJsxSpreadAttribute(expression) { - const node = createBaseNode(292 /* JsxSpreadAttribute */); + const node = createBaseNode(293 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */; return node; @@ -292933,7 +294170,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node; } function createJsxExpression(dotDotDotToken, expression) { - const node = createBaseNode(293 /* JsxExpression */); + const node = createBaseNode(294 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */; @@ -292943,7 +294180,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node; } function createJsxNamespacedName(namespace, name) { - const node = createBaseNode(294 /* JsxNamespacedName */); + const node = createBaseNode(295 /* JsxNamespacedName */); node.namespace = namespace; node.name = name; node.transformFlags |= propagateChildFlags(node.namespace) | propagateChildFlags(node.name) | 2 /* ContainsJsx */; @@ -292953,7 +294190,7 @@ ${lanes.join("\n")} return node.namespace !== namespace || node.name !== name ? update(createJsxNamespacedName(namespace, name), node) : node; } function createCaseClause(expression, statements) { - const node = createBaseNode(295 /* CaseClause */); + const node = createBaseNode(296 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); @@ -292964,7 +294201,7 @@ ${lanes.join("\n")} return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node; } function createDefaultClause(statements) { - const node = createBaseNode(296 /* DefaultClause */); + const node = createBaseNode(297 /* DefaultClause */); node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; @@ -292973,7 +294210,7 @@ ${lanes.join("\n")} return node.statements !== statements ? update(createDefaultClause(statements), node) : node; } function createHeritageClause(token, types) { - const node = createBaseNode(297 /* HeritageClause */); + const node = createBaseNode(298 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); @@ -292993,7 +294230,7 @@ ${lanes.join("\n")} return node.types !== types ? update(createHeritageClause(node.token, types), node) : node; } function createCatchClause(variableDeclaration, block) { - const node = createBaseNode(298 /* CatchClause */); + const node = createBaseNode(299 /* CatchClause */); node.variableDeclaration = asVariableDeclaration(variableDeclaration); node.block = block; node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block) | (!variableDeclaration ? 64 /* ContainsES2019 */ : 0 /* None */); @@ -293005,7 +294242,7 @@ ${lanes.join("\n")} return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node; } function createPropertyAssignment(name, initializer) { - const node = createBaseDeclaration(302 /* PropertyAssignment */); + const node = createBaseDeclaration(303 /* PropertyAssignment */); node.name = asName(name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); @@ -293027,7 +294264,7 @@ ${lanes.join("\n")} return update(updated, original); } function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - const node = createBaseDeclaration(303 /* ShorthandPropertyAssignment */); + const node = createBaseDeclaration(304 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; @@ -293051,7 +294288,7 @@ ${lanes.join("\n")} return update(updated, original); } function createSpreadAssignment(expression) { - const node = createBaseDeclaration(304 /* SpreadAssignment */); + const node = createBaseDeclaration(305 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; node.jsDoc = void 0; @@ -293061,7 +294298,7 @@ ${lanes.join("\n")} return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node; } function createEnumMember(name, initializer) { - const node = createBaseDeclaration(305 /* EnumMember */); + const node = createBaseDeclaration(306 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; @@ -293072,7 +294309,7 @@ ${lanes.join("\n")} return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node; } function createSourceFile2(statements, endOfFileToken, flags2) { - const node = baseFactory2.createBaseSourceFileNode(311 /* SourceFile */); + const node = baseFactory2.createBaseSourceFileNode(312 /* SourceFile */); node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags2; @@ -293112,7 +294349,6 @@ ${lanes.join("\n")} node.imports = void 0; node.moduleAugmentations = void 0; node.ambientModuleNames = void 0; - node.resolvedModules = void 0; node.classifiableNames = void 0; node.impliedNodeFormat = void 0; return node; @@ -293142,7 +294378,7 @@ ${lanes.join("\n")} } function cloneRedirectedSourceFile(source) { const node = createRedirectedSourceFile(source.redirectInfo); - node.flags |= source.flags & ~8 /* Synthesized */; + node.flags |= source.flags & ~16 /* Synthesized */; node.fileName = source.fileName; node.path = source.path; node.resolvedPath = source.resolvedPath; @@ -293153,8 +294389,8 @@ ${lanes.join("\n")} return node; } function cloneSourceFileWorker(source) { - const node = baseFactory2.createBaseSourceFileNode(311 /* SourceFile */); - node.flags |= source.flags & ~8 /* Synthesized */; + const node = baseFactory2.createBaseSourceFileNode(312 /* SourceFile */); + node.flags |= source.flags & ~16 /* Synthesized */; for (const p in source) { if (hasProperty(node, p) || !hasProperty(source, p)) { continue; @@ -293169,7 +294405,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) { @@ -293187,7 +294423,7 @@ ${lanes.join("\n")} return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node; } function createBundle(sourceFiles, prepends = emptyArray) { - const node = createBaseNode(312 /* Bundle */); + const node = createBaseNode(313 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; node.syntheticFileReferences = void 0; @@ -293200,7 +294436,7 @@ ${lanes.join("\n")} return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle(sourceFiles, prepends), node) : node; } function createUnparsedSource(prologues, syntheticReferences, texts) { - const node = createBaseNode(313 /* UnparsedSource */); + const node = createBaseNode(314 /* UnparsedSource */); node.prologues = prologues; node.syntheticReferences = syntheticReferences; node.texts = texts; @@ -293217,48 +294453,48 @@ ${lanes.join("\n")} return node; } function createUnparsedPrologue(data) { - return createBaseUnparsedNode(306 /* UnparsedPrologue */, data); + return createBaseUnparsedNode(307 /* UnparsedPrologue */, data); } function createUnparsedPrepend(data, texts) { - const node = createBaseUnparsedNode(307 /* UnparsedPrepend */, data); + const node = createBaseUnparsedNode(308 /* UnparsedPrepend */, data); node.texts = texts; return node; } function createUnparsedTextLike(data, internal) { - return createBaseUnparsedNode(internal ? 309 /* UnparsedInternalText */ : 308 /* UnparsedText */, data); + return createBaseUnparsedNode(internal ? 310 /* UnparsedInternalText */ : 309 /* UnparsedText */, data); } function createUnparsedSyntheticReference(section) { - const node = createBaseNode(310 /* UnparsedSyntheticReference */); + const node = createBaseNode(311 /* UnparsedSyntheticReference */); node.data = section.data; node.section = section; return node; } function createInputFiles2() { - const node = createBaseNode(314 /* InputFiles */); + const node = createBaseNode(315 /* InputFiles */); node.javascriptText = ""; node.declarationText = ""; return node; } function createSyntheticExpression(type, isSpread = false, tupleNameSource) { - const node = createBaseNode(236 /* SyntheticExpression */); + const node = createBaseNode(237 /* SyntheticExpression */); node.type = type; node.isSpread = isSpread; node.tupleNameSource = tupleNameSource; return node; } function createSyntaxList3(children) { - const node = createBaseNode(357 /* SyntaxList */); + const node = createBaseNode(358 /* SyntaxList */); node._children = children; return node; } function createNotEmittedStatement(original) { - const node = createBaseNode(358 /* NotEmittedStatement */); + const node = createBaseNode(359 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; } function createPartiallyEmittedExpression(expression, original) { - const node = createBaseNode(359 /* PartiallyEmittedExpression */); + const node = createBaseNode(360 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; @@ -293280,7 +294516,7 @@ ${lanes.join("\n")} return node; } function createCommaListExpression(elements) { - const node = createBaseNode(360 /* CommaListExpression */); + const node = createBaseNode(361 /* CommaListExpression */); node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -293289,7 +294525,7 @@ ${lanes.join("\n")} return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; } function createSyntheticReferenceExpression(expression, thisArg) { - const node = createBaseNode(361 /* SyntheticReferenceExpression */); + const node = createBaseNode(362 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); @@ -293300,20 +294536,20 @@ ${lanes.join("\n")} } function cloneGeneratedIdentifier(node) { const clone2 = createBaseIdentifier(node.escapedText); - clone2.flags |= node.flags & ~8 /* Synthesized */; + clone2.flags |= node.flags & ~16 /* Synthesized */; clone2.transformFlags = node.transformFlags; - setOriginalNode(clone2, node); + setOriginal(clone2, node); setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function cloneIdentifier(node) { const clone2 = createBaseIdentifier(node.escapedText); - clone2.flags |= node.flags & ~8 /* Synthesized */; + clone2.flags |= node.flags & ~16 /* Synthesized */; clone2.jsDoc = node.jsDoc; 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); @@ -293321,17 +294557,17 @@ ${lanes.join("\n")} } function cloneGeneratedPrivateIdentifier(node) { const clone2 = createBasePrivateIdentifier(node.escapedText); - clone2.flags |= node.flags & ~8 /* Synthesized */; + clone2.flags |= node.flags & ~16 /* Synthesized */; clone2.transformFlags = node.transformFlags; - setOriginalNode(clone2, node); + setOriginal(clone2, node); setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate }); return clone2; } function clonePrivateIdentifier(node) { const clone2 = createBasePrivateIdentifier(node.escapedText); - clone2.flags |= node.flags & ~8 /* Synthesized */; + clone2.flags |= node.flags & ~16 /* Synthesized */; clone2.transformFlags = node.transformFlags; - setOriginalNode(clone2, node); + setOriginal(clone2, node); return clone2; } function cloneNode(node) { @@ -293354,9 +294590,9 @@ ${lanes.join("\n")} return clonePrivateIdentifier(node); } const clone2 = !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind); - clone2.flags |= node.flags & ~8 /* Synthesized */; + 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; @@ -293447,7 +294683,10 @@ ${lanes.join("\n")} ); } function createTypeCheck(value, tag) { - return tag === "undefined" ? factory2.createStrictEquality(value, createVoidZero()) : factory2.createStrictEquality(createTypeOfExpression(value), createStringLiteral(tag)); + return tag === "null" ? factory2.createStrictEquality(value, createNull()) : tag === "undefined" ? factory2.createStrictEquality(value, createVoidZero()) : factory2.createStrictEquality(createTypeOfExpression(value), createStringLiteral(tag)); + } + function createIsNotTypeCheck(value, tag) { + return tag === "null" ? factory2.createStrictInequality(value, createNull()) : tag === "undefined" ? factory2.createStrictInequality(value, createVoidZero()) : factory2.createStrictInequality(createTypeOfExpression(value), createStringLiteral(tag)); } function createMethodCall(object, methodName, argumentsList) { if (isCallChain(object)) { @@ -293522,17 +294761,17 @@ ${lanes.join("\n")} } function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); - case 215 /* TypeAssertionExpression */: + case 216 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 233 /* AsExpression */: + case 234 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); - case 237 /* SatisfiesExpression */: + case 238 /* SatisfiesExpression */: return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); - case 234 /* NonNullExpression */: + case 235 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 359 /* PartiallyEmittedExpression */: + case 360 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } @@ -293572,13 +294811,13 @@ ${lanes.join("\n")} case 10 /* BigIntLiteral */: case 11 /* StringLiteral */: return false; - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: const elements = target.elements; if (elements.length === 0) { return false; } return true; - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -293721,7 +294960,7 @@ ${lanes.join("\n")} return qualifiedName; } function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { - if (ns && hasSyntacticModifier(node, 1 /* Export */)) { + if (ns && hasSyntacticModifier(node, 32 /* Export */)) { return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); } return getExportName(node, allowComments, allowSourceMaps); @@ -293832,14 +295071,35 @@ ${lanes.join("\n")} } return statements; } - function updateModifiers(node, modifiers) { + function replaceModifiers(node, modifiers) { let modifierArray; if (typeof modifiers === "number") { modifierArray = createModifiersFromModifierFlags(modifiers); } else { modifierArray = modifiers; } - return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node); + return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.attributes) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.attributes) : Debug.assertNever(node); + } + function replaceDecoratorsAndModifiers(node, modifierArray) { + return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node); + } + function replacePropertyName(node, name) { + switch (node.kind) { + case 177 /* GetAccessor */: + return updateGetAccessorDeclaration(node, node.modifiers, name, node.parameters, node.type, node.body); + case 178 /* SetAccessor */: + return updateSetAccessorDeclaration(node, node.modifiers, name, node.parameters, node.body); + case 174 /* MethodDeclaration */: + return updateMethodDeclaration(node, node.modifiers, node.asteriskToken, name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body); + case 173 /* MethodSignature */: + return updateMethodSignature(node, node.modifiers, name, node.questionToken, node.typeParameters, node.parameters, node.type); + case 172 /* PropertyDeclaration */: + return updatePropertyDeclaration2(node, node.modifiers, name, node.questionToken ?? node.exclamationToken, node.type, node.initializer); + case 171 /* PropertySignature */: + return updatePropertySignature(node, node.modifiers, name, node.questionToken, node.type); + case 303 /* PropertyAssignment */: + return updatePropertyAssignment(node, name, node.initializer); + } } function asNodeArray(array) { return array ? createNodeArray(array) : void 0; @@ -293857,7 +295117,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)) { @@ -293873,59 +295133,53 @@ ${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) { - case 350 /* JSDocTypeTag */: + case 351 /* JSDocTypeTag */: return "type"; - case 348 /* JSDocReturnTag */: + case 349 /* JSDocReturnTag */: return "returns"; - case 349 /* JSDocThisTag */: + case 350 /* JSDocThisTag */: return "this"; - case 346 /* JSDocEnumTag */: + case 347 /* JSDocEnumTag */: return "enum"; - case 336 /* JSDocAuthorTag */: + case 337 /* JSDocAuthorTag */: return "author"; - case 338 /* JSDocClassTag */: + case 339 /* JSDocClassTag */: return "class"; - case 339 /* JSDocPublicTag */: + case 340 /* JSDocPublicTag */: return "public"; - case 340 /* JSDocPrivateTag */: + case 341 /* JSDocPrivateTag */: return "private"; - case 341 /* JSDocProtectedTag */: + case 342 /* JSDocProtectedTag */: return "protected"; - case 342 /* JSDocReadonlyTag */: + case 343 /* JSDocReadonlyTag */: return "readonly"; - case 343 /* JSDocOverrideTag */: + case 344 /* JSDocOverrideTag */: return "override"; - case 351 /* JSDocTemplateTag */: + case 352 /* JSDocTemplateTag */: return "template"; - case 352 /* JSDocTypedefTag */: + case 353 /* JSDocTypedefTag */: return "typedef"; - case 347 /* JSDocParameterTag */: + case 348 /* JSDocParameterTag */: return "param"; - case 354 /* JSDocPropertyTag */: + case 355 /* JSDocPropertyTag */: return "prop"; - case 344 /* JSDocCallbackTag */: + case 345 /* JSDocCallbackTag */: return "callback"; - case 345 /* JSDocOverloadTag */: + case 346 /* JSDocOverloadTag */: return "overload"; - case 334 /* JSDocAugmentsTag */: + case 335 /* JSDocAugmentsTag */: return "augments"; - case 335 /* JSDocImplementsTag */: + case 336 /* JSDocImplementsTag */: return "implements"; default: return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`); @@ -294007,77 +295261,77 @@ ${lanes.join("\n")} children.transformFlags = subtreeFlags; } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 181 /* FirstTypeNode */ && kind <= 204 /* LastTypeNode */) { + if (kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 208 /* ArrayLiteralExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 209 /* ArrayLiteralExpression */: return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return -1941676032 /* ModuleExcludes */; - case 168 /* Parameter */: + case 169 /* Parameter */: return -2147483648 /* ParameterExcludes */; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return -2072174592 /* ArrowFunctionExcludes */; - case 217 /* FunctionExpression */: - case 261 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: return -1937940480 /* FunctionExcludes */; - case 260 /* VariableDeclarationList */: + case 261 /* VariableDeclarationList */: return -2146893824 /* VariableDeclarationListExcludes */; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: return -2147344384 /* ClassExcludes */; - case 175 /* Constructor */: + case 176 /* Constructor */: return -1937948672 /* ConstructorExcludes */; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return -2013249536 /* PropertyExcludes */; - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return -2005057536 /* MethodOrAccessorExcludes */; case 133 /* AnyKeyword */: case 150 /* NumberKeyword */: - case 162 /* BigIntKeyword */: + case 163 /* BigIntKeyword */: case 146 /* NeverKeyword */: case 154 /* StringKeyword */: case 151 /* ObjectKeyword */: case 136 /* BooleanKeyword */: case 155 /* SymbolKeyword */: case 116 /* VoidKeyword */: - case 167 /* TypeParameter */: - case 170 /* PropertySignature */: - case 172 /* MethodSignature */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 180 /* IndexSignature */: - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: + case 168 /* TypeParameter */: + case 171 /* PropertySignature */: + case 173 /* MethodSignature */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 181 /* IndexSignature */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return -2147278848 /* ObjectLiteralExcludes */; - case 298 /* CatchClause */: + case 299 /* CatchClause */: return -2147418112 /* CatchClauseExcludes */; - case 205 /* ObjectBindingPattern */: - case 206 /* ArrayBindingPattern */: + case 206 /* ObjectBindingPattern */: + case 207 /* ArrayBindingPattern */: return -2147450880 /* BindingPatternExcludes */; - case 215 /* TypeAssertionExpression */: - case 237 /* SatisfiesExpression */: - case 233 /* AsExpression */: - case 359 /* PartiallyEmittedExpression */: - case 216 /* ParenthesizedExpression */: + case 216 /* TypeAssertionExpression */: + case 238 /* SatisfiesExpression */: + case 234 /* AsExpression */: + case 360 /* PartiallyEmittedExpression */: + case 217 /* ParenthesizedExpression */: case 108 /* SuperKeyword */: return -2147483648 /* OuterExpressionExcludes */; - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: return -2147483648 /* PropertyAccessExcludes */; default: return -2147483648 /* NodeExcludes */; } } function makeSynthetic(node) { - node.flags |= 8 /* Synthesized */; + node.flags |= 16 /* Synthesized */; return node; } function createUnparsedSourceFile(textOrInputFiles, mapPathOrType, mapTextOrStripInternal) { @@ -294326,11 +295580,13 @@ ${lanes.join("\n")} return new (SourceMapSource2 || (SourceMapSource2 = objectAllocator.getSourceMapSourceConstructor()))(fileName, text, skipTrivia2); } function setOriginalNode(node, original) { - node.original = original; - if (original) { - const emitNode = original.emitNode; - if (emitNode) - node.emitNode = mergeEmitNode(emitNode, node.emitNode); + if (node.original !== original) { + node.original = original; + if (original) { + const emitNode = original.emitNode; + if (emitNode) + node.emitNode = mergeEmitNode(emitNode, node.emitNode); + } } return node; } @@ -294346,35 +295602,53 @@ ${lanes.join("\n")} constantValue, helpers, startsOnNewLine, - snippetElement + snippetElement, + classThis, + assignedName } = sourceEmitNode; if (!destEmitNode) destEmitNode = {}; - if (leadingComments) - destEmitNode.leadingComments = addRange(leadingComments.slice(), destEmitNode.leadingComments); - if (trailingComments) - destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments); - if (flags) + if (flags) { destEmitNode.flags = flags; - if (internalFlags) + } + if (internalFlags) { destEmitNode.internalFlags = internalFlags & ~8 /* Immutable */; - if (commentRange) + } + if (leadingComments) { + destEmitNode.leadingComments = addRange(leadingComments.slice(), destEmitNode.leadingComments); + } + if (trailingComments) { + destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments); + } + if (commentRange) { destEmitNode.commentRange = commentRange; - if (sourceMapRange) + } + if (sourceMapRange) { destEmitNode.sourceMapRange = sourceMapRange; - if (tokenSourceMapRanges) + } + if (tokenSourceMapRanges) { destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); - if (constantValue !== void 0) + } + if (constantValue !== void 0) { destEmitNode.constantValue = constantValue; + } if (helpers) { for (const helper of helpers) { destEmitNode.helpers = appendIfUnique(destEmitNode.helpers, helper); } } - if (startsOnNewLine !== void 0) + if (startsOnNewLine !== void 0) { destEmitNode.startsOnNewLine = startsOnNewLine; - if (snippetElement !== void 0) + } + if (snippetElement !== void 0) { destEmitNode.snippetElement = snippetElement; + } + if (classThis) { + destEmitNode.classThis = classThis; + } + if (assignedName) { + destEmitNode.assignedName = assignedName; + } return destEmitNode; } function mergeTokenSourceMapRanges(sourceRanges, destRanges) { @@ -294417,7 +295691,7 @@ ${lanes.join("\n")} function getOrCreateEmitNode(node) { if (!node.emitNode) { if (isParseTreeNode(node)) { - if (node.kind === 311 /* SourceFile */) { + if (node.kind === 312 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } const sourceFile = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node))) ?? Debug.fail("Could not determine parsed source file."); @@ -294679,7 +295953,10 @@ ${lanes.join("\n")} // Class Fields Helpers createClassPrivateFieldGetHelper, createClassPrivateFieldSetHelper, - createClassPrivateFieldInHelper + createClassPrivateFieldInHelper, + // 'using' helpers + createAddDisposableResourceHelper, + createDisposeResourcesHelper }; function getUnscopedHelperName(name) { return setEmitFlags(factory2.createIdentifier(name), 8192 /* HelperName */ | 4 /* AdviseOnEmitNode */); @@ -294734,10 +296011,12 @@ ${lanes.join("\n")} ); } function createESDecorateClassContextObject(contextIn) { - return factory2.createObjectLiteralExpression([ + const properties = [ factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral("class")), - factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name) - ]); + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name), + factory2.createPropertyAssignment(factory2.createIdentifier("metadata"), contextIn.metadata) + ]; + return factory2.createObjectLiteralExpression(properties); } function createESDecorateClassElementAccessGetMethod(elementName) { const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); @@ -294841,13 +296120,15 @@ ${lanes.join("\n")} return factory2.createObjectLiteralExpression(properties); } function createESDecorateClassElementContextObject(contextIn) { - return factory2.createObjectLiteralExpression([ + const properties = [ factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()), - factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)) - ]); + factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)), + factory2.createPropertyAssignment(factory2.createIdentifier("metadata"), contextIn.metadata) + ]; + return factory2.createObjectLiteralExpression(properties); } function createESDecorateContextObject(contextIn) { return contextIn.kind === "class" ? createESDecorateClassContextObject(contextIn) : createESDecorateClassElementContextObject(contextIn); @@ -294977,7 +296258,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*/ @@ -294987,8 +296268,7 @@ ${lanes.join("\n")} void 0, /*typeParameters*/ void 0, - /*parameters*/ - [], + parameters ?? [], /*type*/ void 0, body @@ -295000,7 +296280,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 ] @@ -295158,6 +296438,24 @@ ${lanes.join("\n")} [state, receiver] ); } + function createAddDisposableResourceHelper(envBinding, value, async) { + context.requestEmitHelper(addDisposableResourceHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__addDisposableResource"), + /*typeArguments*/ + void 0, + [envBinding, value, async ? factory2.createTrue() : factory2.createFalse()] + ); + } + function createDisposeResourcesHelper(envBinding) { + context.requestEmitHelper(disposeResourcesHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__disposeResources"), + /*typeArguments*/ + void 0, + [envBinding] + ); + } } function compareEmitHelpers(x, y) { if (x === y) @@ -295210,13 +296508,15 @@ ${lanes.join("\n")} classPrivateFieldSetHelper, classPrivateFieldInHelper, createBindingHelper, - setModuleDefaultHelper + setModuleDefaultHelper, + addDisposableResourceHelper, + disposeResourcesHelper ], (helper) => helper.name)); } function isCallToHelper(firstSegment, helperName) { return isCallExpression(firstSegment) && isIdentifier(firstSegment.expression) && (getEmitFlags(firstSegment.expression) & 8192 /* HelperName */) !== 0 && firstSegment.expression.escapedText === helperName; } - var PrivateIdentifierKind, decorateHelper, metadataHelper, paramHelper, esDecorateHelper, runInitializersHelper, assignHelper, awaitHelper, asyncGeneratorHelper, asyncDelegator, asyncValues, restHelper, awaiterHelper, extendsHelper, templateObjectHelper, readHelper, spreadArrayHelper, propKeyHelper, setFunctionNameHelper, valuesHelper, generatorHelper, createBindingHelper, setModuleDefaultHelper, importStarHelper, importDefaultHelper, exportStarHelper, classPrivateFieldGetHelper, classPrivateFieldSetHelper, classPrivateFieldInHelper, allUnscopedEmitHelpers, asyncSuperHelper, advancedAsyncSuperHelper; + var PrivateIdentifierKind, decorateHelper, metadataHelper, paramHelper, esDecorateHelper, runInitializersHelper, assignHelper, awaitHelper, asyncGeneratorHelper, asyncDelegator, asyncValues, restHelper, awaiterHelper, extendsHelper, templateObjectHelper, readHelper, spreadArrayHelper, propKeyHelper, setFunctionNameHelper, valuesHelper, generatorHelper, createBindingHelper, setModuleDefaultHelper, importStarHelper, importDefaultHelper, exportStarHelper, classPrivateFieldGetHelper, classPrivateFieldSetHelper, classPrivateFieldInHelper, addDisposableResourceHelper, disposeResourcesHelper, allUnscopedEmitHelpers, asyncSuperHelper, advancedAsyncSuperHelper; var init_emitHelpers = __esm({ "src/compiler/factory/emitHelpers.ts"() { "use strict"; @@ -295339,17 +296639,18 @@ ${lanes.join("\n")} scoped: false, dependencies: [awaitHelper], text: ` - var __asyncGenerator = (this && this.__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]); } - };` + var __asyncGenerator = (this && this.__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", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + 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 = { name: "typescript:asyncDelegator", @@ -295648,6 +296949,63 @@ ${lanes.join("\n")} return typeof state === "function" ? receiver === state : state.has(receiver); };` }; + addDisposableResourceHelper = { + name: "typescript:addDisposableResource", + importName: "__addDisposableResource", + scoped: false, + text: ` + var __addDisposableResource = (this && this.__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; + };` + }; + disposeResourcesHelper = { + name: "typescript:disposeResources", + importName: "__disposeResources", + scoped: false, + text: ` + var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) { + return 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(); + }; + })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + });` + }; asyncSuperHelper = { name: "typescript:async-super", scoped: true, @@ -295755,7 +297113,7 @@ ${lanes.join("\n")} return node.kind === 128 /* AbstractKeyword */; } function isOverrideModifier(node) { - return node.kind === 163 /* OverrideKeyword */; + return node.kind === 164 /* OverrideKeyword */; } function isAccessorModifier(node) { return node.kind === 129 /* AccessorKeyword */; @@ -295770,577 +297128,583 @@ ${lanes.join("\n")} return node.kind === 84 /* CaseKeyword */; } function isQualifiedName(node) { - return node.kind === 165 /* QualifiedName */; + return node.kind === 166 /* QualifiedName */; } function isComputedPropertyName(node) { - return node.kind === 166 /* ComputedPropertyName */; + return node.kind === 167 /* ComputedPropertyName */; } function isTypeParameterDeclaration(node) { - return node.kind === 167 /* TypeParameter */; + return node.kind === 168 /* TypeParameter */; } function isParameter(node) { - return node.kind === 168 /* Parameter */; + return node.kind === 169 /* Parameter */; } function isDecorator(node) { - return node.kind === 169 /* Decorator */; + return node.kind === 170 /* Decorator */; } function isPropertySignature(node) { - return node.kind === 170 /* PropertySignature */; + return node.kind === 171 /* PropertySignature */; } function isPropertyDeclaration(node) { - return node.kind === 171 /* PropertyDeclaration */; + return node.kind === 172 /* PropertyDeclaration */; } function isMethodSignature(node) { - return node.kind === 172 /* MethodSignature */; + return node.kind === 173 /* MethodSignature */; } function isMethodDeclaration(node) { - return node.kind === 173 /* MethodDeclaration */; + return node.kind === 174 /* MethodDeclaration */; } function isClassStaticBlockDeclaration(node) { - return node.kind === 174 /* ClassStaticBlockDeclaration */; + return node.kind === 175 /* ClassStaticBlockDeclaration */; } function isConstructorDeclaration(node) { - return node.kind === 175 /* Constructor */; + return node.kind === 176 /* Constructor */; } function isGetAccessorDeclaration(node) { - return node.kind === 176 /* GetAccessor */; + return node.kind === 177 /* GetAccessor */; } function isSetAccessorDeclaration(node) { - return node.kind === 177 /* SetAccessor */; + return node.kind === 178 /* SetAccessor */; } function isCallSignatureDeclaration(node) { - return node.kind === 178 /* CallSignature */; + return node.kind === 179 /* CallSignature */; } function isConstructSignatureDeclaration(node) { - return node.kind === 179 /* ConstructSignature */; + return node.kind === 180 /* ConstructSignature */; } function isIndexSignatureDeclaration(node) { - return node.kind === 180 /* IndexSignature */; + return node.kind === 181 /* IndexSignature */; } function isTypePredicateNode(node) { - return node.kind === 181 /* TypePredicate */; + return node.kind === 182 /* TypePredicate */; } function isTypeReferenceNode(node) { - return node.kind === 182 /* TypeReference */; + return node.kind === 183 /* TypeReference */; } function isFunctionTypeNode(node) { - return node.kind === 183 /* FunctionType */; + return node.kind === 184 /* FunctionType */; } function isConstructorTypeNode(node) { - return node.kind === 184 /* ConstructorType */; + return node.kind === 185 /* ConstructorType */; } function isTypeQueryNode(node) { - return node.kind === 185 /* TypeQuery */; + return node.kind === 186 /* TypeQuery */; } function isTypeLiteralNode(node) { - return node.kind === 186 /* TypeLiteral */; + return node.kind === 187 /* TypeLiteral */; } function isArrayTypeNode(node) { - return node.kind === 187 /* ArrayType */; + return node.kind === 188 /* ArrayType */; } function isTupleTypeNode(node) { - return node.kind === 188 /* TupleType */; + return node.kind === 189 /* TupleType */; } function isNamedTupleMember(node) { - return node.kind === 201 /* NamedTupleMember */; + return node.kind === 202 /* NamedTupleMember */; } function isOptionalTypeNode(node) { - return node.kind === 189 /* OptionalType */; + return node.kind === 190 /* OptionalType */; } function isRestTypeNode(node) { - return node.kind === 190 /* RestType */; + return node.kind === 191 /* RestType */; } function isUnionTypeNode(node) { - return node.kind === 191 /* UnionType */; + return node.kind === 192 /* UnionType */; } function isIntersectionTypeNode(node) { - return node.kind === 192 /* IntersectionType */; + return node.kind === 193 /* IntersectionType */; } function isConditionalTypeNode(node) { - return node.kind === 193 /* ConditionalType */; + return node.kind === 194 /* ConditionalType */; } function isInferTypeNode(node) { - return node.kind === 194 /* InferType */; + return node.kind === 195 /* InferType */; } function isParenthesizedTypeNode(node) { - return node.kind === 195 /* ParenthesizedType */; + return node.kind === 196 /* ParenthesizedType */; } function isThisTypeNode(node) { - return node.kind === 196 /* ThisType */; + return node.kind === 197 /* ThisType */; } function isTypeOperatorNode(node) { - return node.kind === 197 /* TypeOperator */; + return node.kind === 198 /* TypeOperator */; } function isIndexedAccessTypeNode(node) { - return node.kind === 198 /* IndexedAccessType */; + return node.kind === 199 /* IndexedAccessType */; } function isMappedTypeNode(node) { - return node.kind === 199 /* MappedType */; + return node.kind === 200 /* MappedType */; } function isLiteralTypeNode(node) { - return node.kind === 200 /* LiteralType */; + return node.kind === 201 /* LiteralType */; } function isImportTypeNode(node) { - return node.kind === 204 /* ImportType */; + return node.kind === 205 /* ImportType */; } function isTemplateLiteralTypeSpan(node) { - return node.kind === 203 /* TemplateLiteralTypeSpan */; + return node.kind === 204 /* TemplateLiteralTypeSpan */; } function isTemplateLiteralTypeNode(node) { - return node.kind === 202 /* TemplateLiteralType */; + return node.kind === 203 /* TemplateLiteralType */; } function isObjectBindingPattern(node) { - return node.kind === 205 /* ObjectBindingPattern */; + return node.kind === 206 /* ObjectBindingPattern */; } function isArrayBindingPattern(node) { - return node.kind === 206 /* ArrayBindingPattern */; + return node.kind === 207 /* ArrayBindingPattern */; } function isBindingElement(node) { - return node.kind === 207 /* BindingElement */; + return node.kind === 208 /* BindingElement */; } function isArrayLiteralExpression(node) { - return node.kind === 208 /* ArrayLiteralExpression */; + return node.kind === 209 /* ArrayLiteralExpression */; } function isObjectLiteralExpression(node) { - return node.kind === 209 /* ObjectLiteralExpression */; + return node.kind === 210 /* ObjectLiteralExpression */; } function isPropertyAccessExpression(node) { - return node.kind === 210 /* PropertyAccessExpression */; + return node.kind === 211 /* PropertyAccessExpression */; } function isElementAccessExpression(node) { - return node.kind === 211 /* ElementAccessExpression */; + return node.kind === 212 /* ElementAccessExpression */; } function isCallExpression(node) { - return node.kind === 212 /* CallExpression */; + return node.kind === 213 /* CallExpression */; } function isNewExpression(node) { - return node.kind === 213 /* NewExpression */; + return node.kind === 214 /* NewExpression */; } function isTaggedTemplateExpression(node) { - return node.kind === 214 /* TaggedTemplateExpression */; + return node.kind === 215 /* TaggedTemplateExpression */; } function isTypeAssertionExpression(node) { - return node.kind === 215 /* TypeAssertionExpression */; + return node.kind === 216 /* TypeAssertionExpression */; } function isParenthesizedExpression(node) { - return node.kind === 216 /* ParenthesizedExpression */; + return node.kind === 217 /* ParenthesizedExpression */; } function isFunctionExpression(node) { - return node.kind === 217 /* FunctionExpression */; + return node.kind === 218 /* FunctionExpression */; } function isArrowFunction(node) { - return node.kind === 218 /* ArrowFunction */; + return node.kind === 219 /* ArrowFunction */; } function isDeleteExpression(node) { - return node.kind === 219 /* DeleteExpression */; + return node.kind === 220 /* DeleteExpression */; } function isTypeOfExpression(node) { - return node.kind === 220 /* TypeOfExpression */; + return node.kind === 221 /* TypeOfExpression */; } function isVoidExpression(node) { - return node.kind === 221 /* VoidExpression */; + return node.kind === 222 /* VoidExpression */; } function isAwaitExpression(node) { - return node.kind === 222 /* AwaitExpression */; + return node.kind === 223 /* AwaitExpression */; } function isPrefixUnaryExpression(node) { - return node.kind === 223 /* PrefixUnaryExpression */; + return node.kind === 224 /* PrefixUnaryExpression */; } function isPostfixUnaryExpression(node) { - return node.kind === 224 /* PostfixUnaryExpression */; + return node.kind === 225 /* PostfixUnaryExpression */; } function isBinaryExpression(node) { - return node.kind === 225 /* BinaryExpression */; + return node.kind === 226 /* BinaryExpression */; } function isConditionalExpression(node) { - return node.kind === 226 /* ConditionalExpression */; + return node.kind === 227 /* ConditionalExpression */; } function isTemplateExpression(node) { - return node.kind === 227 /* TemplateExpression */; + return node.kind === 228 /* TemplateExpression */; } function isYieldExpression(node) { - return node.kind === 228 /* YieldExpression */; + return node.kind === 229 /* YieldExpression */; } function isSpreadElement(node) { - return node.kind === 229 /* SpreadElement */; + return node.kind === 230 /* SpreadElement */; } function isClassExpression(node) { - return node.kind === 230 /* ClassExpression */; + return node.kind === 231 /* ClassExpression */; } function isOmittedExpression(node) { - return node.kind === 231 /* OmittedExpression */; + return node.kind === 232 /* OmittedExpression */; } function isExpressionWithTypeArguments(node) { - return node.kind === 232 /* ExpressionWithTypeArguments */; + return node.kind === 233 /* ExpressionWithTypeArguments */; } function isAsExpression(node) { - return node.kind === 233 /* AsExpression */; + return node.kind === 234 /* AsExpression */; } function isSatisfiesExpression(node) { - return node.kind === 237 /* SatisfiesExpression */; + return node.kind === 238 /* SatisfiesExpression */; } function isNonNullExpression(node) { - return node.kind === 234 /* NonNullExpression */; + return node.kind === 235 /* NonNullExpression */; } function isMetaProperty(node) { - return node.kind === 235 /* MetaProperty */; + return node.kind === 236 /* MetaProperty */; } function isSyntheticExpression(node) { - return node.kind === 236 /* SyntheticExpression */; + return node.kind === 237 /* SyntheticExpression */; } function isPartiallyEmittedExpression(node) { - return node.kind === 359 /* PartiallyEmittedExpression */; + return node.kind === 360 /* PartiallyEmittedExpression */; } function isCommaListExpression(node) { - return node.kind === 360 /* CommaListExpression */; + return node.kind === 361 /* CommaListExpression */; } function isTemplateSpan(node) { - return node.kind === 238 /* TemplateSpan */; + return node.kind === 239 /* TemplateSpan */; } function isSemicolonClassElement(node) { - return node.kind === 239 /* SemicolonClassElement */; + return node.kind === 240 /* SemicolonClassElement */; } function isBlock(node) { - return node.kind === 240 /* Block */; + return node.kind === 241 /* Block */; } function isVariableStatement(node) { - return node.kind === 242 /* VariableStatement */; + return node.kind === 243 /* VariableStatement */; } function isEmptyStatement(node) { - return node.kind === 241 /* EmptyStatement */; + return node.kind === 242 /* EmptyStatement */; } function isExpressionStatement(node) { - return node.kind === 243 /* ExpressionStatement */; + return node.kind === 244 /* ExpressionStatement */; } function isIfStatement(node) { - return node.kind === 244 /* IfStatement */; + return node.kind === 245 /* IfStatement */; } function isDoStatement(node) { - return node.kind === 245 /* DoStatement */; + return node.kind === 246 /* DoStatement */; } function isWhileStatement(node) { - return node.kind === 246 /* WhileStatement */; + return node.kind === 247 /* WhileStatement */; } function isForStatement(node) { - return node.kind === 247 /* ForStatement */; + return node.kind === 248 /* ForStatement */; } function isForInStatement(node) { - return node.kind === 248 /* ForInStatement */; + return node.kind === 249 /* ForInStatement */; } function isForOfStatement(node) { - return node.kind === 249 /* ForOfStatement */; + return node.kind === 250 /* ForOfStatement */; } function isContinueStatement(node) { - return node.kind === 250 /* ContinueStatement */; + return node.kind === 251 /* ContinueStatement */; } function isBreakStatement(node) { - return node.kind === 251 /* BreakStatement */; + return node.kind === 252 /* BreakStatement */; } function isReturnStatement(node) { - return node.kind === 252 /* ReturnStatement */; + return node.kind === 253 /* ReturnStatement */; } function isWithStatement(node) { - return node.kind === 253 /* WithStatement */; + return node.kind === 254 /* WithStatement */; } function isSwitchStatement(node) { - return node.kind === 254 /* SwitchStatement */; + return node.kind === 255 /* SwitchStatement */; } function isLabeledStatement(node) { - return node.kind === 255 /* LabeledStatement */; + return node.kind === 256 /* LabeledStatement */; } function isThrowStatement(node) { - return node.kind === 256 /* ThrowStatement */; + return node.kind === 257 /* ThrowStatement */; } function isTryStatement(node) { - return node.kind === 257 /* TryStatement */; + return node.kind === 258 /* TryStatement */; } function isDebuggerStatement(node) { - return node.kind === 258 /* DebuggerStatement */; + return node.kind === 259 /* DebuggerStatement */; } function isVariableDeclaration(node) { - return node.kind === 259 /* VariableDeclaration */; + return node.kind === 260 /* VariableDeclaration */; } function isVariableDeclarationList(node) { - return node.kind === 260 /* VariableDeclarationList */; + return node.kind === 261 /* VariableDeclarationList */; } function isFunctionDeclaration(node) { - return node.kind === 261 /* FunctionDeclaration */; + return node.kind === 262 /* FunctionDeclaration */; } function isClassDeclaration(node) { - return node.kind === 262 /* ClassDeclaration */; + return node.kind === 263 /* ClassDeclaration */; } function isInterfaceDeclaration(node) { - return node.kind === 263 /* InterfaceDeclaration */; + return node.kind === 264 /* InterfaceDeclaration */; } function isTypeAliasDeclaration(node) { - return node.kind === 264 /* TypeAliasDeclaration */; + return node.kind === 265 /* TypeAliasDeclaration */; } function isEnumDeclaration(node) { - return node.kind === 265 /* EnumDeclaration */; + return node.kind === 266 /* EnumDeclaration */; } function isModuleDeclaration(node) { - return node.kind === 266 /* ModuleDeclaration */; + return node.kind === 267 /* ModuleDeclaration */; } function isModuleBlock(node) { - return node.kind === 267 /* ModuleBlock */; + return node.kind === 268 /* ModuleBlock */; } function isCaseBlock(node) { - return node.kind === 268 /* CaseBlock */; + return node.kind === 269 /* CaseBlock */; } function isNamespaceExportDeclaration(node) { - return node.kind === 269 /* NamespaceExportDeclaration */; + return node.kind === 270 /* NamespaceExportDeclaration */; } function isImportEqualsDeclaration(node) { - return node.kind === 270 /* ImportEqualsDeclaration */; + return node.kind === 271 /* ImportEqualsDeclaration */; } function isImportDeclaration(node) { - return node.kind === 271 /* ImportDeclaration */; + return node.kind === 272 /* ImportDeclaration */; } function isImportClause(node) { - return node.kind === 272 /* ImportClause */; + return node.kind === 273 /* ImportClause */; } function isImportTypeAssertionContainer(node) { - return node.kind === 301 /* ImportTypeAssertionContainer */; + return node.kind === 302 /* ImportTypeAssertionContainer */; } function isAssertClause(node) { - return node.kind === 299 /* AssertClause */; + return node.kind === 300 /* AssertClause */; } function isAssertEntry(node) { - return node.kind === 300 /* AssertEntry */; + return node.kind === 301 /* AssertEntry */; + } + function isImportAttributes(node) { + return node.kind === 300 /* ImportAttributes */; + } + function isImportAttribute(node) { + return node.kind === 301 /* ImportAttribute */; } function isNamespaceImport(node) { - return node.kind === 273 /* NamespaceImport */; + return node.kind === 274 /* NamespaceImport */; } function isNamespaceExport(node) { - return node.kind === 279 /* NamespaceExport */; + return node.kind === 280 /* NamespaceExport */; } function isNamedImports(node) { - return node.kind === 274 /* NamedImports */; + return node.kind === 275 /* NamedImports */; } function isImportSpecifier(node) { - return node.kind === 275 /* ImportSpecifier */; + return node.kind === 276 /* ImportSpecifier */; } function isExportAssignment(node) { - return node.kind === 276 /* ExportAssignment */; + return node.kind === 277 /* ExportAssignment */; } function isExportDeclaration(node) { - return node.kind === 277 /* ExportDeclaration */; + return node.kind === 278 /* ExportDeclaration */; } function isNamedExports(node) { - return node.kind === 278 /* NamedExports */; + return node.kind === 279 /* NamedExports */; } function isExportSpecifier(node) { - return node.kind === 280 /* ExportSpecifier */; + return node.kind === 281 /* ExportSpecifier */; } function isMissingDeclaration(node) { - return node.kind === 281 /* MissingDeclaration */; + return node.kind === 282 /* MissingDeclaration */; } function isNotEmittedStatement(node) { - return node.kind === 358 /* NotEmittedStatement */; + return node.kind === 359 /* NotEmittedStatement */; } function isSyntheticReference(node) { - return node.kind === 361 /* SyntheticReferenceExpression */; + return node.kind === 362 /* SyntheticReferenceExpression */; } function isExternalModuleReference(node) { - return node.kind === 282 /* ExternalModuleReference */; + return node.kind === 283 /* ExternalModuleReference */; } function isJsxElement(node) { - return node.kind === 283 /* JsxElement */; + return node.kind === 284 /* JsxElement */; } function isJsxSelfClosingElement(node) { - return node.kind === 284 /* JsxSelfClosingElement */; + return node.kind === 285 /* JsxSelfClosingElement */; } function isJsxOpeningElement(node) { - return node.kind === 285 /* JsxOpeningElement */; + return node.kind === 286 /* JsxOpeningElement */; } function isJsxClosingElement(node) { - return node.kind === 286 /* JsxClosingElement */; + return node.kind === 287 /* JsxClosingElement */; } function isJsxFragment(node) { - return node.kind === 287 /* JsxFragment */; + return node.kind === 288 /* JsxFragment */; } function isJsxOpeningFragment(node) { - return node.kind === 288 /* JsxOpeningFragment */; + return node.kind === 289 /* JsxOpeningFragment */; } function isJsxClosingFragment(node) { - return node.kind === 289 /* JsxClosingFragment */; + return node.kind === 290 /* JsxClosingFragment */; } function isJsxAttribute(node) { - return node.kind === 290 /* JsxAttribute */; + return node.kind === 291 /* JsxAttribute */; } function isJsxAttributes(node) { - return node.kind === 291 /* JsxAttributes */; + return node.kind === 292 /* JsxAttributes */; } function isJsxSpreadAttribute(node) { - return node.kind === 292 /* JsxSpreadAttribute */; + return node.kind === 293 /* JsxSpreadAttribute */; } function isJsxExpression(node) { - return node.kind === 293 /* JsxExpression */; + return node.kind === 294 /* JsxExpression */; } function isJsxNamespacedName(node) { - return node.kind === 294 /* JsxNamespacedName */; + return node.kind === 295 /* JsxNamespacedName */; } function isCaseClause(node) { - return node.kind === 295 /* CaseClause */; + return node.kind === 296 /* CaseClause */; } function isDefaultClause(node) { - return node.kind === 296 /* DefaultClause */; + return node.kind === 297 /* DefaultClause */; } function isHeritageClause(node) { - return node.kind === 297 /* HeritageClause */; + return node.kind === 298 /* HeritageClause */; } function isCatchClause(node) { - return node.kind === 298 /* CatchClause */; + return node.kind === 299 /* CatchClause */; } function isPropertyAssignment(node) { - return node.kind === 302 /* PropertyAssignment */; + return node.kind === 303 /* PropertyAssignment */; } function isShorthandPropertyAssignment(node) { - return node.kind === 303 /* ShorthandPropertyAssignment */; + return node.kind === 304 /* ShorthandPropertyAssignment */; } function isSpreadAssignment(node) { - return node.kind === 304 /* SpreadAssignment */; + return node.kind === 305 /* SpreadAssignment */; } function isEnumMember(node) { - return node.kind === 305 /* EnumMember */; + return node.kind === 306 /* EnumMember */; } function isUnparsedPrepend(node) { - return node.kind === 307 /* UnparsedPrepend */; + return node.kind === 308 /* UnparsedPrepend */; } function isSourceFile(node) { - return node.kind === 311 /* SourceFile */; + return node.kind === 312 /* SourceFile */; } function isBundle(node) { - return node.kind === 312 /* Bundle */; + return node.kind === 313 /* Bundle */; } function isUnparsedSource(node) { - return node.kind === 313 /* UnparsedSource */; + return node.kind === 314 /* UnparsedSource */; } function isJSDocTypeExpression(node) { - return node.kind === 315 /* JSDocTypeExpression */; + return node.kind === 316 /* JSDocTypeExpression */; } function isJSDocNameReference(node) { - return node.kind === 316 /* JSDocNameReference */; + return node.kind === 317 /* JSDocNameReference */; } function isJSDocMemberName(node) { - return node.kind === 317 /* JSDocMemberName */; + return node.kind === 318 /* JSDocMemberName */; } function isJSDocLink(node) { - return node.kind === 330 /* JSDocLink */; + return node.kind === 331 /* JSDocLink */; } function isJSDocLinkCode(node) { - return node.kind === 331 /* JSDocLinkCode */; + return node.kind === 332 /* JSDocLinkCode */; } function isJSDocLinkPlain(node) { - return node.kind === 332 /* JSDocLinkPlain */; + return node.kind === 333 /* JSDocLinkPlain */; } function isJSDocAllType(node) { - return node.kind === 318 /* JSDocAllType */; + return node.kind === 319 /* JSDocAllType */; } function isJSDocUnknownType(node) { - return node.kind === 319 /* JSDocUnknownType */; + return node.kind === 320 /* JSDocUnknownType */; } function isJSDocNullableType(node) { - return node.kind === 320 /* JSDocNullableType */; + return node.kind === 321 /* JSDocNullableType */; } function isJSDocNonNullableType(node) { - return node.kind === 321 /* JSDocNonNullableType */; + return node.kind === 322 /* JSDocNonNullableType */; } function isJSDocOptionalType(node) { - return node.kind === 322 /* JSDocOptionalType */; + return node.kind === 323 /* JSDocOptionalType */; } function isJSDocFunctionType(node) { - return node.kind === 323 /* JSDocFunctionType */; + return node.kind === 324 /* JSDocFunctionType */; } function isJSDocVariadicType(node) { - return node.kind === 324 /* JSDocVariadicType */; + return node.kind === 325 /* JSDocVariadicType */; } function isJSDocNamepathType(node) { - return node.kind === 325 /* JSDocNamepathType */; + return node.kind === 326 /* JSDocNamepathType */; } function isJSDoc(node) { - return node.kind === 326 /* JSDoc */; + return node.kind === 327 /* JSDoc */; } function isJSDocTypeLiteral(node) { - return node.kind === 328 /* JSDocTypeLiteral */; + return node.kind === 329 /* JSDocTypeLiteral */; } function isJSDocSignature(node) { - return node.kind === 329 /* JSDocSignature */; + return node.kind === 330 /* JSDocSignature */; } function isJSDocAugmentsTag(node) { - return node.kind === 334 /* JSDocAugmentsTag */; + return node.kind === 335 /* JSDocAugmentsTag */; } function isJSDocAuthorTag(node) { - return node.kind === 336 /* JSDocAuthorTag */; + return node.kind === 337 /* JSDocAuthorTag */; } function isJSDocClassTag(node) { - return node.kind === 338 /* JSDocClassTag */; + return node.kind === 339 /* JSDocClassTag */; } function isJSDocCallbackTag(node) { - return node.kind === 344 /* JSDocCallbackTag */; + return node.kind === 345 /* JSDocCallbackTag */; } function isJSDocPublicTag(node) { - return node.kind === 339 /* JSDocPublicTag */; + return node.kind === 340 /* JSDocPublicTag */; } function isJSDocPrivateTag(node) { - return node.kind === 340 /* JSDocPrivateTag */; + return node.kind === 341 /* JSDocPrivateTag */; } function isJSDocProtectedTag(node) { - return node.kind === 341 /* JSDocProtectedTag */; + return node.kind === 342 /* JSDocProtectedTag */; } function isJSDocReadonlyTag(node) { - return node.kind === 342 /* JSDocReadonlyTag */; + return node.kind === 343 /* JSDocReadonlyTag */; } function isJSDocOverrideTag(node) { - return node.kind === 343 /* JSDocOverrideTag */; + return node.kind === 344 /* JSDocOverrideTag */; } function isJSDocOverloadTag(node) { - return node.kind === 345 /* JSDocOverloadTag */; + return node.kind === 346 /* JSDocOverloadTag */; } function isJSDocDeprecatedTag(node) { - return node.kind === 337 /* JSDocDeprecatedTag */; + return node.kind === 338 /* JSDocDeprecatedTag */; } function isJSDocSeeTag(node) { - return node.kind === 353 /* JSDocSeeTag */; + return node.kind === 354 /* JSDocSeeTag */; } function isJSDocEnumTag(node) { - return node.kind === 346 /* JSDocEnumTag */; + return node.kind === 347 /* JSDocEnumTag */; } function isJSDocParameterTag(node) { - return node.kind === 347 /* JSDocParameterTag */; + return node.kind === 348 /* JSDocParameterTag */; } function isJSDocReturnTag(node) { - return node.kind === 348 /* JSDocReturnTag */; + return node.kind === 349 /* JSDocReturnTag */; } function isJSDocThisTag(node) { - return node.kind === 349 /* JSDocThisTag */; + return node.kind === 350 /* JSDocThisTag */; } function isJSDocTypeTag(node) { - return node.kind === 350 /* JSDocTypeTag */; + return node.kind === 351 /* JSDocTypeTag */; } function isJSDocTemplateTag(node) { - return node.kind === 351 /* JSDocTemplateTag */; + return node.kind === 352 /* JSDocTemplateTag */; } function isJSDocTypedefTag(node) { - return node.kind === 352 /* JSDocTypedefTag */; + return node.kind === 353 /* JSDocTypedefTag */; } function isJSDocUnknownTag(node) { - return node.kind === 333 /* JSDocTag */; + return node.kind === 334 /* JSDocTag */; } function isJSDocPropertyTag(node) { - return node.kind === 354 /* JSDocPropertyTag */; + return node.kind === 355 /* JSDocPropertyTag */; } function isJSDocImplementsTag(node) { - return node.kind === 335 /* JSDocImplementsTag */; + return node.kind === 336 /* JSDocImplementsTag */; } function isJSDocSatisfiesTag(node) { - return node.kind === 356 /* JSDocSatisfiesTag */; + return node.kind === 357 /* JSDocSatisfiesTag */; } function isJSDocThrowsTag(node) { - return node.kind === 355 /* JSDocThrowsTag */; + return node.kind === 356 /* JSDocThrowsTag */; } function isSyntaxList(n) { - return n.kind === 357 /* SyntaxList */; + return n.kind === 358 /* SyntaxList */; } var init_nodeTests = __esm({ "src/compiler/factory/nodeTests.ts"() { @@ -296654,14 +298018,14 @@ ${lanes.join("\n")} Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return createExpressionForAccessorDeclaration(factory2, node.properties, property, receiver, !!node.multiLine); - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return createExpressionForPropertyAssignment(factory2, property, receiver); - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(factory2, property, receiver); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return createExpressionForMethodDeclaration(factory2, property, receiver); } } @@ -296714,7 +298078,7 @@ ${lanes.join("\n")} return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); } function isCommaExpression(node) { - return node.kind === 225 /* BinaryExpression */ && node.operatorToken.kind === 28 /* CommaToken */; + return node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 28 /* CommaToken */; } function isCommaSequence(node) { return isCommaExpression(node) || isCommaListExpression(node); @@ -296729,19 +298093,19 @@ ${lanes.join("\n")} } function isOuterExpression(node, kinds = 15 /* All */) { switch (node.kind) { - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: if (kinds & 16 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) { return false; } return (kinds & 1 /* Parentheses */) !== 0; - case 215 /* TypeAssertionExpression */: - case 233 /* AsExpression */: - case 232 /* ExpressionWithTypeArguments */: - case 237 /* SatisfiesExpression */: + case 216 /* TypeAssertionExpression */: + case 234 /* AsExpression */: + case 233 /* ExpressionWithTypeArguments */: + case 238 /* SatisfiesExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; - case 234 /* NonNullExpression */: + case 235 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 359 /* PartiallyEmittedExpression */: + case 360 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -296799,21 +298163,18 @@ ${lanes.join("\n")} if (some(helperNames)) { helperNames.sort(compareStringsCaseSensitive); namedBindings = nodeFactory.createNamedImports( - map( - helperNames, - (name) => isFileLevelUniqueName(sourceFile, name) ? nodeFactory.createImportSpecifier( - /*isTypeOnly*/ - false, - /*propertyName*/ - void 0, - nodeFactory.createIdentifier(name) - ) : nodeFactory.createImportSpecifier( - /*isTypeOnly*/ - false, - nodeFactory.createIdentifier(name), - helperFactory.getUnscopedHelperName(name) - ) - ) + map(helperNames, (name) => isFileLevelUniqueName(sourceFile, name) ? nodeFactory.createImportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + nodeFactory.createIdentifier(name) + ) : nodeFactory.createImportSpecifier( + /*isTypeOnly*/ + false, + nodeFactory.createIdentifier(name), + helperFactory.getUnscopedHelperName(name) + )) ); const parseNode = getOriginalNode(sourceFile, isSourceFile); const emitNode = getOrCreateEmitNode(parseNode); @@ -296838,7 +298199,7 @@ ${lanes.join("\n")} namedBindings ), nodeFactory.createStringLiteral(externalHelpersModuleNameText), - /*assertClause*/ + /*attributes*/ void 0 ); addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */); @@ -296878,10 +298239,10 @@ ${lanes.join("\n")} const name = namespaceDeclaration.name; return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name)); } - if (node.kind === 271 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 272 /* ImportDeclaration */ && node.importClause) { return factory2.getGeneratedNameForNode(node); } - if (node.kind === 277 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 278 /* ExportDeclaration */ && node.moduleSpecifier) { return factory2.getGeneratedNameForNode(node); } return void 0; @@ -296944,11 +298305,11 @@ ${lanes.join("\n")} } if (isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return bindingElement.name; - case 304 /* SpreadAssignment */: + case 305 /* SpreadAssignment */: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return void 0; @@ -296967,11 +298328,11 @@ ${lanes.join("\n")} } function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 168 /* Parameter */: - case 207 /* BindingElement */: + case 169 /* Parameter */: + case 208 /* BindingElement */: return bindingElement.dotDotDotToken; - case 229 /* SpreadElement */: - case 304 /* SpreadAssignment */: + case 230 /* SpreadElement */: + case 305 /* SpreadAssignment */: return bindingElement; } return void 0; @@ -296983,7 +298344,7 @@ ${lanes.join("\n")} } function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 207 /* BindingElement */: + case 208 /* BindingElement */: if (bindingElement.propertyName) { const propertyName = bindingElement.propertyName; if (isPrivateIdentifier(propertyName)) { @@ -296992,7 +298353,7 @@ ${lanes.join("\n")} return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; } break; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: if (bindingElement.name) { const propertyName = bindingElement.name; if (isPrivateIdentifier(propertyName)) { @@ -297001,7 +298362,7 @@ ${lanes.join("\n")} return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; } break; - case 304 /* SpreadAssignment */: + case 305 /* SpreadAssignment */: if (bindingElement.name && isPrivateIdentifier(bindingElement.name)) { return Debug.failBadSyntaxKind(bindingElement.name); } @@ -297018,11 +298379,11 @@ ${lanes.join("\n")} } function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 205 /* ObjectBindingPattern */: - case 206 /* ArrayBindingPattern */: - case 208 /* ArrayLiteralExpression */: + case 206 /* ObjectBindingPattern */: + case 207 /* ArrayBindingPattern */: + case 209 /* ArrayLiteralExpression */: return name.elements; - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return name.properties; } } @@ -297039,19 +298400,19 @@ ${lanes.join("\n")} } function canHaveIllegalType(node) { const kind = node.kind; - return kind === 175 /* Constructor */ || kind === 177 /* SetAccessor */; + return kind === 176 /* Constructor */ || kind === 178 /* SetAccessor */; } function canHaveIllegalTypeParameters(node) { const kind = node.kind; - return kind === 175 /* Constructor */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */; + return kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; } function canHaveIllegalDecorators(node) { const kind = node.kind; - return kind === 302 /* PropertyAssignment */ || kind === 303 /* ShorthandPropertyAssignment */ || kind === 261 /* FunctionDeclaration */ || kind === 175 /* Constructor */ || kind === 180 /* IndexSignature */ || kind === 174 /* ClassStaticBlockDeclaration */ || kind === 281 /* MissingDeclaration */ || kind === 242 /* VariableStatement */ || kind === 263 /* InterfaceDeclaration */ || kind === 264 /* TypeAliasDeclaration */ || kind === 265 /* EnumDeclaration */ || kind === 266 /* ModuleDeclaration */ || kind === 270 /* ImportEqualsDeclaration */ || kind === 271 /* ImportDeclaration */ || kind === 269 /* NamespaceExportDeclaration */ || kind === 277 /* ExportDeclaration */ || kind === 276 /* ExportAssignment */; + return kind === 303 /* PropertyAssignment */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 262 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 243 /* VariableStatement */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 270 /* NamespaceExportDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */; } function canHaveIllegalModifiers(node) { const kind = node.kind; - return kind === 174 /* ClassStaticBlockDeclaration */ || kind === 302 /* PropertyAssignment */ || kind === 303 /* ShorthandPropertyAssignment */ || kind === 281 /* MissingDeclaration */ || kind === 269 /* NamespaceExportDeclaration */; + return kind === 175 /* ClassStaticBlockDeclaration */ || kind === 303 /* PropertyAssignment */ || kind === 304 /* ShorthandPropertyAssignment */ || kind === 282 /* MissingDeclaration */ || kind === 270 /* NamespaceExportDeclaration */; } function isQuestionOrExclamationToken(node) { return isQuestionToken(node) || isExclamationToken(node); @@ -297218,7 +298579,7 @@ ${lanes.join("\n")} initializer ); } - function createAccessorPropertyGetRedirector(factory2, node, modifiers, name) { + function createAccessorPropertyGetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) { return factory2.createGetAccessorDeclaration( modifiers, name, @@ -297228,7 +298589,7 @@ ${lanes.join("\n")} factory2.createBlock([ factory2.createReturnStatement( factory2.createPropertyAccessExpression( - factory2.createThis(), + receiver, factory2.getGeneratedPrivateNameForNode( node.name, /*prefix*/ @@ -297240,7 +298601,7 @@ ${lanes.join("\n")} ]) ); } - function createAccessorPropertySetRedirector(factory2, node, modifiers, name) { + function createAccessorPropertySetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) { return factory2.createSetAccessorDeclaration( modifiers, name, @@ -297255,7 +298616,7 @@ ${lanes.join("\n")} factory2.createExpressionStatement( factory2.createAssignment( factory2.createPropertyAccessExpression( - factory2.createThis(), + receiver, factory2.getGeneratedPrivateNameForNode( node.name, /*prefix*/ @@ -297456,11 +298817,11 @@ ${lanes.join("\n")} } function canHaveModifiers(node) { const kind = node.kind; - return kind === 167 /* TypeParameter */ || kind === 168 /* Parameter */ || kind === 170 /* PropertySignature */ || kind === 171 /* PropertyDeclaration */ || kind === 172 /* MethodSignature */ || kind === 173 /* MethodDeclaration */ || kind === 175 /* Constructor */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */ || kind === 180 /* IndexSignature */ || kind === 184 /* ConstructorType */ || kind === 217 /* FunctionExpression */ || kind === 218 /* ArrowFunction */ || kind === 230 /* ClassExpression */ || kind === 242 /* VariableStatement */ || kind === 261 /* FunctionDeclaration */ || kind === 262 /* ClassDeclaration */ || kind === 263 /* InterfaceDeclaration */ || kind === 264 /* TypeAliasDeclaration */ || kind === 265 /* EnumDeclaration */ || kind === 266 /* ModuleDeclaration */ || kind === 270 /* ImportEqualsDeclaration */ || kind === 271 /* ImportDeclaration */ || kind === 276 /* ExportAssignment */ || kind === 277 /* ExportDeclaration */; + return kind === 168 /* TypeParameter */ || kind === 169 /* Parameter */ || kind === 171 /* PropertySignature */ || kind === 172 /* PropertyDeclaration */ || kind === 173 /* MethodSignature */ || kind === 174 /* MethodDeclaration */ || kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 185 /* ConstructorType */ || kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || kind === 231 /* ClassExpression */ || kind === 243 /* VariableStatement */ || kind === 262 /* FunctionDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 278 /* ExportDeclaration */; } function canHaveDecorators(node) { const kind = node.kind; - return kind === 168 /* Parameter */ || kind === 171 /* PropertyDeclaration */ || kind === 173 /* MethodDeclaration */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */ || kind === 230 /* ClassExpression */ || kind === 262 /* ClassDeclaration */; + return kind === 169 /* Parameter */ || kind === 172 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 231 /* ClassExpression */ || kind === 263 /* ClassDeclaration */; } var init_utilitiesPublic2 = __esm({ "src/compiler/factory/utilitiesPublic.ts"() { @@ -297496,7 +298857,7 @@ ${lanes.join("\n")} return canHaveModifiers(node) && hasModifierOfKind(node, 95 /* ExportKeyword */) || isImportEqualsDeclaration(node) && isExternalModuleReference(node.moduleReference) || isImportDeclaration(node) || isExportAssignment(node) || isExportDeclaration(node) ? node : void 0; } function getImportMetaIfNecessary(sourceFile) { - return sourceFile.flags & 4194304 /* PossiblyContainsImportMeta */ ? walkTreeForImportMeta(sourceFile) : void 0; + return sourceFile.flags & 8388608 /* PossiblyContainsImportMeta */ ? walkTreeForImportMeta(sourceFile) : void 0; } function walkTreeForImportMeta(node) { return isImportMeta2(node) ? node : forEachChild(node, walkTreeForImportMeta); @@ -297560,7 +298921,7 @@ ${lanes.join("\n")} return visitNode2(cbNode, node.expression); } function forEachChild(node, cbNode, cbNodes) { - if (node === void 0 || node.kind <= 164 /* LastToken */) { + if (node === void 0 || node.kind <= 165 /* LastToken */) { return; } const fn = forEachChildTable[node.kind]; @@ -297595,7 +298956,7 @@ ${lanes.join("\n")} continue; return res; } - if (current.kind >= 165 /* FirstNode */) { + if (current.kind >= 166 /* FirstNode */) { for (const child of gatherPossibleChildren(current)) { queue.push(child); parents.push(current); @@ -297630,7 +298991,8 @@ ${lanes.join("\n")} const { languageVersion, setExternalModuleIndicator: overrideSetExternalModuleIndicator, - impliedNodeFormat: format + impliedNodeFormat: format, + jsDocParsingMode } = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions }; if (languageVersion === 100 /* JSON */) { result = Parser.parseSourceFile( @@ -297641,7 +299003,8 @@ ${lanes.join("\n")} void 0, setParentNodes, 6 /* JSON */, - noop + noop, + jsDocParsingMode ); } else { const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => { @@ -297656,7 +299019,8 @@ ${lanes.join("\n")} void 0, setParentNodes, scriptKind, - setIndicator + setIndicator, + jsDocParsingMode ); } (_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile(); @@ -297676,7 +299040,7 @@ ${lanes.join("\n")} } function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks = false) { const newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); - newSourceFile.flags |= sourceFile.flags & 6291456 /* PermanentlySetIncrementalFlags */; + newSourceFile.flags |= sourceFile.flags & 12582912 /* PermanentlySetIncrementalFlags */; return newSourceFile; } function parseIsolatedJSDocComment(content, start, length2) { @@ -297690,7 +299054,25 @@ ${lanes.join("\n")} return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2); } function isDeclarationFileName(fileName) { - return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && stringContains(getBaseFileName(fileName), ".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) { @@ -297873,7 +299255,7 @@ ${lanes.join("\n")} return {}; if (!pragma.args) return {}; - const args = trimString(text).split(/\s+/); + const args = text.trim().split(/\s+/); const argMap = {}; for (let i = 0; i < pragma.args.length; i++) { const argument = pragma.args[i]; @@ -297897,7 +299279,7 @@ ${lanes.join("\n")} if (lhs.kind === 110 /* ThisKeyword */) { return true; } - if (lhs.kind === 294 /* JsxNamespacedName */) { + if (lhs.kind === 295 /* JsxNamespacedName */) { return lhs.namespace.escapedText === rhs.namespace.escapedText && lhs.name.escapedText === rhs.name.escapedText; } return lhs.name.escapedText === rhs.name.escapedText && tagNamesAreEquivalent(lhs.expression, rhs.expression); @@ -297917,428 +299299,428 @@ ${lanes.join("\n")} }; parseNodeFactory = createNodeFactory(1 /* NoParenthesizerRules */, parseBaseNodeFactory); forEachChildTable = { - [165 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) { + [166 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); }, - [167 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) { + [168 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); }, - [303 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { + [304 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); }, - [304 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { + [305 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [168 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) { + [169 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [171 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) { + [172 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [170 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) { + [171 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [302 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { + [303 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); }, - [259 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { + [260 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); }, - [207 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) { + [208 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, - [180 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { + [181 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [184 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { + [185 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [183 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) { + [184 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [178 /* CallSignature */]: forEachChildInCallOrConstructSignature, - [179 /* ConstructSignature */]: forEachChildInCallOrConstructSignature, - [173 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) { + [179 /* CallSignature */]: forEachChildInCallOrConstructSignature, + [180 /* ConstructSignature */]: forEachChildInCallOrConstructSignature, + [174 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [172 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) { + [173 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [175 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { + [176 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [176 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { + [177 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [177 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) { + [178 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [261 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { + [262 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [217 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { + [218 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); }, - [218 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) { + [219 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); }, - [174 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { + [175 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); }, - [182 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { + [183 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [181 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) { + [182 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type); }, - [185 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) { + [186 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) { return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [186 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) { + [187 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.members); }, - [187 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) { + [188 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.elementType); }, - [188 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) { + [189 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [191 /* UnionType */]: forEachChildInUnionOrIntersectionType, - [192 /* IntersectionType */]: forEachChildInUnionOrIntersectionType, - [193 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) { + [192 /* UnionType */]: forEachChildInUnionOrIntersectionType, + [193 /* IntersectionType */]: forEachChildInUnionOrIntersectionType, + [194 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType); }, - [194 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) { + [195 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.typeParameter); }, - [204 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.assertions) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); + [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [301 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { + [302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.assertClause); }, - [195 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator, - [197 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator, - [198 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { + [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator, + [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator, + [199 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType); }, - [199 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) { + [200 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) { return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members); }, - [200 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) { + [201 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.literal); }, - [201 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { + [202 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type); }, - [205 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, - [206 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, - [208 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { + [206 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, + [207 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, + [209 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [209 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { + [210 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.properties); }, - [210 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { + [211 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name); }, - [211 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { + [212 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression); }, - [212 /* CallExpression */]: forEachChildInCallOrNewExpression, - [213 /* NewExpression */]: forEachChildInCallOrNewExpression, - [214 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { + [213 /* CallExpression */]: forEachChildInCallOrNewExpression, + [214 /* NewExpression */]: forEachChildInCallOrNewExpression, + [215 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template); }, - [215 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { + [216 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression); }, - [216 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { + [217 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [219 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { + [220 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [220 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { + [221 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [221 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) { + [222 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [223 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { + [224 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.operand); }, - [228 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) { + [229 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression); }, - [222 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { + [223 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [224 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { + [225 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.operand); }, - [225 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { + [226 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right); }, - [233 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) { + [234 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); }, - [234 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { + [235 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [237 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { + [238 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); }, - [235 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) { + [236 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [226 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) { + [227 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse); }, - [229 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) { + [230 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [240 /* Block */]: forEachChildInBlock, - [267 /* ModuleBlock */]: forEachChildInBlock, - [311 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) { + [241 /* Block */]: forEachChildInBlock, + [268 /* ModuleBlock */]: forEachChildInBlock, + [312 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); }, - [242 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { + [243 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); }, - [260 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { + [261 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.declarations); }, - [243 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { + [244 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [244 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) { + [245 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement); }, - [245 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) { + [246 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression); }, - [246 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) { + [247 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [247 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) { + [248 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement); }, - [248 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) { + [249 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [249 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) { + [250 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [250 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement, - [251 /* BreakStatement */]: forEachChildInContinueOrBreakStatement, - [252 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) { + [251 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement, + [252 /* BreakStatement */]: forEachChildInContinueOrBreakStatement, + [253 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [253 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) { + [254 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); }, - [254 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { + [255 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock); }, - [268 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) { + [269 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.clauses); }, - [295 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) { + [296 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) { return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); }, - [296 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) { + [297 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.statements); }, - [255 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { + [256 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement); }, - [256 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) { + [257 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [257 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) { + [258 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock); }, - [298 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) { + [299 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block); }, - [169 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) { + [170 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [262 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, - [230 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, - [263 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { + [263 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, + [231 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, + [264 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); }, - [264 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { + [265 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); }, - [265 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { + [266 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); }, - [305 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { + [306 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, - [266 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { + [267 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); }, - [270 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { + [271 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); }, - [271 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + [272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); }, - [272 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { + [273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); }, - [299 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) { + [300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [300 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) { + [301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); }, - [269 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { + [270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); }, - [273 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { + [274 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [279 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { + [280 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [274 /* NamedImports */]: forEachChildInNamedImportsOrExports, - [278 /* NamedExports */]: forEachChildInNamedImportsOrExports, - [277 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { - return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); + [275 /* NamedImports */]: forEachChildInNamedImportsOrExports, + [279 /* NamedExports */]: forEachChildInNamedImportsOrExports, + [278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); }, - [275 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, - [280 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, - [276 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { + [276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, + [281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, + [277 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); }, - [227 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { + [228 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); }, - [238 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { + [239 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal); }, - [202 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { + [203 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); }, - [203 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { + [204 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal); }, - [166 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { + [167 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [297 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) { + [298 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.types); }, - [232 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { + [233 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); }, - [282 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { + [283 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [281 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { + [282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.modifiers); }, - [360 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + [361 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.elements); }, - [283 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { + [284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement); }, - [287 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) { + [288 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) { return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment); }, - [284 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement, - [285 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement, - [291 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) { + [285 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement, + [286 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement, + [292 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.properties); }, - [290 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { + [291 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); }, - [292 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { + [293 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.expression); }, - [293 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) { + [294 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression); }, - [286 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { + [287 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.tagName); }, - [294 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName(node, cbNode, _cbNodes) { + [295 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.namespace) || visitNode2(cbNode, node.name); }, - [189 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [190 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [315 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [321 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [320 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [322 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [324 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier, - [323 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { + [190 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [191 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [316 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [322 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [321 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [323 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [325 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier, + [324 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); }, - [326 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) { + [327 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) { return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags); }, - [353 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) { + [354 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [316 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { + [317 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.name); }, - [317 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { + [318 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); }, - [347 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag, - [354 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag, - [336 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { + [348 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag, + [355 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag, + [337 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [335 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) { + [336 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [334 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) { + [335 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [351 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) { + [352 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [352 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { - return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 315 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment))); + [353 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 316 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment))); }, - [344 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) { + [345 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) { return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); }, - [348 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag, - [350 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, - [349 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, - [346 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, - [356 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, - [355 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, - [345 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, - [329 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { + [349 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag, + [351 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag, + [350 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag, + [347 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag, + [357 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag, + [356 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag, + [346 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag, + [330 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type); }, - [330 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain, - [331 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain, - [332 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain, - [328 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { + [331 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain, + [332 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain, + [333 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain, + [329 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { return forEach(node.jsDocPropertyTags, cbNode); }, - [333 /* JSDocTag */]: forEachChildInJSDocTag, - [338 /* JSDocClassTag */]: forEachChildInJSDocTag, - [339 /* JSDocPublicTag */]: forEachChildInJSDocTag, - [340 /* JSDocPrivateTag */]: forEachChildInJSDocTag, - [341 /* JSDocProtectedTag */]: forEachChildInJSDocTag, - [342 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, - [337 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, - [343 /* JSDocOverrideTag */]: forEachChildInJSDocTag, - [359 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression + [334 /* JSDocTag */]: forEachChildInJSDocTag, + [339 /* JSDocClassTag */]: forEachChildInJSDocTag, + [340 /* JSDocPublicTag */]: forEachChildInJSDocTag, + [341 /* JSDocPrivateTag */]: forEachChildInJSDocTag, + [342 /* JSDocProtectedTag */]: forEachChildInJSDocTag, + [343 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, + [338 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, + [344 /* JSDocOverrideTag */]: forEachChildInJSDocTag, + [360 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression }; ((Parser2) => { var scanner2 = createScanner( @@ -298346,7 +299728,7 @@ ${lanes.join("\n")} /*skipTrivia*/ true ); - var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; + var disallowInAndDecoratorContext = 8192 /* DisallowInContext */ | 32768 /* DecoratorContext */; var NodeConstructor2; var TokenConstructor2; var IdentifierConstructor2; @@ -298440,7 +299822,7 @@ ${lanes.join("\n")} var contextFlags; var topLevel = true; var parseErrorBeforeNextFinishedNode = false; - function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) { + function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) { var _a; scriptKind2 = ensureScriptKind(fileName2, scriptKind2); if (scriptKind2 === 6 /* JSON */) { @@ -298462,8 +299844,8 @@ ${lanes.join("\n")} result2.pragmas = emptyMap; return result2; } - initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2); - const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator); + initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode); + const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode); clearState(); return result; } @@ -298475,20 +299857,21 @@ ${lanes.join("\n")} languageVersion2, /*syntaxCursor*/ void 0, - 1 /* JS */ + 1 /* JS */, + 0 /* ParseAll */ ); nextToken(); const entityName = parseEntityName( /*allowReservedWords*/ true ); - const isInvalid = token() === 1 /* EndOfFileToken */ && !parseDiagnostics.length; + const isValid = token() === 1 /* EndOfFileToken */ && !parseDiagnostics.length; clearState(); - return isInvalid ? entityName : void 0; + return isValid ? entityName : void 0; } Parser2.parseIsolatedEntityName = parseIsolatedEntityName2; function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) { - initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */); + initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */); sourceFlags = contextFlags; nextToken(); const pos = getNodePos(); @@ -298569,7 +299952,7 @@ ${lanes.join("\n")} return result; } Parser2.parseJsonText = parseJsonText2; - function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind) { + function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) { NodeConstructor2 = objectAllocator.getNodeConstructor(); TokenConstructor2 = objectAllocator.getTokenConstructor(); IdentifierConstructor2 = objectAllocator.getIdentifierConstructor(); @@ -298591,10 +299974,10 @@ ${lanes.join("\n")} switch (scriptKind) { case 1 /* JS */: case 2 /* JSX */: - contextFlags = 262144 /* JavaScriptFile */; + contextFlags = 524288 /* JavaScriptFile */; break; case 6 /* JSON */: - contextFlags = 262144 /* JavaScriptFile */ | 67108864 /* JsonFile */; + contextFlags = 524288 /* JavaScriptFile */ | 134217728 /* JsonFile */; break; default: contextFlags = 0 /* None */; @@ -298605,11 +299988,15 @@ ${lanes.join("\n")} scanner2.setOnError(scanError); scanner2.setScriptTarget(languageVersion); scanner2.setLanguageVariant(languageVariant); + scanner2.setScriptKind(scriptKind); + scanner2.setJSDocParsingMode(_jsDocParsingMode); } function clearState() { scanner2.clearCommentDirectives(); scanner2.setText(""); scanner2.setOnError(void 0); + scanner2.setScriptKind(0 /* Unknown */); + scanner2.setJSDocParsingMode(0 /* ParseAll */); sourceText = void 0; languageVersion = void 0; syntaxCursor = void 0; @@ -298623,16 +300010,17 @@ ${lanes.join("\n")} notParenthesizedArrow = void 0; topLevel = true; } - function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2) { + function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) { const isDeclarationFile = isDeclarationFileName(fileName); if (isDeclarationFile) { - contextFlags |= 16777216 /* Ambient */; + contextFlags |= 33554432 /* Ambient */; } sourceFlags = contextFlags; nextToken(); const statements = parseList(0 /* SourceElements */, parseStatement); Debug.assert(token() === 1 /* EndOfFileToken */); - const endOfFileToken = addJSDocComment(parseTokenNode()); + const endHasJSDoc = hasPrecedingJSDocComment(); + const endOfFileToken = withJSDoc(parseTokenNode(), endHasJSDoc); const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2); processCommentPragmas(sourceFile, sourceText); processPragmasIntoFields(sourceFile, reportPragmaDiagnostic); @@ -298641,6 +300029,7 @@ ${lanes.join("\n")} sourceFile.identifierCount = identifierCount; sourceFile.identifiers = identifiers; sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); + sourceFile.jsDocParsingMode = jsDocParsingMode; if (jsDocDiagnostics) { sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); } @@ -298649,21 +300038,21 @@ ${lanes.join("\n")} } return sourceFile; function reportPragmaDiagnostic(pos, end, diagnostic) { - parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic)); + parseDiagnostics.push(createDetachedDiagnostic(fileName, sourceText, pos, end, diagnostic)); } } - function withJSDoc(node, hasJSDoc) { - return hasJSDoc ? addJSDocComment(node) : node; - } let hasDeprecatedTag = false; - function addJSDocComment(node) { + function withJSDoc(node, hasJSDoc) { + if (!hasJSDoc) { + return node; + } Debug.assert(!node.jsDoc); const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), (comment) => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos)); if (jsDoc.length) node.jsDoc = jsDoc; if (hasDeprecatedTag) { hasDeprecatedTag = false; - node.flags |= 268435456 /* Deprecated */; + node.flags |= 536870912 /* Deprecated */; } return node; } @@ -298688,7 +300077,7 @@ ${lanes.join("\n")} } speculationHelper(() => { const savedContextFlags = contextFlags; - contextFlags |= 32768 /* AwaitContext */; + contextFlags |= 65536 /* AwaitContext */; scanner2.resetTokenState(nextStatement.pos); nextToken(); while (token() !== 1 /* EndOfFileToken */) { @@ -298723,7 +300112,7 @@ ${lanes.join("\n")} syntaxCursor = savedSyntaxCursor; return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements)); function containsPossibleTopLevelAwait(node) { - return !(node.flags & 32768 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */); + return !(node.flags & 65536 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */); } function findNextStatementWithAwait(statements2, start2) { for (let i = start2; i < statements2.length; i++) { @@ -298762,8 +300151,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) { @@ -298787,16 +300178,16 @@ ${lanes.join("\n")} } } function setDisallowInContext(val) { - setContextFlag(val, 4096 /* DisallowInContext */); + setContextFlag(val, 8192 /* DisallowInContext */); } function setYieldContext(val) { - setContextFlag(val, 8192 /* YieldContext */); + setContextFlag(val, 16384 /* YieldContext */); } function setDecoratorContext(val) { - setContextFlag(val, 16384 /* DecoratorContext */); + setContextFlag(val, 32768 /* DecoratorContext */); } function setAwaitContext(val) { - setContextFlag(val, 32768 /* AwaitContext */); + setContextFlag(val, 65536 /* AwaitContext */); } function doOutsideOfContext(context, func) { const contextFlagsToClear = context & contextFlags; @@ -298835,52 +300226,52 @@ ${lanes.join("\n")} return func(); } function allowInAnd(func) { - return doOutsideOfContext(4096 /* DisallowInContext */, func); + return doOutsideOfContext(8192 /* DisallowInContext */, func); } function disallowInAnd(func) { - return doInsideOfContext(4096 /* DisallowInContext */, func); + return doInsideOfContext(8192 /* DisallowInContext */, func); } function allowConditionalTypesAnd(func) { - return doOutsideOfContext(65536 /* DisallowConditionalTypesContext */, func); + return doOutsideOfContext(131072 /* DisallowConditionalTypesContext */, func); } function disallowConditionalTypesAnd(func) { - return doInsideOfContext(65536 /* DisallowConditionalTypesContext */, func); + return doInsideOfContext(131072 /* DisallowConditionalTypesContext */, func); } function doInYieldContext(func) { - return doInsideOfContext(8192 /* YieldContext */, func); + return doInsideOfContext(16384 /* YieldContext */, func); } function doInDecoratorContext(func) { - return doInsideOfContext(16384 /* DecoratorContext */, func); + return doInsideOfContext(32768 /* DecoratorContext */, func); } function doInAwaitContext(func) { - return doInsideOfContext(32768 /* AwaitContext */, func); + return doInsideOfContext(65536 /* AwaitContext */, func); } function doOutsideOfAwaitContext(func) { - return doOutsideOfContext(32768 /* AwaitContext */, func); + return doOutsideOfContext(65536 /* AwaitContext */, func); } function doInYieldAndAwaitContext(func) { - return doInsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */, func); + return doInsideOfContext(16384 /* YieldContext */ | 65536 /* AwaitContext */, func); } function doOutsideOfYieldAndAwaitContext(func) { - return doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */, func); + return doOutsideOfContext(16384 /* YieldContext */ | 65536 /* AwaitContext */, func); } function inContext(flags) { return (contextFlags & flags) !== 0; } function inYieldContext() { - return inContext(8192 /* YieldContext */); + return inContext(16384 /* YieldContext */); } function inDisallowInContext() { - return inContext(4096 /* DisallowInContext */); + return inContext(8192 /* DisallowInContext */); } function inDisallowConditionalTypesContext() { - return inContext(65536 /* DisallowConditionalTypesContext */); + return inContext(131072 /* DisallowConditionalTypesContext */); } function inDecoratorContext() { - return inContext(16384 /* DecoratorContext */); + return inContext(32768 /* DecoratorContext */); } function inAwaitContext() { - return inContext(32768 /* AwaitContext */); + return inContext(65536 /* AwaitContext */); } function parseErrorAtCurrentToken(message, ...args) { return parseErrorAt(scanner2.getTokenStart(), scanner2.getTokenEnd(), message, ...args); @@ -298889,7 +300280,7 @@ ${lanes.join("\n")} const lastError = lastOrUndefined(parseDiagnostics); let result; if (!lastError || start !== lastError.start) { - result = createDetachedDiagnostic(fileName, start, length2, message, ...args); + result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args); parseDiagnostics.push(result); } parseErrorBeforeNextFinishedNode = true; @@ -299117,7 +300508,7 @@ ${lanes.join("\n")} if (lastError) { addRelatedInfo( lastError, - createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind)) + createDetachedDiagnostic(fileName, sourceText, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind)) ); } } @@ -299204,7 +300595,7 @@ ${lanes.join("\n")} } if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.flags |= 131072 /* ThisNodeHasError */; + node.flags |= 262144 /* ThisNodeHasError */; } return node; } @@ -299233,7 +300624,7 @@ ${lanes.join("\n")} "", /*isSingleQuote*/ void 0 - ) : kind === 281 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); + ) : kind === 282 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind); return finishNode(result, pos); } function internIdentifier(text) { @@ -299287,10 +300678,16 @@ ${lanes.join("\n")} function parseIdentifierName(diagnosticMessage) { return createIdentifier(tokenIsIdentifierOrKeyword(token()), diagnosticMessage); } + function parseIdentifierNameErrorOnUnicodeEscapeSequence() { + if (scanner2.hasUnicodeEscape() || scanner2.hasExtendedUnicodeEscape()) { + parseErrorAtCurrentToken(Diagnostics.Unicode_escape_sequence_cannot_appear_here); + } + return createIdentifier(tokenIsIdentifierOrKeyword(token())); + } function isLiteralPropertyName() { return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */; } - function isAssertionKey2() { + function isImportAttributeName2() { return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */; } function parsePropertyNameWorker(allowComputedPropertyNames) { @@ -299409,8 +300806,8 @@ ${lanes.join("\n")} return isLiteralPropertyName(); case 9 /* ObjectBindingElements */: return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName(); - case 24 /* AssertEntries */: - return isAssertionKey2(); + case 24 /* ImportAttributes */: + return isImportAttributeName2(); case 7 /* HeritageClauseElement */: if (token() === 19 /* OpenBraceToken */) { return lookAhead(isValidHeritageClauseObjectLiteral); @@ -299450,6 +300847,9 @@ ${lanes.join("\n")} case 22 /* HeritageClauses */: return isHeritageClause2(); case 23 /* ImportOrExportSpecifiers */: + if (token() === 161 /* FromKeyword */ && lookAhead(nextTokenIsStringLiteral)) { + return false; + } return tokenIsIdentifierOrKeyword(token()); case 13 /* JsxAttributes */: return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */; @@ -299510,7 +300910,7 @@ ${lanes.join("\n")} case 12 /* ObjectLiteralMembers */: case 9 /* ObjectBindingElements */: case 23 /* ImportOrExportSpecifiers */: - case 24 /* AssertEntries */: + case 24 /* ImportAttributes */: return token() === 20 /* CloseBraceToken */; case 3 /* SwitchClauseStatements */: return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */; @@ -299606,7 +301006,7 @@ ${lanes.join("\n")} if (nodeIsMissing(node) || node.intersectsChange || containsParseError(node)) { return void 0; } - const nodeContextFlags = node.flags & 50720768 /* ContextFlags */; + const nodeContextFlags = node.flags & 101441536 /* ContextFlags */; if (nodeContextFlags !== contextFlags) { return void 0; } @@ -299664,14 +301064,14 @@ ${lanes.join("\n")} function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 175 /* Constructor */: - case 180 /* IndexSignature */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 171 /* PropertyDeclaration */: - case 239 /* SemicolonClassElement */: + case 176 /* Constructor */: + case 181 /* IndexSignature */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 172 /* PropertyDeclaration */: + case 240 /* SemicolonClassElement */: return true; - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: const methodDeclaration = node; const nameIsConstructor = methodDeclaration.name.kind === 80 /* Identifier */ && methodDeclaration.name.escapedText === "constructor"; return !nameIsConstructor; @@ -299682,8 +301082,8 @@ ${lanes.join("\n")} function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 295 /* CaseClause */: - case 296 /* DefaultClause */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: return true; } } @@ -299692,65 +301092,65 @@ ${lanes.join("\n")} function isReusableStatement(node) { if (node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 242 /* VariableStatement */: - case 240 /* Block */: - case 244 /* IfStatement */: - case 243 /* ExpressionStatement */: - case 256 /* ThrowStatement */: - case 252 /* ReturnStatement */: - case 254 /* SwitchStatement */: - case 251 /* BreakStatement */: - case 250 /* ContinueStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 247 /* ForStatement */: - case 246 /* WhileStatement */: - case 253 /* WithStatement */: - case 241 /* EmptyStatement */: - case 257 /* TryStatement */: - case 255 /* LabeledStatement */: - case 245 /* DoStatement */: - case 258 /* DebuggerStatement */: - case 271 /* ImportDeclaration */: - case 270 /* ImportEqualsDeclaration */: - case 277 /* ExportDeclaration */: - case 276 /* ExportAssignment */: - case 266 /* ModuleDeclaration */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: - case 264 /* TypeAliasDeclaration */: + case 262 /* FunctionDeclaration */: + case 243 /* VariableStatement */: + case 241 /* Block */: + case 245 /* IfStatement */: + case 244 /* ExpressionStatement */: + case 257 /* ThrowStatement */: + case 253 /* ReturnStatement */: + case 255 /* SwitchStatement */: + case 252 /* BreakStatement */: + case 251 /* ContinueStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 248 /* ForStatement */: + case 247 /* WhileStatement */: + case 254 /* WithStatement */: + case 242 /* EmptyStatement */: + case 258 /* TryStatement */: + case 256 /* LabeledStatement */: + case 246 /* DoStatement */: + case 259 /* DebuggerStatement */: + case 272 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 278 /* ExportDeclaration */: + case 277 /* ExportAssignment */: + case 267 /* ModuleDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: + case 265 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 305 /* EnumMember */; + return node.kind === 306 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 179 /* ConstructSignature */: - case 172 /* MethodSignature */: - case 180 /* IndexSignature */: - case 170 /* PropertySignature */: - case 178 /* CallSignature */: + case 180 /* ConstructSignature */: + case 173 /* MethodSignature */: + case 181 /* IndexSignature */: + case 171 /* PropertySignature */: + case 179 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 259 /* VariableDeclaration */) { + if (node.kind !== 260 /* VariableDeclaration */) { return false; } const variableDeclarator = node; return variableDeclarator.initializer === void 0; } function isReusableParameter(node) { - if (node.kind !== 168 /* Parameter */) { + if (node.kind !== 169 /* Parameter */) { return false; } const parameter = node; @@ -299808,12 +301208,15 @@ ${lanes.join("\n")} case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected); case 23 /* ImportOrExportSpecifiers */: + if (token() === 161 /* FromKeyword */) { + return parseErrorAtCurrentToken(Diagnostics._0_expected, "}"); + } return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); case 14 /* JsxChildren */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case 24 /* AssertEntries */: + case 24 /* ImportAttributes */: return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); case 25 /* JSDocComment */: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); @@ -299907,7 +301310,9 @@ ${lanes.join("\n")} parseRightSideOfDot( allowReservedWords, /*allowPrivateIdentifiers*/ - false + false, + /*allowUnicodeEscapeSequenceInIdentifierName*/ + true ) ), pos @@ -299918,7 +301323,7 @@ ${lanes.join("\n")} function createQualifiedName(entity, name) { return finishNode(factory2.createQualifiedName(entity, name), entity.pos); } - function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers) { + function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers, allowUnicodeEscapeSequenceInIdentifierName) { if (scanner2.hasPrecedingLineBreak() && tokenIsIdentifierOrKeyword(token())) { const matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); if (matchesPattern) { @@ -299939,7 +301344,10 @@ ${lanes.join("\n")} Diagnostics.Identifier_expected ); } - return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); + if (allowIdentifierNames) { + return allowUnicodeEscapeSequenceInIdentifierName ? parseIdentifierName() : parseIdentifierNameErrorOnUnicodeEscapeSequence(); + } + return parseIdentifier(); } function parseTemplateSpans(isTaggedTemplate) { const pos = getNodePos(); @@ -300087,14 +301495,14 @@ ${lanes.join("\n")} } function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 182 /* TypeReference */: + case 183 /* TypeReference */: return nodeIsMissing(node.typeName); - case 183 /* FunctionType */: - case 184 /* ConstructorType */: { + case 184 /* FunctionType */: + case 185 /* ConstructorType */: { const { parameters, type } = node; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 195 /* ParenthesizedType */: + case 196 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -300144,8 +301552,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 */, @@ -300386,7 +301793,7 @@ ${lanes.join("\n")} function parseSignatureMember(kind) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 179 /* ConstructSignature */) { + if (kind === 180 /* ConstructSignature */) { parseExpected(105 /* NewKeyword */); } const typeParameters = parseTypeParameters(); @@ -300397,7 +301804,7 @@ ${lanes.join("\n")} true ); parseTypeMemberSemicolon(); - const node = kind === 178 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type); + const node = kind === 179 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); } function isIndexSignature() { @@ -300482,10 +301889,10 @@ ${lanes.join("\n")} } function parseTypeMember() { if (token() === 21 /* OpenParenToken */ || token() === 30 /* LessThanToken */) { - return parseSignatureMember(178 /* CallSignature */); + return parseSignatureMember(179 /* CallSignature */); } if (token() === 105 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(179 /* ConstructSignature */); + return parseSignatureMember(180 /* ConstructSignature */); } const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); @@ -300494,10 +301901,10 @@ ${lanes.join("\n")} false ); if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 176 /* GetAccessor */, 4 /* Type */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* GetAccessor */, 4 /* Type */); } if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* SetAccessor */, 4 /* Type */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* SetAccessor */, 4 /* Type */); } if (isIndexSignature()) { return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); @@ -300683,43 +302090,43 @@ ${lanes.join("\n")} nextToken(); return token() === 102 /* ImportKeyword */; } - function parseImportTypeAssertions() { - const pos = getNodePos(); - const openBracePosition = scanner2.getTokenStart(); - parseExpected(19 /* OpenBraceToken */); - const multiLine = scanner2.hasPrecedingLineBreak(); - parseExpected(132 /* AssertKeyword */); - parseExpected(59 /* ColonToken */); - const clause = parseAssertClause( - /*skipAssertKeyword*/ - true - ); - if (!parseExpected(20 /* CloseBraceToken */)) { - const lastError = lastOrUndefined(parseDiagnostics); - if (lastError && lastError.code === Diagnostics._0_expected.code) { - addRelatedInfo( - lastError, - createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}") - ); - } - } - return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos); - } function parseImportType() { - sourceFlags |= 2097152 /* PossiblyContainsDynamicImport */; + sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */; const pos = getNodePos(); const isTypeOf = parseOptional(114 /* TypeOfKeyword */); parseExpected(102 /* ImportKeyword */); parseExpected(21 /* OpenParenToken */); const type = parseType(); - let assertions; + let attributes; if (parseOptional(28 /* CommaToken */)) { - assertions = parseImportTypeAssertions(); + const openBracePosition = scanner2.getTokenStart(); + parseExpected(19 /* OpenBraceToken */); + const currentToken2 = token(); + if (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) { + nextToken(); + } else { + parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */)); + } + parseExpected(59 /* ColonToken */); + attributes = parseImportAttributes( + currentToken2, + /*skipKeyword*/ + true + ); + if (!parseExpected(20 /* CloseBraceToken */)) { + const lastError = lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === Diagnostics._0_expected.code) { + addRelatedInfo( + lastError, + createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}") + ); + } + } } parseExpected(22 /* CloseParenToken */); const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0; const typeArguments = parseTypeArgumentsOfTypeReference(); - return finishNode(factory2.createImportTypeNode(type, assertions, qualifier, typeArguments, isTypeOf), pos); + return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos); } function nextTokenIsNumericOrBigIntLiteral() { nextToken(); @@ -300731,7 +302138,7 @@ ${lanes.join("\n")} case 159 /* UnknownKeyword */: case 154 /* StringKeyword */: case 150 /* NumberKeyword */: - case 162 /* BigIntKeyword */: + case 163 /* BigIntKeyword */: case 155 /* SymbolKeyword */: case 136 /* BooleanKeyword */: case 157 /* UndefinedKeyword */: @@ -300797,7 +302204,7 @@ ${lanes.join("\n")} case 159 /* UnknownKeyword */: case 154 /* StringKeyword */: case 150 /* NumberKeyword */: - case 162 /* BigIntKeyword */: + case 163 /* BigIntKeyword */: case 136 /* BooleanKeyword */: case 148 /* ReadonlyKeyword */: case 155 /* SymbolKeyword */: @@ -301043,8 +302450,8 @@ ${lanes.join("\n")} return finishNode(factory2.createTypePredicateNode(assertsModifier, parameterName, type), pos); } function parseType() { - if (contextFlags & 40960 /* TypeExcludesFlags */) { - return doOutsideOfContext(40960 /* TypeExcludesFlags */, parseType); + if (contextFlags & 81920 /* TypeExcludesFlags */) { + return doOutsideOfContext(81920 /* TypeExcludesFlags */, parseType); } if (isStartOfFunctionTypeOrConstructorType()) { return parseFunctionOrConstructorType(); @@ -301165,12 +302572,14 @@ ${lanes.join("\n")} return arrowExpression; } const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); if (expr.kind === 80 /* Identifier */ && token() === 39 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression( pos, expr, allowReturnTypeInArrowFunction, + hasJSDoc, /*asyncModifier*/ void 0 ); @@ -301216,7 +302625,7 @@ ${lanes.join("\n")} ), pos); } } - function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) { + function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier) { Debug.assert(token() === 39 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); const parameter = factory2.createParameterDeclaration( /*modifiers*/ @@ -301249,7 +302658,7 @@ ${lanes.join("\n")} equalsGreaterThanToken, body ); - return addJSDocComment(finishNode(node, pos)); + return withJSDoc(finishNode(node, pos), hasJSDoc); } function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { const triState = isParenthesizedArrowFunctionExpression(); @@ -301377,9 +302786,10 @@ ${lanes.join("\n")} if (token() === 134 /* AsyncKeyword */) { if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) { const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); const asyncModifier = parseModifiersForArrowFunction(); const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); - return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier); + return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier); } } return void 0; @@ -301433,7 +302843,7 @@ ${lanes.join("\n")} return void 0; } let unwrappedType = type; - while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 195 /* ParenthesizedType */) { + while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196 /* ParenthesizedType */) { unwrappedType = unwrappedType.type; } const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType); @@ -301496,7 +302906,7 @@ ${lanes.join("\n")} return parseBinaryExpressionRest(precedence, leftOperand, pos); } function isInOrOfKeyword(t) { - return t === 103 /* InKeyword */ || t === 164 /* OfKeyword */; + return t === 103 /* InKeyword */ || t === 165 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand, pos) { while (true) { @@ -301578,7 +302988,7 @@ ${lanes.join("\n")} if (token() === 43 /* AsteriskAsteriskToken */) { const pos = skipTrivia(sourceText, simpleUnaryExpression.pos); const { end } = simpleUnaryExpression; - if (simpleUnaryExpression.kind === 215 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 216 /* TypeAssertionExpression */) { parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { Debug.assert(isKeywordOrPunctuation(unaryOperator)); @@ -301665,13 +303075,13 @@ ${lanes.join("\n")} let expression; if (token() === 102 /* ImportKeyword */) { if (lookAhead(nextTokenIsOpenParenOrLessThan)) { - sourceFlags |= 2097152 /* PossiblyContainsDynamicImport */; + sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */; expression = parseTokenNode(); } else if (lookAhead(nextTokenIsDot)) { nextToken(); nextToken(); expression = finishNode(factory2.createMetaProperty(102 /* ImportKeyword */, parseIdentifierName()), pos); - sourceFlags |= 4194304 /* PossiblyContainsImportMeta */; + sourceFlags |= 8388608 /* PossiblyContainsImportMeta */; } else { expression = parseMemberExpressionOrHigher(); } @@ -301711,6 +303121,8 @@ ${lanes.join("\n")} /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ + true, + /*allowUnicodeEscapeSequenceInIdentifierName*/ true )), pos); } @@ -301718,11 +303130,11 @@ ${lanes.join("\n")} const pos = getNodePos(); const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); let result; - if (opening.kind === 285 /* JsxOpeningElement */) { + if (opening.kind === 286 /* JsxOpeningElement */) { let children = parseJsxChildren(opening); let closingElement; const lastChild = children[children.length - 1]; - if ((lastChild == null ? void 0 : lastChild.kind) === 283 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { + if ((lastChild == null ? void 0 : lastChild.kind) === 284 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { const end = lastChild.children.end; const newLast = finishNode( factory2.createJsxElement( @@ -301746,10 +303158,10 @@ ${lanes.join("\n")} } } result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos); - } else if (opening.kind === 288 /* JsxOpeningFragment */) { + } else if (opening.kind === 289 /* JsxOpeningFragment */) { result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); } else { - Debug.assert(opening.kind === 284 /* JsxSelfClosingElement */); + Debug.assert(opening.kind === 285 /* JsxSelfClosingElement */); result = opening; } if (!mustBeUnary && inExpressionContext && token() === 30 /* LessThanToken */) { @@ -301822,7 +303234,7 @@ ${lanes.join("\n")} if (!child) break; list.push(child); - if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 283 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { + if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 284 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { break; } } @@ -301841,7 +303253,7 @@ ${lanes.join("\n")} return finishNode(factory2.createJsxOpeningFragment(), pos); } const tagName = parseJsxElementName(); - const typeArguments = (contextFlags & 262144 /* JavaScriptFile */) === 0 ? tryParseTypeArguments() : void 0; + const typeArguments = (contextFlags & 524288 /* JavaScriptFile */) === 0 ? tryParseTypeArguments() : void 0; const attributes = parseJsxAttributes(); let node; if (token() === 32 /* GreaterThanToken */) { @@ -301878,6 +303290,8 @@ ${lanes.join("\n")} /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ + false, + /*allowUnicodeEscapeSequenceInIdentifierName*/ false )), pos); } @@ -301887,10 +303301,10 @@ ${lanes.join("\n")} const pos = getNodePos(); scanJsxIdentifier(); const isThis2 = token() === 110 /* ThisKeyword */; - const tagName = parseIdentifierName(); + const tagName = parseIdentifierNameErrorOnUnicodeEscapeSequence(); if (parseOptional(59 /* ColonToken */)) { scanJsxIdentifier(); - return finishNode(factory2.createJsxNamespacedName(tagName, parseIdentifierName()), pos); + return finishNode(factory2.createJsxNamespacedName(tagName, parseIdentifierNameErrorOnUnicodeEscapeSequence()), pos); } return isThis2 ? finishNode(factory2.createToken(110 /* ThisKeyword */), pos) : tagName; } @@ -301902,7 +303316,9 @@ ${lanes.join("\n")} let dotDotDotToken; let expression; if (token() !== 20 /* CloseBraceToken */) { - dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */); + if (!inExpressionContext) { + dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */); + } expression = parseExpression(); } if (inExpressionContext) { @@ -301951,10 +303367,10 @@ ${lanes.join("\n")} function parseJsxAttributeName() { const pos = getNodePos(); scanJsxIdentifier(); - const attrName = parseIdentifierName(); + const attrName = parseIdentifierNameErrorOnUnicodeEscapeSequence(); if (parseOptional(59 /* ColonToken */)) { scanJsxIdentifier(); - return finishNode(factory2.createJsxNamespacedName(attrName, parseIdentifierName()), pos); + return finishNode(factory2.createJsxNamespacedName(attrName, parseIdentifierNameErrorOnUnicodeEscapeSequence()), pos); } return attrName; } @@ -302019,17 +303435,17 @@ ${lanes.join("\n")} return token() === 29 /* QuestionDotToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); } function tryReparseOptionalChain(node) { - if (node.flags & 32 /* OptionalChain */) { + if (node.flags & 64 /* OptionalChain */) { return true; } if (isNonNullExpression(node)) { let expr = node.expression; - while (isNonNullExpression(expr) && !(expr.flags & 32 /* OptionalChain */)) { + while (isNonNullExpression(expr) && !(expr.flags & 64 /* OptionalChain */)) { expr = expr.expression; } - if (expr.flags & 32 /* OptionalChain */) { + if (expr.flags & 64 /* OptionalChain */) { while (isNonNullExpression(node)) { - node.flags |= 32 /* OptionalChain */; + node.flags |= 64 /* OptionalChain */; node = node.expression; } return true; @@ -302042,6 +303458,8 @@ ${lanes.join("\n")} /*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ + true, + /*allowUnicodeEscapeSequenceInIdentifierName*/ true ); const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression); @@ -302095,7 +303513,7 @@ ${lanes.join("\n")} continue; } if (isTemplateStartOfTaggedTemplate()) { - expression = !questionDotToken && expression.kind === 232 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest( + expression = !questionDotToken && expression.kind === 233 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest( pos, expression, questionDotToken, @@ -302134,8 +303552,8 @@ ${lanes.join("\n")} true ) ); - if (questionDotToken || tag.flags & 32 /* OptionalChain */) { - tagExpression.flags |= 32 /* OptionalChain */; + if (questionDotToken || tag.flags & 64 /* OptionalChain */) { + tagExpression.flags |= 64 /* OptionalChain */; } tagExpression.questionDotToken = questionDotToken; return finishNode(tagExpression, pos); @@ -302158,7 +303576,7 @@ ${lanes.join("\n")} } } if (typeArguments || token() === 21 /* OpenParenToken */) { - if (!questionDotToken && expression.kind === 232 /* ExpressionWithTypeArguments */) { + if (!questionDotToken && expression.kind === 233 /* ExpressionWithTypeArguments */) { typeArguments = expression.typeArguments; expression = expression.expression; } @@ -302187,7 +303605,7 @@ ${lanes.join("\n")} return result; } function parseTypeArgumentsInExpression() { - if ((contextFlags & 262144 /* JavaScriptFile */) !== 0) { + if ((contextFlags & 524288 /* JavaScriptFile */) !== 0) { return void 0; } if (reScanLessThanToken() !== 30 /* LessThanToken */) { @@ -302319,10 +303737,10 @@ ${lanes.join("\n")} true ); if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 176 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* SetAccessor */, 0 /* None */); } const asteriskToken = parseOptionalToken(42 /* AsteriskToken */); const tokenIsIdentifier = isIdentifier2(); @@ -302416,7 +303834,7 @@ ${lanes.join("\n")} false ); let typeArguments; - if (expression.kind === 232 /* ExpressionWithTypeArguments */) { + if (expression.kind === 233 /* ExpressionWithTypeArguments */) { typeArguments = expression.typeArguments; expression = expression.expression; } @@ -302526,7 +303944,8 @@ ${lanes.join("\n")} parseExpected(21 /* OpenParenToken */); let initializer; if (token() !== 27 /* SemicolonToken */) { - if (token() === 115 /* VarKeyword */ || token() === 121 /* LetKeyword */ || token() === 87 /* ConstKeyword */) { + if (token() === 115 /* VarKeyword */ || token() === 121 /* LetKeyword */ || token() === 87 /* ConstKeyword */ || token() === 160 /* UsingKeyword */ && lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLineDisallowOf) || // this one is meant to allow of + token() === 135 /* AwaitKeyword */ && lookAhead(nextTokenIsUsingKeywordThenBindingIdentifierOrStartOfObjectDestructuringOnSameLine)) { initializer = parseVariableDeclarationList( /*inForStatementInitializer*/ true @@ -302536,7 +303955,7 @@ ${lanes.join("\n")} } } let node; - if (awaitToken ? parseExpected(164 /* OfKeyword */) : parseOptional(164 /* OfKeyword */)) { + if (awaitToken ? parseExpected(165 /* OfKeyword */) : parseOptional(165 /* OfKeyword */)) { const expression = allowInAnd(() => parseAssignmentExpressionOrHigher( /*allowReturnTypeInArrowFunction*/ true @@ -302560,10 +303979,10 @@ ${lanes.join("\n")} function parseBreakOrContinueStatement(kind) { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); - parseExpected(kind === 251 /* BreakStatement */ ? 83 /* BreakKeyword */ : 88 /* ContinueKeyword */); + parseExpected(kind === 252 /* BreakStatement */ ? 83 /* BreakKeyword */ : 88 /* ContinueKeyword */); const label = canParseSemicolon() ? void 0 : parseIdentifier(); parseSemicolon(); - const node = kind === 251 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label); + const node = kind === 252 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseReturnStatement() { @@ -302582,7 +304001,7 @@ ${lanes.join("\n")} const openParenParsed = parseExpected(21 /* OpenParenToken */); const expression = allowInAnd(parseExpression); parseExpectedMatchingBrackets(21 /* OpenParenToken */, 22 /* CloseParenToken */, openParenParsed, openParenPosition); - const statement = doInsideOfContext(33554432 /* InWithStatement */, parseStatement); + const statement = doInsideOfContext(67108864 /* InWithStatement */, parseStatement); return withJSDoc(finishNode(factory2.createWithStatement(expression, statement), pos), hasJSDoc); } function parseCaseClause() { @@ -302722,6 +304141,10 @@ ${lanes.join("\n")} case 86 /* ClassKeyword */: case 94 /* EnumKeyword */: return true; + case 160 /* UsingKeyword */: + return isUsingDeclaration(); + case 135 /* AwaitKeyword */: + return isAwaitUsingDeclaration(); case 120 /* InterfaceKeyword */: case 156 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); @@ -302736,12 +304159,16 @@ ${lanes.join("\n")} case 124 /* ProtectedKeyword */: case 125 /* PublicKeyword */: case 148 /* ReadonlyKeyword */: + const previousToken = token(); nextToken(); if (scanner2.hasPrecedingLineBreak()) { return false; } + if (previousToken === 138 /* DeclareKeyword */ && token() === 156 /* TypeKeyword */) { + return true; + } continue; - case 161 /* GlobalKeyword */: + case 162 /* GlobalKeyword */: nextToken(); return token() === 19 /* OpenBraceToken */ || token() === 80 /* Identifier */ || token() === 95 /* ExportKeyword */; case 102 /* ImportKeyword */: @@ -302774,6 +304201,7 @@ ${lanes.join("\n")} case 19 /* OpenBraceToken */: case 115 /* VarKeyword */: case 121 /* LetKeyword */: + case 160 /* UsingKeyword */: case 100 /* FunctionKeyword */: case 86 /* ClassKeyword */: case 94 /* EnumKeyword */: @@ -302803,7 +304231,7 @@ ${lanes.join("\n")} case 144 /* ModuleKeyword */: case 145 /* NamespaceKeyword */: case 156 /* TypeKeyword */: - case 161 /* GlobalKeyword */: + case 162 /* GlobalKeyword */: return true; case 129 /* AccessorKeyword */: case 125 /* PublicKeyword */: @@ -302823,6 +304251,30 @@ ${lanes.join("\n")} function isLetDeclaration() { return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuring); } + function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLineDisallowOf() { + return nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine( + /*disallowOf*/ + true + ); + } + function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(disallowOf) { + nextToken(); + if (disallowOf && token() === 165 /* OfKeyword */) + return false; + return (isBindingIdentifier() || token() === 19 /* OpenBraceToken */) && !scanner2.hasPrecedingLineBreak(); + } + function isUsingDeclaration() { + return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine); + } + function nextTokenIsUsingKeywordThenBindingIdentifierOrStartOfObjectDestructuringOnSameLine(disallowOf) { + if (nextToken() === 160 /* UsingKeyword */) { + return nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(disallowOf); + } + return false; + } + function isAwaitUsingDeclaration() { + return lookAhead(nextTokenIsUsingKeywordThenBindingIdentifierOrStartOfObjectDestructuringOnSameLine); + } function parseStatement() { switch (token()) { case 27 /* SemicolonToken */: @@ -302849,6 +304301,26 @@ ${lanes.join("\n")} ); } break; + case 135 /* AwaitKeyword */: + if (isAwaitUsingDeclaration()) { + return parseVariableStatement( + getNodePos(), + hasPrecedingJSDocComment(), + /*modifiers*/ + void 0 + ); + } + break; + case 160 /* UsingKeyword */: + if (isUsingDeclaration()) { + return parseVariableStatement( + getNodePos(), + hasPrecedingJSDocComment(), + /*modifiers*/ + void 0 + ); + } + break; case 100 /* FunctionKeyword */: return parseFunctionDeclaration( getNodePos(), @@ -302872,9 +304344,9 @@ ${lanes.join("\n")} case 99 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 88 /* ContinueKeyword */: - return parseBreakOrContinueStatement(250 /* ContinueStatement */); + return parseBreakOrContinueStatement(251 /* ContinueStatement */); case 83 /* BreakKeyword */: - return parseBreakOrContinueStatement(251 /* BreakStatement */); + return parseBreakOrContinueStatement(252 /* BreakStatement */); case 107 /* ReturnKeyword */: return parseReturnStatement(); case 118 /* WithKeyword */: @@ -302908,7 +304380,7 @@ ${lanes.join("\n")} case 129 /* AccessorKeyword */: case 126 /* StaticKeyword */: case 148 /* ReadonlyKeyword */: - case 161 /* GlobalKeyword */: + case 162 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -302933,15 +304405,15 @@ ${lanes.join("\n")} return node; } for (const m of modifiers) { - m.flags |= 16777216 /* Ambient */; + m.flags |= 33554432 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, modifiers)); + return doInsideOfContext(33554432 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, modifiers)); } else { return parseDeclarationWorker(pos, hasJSDoc, modifiers); } } function tryReuseAmbientDeclaration(pos) { - return doInsideOfContext(16777216 /* Ambient */, () => { + return doInsideOfContext(33554432 /* Ambient */, () => { const node = currentNode(parsingContext, pos); if (node) { return consumeNode(node); @@ -302953,6 +304425,8 @@ ${lanes.join("\n")} case 115 /* VarKeyword */: case 121 /* LetKeyword */: case 87 /* ConstKeyword */: + case 160 /* UsingKeyword */: + case 135 /* AwaitKeyword */: return parseVariableStatement(pos, hasJSDoc, modifiersIn); case 100 /* FunctionKeyword */: return parseFunctionDeclaration(pos, hasJSDoc, modifiersIn); @@ -302964,7 +304438,7 @@ ${lanes.join("\n")} return parseTypeAliasDeclaration(pos, hasJSDoc, modifiersIn); case 94 /* EnumKeyword */: return parseEnumDeclaration(pos, hasJSDoc, modifiersIn); - case 161 /* GlobalKeyword */: + case 162 /* GlobalKeyword */: case 144 /* ModuleKeyword */: case 145 /* NamespaceKeyword */: return parseModuleDeclaration(pos, hasJSDoc, modifiersIn); @@ -302984,7 +304458,7 @@ ${lanes.join("\n")} default: if (modifiersIn) { const missing = createMissingNode( - 281 /* MissingDeclaration */, + 282 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, Diagnostics.Declaration_expected @@ -302996,6 +304470,13 @@ ${lanes.join("\n")} return void 0; } } + 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 */); @@ -303048,14 +304529,14 @@ ${lanes.join("\n")} function parseObjectBindingPattern() { const pos = getNodePos(); parseExpected(19 /* OpenBraceToken */); - const elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); + const elements = allowInAnd(() => parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement)); parseExpected(20 /* CloseBraceToken */); return finishNode(factory2.createObjectBindingPattern(elements), pos); } function parseArrayBindingPattern() { const pos = getNodePos(); parseExpected(23 /* OpenBracketToken */); - const elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); + const elements = allowInAnd(() => parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement)); parseExpected(24 /* CloseBracketToken */); return finishNode(factory2.createArrayBindingPattern(elements), pos); } @@ -303102,12 +304583,20 @@ ${lanes.join("\n")} case 87 /* ConstKeyword */: flags |= 2 /* Const */; break; + case 160 /* UsingKeyword */: + flags |= 4 /* Using */; + break; + case 135 /* AwaitKeyword */: + Debug.assert(isAwaitUsingDeclaration()); + flags |= 6 /* AwaitUsing */; + nextToken(); + break; default: Debug.fail(); } nextToken(); let declarations; - if (token() === 164 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 165 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { declarations = createMissingList(); } else { const savedDisallowIn = inDisallowInContext(); @@ -303137,11 +304626,11 @@ ${lanes.join("\n")} const modifierFlags = modifiersToFlags(modifiers); parseExpected(100 /* FunctionKeyword */); const asteriskToken = parseOptionalToken(42 /* AsteriskToken */); - const name = modifierFlags & 1024 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier(); + const name = modifierFlags & 2048 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier(); const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; - const isAsync = modifierFlags & 512 /* Async */ ? 2 /* Await */ : 0 /* None */; + const isAsync = modifierFlags & 1024 /* Async */ ? 2 /* Await */ : 0 /* None */; const typeParameters = parseTypeParameters(); - if (modifierFlags & 1 /* Export */) + if (modifierFlags & 32 /* Export */) setAwaitContext( /*value*/ true @@ -303213,7 +304702,7 @@ ${lanes.join("\n")} function parsePropertyDeclaration(pos, hasJSDoc, modifiers, name, questionToken) { const exclamationToken = !questionToken && !scanner2.hasPrecedingLineBreak() ? parseOptionalToken(54 /* ExclamationToken */) : void 0; const type = parseTypeAnnotation(); - const initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer); + const initializer = doOutsideOfContext(16384 /* YieldContext */ | 65536 /* AwaitContext */ | 8192 /* DisallowInContext */, parseInitializer); parseSemicolonAfterPropertyName(name, type, initializer); const node = factory2.createPropertyDeclaration( modifiers, @@ -303253,7 +304742,7 @@ ${lanes.join("\n")} false ); const body = parseFunctionBlockOrSemicolon(flags); - const node = kind === 176 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); + const node = kind === 177 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(modifiers, name, parameters, type, body) : factory2.createSetAccessorDeclaration(modifiers, name, parameters, body); node.typeParameters = typeParameters; if (isSetAccessorDeclaration(node)) node.type = type; @@ -303419,10 +304908,10 @@ ${lanes.join("\n")} return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); } if (parseContextualModifier(139 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 176 /* GetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* GetAccessor */, 0 /* None */); } if (parseContextualModifier(153 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 177 /* SetAccessor */, 0 /* None */); + return parseAccessorDeclaration(pos, hasJSDoc, modifiers, 178 /* SetAccessor */, 0 /* None */); } if (token() === 137 /* ConstructorKeyword */ || token() === 11 /* StringLiteral */) { const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); @@ -303437,9 +304926,9 @@ ${lanes.join("\n")} const isAmbient = some(modifiers, isDeclareModifier); if (isAmbient) { for (const m of modifiers) { - m.flags |= 16777216 /* Ambient */; + m.flags |= 33554432 /* Ambient */; } - return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers)); + return doInsideOfContext(33554432 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers)); } else { return parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers); } @@ -303470,10 +304959,10 @@ ${lanes.join("\n")} true ); if (token() === 86 /* ClassKeyword */) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 230 /* ClassExpression */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 231 /* ClassExpression */); } const missing = createMissingNode( - 281 /* MissingDeclaration */, + 282 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, Diagnostics.Expression_expected @@ -303488,11 +304977,11 @@ ${lanes.join("\n")} hasPrecedingJSDocComment(), /*modifiers*/ void 0, - 230 /* ClassExpression */ + 231 /* ClassExpression */ ); } function parseClassDeclaration(pos, hasJSDoc, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 262 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, 263 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { const savedAwaitContext = inAwaitContext(); @@ -303513,7 +305002,7 @@ ${lanes.join("\n")} members = createMissingList(); } setAwaitContext(savedAwaitContext); - const node = kind === 262 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); + const node = kind === 263 /* ClassDeclaration */ ? factory2.createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseNameOfClassDeclarationOrExpression() { @@ -303539,7 +305028,7 @@ ${lanes.join("\n")} function parseExpressionWithTypeArguments() { const pos = getNodePos(); const expression = parseLeftHandSideExpressionOrHigher(); - if (expression.kind === 232 /* ExpressionWithTypeArguments */) { + if (expression.kind === 233 /* ExpressionWithTypeArguments */) { return expression; } const typeArguments = tryParseTypeArguments(); @@ -303565,6 +305054,9 @@ ${lanes.join("\n")} } function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) { parseExpected(156 /* TypeKeyword */); + if (scanner2.hasPrecedingLineBreak()) { + parseErrorAtCurrentToken(Diagnostics.Line_break_not_permitted_here); + } const name = parseIdentifier(); const typeParameters = parseTypeParameters(); parseExpected(64 /* EqualsToken */); @@ -303605,15 +305097,15 @@ ${lanes.join("\n")} return finishNode(factory2.createModuleBlock(statements), pos); } function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) { - const namespaceFlag = flags & 16 /* Namespace */; - const name = parseIdentifier(); + const namespaceFlag = flags & 32 /* Namespace */; + const name = flags & 8 /* NestedNamespace */ ? parseIdentifierName() : parseIdentifier(); const body = parseOptional(25 /* DotToken */) ? parseModuleOrNamespaceDeclaration( getNodePos(), /*hasJSDoc*/ false, /*modifiers*/ void 0, - 4 /* NestedNamespace */ | namespaceFlag + 8 /* NestedNamespace */ | namespaceFlag ) : parseModuleBlock(); const node = factory2.createModuleDeclaration(modifiers, name, body, flags); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -303621,9 +305113,9 @@ ${lanes.join("\n")} function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; let name; - if (token() === 161 /* GlobalKeyword */) { + if (token() === 162 /* GlobalKeyword */) { name = parseIdentifier(); - flags |= 1024 /* GlobalAugmentation */; + flags |= 2048 /* GlobalAugmentation */; } else { name = parseLiteralNode(); name.text = internIdentifier(name.text); @@ -303639,10 +305131,10 @@ ${lanes.join("\n")} } function parseModuleDeclaration(pos, hasJSDoc, modifiersIn) { let flags = 0; - if (token() === 161 /* GlobalKeyword */) { + if (token() === 162 /* GlobalKeyword */) { return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); } else if (parseOptional(145 /* NamespaceKeyword */)) { - flags |= 16 /* Namespace */; + flags |= 32 /* Namespace */; } else { parseExpected(144 /* ModuleKeyword */); if (token() === 11 /* StringLiteral */) { @@ -303680,7 +305172,7 @@ ${lanes.join("\n")} identifier = parseIdentifier(); } let isTypeOnly = false; - if (token() !== 160 /* 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; } @@ -303692,18 +305184,19 @@ ${lanes.join("\n")} token() === 42 /* AsteriskToken */ || // import * token() === 19 /* OpenBraceToken */) { importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(160 /* FromKeyword */); + parseExpected(161 /* FromKeyword */); } const moduleSpecifier = parseModuleSpecifier(); - let assertClause; - if (token() === 132 /* AssertKeyword */ && !scanner2.hasPrecedingLineBreak()) { - assertClause = parseAssertClause(); + const currentToken2 = token(); + let attributes; + if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) { + attributes = parseImportAttributes(currentToken2); } parseSemicolon(); - const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); + const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseAssertEntry() { + function parseImportAttribute() { const pos = getNodePos(); const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */); parseExpected(59 /* ColonToken */); @@ -303711,19 +305204,19 @@ ${lanes.join("\n")} /*allowReturnTypeInArrowFunction*/ true ); - return finishNode(factory2.createAssertEntry(name, value), pos); + return finishNode(factory2.createImportAttribute(name, value), pos); } - function parseAssertClause(skipAssertKeyword) { + function parseImportAttributes(token2, skipKeyword) { const pos = getNodePos(); - if (!skipAssertKeyword) { - parseExpected(132 /* AssertKeyword */); + if (!skipKeyword) { + parseExpected(token2); } const openBracePosition = scanner2.getTokenStart(); if (parseExpected(19 /* OpenBraceToken */)) { const multiLine = scanner2.hasPrecedingLineBreak(); const elements = parseDelimitedList( - 24 /* AssertEntries */, - parseAssertEntry, + 24 /* ImportAttributes */, + parseImportAttribute, /*considerSemicolonAsDelimiter*/ true ); @@ -303732,11 +305225,11 @@ ${lanes.join("\n")} if (lastError && lastError.code === Diagnostics._0_expected.code) { addRelatedInfo( lastError, - createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}") + createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}") ); } } - return finishNode(factory2.createAssertClause(elements, multiLine), pos); + return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos); } else { const elements = createNodeArray( [], @@ -303746,10 +305239,11 @@ ${lanes.join("\n")} /*hasTrailingComma*/ false ); - return finishNode(factory2.createAssertClause( + return finishNode(factory2.createImportAttributes( elements, /*multiLine*/ - false + false, + token2 ), pos); } } @@ -303757,7 +305251,7 @@ ${lanes.join("\n")} return token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */; } function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { - return token() === 28 /* CommaToken */ || token() === 160 /* FromKeyword */; + return token() === 28 /* CommaToken */ || token() === 161 /* FromKeyword */; } function parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly) { parseExpected(64 /* EqualsToken */); @@ -303770,7 +305264,7 @@ ${lanes.join("\n")} function parseImportClause(identifier, pos, isTypeOnly) { let namedBindings; if (!identifier || parseOptional(28 /* CommaToken */)) { - namedBindings = token() === 42 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(274 /* NamedImports */); + namedBindings = token() === 42 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(275 /* NamedImports */); } return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos); } @@ -303806,15 +305300,15 @@ ${lanes.join("\n")} } function parseNamedImportsOrExports(kind) { const pos = getNodePos(); - const node = kind === 274 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)); + const node = kind === 275 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { const hasJSDoc = hasPrecedingJSDocComment(); - return withJSDoc(parseImportOrExportSpecifier(280 /* ExportSpecifier */), hasJSDoc); + return withJSDoc(parseImportOrExportSpecifier(281 /* ExportSpecifier */), hasJSDoc); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(275 /* ImportSpecifier */); + return parseImportOrExportSpecifier(276 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { const pos = getNodePos(); @@ -303858,10 +305352,10 @@ ${lanes.join("\n")} parseExpected(130 /* AsKeyword */); name = parseNameWithKeywordCheck(); } - if (kind === 275 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 276 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected); } - const node = kind === 275 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name); + const node = kind === 276 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name); return finishNode(node, pos); function parseNameWithKeywordCheck() { checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2(); @@ -303881,28 +305375,29 @@ ${lanes.join("\n")} ); let exportClause; let moduleSpecifier; - let assertClause; + let attributes; const isTypeOnly = parseOptional(156 /* TypeKeyword */); const namespaceExportPos = getNodePos(); if (parseOptional(42 /* AsteriskToken */)) { if (parseOptional(130 /* AsKeyword */)) { exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(160 /* FromKeyword */); + parseExpected(161 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } else { - exportClause = parseNamedImportsOrExports(278 /* NamedExports */); - if (token() === 160 /* FromKeyword */ || token() === 11 /* StringLiteral */ && !scanner2.hasPrecedingLineBreak()) { - parseExpected(160 /* FromKeyword */); + exportClause = parseNamedImportsOrExports(279 /* NamedExports */); + if (token() === 161 /* FromKeyword */ || token() === 11 /* StringLiteral */ && !scanner2.hasPrecedingLineBreak()) { + parseExpected(161 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } } - if (moduleSpecifier && token() === 132 /* AssertKeyword */ && !scanner2.hasPrecedingLineBreak()) { - assertClause = parseAssertClause(); + const currentToken2 = token(); + if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) { + attributes = parseImportAttributes(currentToken2); } parseSemicolon(); setAwaitContext(savedAwaitContext); - const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); + const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes); return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseExportAssignment(pos, hasJSDoc, modifiers) { @@ -303952,7 +305447,7 @@ ${lanes.join("\n")} ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes"; ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses"; ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers"; - ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries"; + ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes"; ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment"; ParsingContext2[ParsingContext2["Count"] = 26] = "Count"; })(ParsingContext || (ParsingContext = {})); @@ -303971,7 +305466,8 @@ ${lanes.join("\n")} 99 /* Latest */, /*syntaxCursor*/ void 0, - 1 /* JS */ + 1 /* JS */, + 0 /* ParseAll */ ); scanner2.setText(content, start, length2); currentToken = scanner2.scan(); @@ -303998,7 +305494,7 @@ ${lanes.join("\n")} function parseJSDocTypeExpression(mayOmitBraces) { const pos = getNodePos(); const hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(19 /* OpenBraceToken */); - const type = doInsideOfContext(8388608 /* JSDoc */, parseJSDocType); + const type = doInsideOfContext(16777216 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { parseExpectedJSDoc(20 /* CloseBraceToken */); } @@ -304035,9 +305531,10 @@ ${lanes.join("\n")} 99 /* Latest */, /*syntaxCursor*/ void 0, - 1 /* JS */ + 1 /* JS */, + 0 /* ParseAll */ ); - const jsDoc = doInsideOfContext(8388608 /* JSDoc */, () => parseJSDocCommentWorker(start, length2)); + const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2)); const sourceFile = { languageVariant: 0 /* Standard */, text: content }; const diagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); clearState(); @@ -304048,13 +305545,13 @@ ${lanes.join("\n")} const saveToken = currentToken; const saveParseDiagnosticsLength = parseDiagnostics.length; const saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; - const comment = doInsideOfContext(8388608 /* JSDoc */, () => parseJSDocCommentWorker(start, length2)); + const comment = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2)); setParent(comment, parent2); - if (contextFlags & 262144 /* JavaScriptFile */) { + if (contextFlags & 524288 /* JavaScriptFile */) { if (!jsDocDiagnostics) { jsDocDiagnostics = []; } - jsDocDiagnostics.push(...parseDiagnostics); + addRange(jsDocDiagnostics, parseDiagnostics, saveParseDiagnosticsLength); } currentToken = saveToken; parseDiagnostics.length = saveParseDiagnosticsLength; @@ -304076,8 +305573,6 @@ ${lanes.join("\n")} PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter"; })(PropertyLikeParse || (PropertyLikeParse = {})); function parseJSDocCommentWorker(start = 0, length2) { - const saveParsingContext = parsingContext; - parsingContext |= 1 << 25 /* JSDocComment */; const content = sourceText; const end = length2 === void 0 ? content.length : start + length2; length2 = end - start; @@ -304094,26 +305589,28 @@ ${lanes.join("\n")} let commentsPos; let comments = []; const parts = []; + const saveParsingContext = parsingContext; + parsingContext |= 1 << 25 /* JSDocComment */; const result = scanner2.scanRange(start + 3, length2 - 5, doJSDocScan); parsingContext = saveParsingContext; return result; function doJSDocScan() { let state = 1 /* SawAsterisk */; let margin; - let indent2 = start - (content.lastIndexOf("\n", start) + 1) + 4; + let indent3 = start - (content.lastIndexOf("\n", start) + 1) + 4; function pushComment(text) { if (!margin) { - margin = indent2; + margin = indent3; } comments.push(text); - indent2 += text.length; + indent3 += text.length; } nextTokenJSDoc(); while (parseOptionalJsdoc(5 /* WhitespaceTrivia */)) ; if (parseOptionalJsdoc(4 /* NewLineTrivia */)) { state = 0 /* BeginningOfLine */; - indent2 = 0; + indent3 = 0; } loop: while (true) { @@ -304122,14 +305619,14 @@ ${lanes.join("\n")} removeTrailingWhitespace(comments); if (!commentsPos) commentsPos = getNodePos(); - addTag(parseTag(indent2)); + addTag(parseTag(indent3)); state = 0 /* BeginningOfLine */; margin = void 0; break; case 4 /* NewLineTrivia */: comments.push(scanner2.getTokenText()); state = 0 /* BeginningOfLine */; - indent2 = 0; + indent3 = 0; break; case 42 /* AsteriskToken */: const asterisk = scanner2.getTokenText(); @@ -304139,16 +305636,16 @@ ${lanes.join("\n")} } else { Debug.assert(state === 0 /* BeginningOfLine */); state = 1 /* SawAsterisk */; - indent2 += asterisk.length; + indent3 += asterisk.length; } break; case 5 /* WhitespaceTrivia */: Debug.assert(state !== 2 /* SavingComments */, "whitespace shouldn't come from the scanner while saving top-level comment text"); const whitespace = scanner2.getTokenText(); - if (margin !== void 0 && indent2 + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent2)); + if (margin !== void 0 && indent3 + whitespace.length > margin) { + comments.push(whitespace.slice(margin - indent3)); } - indent2 += whitespace.length; + indent3 += whitespace.length; break; case 1 /* EndOfFileToken */: break loop; @@ -304185,7 +305682,7 @@ ${lanes.join("\n")} nextTokenJSDoc(); } } - const trimmedComments = trimStringEnd(comments.join("")); + const trimmedComments = comments.join("").trimEnd(); if (parts.length && trimmedComments.length) { parts.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd ?? start, commentsPos)); } @@ -304201,7 +305698,7 @@ ${lanes.join("\n")} } function removeTrailingWhitespace(comments2) { while (comments2.length) { - const trimmed = trimStringEnd(comments2[comments2.length - 1]); + const trimmed = comments2[comments2.length - 1].trimEnd(); if (trimmed === "") { comments2.pop(); } else if (trimmed.length < comments2[comments2.length - 1].length) { @@ -304350,7 +305847,7 @@ ${lanes.join("\n")} } return parseTagComments(margin, indentText.slice(margin)); } - function parseTagComments(indent2, initialMargin) { + function parseTagComments(indent3, initialMargin) { const commentsPos2 = getNodePos(); let comments2 = []; const parts2 = []; @@ -304359,10 +305856,10 @@ ${lanes.join("\n")} let margin; function pushComment(text) { if (!margin) { - margin = indent2; + margin = indent3; } comments2.push(text); - indent2 += text.length; + indent3 += text.length; } if (initialMargin !== void 0) { if (initialMargin !== "") { @@ -304377,7 +305874,7 @@ ${lanes.join("\n")} case 4 /* NewLineTrivia */: state = 0 /* BeginningOfLine */; comments2.push(scanner2.getTokenText()); - indent2 = 0; + indent3 = 0; break; case 60 /* AtToken */: scanner2.resetTokenState(scanner2.getTokenEnd() - 1); @@ -304387,11 +305884,11 @@ ${lanes.join("\n")} case 5 /* WhitespaceTrivia */: Debug.assert(state !== 2 /* SavingComments */ && state !== 3 /* SavingBackticks */, "whitespace shouldn't come from the scanner while saving comment text"); const whitespace = scanner2.getTokenText(); - if (margin !== void 0 && indent2 + whitespace.length > margin) { - comments2.push(whitespace.slice(margin - indent2)); + if (margin !== void 0 && indent3 + whitespace.length > margin) { + comments2.push(whitespace.slice(margin - indent3)); state = 2 /* SavingComments */; } - indent2 += whitespace.length; + indent3 += whitespace.length; break; case 19 /* OpenBraceToken */: state = 2 /* SavingComments */; @@ -304424,7 +305921,7 @@ ${lanes.join("\n")} case 42 /* AsteriskToken */: if (state === 0 /* BeginningOfLine */) { state = 1 /* SawAsterisk */; - indent2 += 1; + indent3 += 1; break; } default: @@ -304441,7 +305938,7 @@ ${lanes.join("\n")} } } removeLeadingNewlines(comments2); - const trimmedComments = trimStringEnd(comments2.join("")); + const trimmedComments = comments2.join("").trimEnd(); if (parts2.length) { if (trimmedComments.length) { parts2.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd2 ?? commentsPos2)); @@ -304458,18 +305955,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()); @@ -304478,6 +305964,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())) { @@ -304489,8 +305995,8 @@ ${lanes.join("\n")} function isJSDocLinkTag(kind) { return kind === "link" || kind === "linkcode" || kind === "linkplain"; } - function parseUnknownTag(start2, tagName, indent2, indentText) { - return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2); + function parseUnknownTag(start2, tagName, indent3, indentText) { + return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2); } function addTag(tag) { if (!tag) { @@ -304531,13 +306037,13 @@ ${lanes.join("\n")} switch (node.kind) { case 151 /* ObjectKeyword */: return true; - case 187 /* ArrayType */: + case 188 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; } } - function parseParameterOrPropertyTag(start2, tagName, target, indent2) { + function parseParameterOrPropertyTag(start2, tagName, target, indent3) { let typeExpression = tryParseTypeExpression(); let isNameFirst = !typeExpression; skipWhitespaceOrAsterisk(); @@ -304546,8 +306052,8 @@ ${lanes.join("\n")} if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) { typeExpression = tryParseTypeExpression(); } - const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText); - const nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent2); + const comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); + const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target, indent3); if (nestedTypeLiteral) { typeExpression = nestedTypeLiteral; isNameFirst = true; @@ -304555,32 +306061,32 @@ ${lanes.join("\n")} const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment); return finishNode(result2, start2); } - function parseNestedTypeLiteral(typeExpression, name, target, indent2) { + function parseNestedTypeLiteral(typeExpression, name, target, indent3) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { const pos = getNodePos(); let child; let children; - while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) { - if (child.kind === 347 /* JSDocParameterTag */ || child.kind === 354 /* JSDocPropertyTag */) { + while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name))) { + if (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) { children = append(children, child); - } else if (child.kind === 351 /* JSDocTemplateTag */) { + } else if (child.kind === 352 /* JSDocTemplateTag */) { parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag); } } if (children) { - const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 187 /* ArrayType */), pos); + const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 188 /* ArrayType */), pos); return finishNode(factory2.createJSDocTypeExpression(literal), pos); } } } - function parseReturnTag(start2, tagName, indent2, indentText) { + function parseReturnTag(start2, tagName, indent3, indentText) { if (some(tags, isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText)); } const typeExpression = tryParseTypeExpression(); - return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2); + return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2); } - function parseTypeTag(start2, tagName, indent2, indentText) { + function parseTypeTag(start2, tagName, indent3, indentText) { if (some(tags, isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText)); } @@ -304588,25 +306094,25 @@ ${lanes.join("\n")} /*mayOmitBraces*/ true ); - const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0; + const comments2 = indent3 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent3, indentText) : void 0; return finishNode(factory2.createJSDocTypeTag(tagName, typeExpression, comments2), start2); } - function parseSeeTag(start2, tagName, indent2, indentText) { + function parseSeeTag(start2, tagName, indent3, indentText) { const isMarkdownOrJSDocLink = token() === 23 /* OpenBracketToken */ || lookAhead(() => nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner2.getTokenValue())); const nameExpression = isMarkdownOrJSDocLink ? void 0 : parseJSDocNameReference(); - const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0; + const comments2 = indent3 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent3, indentText) : void 0; return finishNode(factory2.createJSDocSeeTag(tagName, nameExpression, comments2), start2); } - function parseThrowsTag(start2, tagName, indent2, indentText) { + function parseThrowsTag(start2, tagName, indent3, indentText) { const typeExpression = tryParseTypeExpression(); - const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText); + const comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); return finishNode(factory2.createJSDocThrowsTag(tagName, typeExpression, comment), start2); } - function parseAuthorTag(start2, tagName, indent2, indentText) { + function parseAuthorTag(start2, tagName, indent3, indentText) { const commentStart = getNodePos(); const textOnly = parseAuthorNameAndEmail(); let commentEnd = scanner2.getTokenFullStart(); - const comments2 = parseTrailingTagComments(start2, commentEnd, indent2, indentText); + const comments2 = parseTrailingTagComments(start2, commentEnd, indent3, indentText); if (!comments2) { commentEnd = scanner2.getTokenFullStart(); } @@ -304690,28 +306196,28 @@ ${lanes.join("\n")} skipWhitespace(); return finishNode(factory2.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); } - function parseTypedefTag(start2, tagName, indent2, indentText) { + function parseTypedefTag(start2, tagName, indent3, indentText) { let typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); const fullName = parseJSDocTypeNameWithNamespace(); skipWhitespace(); - let comment = parseTagComments(indent2); + let comment = parseTagComments(indent3); let end2; if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) { let child; let childTypeTag; let jsDocPropertyTags; let hasChildren = false; - while (child = tryParse(() => parseChildPropertyTag(indent2))) { - if (child.kind === 351 /* JSDocTemplateTag */) { + while (child = tryParse(() => parseChildPropertyTag(indent3))) { + if (child.kind === 352 /* JSDocTemplateTag */) { break; } hasChildren = true; - if (child.kind === 350 /* JSDocTypeTag */) { + if (child.kind === 351 /* JSDocTypeTag */) { if (childTypeTag) { const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); if (lastError) { - addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here)); + addRelatedInfo(lastError, createDetachedDiagnostic(fileName, sourceText, 0, 0, Diagnostics.The_tag_was_first_specified_here)); } break; } else { @@ -304722,7 +306228,7 @@ ${lanes.join("\n")} } } if (hasChildren) { - const isArrayType = typeExpression && typeExpression.type.kind === 187 /* ArrayType */; + const isArrayType = typeExpression && typeExpression.type.kind === 188 /* ArrayType */; const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2); end2 = typeExpression.end; @@ -304730,7 +306236,7 @@ ${lanes.join("\n")} } end2 = end2 || comment !== void 0 ? getNodePos() : (fullName ?? typeExpression ?? tagName).end; if (!comment) { - comment = parseTrailingTagComments(start2, end2, indent2, indentText); + comment = parseTrailingTagComments(start2, end2, indent3, indentText); } const typedefTag = factory2.createJSDocTypedefTag(tagName, typeExpression, fullName, comment); return finishNode(typedefTag, start2, end2); @@ -304751,21 +306257,21 @@ ${lanes.join("\n")} void 0, typeNameOrNamespaceName, body, - nested ? 4 /* NestedNamespace */ : void 0 + nested ? 8 /* NestedNamespace */ : void 0 ); return finishNode(jsDocNamespaceNode, start2); } if (nested) { - typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */; + typeNameOrNamespaceName.flags |= 4096 /* IdentifierIsInJSDocNamespace */; } return typeNameOrNamespaceName; } - function parseCallbackTagParameters(indent2) { + function parseCallbackTagParameters(indent3) { const pos = getNodePos(); let child; let parameters; - while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent2))) { - if (child.kind === 351 /* JSDocTemplateTag */) { + while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent3))) { + if (child.kind === 352 /* JSDocTemplateTag */) { parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag); break; } @@ -304773,12 +306279,12 @@ ${lanes.join("\n")} } return createNodeArray(parameters || [], pos); } - function parseJSDocSignature(start2, indent2) { - const parameters = parseCallbackTagParameters(indent2); + function parseJSDocSignature(start2, indent3) { + const parameters = parseCallbackTagParameters(indent3); const returnTag = tryParse(() => { if (parseOptionalJsdoc(60 /* AtToken */)) { - const tag = parseTag(indent2); - if (tag && tag.kind === 348 /* JSDocReturnTag */) { + const tag = parseTag(indent3); + if (tag && tag.kind === 349 /* JSDocReturnTag */) { return tag; } } @@ -304790,23 +306296,23 @@ ${lanes.join("\n")} returnTag ), start2); } - function parseCallbackTag(start2, tagName, indent2, indentText) { + function parseCallbackTag(start2, tagName, indent3, indentText) { const fullName = parseJSDocTypeNameWithNamespace(); skipWhitespace(); - let comment = parseTagComments(indent2); - const typeExpression = parseJSDocSignature(start2, indent2); + let comment = parseTagComments(indent3); + const typeExpression = parseJSDocSignature(start2, indent3); if (!comment) { - comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText); + comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); } const end2 = comment !== void 0 ? getNodePos() : typeExpression.end; return finishNode(factory2.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2); } - function parseOverloadTag(start2, tagName, indent2, indentText) { + function parseOverloadTag(start2, tagName, indent3, indentText) { skipWhitespace(); - let comment = parseTagComments(indent2); - const typeExpression = parseJSDocSignature(start2, indent2); + let comment = parseTagComments(indent3); + const typeExpression = parseJSDocSignature(start2, indent3); if (!comment) { - comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText); + comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); } const end2 = comment !== void 0 ? getNodePos() : typeExpression.end; return finishNode(factory2.createJSDocOverloadTag(tagName, typeExpression, comment), start2, end2); @@ -304822,18 +306328,18 @@ ${lanes.join("\n")} } return a.escapedText === b.escapedText; } - function parseChildPropertyTag(indent2) { - return parseChildParameterOrPropertyTag(1 /* Property */, indent2); + function parseChildPropertyTag(indent3) { + return parseChildParameterOrPropertyTag(1 /* Property */, indent3); } - function parseChildParameterOrPropertyTag(target, indent2, name) { + function parseChildParameterOrPropertyTag(target, indent3, name) { let canParseTag = true; let seenAsterisk = false; while (true) { switch (nextTokenJSDoc()) { case 60 /* AtToken */: if (canParseTag) { - const child = tryParseChildTag(target, indent2); - if (child && (child.kind === 347 /* JSDocParameterTag */ || child.kind === 354 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { + const child = tryParseChildTag(target, indent3); + if (child && (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; } return child; @@ -304858,7 +306364,7 @@ ${lanes.join("\n")} } } } - function tryParseChildTag(target, indent2) { + function tryParseChildTag(target, indent3) { Debug.assert(token() === 60 /* AtToken */); const start2 = scanner2.getTokenFullStart(); nextTokenJSDoc(); @@ -304878,14 +306384,16 @@ ${lanes.join("\n")} t = 2 /* Parameter */ | 4 /* CallbackParameter */; break; case "template": - return parseTemplateTag(start2, tagName, indent2, indentText); + return parseTemplateTag(start2, tagName, indent3, indentText); + case "this": + return parseThisTag(start2, tagName, indent3, indentText); default: return false; } if (!(target & t)) { return false; } - return parseParameterOrPropertyTag(start2, tagName, target, indent2); + return parseParameterOrPropertyTag(start2, tagName, target, indent3); } function parseTemplateTagTypeParameter() { const typeParameterPos = getNodePos(); @@ -304893,20 +306401,25 @@ ${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) { skipWhitespace(); parseExpected(64 /* EqualsToken */); - defaultType = doInsideOfContext(8388608 /* JSDoc */, parseJSDocType); + defaultType = doInsideOfContext(16777216 /* JSDoc */, parseJSDocType); parseExpected(24 /* CloseBracketToken */); } if (nodeIsMissing(name)) { return void 0; } return finishNode(factory2.createTypeParameterDeclaration( - /*modifiers*/ - void 0, + modifiers, name, /*constraint*/ void 0, @@ -304926,10 +306439,10 @@ ${lanes.join("\n")} } while (parseOptionalJsdoc(28 /* CommaToken */)); return createNodeArray(typeParameters, pos); } - function parseTemplateTag(start2, tagName, indent2, indentText) { + function parseTemplateTag(start2, tagName, indent3, indentText) { const constraint = token() === 19 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0; const typeParameters = parseTemplateTagTypeParameters(); - return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2); + return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2); } function parseOptionalJsdoc(t) { if (token() === t) { @@ -304990,7 +306503,8 @@ ${lanes.join("\n")} /*setParentNodes*/ true, sourceFile.scriptKind, - sourceFile.setExternalModuleIndicator + sourceFile.setExternalModuleIndicator, + sourceFile.jsDocParsingMode ); } const incrementalSourceFile = sourceFile; @@ -305005,16 +306519,7 @@ ${lanes.join("\n")} Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span)); Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange))); const delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length; - updateTokenPositionsAndMarkElements( - incrementalSourceFile, - changeRange.span.start, - textSpanEnd(changeRange.span), - textSpanEnd(textChangeRangeNewSpan(changeRange)), - delta, - oldText, - newText, - aggressiveChecks - ); + updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); const result = Parser.parseSourceFile( sourceFile.fileName, newText, @@ -305023,7 +306528,8 @@ ${lanes.join("\n")} /*setParentNodes*/ true, sourceFile.scriptKind, - sourceFile.setExternalModuleIndicator + sourceFile.setExternalModuleIndicator, + sourceFile.jsDocParsingMode ); result.commentDirectives = getNewCommentDirectives( sourceFile.commentDirectives, @@ -305348,7 +306854,7 @@ ${lanes.join("\n")} })(IncrementalParser || (IncrementalParser = {})); namedArgRegExCache = /* @__PURE__ */ new Map(); tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im; - singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im; + singleLinePragmaRegEx = /^\/\/\/?\s*@([^\s:]+)(.*)\s*$/im; } }); @@ -305376,14 +306882,14 @@ ${lanes.join("\n")} return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames); } function parseCustomTypeOption(opt, value, errors) { - return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors); + return convertJsonOptionOfCustomType(opt, (value ?? "").trim(), errors); } function parseListTypeOption(opt, value = "", errors) { - value = trimString(value); + value = value.trim(); if (startsWith(value, "-")) { return void 0; } - if (opt.type === "listOrElement" && !stringContains(value, ",")) { + if (opt.type === "listOrElement" && !value.includes(",")) { return validateJsonOptionValue(opt, value, errors); } if (value === "") { @@ -305604,9 +307110,8 @@ ${lanes.join("\n")} } return { buildOptions, watchOptions, projects, errors }; } - function getDiagnosticText(_message, ..._args) { - const diagnostic = createCompilerDiagnostic.apply(void 0, arguments); - return diagnostic.messageText; + function getDiagnosticText(message, ...args) { + return cast(createCompilerDiagnostic(message, ...args).messageText, isString); } function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend, extraFileExtensions) { const configFileText = tryReadFile(configFileName, (fileName) => host.readFile(fileName)); @@ -305734,7 +307239,7 @@ ${lanes.join("\n")} function convertConfigFileToObject(sourceFile, errors, jsonConversionNotifier) { var _a; const rootExpression = (_a = sourceFile.statements[0]) == null ? void 0 : _a.expression; - if (rootExpression && rootExpression.kind !== 209 /* ObjectLiteralExpression */) { + if (rootExpression && rootExpression.kind !== 210 /* ObjectLiteralExpression */) { errors.push(createDiagnosticForNodeInSourceFile( sourceFile, rootExpression, @@ -305786,7 +307291,7 @@ ${lanes.join("\n")} var _a; const result = returnValue ? {} : void 0; for (const element of node.properties) { - if (element.kind !== 302 /* PropertyAssignment */) { + if (element.kind !== 303 /* PropertyAssignment */) { errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected)); continue; } @@ -305831,15 +307336,15 @@ ${lanes.join("\n")} return valueExpression.text; case 9 /* NumericLiteral */: return Number(valueExpression.text); - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: if (valueExpression.operator !== 41 /* MinusToken */ || valueExpression.operand.kind !== 9 /* NumericLiteral */) { break; } return -Number(valueExpression.operand.text); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: const objectLiteralExpression = valueExpression; return convertObjectLiteralExpressionToJson(objectLiteralExpression, option); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return convertArrayLiteralExpressionToJson( valueExpression.elements, option && option.element @@ -305889,7 +307394,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: { @@ -305914,6 +307420,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) { @@ -306222,8 +307740,8 @@ ${lanes.join("\n")} const fileName = configFileName || "tsconfig.json"; const diagnosticMessage = Diagnostics.The_files_list_in_config_file_0_is_empty; const nodeValue = forEachTsConfigPropArray(sourceFile, "files", (property) => property.initializer); - const error = createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, nodeValue, diagnosticMessage, fileName); - errors.push(error); + const error2 = createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, nodeValue, diagnosticMessage, fileName); + errors.push(error2); } else { createCompilerDiagnosticOnlyIfJson(Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json"); } @@ -306330,8 +307848,8 @@ ${lanes.join("\n")} } } } - function isErrorNoInputFiles(error) { - return error.code === Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code; + function isErrorNoInputFiles(error2) { + return error2.code === Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code; } function getErrorForNoInputFiles({ includeSpecs, excludeSpecs }, configFileName) { return createCompilerDiagnostic( @@ -306352,7 +307870,7 @@ ${lanes.join("\n")} if (shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles)) { configParseDiagnostics.push(getErrorForNoInputFiles(configFileSpecs, configFileName)); } else { - filterMutate(configParseDiagnostics, (error) => !isErrorNoInputFiles(error)); + filterMutate(configParseDiagnostics, (error2) => !isErrorNoInputFiles(error2)); } return existingErrors !== configParseDiagnostics.length; } @@ -306363,7 +307881,7 @@ ${lanes.join("\n")} var _a; basePath = normalizeSlashes(basePath); const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath); - if (resolutionStack.indexOf(resolvedPath) >= 0) { + if (resolutionStack.includes(resolvedPath)) { errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> "))); return { raw: json || convertToObject(sourceFile, errors) }; } @@ -306445,14 +307963,17 @@ ${lanes.join("\n")} for (let index = 0; index < value.length; index++) { const fileName = value[index]; if (isString(fileName)) { - extendedConfigPath = append(extendedConfigPath, getExtendsConfigPath( - fileName, - host, - newBase, - errors, - valueExpression == null ? void 0 : valueExpression.elements[index], - sourceFile - )); + extendedConfigPath = append( + extendedConfigPath, + getExtendsConfigPath( + fileName, + host, + newBase, + errors, + valueExpression == null ? void 0 : valueExpression.elements[index], + sourceFile + ) + ); } else { convertJsonOption(extendsOptionDeclaration.element, value, basePath, errors, propertyAssignment, valueExpression == null ? void 0 : valueExpression.elements[index], sourceFile); } @@ -306760,19 +308281,19 @@ ${lanes.join("\n")} const wildcardFiles = arrayFrom(wildcardFileMap.values()); return literalFiles.concat(wildcardFiles, arrayFrom(wildCardJsonFileMap.values())); } - function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames, currentDirectory) { + function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames2, currentDirectory) { const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = spec; if (!length(validatedIncludeSpecs) || !length(validatedExcludeSpecs)) return false; basePath = normalizePath(basePath); - const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames); + const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames2); if (validatedFilesSpec) { for (const fileName of validatedFilesSpec) { if (keyMapper(getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck) return false; } } - return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath); + return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath); } function invalidDotDotAfterRecursiveWildcard(s) { const wildcardIndex = startsWith(s, "**/") ? 0 : s.indexOf("/**/"); @@ -306782,17 +308303,17 @@ ${lanes.join("\n")} const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../"); return lastDotIndex > wildcardIndex; } - function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory) { + function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) { return matchesExcludeWorker( pathToCheck, filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)), - useCaseSensitiveFileNames, + useCaseSensitiveFileNames2, currentDirectory ); } - function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath) { + function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) { const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude"); - const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames); + const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2); if (!excludeRegex) return false; if (excludeRegex.test(pathToCheck)) @@ -306822,34 +308343,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, useCaseSensitiveFileNames) { - const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude"); - const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); + 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, useCaseSensitiveFileNames); + 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, !useCaseSensitiveFileNames)) { - delete wildcardDirectories[key]; + const key = toCanonicalKey(path, useCaseSensitiveFileNames2); + if (key !== recursiveKey && containsPath(recursiveKey, key, basePath, !useCaseSensitiveFileNames2)) { + delete wildcardDirectories[path]; } } } @@ -306857,20 +308383,26 @@ ${lanes.join("\n")} } return wildcardDirectories; } - function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames) { + function toCanonicalKey(path, useCaseSensitiveFileNames2) { + return useCaseSensitiveFileNames2 ? path : toFileNameLowerCase(path); + } + function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) { const match = wildcardDirectoryPattern.exec(spec); if (match) { const questionWildcardIndex = spec.indexOf("?"); const starWildcardIndex = spec.indexOf("*"); const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator); return { - key: useCaseSensitiveFileNames ? 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(useCaseSensitiveFileNames ? spec : toFileNameLowerCase(spec)), + key: toCanonicalKey(path, useCaseSensitiveFileNames2), + path, flags: 1 /* Recursive */ }; } @@ -306882,7 +308414,7 @@ ${lanes.join("\n")} return false; } for (const ext of extensionGroup) { - if (fileExtensionIs(file, ext)) { + if (fileExtensionIs(file, ext) && (ext !== ".ts" /* Ts */ || !fileExtensionIs(file, ".d.ts" /* Dts */))) { return false; } const higherPriorityPath = keyMapper(changeExtension(file, ext)); @@ -307005,9 +308537,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"], @@ -307020,6 +308554,8 @@ ${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"], ["es2017.string", "lib.es2017.string.d.ts"], @@ -307055,14 +308591,19 @@ ${lanes.join("\n")} ["es2022.string", "lib.es2022.string.d.ts"], ["es2022.regexp", "lib.es2022.regexp.d.ts"], ["es2023.array", "lib.es2023.array.d.ts"], + ["es2023.collection", "lib.es2023.collection.d.ts"], ["esnext.array", "lib.es2023.array.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"] ]; @@ -307346,6 +308887,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, @@ -307367,8 +308909,10 @@ ${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, affectsEmit: true, affectsBuildInfo: true, @@ -307461,7 +309005,8 @@ ${lanes.join("\n")} { name: "allowJs", type: "boolean", - affectsModuleResolution: true, + allowJsFlag: true, + affectsBuildInfo: true, showInSimplifiedHelpView: true, category: Diagnostics.JavaScript_Support, description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files, @@ -307470,6 +309015,9 @@ ${lanes.join("\n")} { name: "checkJs", type: "boolean", + affectsModuleResolution: true, + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, showInSimplifiedHelpView: true, category: Diagnostics.JavaScript_Support, description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files, @@ -307482,6 +309030,10 @@ ${lanes.join("\n")} affectsEmit: true, affectsBuildInfo: true, affectsModuleResolution: true, + // The checker emits an error when it sees JSX but this option is not set in compilerOptions. + // This is effectively a semantic error, so mark this option as affecting semantic diagnostics + // so we know to refresh errors when this option is changed. + affectsSemanticDiagnostics: true, paramType: Diagnostics.KIND, showInSimplifiedHelpView: true, category: Diagnostics.Language_and_Environment, @@ -307696,7 +309248,7 @@ ${lanes.join("\n")} strictFlag: true, category: Diagnostics.Type_Checking, description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any, - defaultValueDescription: false + defaultValueDescription: Diagnostics.false_unless_strict_is_set }, { name: "alwaysStrict", @@ -307797,6 +309349,7 @@ ${lanes.join("\n")} bundler: 100 /* Bundler */ })), deprecatedKeys: /* @__PURE__ */ new Set(["node"]), + affectsSourceFile: true, affectsModuleResolution: true, paramType: Diagnostics.STRATEGY, category: Diagnostics.Modules, @@ -308047,7 +309600,7 @@ ${lanes.join("\n")} affectsBuildInfo: true, affectsDeclarationPath: true, isFilePath: false, - // This is intentionally broken to support compatability with existing tsconfig files + // This is intentionally broken to support compatibility with existing tsconfig files // for correct behaviour, please use outFile category: Diagnostics.Backwards_Compatibility, paramType: Diagnostics.FILE, @@ -308339,6 +309892,7 @@ ${lanes.join("\n")} legacy: 1 /* Legacy */, force: 3 /* Force */ })), + affectsSourceFile: true, affectsModuleResolution: true, description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files, category: Diagnostics.Language_and_Environment, @@ -308358,7 +309912,7 @@ ${lanes.join("\n")} affectsEmitOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsEmit); affectsDeclarationPathOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsDeclarationPath); moduleResolutionOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsModuleResolution); - sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics); + sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.affectsBindDiagnostics); optionsAffectingProgramStructure = optionDeclarations.filter((option) => !!option.affectsProgramStructure); transpileOptionValueCompilerOptions = optionDeclarations.filter((option) => hasProperty(option, "transpileOptionValue")); optionsForBuild = [ @@ -308505,8 +310059,8 @@ ${lanes.join("\n")} }); // src/compiler/moduleNameResolver.ts - function trace(host) { - host.trace(formatMessage.apply(void 0, arguments)); + function trace(host, message, ...args) { + host.trace(formatMessage(message, ...args)); } function isTraceEnabled(compilerOptions, host) { return !!compilerOptions.traceResolution && host.trace !== void 0; @@ -308550,6 +310104,18 @@ ${lanes.join("\n")} result.push("JSON"); return result.join(", "); } + function extensionsToExtensionsArray(extensions) { + const result = []; + if (extensions & 1 /* TypeScript */) + result.push(...supportedTSImplementationExtensions); + if (extensions & 2 /* JavaScript */) + result.push(...supportedJSExtensionsFlat); + if (extensions & 4 /* Declaration */) + result.push(...supportedDeclarationExtensions); + if (extensions & 8 /* Json */) + result.push(".json" /* Json */); + return result; + } function resolvedTypeScriptOnly(resolved) { if (!resolved) { return void 0; @@ -308557,7 +310123,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, 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) @@ -308570,15 +310136,25 @@ ${lanes.join("\n")} affectingLocations, diagnostics, state.resultFromCache, - legacyResult + cache, + alternateResult ); } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) { + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, alternateResult) { if (resultFromCache) { - resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); - resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations); - resultFromCache.resolutionDiagnostics = updateResolutionField(resultFromCache.resolutionDiagnostics, diagnostics); - return resultFromCache; + if (!(cache == null ? void 0 : cache.isReadonly)) { + resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); + resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations); + resultFromCache.resolutionDiagnostics = updateResolutionField(resultFromCache.resolutionDiagnostics, diagnostics); + return resultFromCache; + } else { + return { + ...resultFromCache, + failedLookupLocations: initializeResolutionFieldForReadonlyCache(resultFromCache.failedLookupLocations, failedLookupLocations), + affectingLocations: initializeResolutionFieldForReadonlyCache(resultFromCache.affectingLocations, affectingLocations), + resolutionDiagnostics: initializeResolutionFieldForReadonlyCache(resultFromCache.resolutionDiagnostics, diagnostics) + }; + } } return { resolvedModule: resolved && { @@ -308592,7 +310168,7 @@ ${lanes.join("\n")} failedLookupLocations: initializeResolutionField(failedLookupLocations), affectingLocations: initializeResolutionField(affectingLocations), resolutionDiagnostics: initializeResolutionField(diagnostics), - node10Result: legacyResult + alternateResult }; } function initializeResolutionField(value) { @@ -308606,6 +310182,13 @@ ${lanes.join("\n")} to.push(...value); return to; } + function initializeResolutionFieldForReadonlyCache(fromCache, value) { + if (!(fromCache == null ? void 0 : fromCache.length)) + return initializeResolutionField(value); + if (!value.length) + return fromCache.slice(); + return [...fromCache, ...value]; + } function readPackageJsonField(jsonContent, fieldName, typeOfTag, state) { if (!hasProperty(jsonContent, fieldName)) { if (state.traceEnabled) { @@ -308722,8 +310305,8 @@ ${lanes.join("\n")} return typeRoots; } function arePathsEqual(path1, path2, host) { - const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; - return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */; + const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; + return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0 /* EqualTo */; } function getOriginalAndResolvedFileName(fileName, host, traceEnabled) { const resolvedFileName = realPath(fileName, host, traceEnabled); @@ -308781,10 +310364,14 @@ ${lanes.join("\n")} const failedLookupLocations = []; const affectingLocations = []; let features = getNodeResolutionFeatures(options); - if (resolutionMode === 99 /* ESNext */ && (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */)) { + if (resolutionMode !== void 0) { + features |= 30 /* AllFeatures */; + } + const moduleResolution = getEmitModuleResolutionKind(options); + if (resolutionMode === 99 /* ESNext */ && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) { features |= 32 /* EsmMode */; } - const conditions = features & 8 /* Exports */ ? getConditions(options, !!(features & 32 /* EsmMode */)) : []; + const conditions = features & 8 /* Exports */ ? getConditions(options, resolutionMode) : []; const diagnostics = []; const moduleResolutionState = { compilerOptions: options, @@ -308798,7 +310385,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; @@ -308826,15 +310414,15 @@ ${lanes.join("\n")} affectingLocations: initializeResolutionField(affectingLocations), resolutionDiagnostics: initializeResolutionField(diagnostics) }; - if (containingDirectory) { - cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set( + if (containingDirectory && cache && !cache.isReadonly) { + cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set( typeReferenceDirectiveName, /*mode*/ resolutionMode, result ); if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) { - cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result); + cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result); } } if (traceEnabled) @@ -308875,12 +310463,7 @@ ${lanes.join("\n")} } } return resolvedTypeScriptOnly( - loadNodeModuleFromDirectory( - 4 /* Declaration */, - candidate, - !directoryExists, - moduleResolutionState - ) + loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, moduleResolutionState) ); }); } else { @@ -308957,12 +310540,20 @@ ${lanes.join("\n")} } return features; } - function getConditions(options, esmMode) { - const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["import"] : ["require"]; + function getConditions(options, resolutionMode) { + const moduleResolution = getEmitModuleResolutionKind(options); + if (resolutionMode === void 0) { + if (moduleResolution === 100 /* Bundler */) { + resolutionMode = 99 /* ESNext */; + } else if (moduleResolution === 2 /* Node10 */) { + return []; + } + } + const conditions = resolutionMode === 99 /* ESNext */ ? ["import"] : ["require"]; if (!options.noDtsResolution) { conditions.push("types"); } - if (getEmitModuleResolutionKind(options) !== 100 /* Bundler */) { + if (moduleResolution !== 100 /* Bundler */) { conditions.push("node"); } return concatenate(conditions, options.customConditions); @@ -309009,6 +310600,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") { @@ -309026,11 +310623,10 @@ ${lanes.join("\n")} return str + "}"; } function getKeyForCompilerOptions(options, affectingOptionDeclarations) { - return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + (options.pathsBasePath ? `|${options.pathsBasePath}` : void 0); + return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + `|${options.pathsBasePath}`; } - function createCacheWithRedirects(ownOptions) { + function createCacheWithRedirects(ownOptions, optionsToRedirectsKey) { const redirectsMap = /* @__PURE__ */ new Map(); - const optionsToRedirectsKey = /* @__PURE__ */ new Map(); const redirectsKeyToMap = /* @__PURE__ */ new Map(); let ownMap = /* @__PURE__ */ new Map(); if (ownOptions) @@ -309039,7 +310635,8 @@ ${lanes.join("\n")} getMapOfCacheRedirects, getOrCreateMapOfCacheRedirects, update, - clear: clear2 + clear: clear2, + getOwnMap: () => ownMap }; function getMapOfCacheRedirects(redirectedReference) { return redirectedReference ? getOrCreateMap( @@ -309113,7 +310710,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)); } @@ -309123,10 +310720,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; } @@ -309140,13 +310733,14 @@ ${lanes.join("\n")} } return result; } - function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options) { - const directoryToModuleNameMap = createCacheWithRedirects(options); + function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options, optionsToRedirectsKey) { + const directoryToModuleNameMap = createCacheWithRedirects(options, optionsToRedirectsKey); return { getFromDirectoryCache, getOrCreateCacheForDirectory, clear: clear2, - update + update, + directoryToModuleNameMap }; function clear2() { directoryToModuleNameMap.clear(); @@ -309202,23 +310796,14 @@ ${lanes.join("\n")} return result; } } - function zipToModeAwareCache(file, keys, values, nameAndModeGetter) { - Debug.assert(keys.length === values.length); - const map2 = createModeAwareCache(); - for (let i = 0; i < keys.length; ++i) { - const entry = keys[i]; - map2.set(nameAndModeGetter.getName(entry), nameAndModeGetter.getMode(entry, file), values[i]); - } - return map2; - } function getOriginalOrResolvedModuleFileName(result) { return result.resolvedModule && (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName); } function getOriginalOrResolvedTypeReferenceFileName(result) { return result.resolvedTypeReferenceDirective && (result.resolvedTypeReferenceDirective.originalPath || result.resolvedTypeReferenceDirective.resolvedFileName); } - function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName) { - const moduleNameToDirectoryMap = createCacheWithRedirects(options); + function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName, optionsToRedirectsKey) { + const moduleNameToDirectoryMap = createCacheWithRedirects(options, optionsToRedirectsKey); return { getFromNonRelativeNameCache, getOrCreateCacheForNonRelativeName, @@ -309286,13 +310871,20 @@ ${lanes.join("\n")} } } } - function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName) { - const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options); + function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName, optionsToRedirectsKey) { + optionsToRedirectsKey ?? (optionsToRedirectsKey = /* @__PURE__ */ new Map()); + const perDirectoryResolutionCache = createPerDirectoryResolutionCache( + currentDirectory, + getCanonicalFileName, + options, + optionsToRedirectsKey + ); const nonRelativeNameResolutionCache = createNonRelativeNameResolutionCache( currentDirectory, getCanonicalFileName, options, - getResolvedFileName + getResolvedFileName, + optionsToRedirectsKey ); packageJsonInfoCache ?? (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName)); return { @@ -309302,7 +310894,8 @@ ${lanes.join("\n")} clear: clear2, update, getPackageJsonInfoCache: () => packageJsonInfoCache, - clearAllExceptPackageJsonInfoCache + clearAllExceptPackageJsonInfoCache, + optionsToRedirectsKey }; function clear2() { clearAllExceptPackageJsonInfoCache(); @@ -309317,24 +310910,26 @@ ${lanes.join("\n")} nonRelativeNameResolutionCache.update(options2); } } - function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) { + function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) { const result = createModuleOrTypeReferenceResolutionCache( currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, - getOriginalOrResolvedModuleFileName + getOriginalOrResolvedModuleFileName, + optionsToRedirectsKey ); result.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference); return result; } - function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) { + function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) { return createModuleOrTypeReferenceResolutionCache( currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, - getOriginalOrResolvedTypeReferenceFileName + getOriginalOrResolvedTypeReferenceFileName, + optionsToRedirectsKey ); } function getOptionsForLibraryResolution(options) { @@ -309374,20 +310969,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]); } @@ -309405,13 +310987,13 @@ ${lanes.join("\n")} result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); break; case 2 /* Node10 */: - result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference); + result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode) : void 0); break; case 1 /* Classic */: result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference); break; case 100 /* Bundler */: - result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference); + result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode) : void 0); break; default: return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`); @@ -309419,9 +311001,11 @@ ${lanes.join("\n")} if (result && result.resolvedModule) (_b = perfLogger) == null ? void 0 : _b.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`); (_c = perfLogger) == null ? void 0 : _c.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null"); - cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result); - if (!isExternalModuleNameRelative(moduleName)) { - cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result); + if (cache && !cache.isReadonly) { + cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result); + if (!isExternalModuleNameRelative(moduleName)) { + cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result); + } } } if (traceEnabled) { @@ -309576,7 +311160,7 @@ ${lanes.join("\n")} resolutionMode ); } - function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { + function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode, conditions) { const containingDirectory = getDirectoryPath(containingFile); const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0; let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */; @@ -309593,7 +311177,8 @@ ${lanes.join("\n")} extensions, /*isConfigLookup*/ false, - redirectedReference + redirectedReference, + conditions ); } function tryResolveJSModuleWorker(moduleName, initialDir, host) { @@ -309609,10 +311194,12 @@ ${lanes.join("\n")} /*isConfigLookup*/ false, /*redirectedReference*/ + void 0, + /*conditions*/ void 0 ); } - function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) { + function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions) { const containingDirectory = getDirectoryPath(containingFile); let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */; if (getResolveJsonModule(compilerOptions)) { @@ -309628,10 +311215,11 @@ ${lanes.join("\n")} extensions, /*isConfigLookup*/ false, - redirectedReference + redirectedReference, + conditions ); } - function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) { + function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions, isConfigLookup) { let extensions; if (isConfigLookup) { extensions = 8 /* Json */; @@ -309642,7 +311230,7 @@ ${lanes.join("\n")} } else { extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */; } - return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference); + return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions); } function nodeNextJsonConfigResolver(moduleName, containingFile, host) { return nodeModuleNameResolverWorker( @@ -309657,15 +311245,21 @@ ${lanes.join("\n")} /*isConfigLookup*/ true, /*redirectedReference*/ + void 0, + /*conditions*/ void 0 ); } - function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) { - var _a, _b, _c, _d; + function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) { + var _a, _b, _c, _d, _e; const traceEnabled = isTraceEnabled(compilerOptions, host); const failedLookupLocations = []; const affectingLocations = []; - const conditions = getConditions(compilerOptions, !!(features & 32 /* EsmMode */)); + const moduleResolution = getEmitModuleResolutionKind(compilerOptions); + conditions ?? (conditions = getConditions( + compilerOptions, + moduleResolution === 100 /* Bundler */ || moduleResolution === 2 /* Node10 */ ? void 0 : features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */ + )); const diagnostics = []; const state = { compilerOptions, @@ -309675,45 +311269,64 @@ ${lanes.join("\n")} affectingLocations, packageJsonInfoCache: cache, features, - conditions, + conditions: conditions ?? emptyArray, requestContainingDirectory: containingDirectory, reportDiagnostic: (diag2) => void diagnostics.push(diag2), isConfigLookup, - candidateIsFromPackageJsonField: false + candidateIsFromPackageJsonField: false, + resolvedPackageDirectory: false }; - if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(getEmitModuleResolutionKind(compilerOptions))) { - trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", ")); + 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(", ")); } let result; - if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) { + if (moduleResolution === 2 /* Node10 */) { const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */); const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */); result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0; } 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.indexOf("import") > -1) { - 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, - legacyResult + cache, + alternateResult ); function tryResolve(extensions2, state2) { const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName( @@ -309737,7 +311350,7 @@ ${lanes.join("\n")} resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference); } if (!resolved2) { - if (moduleName.indexOf(":") > -1) { + if (moduleName.includes(":")) { if (traceEnabled) { trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2)); } @@ -309782,7 +311395,6 @@ ${lanes.join("\n")} if (traceEnabled) { trace(host, Diagnostics.Resolving_real_path_for_0_result_1, path, real); } - Debug.assert(host.fileExists(real), `${path} linked to nonexistent file ${real}`); return real; } function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) { @@ -309826,7 +311438,7 @@ ${lanes.join("\n")} return void 0; } function pathContainsNodeModules(path) { - return stringContains(path, nodeModulesPathPart); + return path.includes(nodeModulesPathPart); } function parseNodeModuleFromPath(resolved, isFolder) { const path = normalizePath(resolved); @@ -309862,7 +311474,7 @@ ${lanes.join("\n")} } function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) { const filename = getBaseFileName(candidate); - if (filename.indexOf(".") === -1) { + if (!filename.includes(".")) { return void 0; } let extensionless = removeFileExtension(candidate); @@ -309974,19 +311586,11 @@ ${lanes.join("\n")} entrypoints = append(entrypoints, mainResolution == null ? void 0 : mainResolution.path); if (features & 8 /* Exports */ && packageJsonInfo.contents.packageJsonContent.exports) { const conditionSets = deduplicate( - [getConditions( - options, - /*esmMode*/ - true - ), getConditions( - options, - /*esmMode*/ - false - )], + [getConditions(options, 99 /* ESNext */), getConditions(options, 1 /* CommonJS */)], arrayIsEqualTo ); for (const conditions of conditionSets) { - const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions }; + const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions, host }; const exportResolutions = loadEntrypointsFromExportMap( packageJsonInfo, packageJsonInfo.contents.packageJsonContent.exports, @@ -310018,23 +311622,44 @@ ${lanes.join("\n")} return entrypoints; function loadEntrypointsFromTargetExports(target) { var _a, _b; - if (typeof target === "string" && startsWith(target, "./") && target.indexOf("*") === -1) { - const partsAfterFirst = getPathComponents(target).slice(2); - if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) { - return false; - } - const resolvedTarget = combinePaths(scope.packageDirectory, target); - const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)); - const result = loadFileNameFromPackageJsonField( - extensions, - finalPath, - /*onlyRecordFailures*/ - false, - state - ); - if (result) { - entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path); - return true; + if (typeof target === "string" && startsWith(target, "./")) { + if (target.includes("*") && state.host.readDirectory) { + if (target.indexOf("*") !== target.lastIndexOf("*")) { + return false; + } + state.host.readDirectory( + scope.packageDirectory, + extensionsToExtensionsArray(extensions), + /*excludes*/ + void 0, + [ + changeFullExtension(replaceFirstStar(target, "**/*"), ".*") + ] + ).forEach((entry) => { + entrypoints = appendIfUnique(entrypoints, { + path: entry, + ext: getAnyExtensionFromPath(entry), + resolvedUsingTsExtension: void 0 + }); + }); + } else { + const partsAfterFirst = getPathComponents(target).slice(2); + if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) { + return false; + } + const resolvedTarget = combinePaths(scope.packageDirectory, target); + const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)); + const result = loadFileNameFromPackageJsonField( + extensions, + finalPath, + /*onlyRecordFailures*/ + false, + state + ); + if (result) { + entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path); + return true; + } } } else if (Array.isArray(target)) { for (const t of target) { @@ -310066,7 +311691,8 @@ ${lanes.join("\n")} requestContainingDirectory: void 0, reportDiagnostic: noop, isConfigLookup: false, - candidateIsFromPackageJsonField: false + candidateIsFromPackageJsonField: false, + resolvedPackageDirectory: false }; } function getPackageScopeForPath(fileName, state) { @@ -310093,7 +311719,7 @@ ${lanes.join("\n")} return packageJsonInfo.contents.versionPaths || void 0; } function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) { - var _a, _b, _c, _d, _e, _f, _g, _h; + var _a, _b, _c, _d, _e, _f; const { host, traceEnabled } = state; const packageJsonPath = combinePaths(packageDirectory, "package.json"); if (onlyRecordFailures) { @@ -310102,13 +311728,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; @@ -310121,15 +311747,17 @@ ${lanes.join("\n")} trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath); } const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } }; - (_e = state.packageJsonInfoCache) == null ? void 0 : _e.setPackageJsonInfo(packageJsonPath, result); - (_f = state.affectingLocations) == null ? void 0 : _f.push(packageJsonPath); + if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly) + state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result); + (_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath); return result; } else { if (directoryExists && traceEnabled) { trace(host, Diagnostics.File_0_does_not_exist, packageJsonPath); } - (_g = state.packageJsonInfoCache) == null ? void 0 : _g.setPackageJsonInfo(packageJsonPath, directoryExists); - (_h = state.failedLookupLocations) == null ? void 0 : _h.push(packageJsonPath); + if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly) + state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, { packageDirectory, directoryExists }); + (_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath); } } function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) { @@ -310142,15 +311770,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; @@ -310206,10 +311828,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; } @@ -310243,6 +311861,9 @@ ${lanes.join("\n")} } const trailingParts = parts.slice(nameParts.length); const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`; + if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) { + return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference); + } const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */); const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */); return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference); @@ -310384,7 +312005,7 @@ ${lanes.join("\n")} } function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) { const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports); - if (!endsWith(moduleName, directorySeparator) && moduleName.indexOf("*") === -1 && hasProperty(lookupTable, moduleName)) { + if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) { const target = lookupTable[moduleName]; return loadModuleFromTargetImportOrExport( target, @@ -310395,7 +312016,7 @@ ${lanes.join("\n")} moduleName ); } - const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.indexOf("*") !== -1 || endsWith(k, "/")), comparePatternKeys); + const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys); for (const potentialTarget of expandingKeys) { if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) { const target = lookupTable[potentialTarget]; @@ -310467,15 +312088,18 @@ ${lanes.join("\n")} extensions, /*isConfigLookup*/ false, - redirectedReference + redirectedReference, + state.conditions + ); + return toSearchResult( + result.resolvedModule ? { + path: result.resolvedModule.resolvedFileName, + extension: result.resolvedModule.extension, + packageId: result.resolvedModule.packageId, + originalPath: result.resolvedModule.originalPath, + resolvedUsingTsExtension: result.resolvedModule.resolvedUsingTsExtension + } : void 0 ); - return toSearchResult(result.resolvedModule ? { - path: result.resolvedModule.resolvedFileName, - extension: result.resolvedModule.extension, - packageId: result.resolvedModule.packageId, - originalPath: result.resolvedModule.originalPath, - resolvedUsingTsExtension: result.resolvedModule.resolvedUsingTsExtension - } : void 0); } if (state.traceEnabled) { trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); @@ -310487,7 +312111,7 @@ ${lanes.join("\n")} } const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target); const partsAfterFirst = parts.slice(1); - if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) { + if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) { if (state.traceEnabled) { trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); } @@ -310498,7 +312122,7 @@ ${lanes.join("\n")} } const resolvedTarget = combinePaths(scope.packageDirectory, target); const subpathParts = getPathComponents(subpath); - if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0) { + if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) { if (state.traceEnabled) { trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); } @@ -310508,13 +312132,7 @@ ${lanes.join("\n")} ); } if (state.traceEnabled) { - trace( - state.host, - Diagnostics.Using_0_subpath_1_with_target_2, - isImports ? "imports" : "exports", - key, - pattern ? target.replace(/\*/g, subpath) : target + subpath - ); + trace(state.host, Diagnostics.Using_0_subpath_1_with_target_2, isImports ? "imports" : "exports", key, pattern ? target.replace(/\*/g, subpath) : target + subpath); } const finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath); const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports); @@ -310531,7 +312149,7 @@ ${lanes.join("\n")} if (!Array.isArray(target)) { traceIfEnabled(state, Diagnostics.Entering_conditional_exports); for (const condition of getOwnKeys(target)) { - if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) { + if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) { traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); const subTarget = target[condition]; const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key); @@ -310590,13 +312208,10 @@ ${lanes.join("\n")} function combineDirectoryPath(root, dir) { return ensureTrailingDirectorySeparator(combinePaths(root, dir)); } - function useCaseSensitiveFileNames() { - return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames(); - } function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) { var _a, _b, _c, _d; - if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) { - const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames }); + if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) { + const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) }); const commonSourceDirGuesses = []; if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) { const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName)); @@ -310625,7 +312240,7 @@ ${lanes.join("\n")} for (const commonSourceDirGuess of commonSourceDirGuesses) { const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess); for (const candidateDir of candidateDirectories) { - if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) { + if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) { const pathFragment = finalPath.slice(candidateDir.length + 1); const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment); const jsAndDtsExtensions = [".mjs" /* Mjs */, ".cjs" /* Cjs */, ".js" /* Js */, ".json" /* Json */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".d.ts" /* Dts */]; @@ -310635,7 +312250,7 @@ ${lanes.join("\n")} for (const possibleExt of inputExts) { if (!extensionIsOk(extensions, possibleExt)) continue; - const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames()); + const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state)); if (state.host.fileExists(possibleInputWithInputExtension)) { return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField( extensions, @@ -310669,7 +312284,7 @@ ${lanes.join("\n")} } } function isApplicableVersionedTypesKey(conditions, key) { - if (conditions.indexOf("types") === -1) + if (!conditions.includes("types")) return false; if (!startsWith(key, "types@")) return false; @@ -310709,11 +312324,13 @@ ${lanes.join("\n")} const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */); const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */); if (priorityExtensions) { + traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0, formatExtensions(priorityExtensions)); const result = lookup(priorityExtensions); if (result) return result; } if (secondaryExtensions && !typesScopeOnly) { + traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0, formatExtensions(secondaryExtensions)); return lookup(secondaryExtensions); } function lookup(extensions2) { @@ -310791,6 +312408,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; } @@ -310827,7 +312447,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); @@ -310871,7 +312491,7 @@ ${lanes.join("\n")} return mangledName; } function unmangleScopedPackageName(typesPackageName) { - return stringContains(typesPackageName, mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName; + return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName; } function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) { const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference); @@ -310909,7 +312529,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( @@ -310919,7 +312540,8 @@ ${lanes.join("\n")} failedLookupLocations, affectingLocations, diagnostics, - state + state, + cache ); function tryResolve(extensions) { const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); @@ -311017,7 +312639,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 */, @@ -311038,7 +312661,9 @@ ${lanes.join("\n")} failedLookupLocations, affectingLocations, diagnostics, - state.resultFromCache + state.resultFromCache, + /*cache*/ + void 0 ); } function toSearchResult(value) { @@ -311049,6 +312674,9 @@ ${lanes.join("\n")} trace(state.host, diagnostic, ...args); } } + function useCaseSensitiveFileNames(state) { + return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames(); + } var typeScriptVersion, nodeModulesAtTypes, NodeResolutionFeatures, nodeModulesPathPart, mangledScopedPackageSeparator; var init_moduleNameResolver = __esm({ "src/compiler/moduleNameResolver.ts"() { @@ -311097,23 +312725,23 @@ ${lanes.join("\n")} } function getModuleInstanceStateWorker(node, visited) { switch (node.kind) { - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: if (isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; - case 271 /* ImportDeclaration */: - case 270 /* ImportEqualsDeclaration */: - if (!hasSyntacticModifier(node, 1 /* Export */)) { + case 272 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: + if (!hasSyntacticModifier(node, 32 /* Export */)) { return 0 /* NonInstantiated */; } break; - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: const exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 278 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 279 /* NamedExports */) { let state = 0 /* NonInstantiated */; for (const specifier of exportDeclaration.exportClause.elements) { const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited); @@ -311127,7 +312755,7 @@ ${lanes.join("\n")} return state; } break; - case 267 /* ModuleBlock */: { + case 268 /* ModuleBlock */: { let state = 0 /* NonInstantiated */; forEachChild(node, (n) => { const childState = getModuleInstanceStateCached(n, visited); @@ -311146,10 +312774,10 @@ ${lanes.join("\n")} }); return state; } - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 80 /* Identifier */: - if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { + if (node.flags & 4096 /* IdentifierIsInJSDocNamespace */) { return 0 /* NonInstantiated */; } } @@ -311179,6 +312807,9 @@ ${lanes.join("\n")} if (found === 1 /* Instantiated */) { return found; } + if (statement.kind === 271 /* ImportEqualsDeclaration */) { + found = 1 /* Instantiated */; + } } } if (found !== void 0) { @@ -311312,7 +312943,7 @@ ${lanes.join("\n")} } } function getDeclarationName(node) { - if (node.kind === 276 /* ExportAssignment */) { + if (node.kind === 277 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } const name = getNameOfDeclaration(node); @@ -311321,7 +312952,7 @@ ${lanes.join("\n")} const moduleName = getTextOfIdentifierOrLiteral(name); return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`; } - if (name.kind === 166 /* ComputedPropertyName */) { + if (name.kind === 167 /* ComputedPropertyName */) { const nameExpression = name.expression; if (isStringOrNumericLiteralLike(nameExpression)) { return escapeLeadingUnderscores(nameExpression.text); @@ -311346,31 +312977,31 @@ ${lanes.join("\n")} return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0; } switch (node.kind) { - case 175 /* Constructor */: + case 176 /* Constructor */: return "__constructor" /* Constructor */; - case 183 /* FunctionType */: - case 178 /* CallSignature */: - case 329 /* JSDocSignature */: + case 184 /* FunctionType */: + case 179 /* CallSignature */: + case 330 /* JSDocSignature */: return "__call" /* Call */; - case 184 /* ConstructorType */: - case 179 /* ConstructSignature */: + case 185 /* ConstructorType */: + case 180 /* ConstructSignature */: return "__new" /* New */; - case 180 /* IndexSignature */: + case 181 /* IndexSignature */: return "__index" /* Index */; - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 311 /* SourceFile */: + case 312 /* SourceFile */: return "export=" /* ExportEquals */; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { return "export=" /* ExportEquals */; } Debug.fail("Unknown binary declaration kind"); break; - case 323 /* JSDocFunctionType */: + case 324 /* JSDocFunctionType */: return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */; - case 168 /* Parameter */: - Debug.assert(node.parent.kind === 323 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`); + case 169 /* Parameter */: + Debug.assert(node.parent.kind === 324 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`); const functionType = node.parent; const index = functionType.parameters.indexOf(node); return "arg" + index; @@ -311381,7 +313012,7 @@ ${lanes.join("\n")} } function declareSymbol(symbolTable, parent3, node, includes, excludes, isReplaceableByMethod, isComputedName) { Debug.assert(isComputedName || !hasDynamicName(node)); - const isDefaultExport = hasSyntacticModifier(node, 1024 /* Default */) || isExportSpecifier(node) && node.name.escapedText === "default"; + const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && node.name.escapedText === "default"; const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent3 ? "default" /* Default */ : getDeclarationName(node); let symbol; if (name === void 0) { @@ -311417,7 +313048,7 @@ ${lanes.join("\n")} messageNeedsName = false; multipleDefaultExports = true; } else { - if (symbol.declarations && symbol.declarations.length && (node.kind === 276 /* ExportAssignment */ && !node.isExportEquals)) { + if (symbol.declarations && symbol.declarations.length && (node.kind === 277 /* ExportAssignment */ && !node.isExportEquals)) { message = Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName = false; multipleDefaultExports = true; @@ -311425,7 +313056,7 @@ ${lanes.join("\n")} } } const relatedInformation = []; - if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) { + if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node, 32 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) { relatedInformation.push(createDiagnosticForNode2(node, Diagnostics.Did_you_mean_0, `export type { ${unescapeLeadingUnderscores(node.name.escapedText)} }`)); } const declarationName = getNameOfDeclaration(node) || node; @@ -311454,9 +313085,9 @@ ${lanes.join("\n")} return symbol; } function declareModuleMember(node, symbolFlags, symbolExcludes) { - const hasExportModifier = !!(getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node); + const hasExportModifier = !!(getCombinedModifierFlags(node) & 32 /* Export */) || jsdocTreatAsExported(node); if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 280 /* ExportSpecifier */ || node.kind === 270 /* ImportEqualsDeclaration */ && hasExportModifier) { + if (node.kind === 281 /* ExportSpecifier */ || node.kind === 271 /* ImportEqualsDeclaration */ && hasExportModifier) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { Debug.assertNode(container, canHaveLocals); @@ -311472,8 +313103,8 @@ ${lanes.join("\n")} } else { if (isJSDocTypeAlias(node)) Debug.assert(isInJSFile(node)); - if (!isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) { - if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node, 1024 /* Default */) && !getDeclarationName(node)) { + if (!isAmbientModule(node) && (hasExportModifier || container.flags & 128 /* ExportContext */)) { + if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node, 2048 /* Default */) && !getDeclarationName(node)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } const exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0; @@ -311514,7 +313145,7 @@ ${lanes.join("\n")} return false; if (isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) return true; - if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) & 1 /* Export */) + if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) & 32 /* Export */) return true; return false; } @@ -311523,7 +313154,7 @@ ${lanes.join("\n")} const saveThisParentContainer = thisParentContainer; const savedBlockScopeContainer = blockScopeContainer; if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 218 /* ArrowFunction */) { + if (node.kind !== 219 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -311545,35 +313176,35 @@ ${lanes.join("\n")} const saveExceptionTarget = currentExceptionTarget; const saveActiveLabelList = activeLabelList; const saveHasExplicitReturn = hasExplicitReturn; - const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 174 /* ClassStaticBlockDeclaration */; + const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */; if (!isImmediatelyInvoked) { currentFlow = initFlowNode({ flags: 2 /* Start */ }); if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) { currentFlow.node = node; } } - currentReturnTarget = isImmediatelyInvoked || node.kind === 175 /* Constructor */ || isInJSFile(node) && (node.kind === 261 /* FunctionDeclaration */ || node.kind === 217 /* FunctionExpression */) ? createBranchLabel() : void 0; + currentReturnTarget = isImmediatelyInvoked || node.kind === 176 /* Constructor */ || isInJSFile(node) && (node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */) ? createBranchLabel() : void 0; currentExceptionTarget = void 0; currentBreakTarget = void 0; currentContinueTarget = void 0; activeLabelList = void 0; hasExplicitReturn = false; bindChildren(node); - node.flags &= ~2816 /* ReachabilityAndEmitFlags */; + node.flags &= ~5632 /* ReachabilityAndEmitFlags */; if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) { - node.flags |= 256 /* HasImplicitReturn */; + node.flags |= 512 /* HasImplicitReturn */; if (hasExplicitReturn) - node.flags |= 512 /* HasExplicitReturn */; + node.flags |= 1024 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 311 /* SourceFile */) { + if (node.kind === 312 /* SourceFile */) { node.flags |= emitFlags; node.endFlowNode = currentFlow; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 175 /* Constructor */ || node.kind === 174 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 261 /* FunctionDeclaration */ || node.kind === 217 /* FunctionExpression */)) { + if (node.kind === 176 /* Constructor */ || node.kind === 175 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) { node.returnFlowNode = currentFlow; } } @@ -311590,7 +313221,7 @@ ${lanes.join("\n")} seenThisKeyword = false; bindChildren(node); Debug.assertNotNode(node, isIdentifier); - node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */; + node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */; } else { bindChildren(node); } @@ -311599,8 +313230,8 @@ ${lanes.join("\n")} blockScopeContainer = savedBlockScopeContainer; } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, (n) => n.kind === 261 /* FunctionDeclaration */ ? bind(n) : void 0); - bindEach(nodes, (n) => n.kind !== 261 /* FunctionDeclaration */ ? bind(n) : void 0); + bindEach(nodes, (n) => n.kind === 262 /* FunctionDeclaration */ ? bind(n) : void 0); + bindEach(nodes, (n) => n.kind !== 262 /* FunctionDeclaration */ ? bind(n) : void 0); } function bindEach(nodes, bindFunction = bind) { if (nodes === void 0) { @@ -311620,59 +313251,59 @@ ${lanes.join("\n")} inAssignmentPattern = saveInAssignmentPattern; return; } - if (node.kind >= 242 /* FirstStatement */ && node.kind <= 258 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 243 /* FirstStatement */ && node.kind <= 259 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 246 /* WhileStatement */: + case 247 /* WhileStatement */: bindWhileStatement(node); break; - case 245 /* DoStatement */: + case 246 /* DoStatement */: bindDoStatement(node); break; - case 247 /* ForStatement */: + case 248 /* ForStatement */: bindForStatement(node); break; - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 244 /* IfStatement */: + case 245 /* IfStatement */: bindIfStatement(node); break; - case 252 /* ReturnStatement */: - case 256 /* ThrowStatement */: + case 253 /* ReturnStatement */: + case 257 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 251 /* BreakStatement */: - case 250 /* ContinueStatement */: + case 252 /* BreakStatement */: + case 251 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 257 /* TryStatement */: + case 258 /* TryStatement */: bindTryStatement(node); break; - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: bindSwitchStatement(node); break; - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: bindCaseBlock(node); break; - case 295 /* CaseClause */: + case 296 /* CaseClause */: bindCaseClause(node); break; - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: bindLabeledStatement(node); break; - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 224 /* PostfixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: if (isDestructuringAssignment(node)) { inAssignmentPattern = saveInAssignmentPattern; bindDestructuringAssignmentFlow(node); @@ -311680,49 +313311,49 @@ ${lanes.join("\n")} } bindBinaryExpressionFlow(node); break; - case 219 /* DeleteExpression */: + case 220 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 212 /* CallExpression */: + case 213 /* CallExpression */: bindCallExpressionFlow(node); break; - case 234 /* NonNullExpression */: + case 235 /* NonNullExpression */: bindNonNullExpressionFlow(node); break; - case 352 /* JSDocTypedefTag */: - case 344 /* JSDocCallbackTag */: - case 346 /* JSDocEnumTag */: + case 353 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: + case 347 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; - case 311 /* SourceFile */: { + case 312 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 240 /* Block */: - case 267 /* ModuleBlock */: + case 241 /* Block */: + case 268 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; - case 207 /* BindingElement */: + case 208 /* BindingElement */: bindBindingElementFlow(node); break; - case 168 /* Parameter */: + case 169 /* Parameter */: bindParameterFlow(node); break; - case 209 /* ObjectLiteralExpression */: - case 208 /* ArrayLiteralExpression */: - case 302 /* PropertyAssignment */: - case 229 /* SpreadElement */: + case 210 /* ObjectLiteralExpression */: + case 209 /* ArrayLiteralExpression */: + case 303 /* PropertyAssignment */: + case 230 /* SpreadElement */: inAssignmentPattern = saveInAssignmentPattern; default: bindEachChild(node); @@ -311736,19 +313367,22 @@ ${lanes.join("\n")} case 80 /* Identifier */: case 81 /* PrivateIdentifier */: case 110 /* ThisKeyword */: - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return hasNarrowableArgument(expr); - case 216 /* ParenthesizedExpression */: - case 234 /* NonNullExpression */: + case 217 /* ParenthesizedExpression */: + if (isJSDocTypeAssertion(expr)) { + return false; + } + case 235 /* NonNullExpression */: return isNarrowingExpression(expr.expression); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: return expr.operator === 54 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 220 /* TypeOfExpression */: + case 221 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; @@ -311767,7 +313401,7 @@ ${lanes.join("\n")} } } } - if (expr.expression.kind === 210 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { + if (expr.expression.kind === 211 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } return false; @@ -311786,7 +313420,7 @@ ${lanes.join("\n")} case 36 /* ExclamationEqualsToken */: case 37 /* EqualsEqualsEqualsToken */: case 38 /* ExclamationEqualsEqualsToken */: - return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); + return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right)); case 104 /* InstanceOfKeyword */: return isNarrowableOperand(expr.left); case 103 /* InKeyword */: @@ -311798,9 +313432,9 @@ ${lanes.join("\n")} } function isNarrowableOperand(expr) { switch (expr.kind) { - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 64 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -311873,21 +313507,21 @@ ${lanes.join("\n")} function isStatementCondition(node) { const parent3 = node.parent; switch (parent3.kind) { - case 244 /* IfStatement */: - case 246 /* WhileStatement */: - case 245 /* DoStatement */: + case 245 /* IfStatement */: + case 247 /* WhileStatement */: + case 246 /* DoStatement */: return parent3.expression === node; - case 247 /* ForStatement */: - case 226 /* ConditionalExpression */: + case 248 /* ForStatement */: + case 227 /* ConditionalExpression */: return parent3.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 216 /* ParenthesizedExpression */) { + if (node.kind === 217 /* ParenthesizedExpression */) { node = node.expression; - } else if (node.kind === 223 /* PrefixUnaryExpression */ && node.operator === 54 /* ExclamationToken */) { + } else if (node.kind === 224 /* PrefixUnaryExpression */ && node.operator === 54 /* ExclamationToken */) { node = node.operand; } else { return isLogicalOrCoalescingBinaryExpression(node); @@ -311930,7 +313564,7 @@ ${lanes.join("\n")} } function setContinueTarget(node, target) { let label = activeLabelList; - while (label && node.parent.kind === 255 /* LabeledStatement */) { + while (label && node.parent.kind === 256 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -311981,12 +313615,12 @@ ${lanes.join("\n")} bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 249 /* ForOfStatement */) { + if (node.kind === 250 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 260 /* VariableDeclarationList */) { + if (node.initializer.kind !== 261 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -312008,7 +313642,7 @@ ${lanes.join("\n")} } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 252 /* ReturnStatement */) { + if (node.kind === 253 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -312025,7 +313659,7 @@ ${lanes.join("\n")} return void 0; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - const flowLabel = node.kind === 251 /* BreakStatement */ ? breakTarget : continueTarget; + const flowLabel = node.kind === 252 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -312095,7 +313729,7 @@ ${lanes.join("\n")} preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 296 /* DefaultClause */); + const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 297 /* DefaultClause */); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -312106,11 +313740,14 @@ ${lanes.join("\n")} } function bindCaseBlock(node) { const clauses = node.clauses; - const isNarrowingSwitch = isNarrowingExpression(node.parent.expression); + const isNarrowingSwitch = node.parent.expression.kind === 112 /* TrueKeyword */ || isNarrowingExpression(node.parent.expression); let fallthroughFlow = unreachableFlow; 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++; } @@ -312138,7 +313775,7 @@ ${lanes.join("\n")} maybeBindExpressionFlowIfCall(node.expression); } function maybeBindExpressionFlowIfCall(node) { - if (node.kind === 212 /* CallExpression */) { + if (node.kind === 213 /* CallExpression */) { const call = node; if (call.expression.kind !== 108 /* SuperKeyword */ && isDottedName(call.expression)) { currentFlow = createFlowCall(currentFlow, call); @@ -312164,7 +313801,7 @@ ${lanes.join("\n")} currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 225 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */) { + if (node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { bindAssignmentTargetFlow(node); @@ -312173,21 +313810,21 @@ ${lanes.join("\n")} function bindAssignmentTargetFlow(node) { if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); - } else if (node.kind === 208 /* ArrayLiteralExpression */) { + } else if (node.kind === 209 /* ArrayLiteralExpression */) { for (const e of node.elements) { - if (e.kind === 229 /* SpreadElement */) { + if (e.kind === 230 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { bindDestructuringTargetFlow(e); } } - } else if (node.kind === 209 /* ObjectLiteralExpression */) { + } else if (node.kind === 210 /* ObjectLiteralExpression */) { for (const p of node.properties) { - if (p.kind === 302 /* PropertyAssignment */) { + if (p.kind === 303 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); - } else if (p.kind === 303 /* ShorthandPropertyAssignment */) { + } else if (p.kind === 304 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); - } else if (p.kind === 304 /* SpreadAssignment */) { + } else if (p.kind === 305 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -312318,7 +313955,7 @@ ${lanes.join("\n")} const operator = node.operatorToken.kind; if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 64 /* EqualsToken */ && node.left.kind === 211 /* ElementAccessExpression */) { + if (operator === 64 /* EqualsToken */ && node.left.kind === 212 /* ElementAccessExpression */) { const elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -312346,7 +313983,7 @@ ${lanes.join("\n")} } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 210 /* PropertyAccessExpression */) { + if (node.expression.kind === 211 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -312411,7 +314048,7 @@ ${lanes.join("\n")} } function bindJSDocTypeAlias(node) { bind(node.tagName); - if (node.kind !== 346 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 347 /* JSDocEnumTag */ && node.fullName) { setParent(node.fullName, node); setParentRecursive( node.fullName, @@ -312426,7 +314063,7 @@ ${lanes.join("\n")} function bindJSDocClassTag(node) { bindEachChild(node); const host = getHostSignatureFromJSDoc(node); - if (host && host.kind !== 173 /* MethodDeclaration */) { + if (host && host.kind !== 174 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -312439,15 +314076,15 @@ ${lanes.join("\n")} } function bindOptionalChainRest(node) { switch (node.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: bind(node.questionDotToken); bind(node.name); break; - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: bind(node.questionDotToken); bind(node.argumentExpression); break; - case 212 /* CallExpression */: + case 213 /* CallExpression */: bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); @@ -312494,7 +314131,7 @@ ${lanes.join("\n")} bindOptionalChainFlow(node); } else { const expr = skipParentheses(node.expression); - if (expr.kind === 217 /* FunctionExpression */ || expr.kind === 218 /* ArrowFunction */) { + if (expr.kind === 218 /* FunctionExpression */ || expr.kind === 219 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -312505,7 +314142,7 @@ ${lanes.join("\n")} } } } - if (node.expression.kind === 210 /* PropertyAccessExpression */) { + if (node.expression.kind === 211 /* PropertyAccessExpression */) { const propertyAccess = node.expression; if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -312520,39 +314157,39 @@ ${lanes.join("\n")} } function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 311 /* SourceFile */: + case 312 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 230 /* ClassExpression */: - case 262 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 263 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 186 /* TypeLiteral */: - case 328 /* JSDocTypeLiteral */: - case 209 /* ObjectLiteralExpression */: - case 263 /* InterfaceDeclaration */: - case 291 /* JsxAttributes */: + case 187 /* TypeLiteral */: + case 329 /* JSDocTypeLiteral */: + case 210 /* ObjectLiteralExpression */: + case 264 /* InterfaceDeclaration */: + case 292 /* JsxAttributes */: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 329 /* JSDocSignature */: - case 180 /* IndexSignature */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 323 /* JSDocFunctionType */: - case 174 /* ClassStaticBlockDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 199 /* MappedType */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 330 /* JSDocSignature */: + case 181 /* IndexSignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 324 /* JSDocFunctionType */: + case 175 /* ClassStaticBlockDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 200 /* MappedType */: if (container.locals) Debug.assertNode(container, canHaveLocals); return declareSymbol( @@ -312583,16 +314220,16 @@ ${lanes.join("\n")} return !!body && body.statements.some((s) => isExportDeclaration(s) || isExportAssignment(s)); } function setExportContextFlag(node) { - if (node.flags & 16777216 /* Ambient */ && !hasExportDeclarations(node)) { - node.flags |= 64 /* ExportContext */; + if (node.flags & 33554432 /* Ambient */ && !hasExportDeclarations(node)) { + node.flags |= 128 /* ExportContext */; } else { - node.flags &= ~64 /* ExportContext */; + node.flags &= ~128 /* ExportContext */; } } function bindModuleDeclaration(node) { setExportContextFlag(node); if (isAmbientModule(node)) { - if (hasSyntacticModifier(node, 1 /* Export */)) { + if (hasSyntacticModifier(node, 32 /* Export */)) { errorOnFirstToken(node, Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); } if (isModuleAugmentationExternal(node)) { @@ -312654,10 +314291,10 @@ ${lanes.join("\n")} } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 311 /* SourceFile */: + case 312 /* SourceFile */: if (isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -312689,7 +314326,7 @@ ${lanes.join("\n")} const saveCurrentFlow = currentFlow; for (const typeAlias of delayedTypeAliases) { const host = typeAlias.parent.parent; - container = findAncestor(host.parent, (n) => !!(getContainerFlags(n) & 1 /* IsContainer */)) || file; + container = getEnclosingContainer(host) || file; blockScopeContainer = getEnclosingBlockScopeContainer(host) || file; currentFlow = initFlowNode({ flags: 2 /* Start */ }); parent2 = typeAlias; @@ -312747,37 +314384,21 @@ ${lanes.join("\n")} currentFlow = saveCurrentFlow; } function checkContextualIdentifier(node) { - if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) { + if (!file.parseDiagnostics.length && !(node.flags & 33554432 /* Ambient */) && !(node.flags & 16777216 /* JSDoc */) && !isIdentifierName(node)) { const originalKeywordKind = identifierToKeywordKind(node); if (originalKeywordKind === void 0) { return; } if (inStrictMode && originalKeywordKind >= 119 /* FirstFutureReservedWord */ && originalKeywordKind <= 127 /* LastFutureReservedWord */) { - file.bindDiagnostics.push(createDiagnosticForNode2( - node, - getStrictModeIdentifierMessage(node), - declarationNameToString(node) - )); + file.bindDiagnostics.push(createDiagnosticForNode2(node, getStrictModeIdentifierMessage(node), declarationNameToString(node))); } else if (originalKeywordKind === 135 /* AwaitKeyword */) { if (isExternalModule(file) && isInTopLevelContext(node)) { - file.bindDiagnostics.push(createDiagnosticForNode2( - node, - Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, - declarationNameToString(node) - )); - } else if (node.flags & 32768 /* AwaitContext */) { - file.bindDiagnostics.push(createDiagnosticForNode2( - node, - Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, - declarationNameToString(node) - )); + file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, declarationNameToString(node))); + } else if (node.flags & 65536 /* AwaitContext */) { + file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node))); } - } else if (originalKeywordKind === 127 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { - file.bindDiagnostics.push(createDiagnosticForNode2( - node, - Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, - declarationNameToString(node) - )); + } else if (originalKeywordKind === 127 /* YieldKeyword */ && node.flags & 16384 /* YieldContext */) { + file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node))); } } } @@ -312793,11 +314414,7 @@ ${lanes.join("\n")} function checkPrivateIdentifier(node) { if (node.escapedText === "#constructor") { if (!file.parseDiagnostics.length) { - file.bindDiagnostics.push(createDiagnosticForNode2( - node, - Diagnostics.constructor_is_a_reserved_word, - declarationNameToString(node) - )); + file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.constructor_is_a_reserved_word, declarationNameToString(node))); } } } @@ -312825,13 +314442,7 @@ ${lanes.join("\n")} const identifier = name; if (isEvalOrArgumentsIdentifier(identifier)) { const span = getErrorSpanForNode(file, name); - file.bindDiagnostics.push(createFileDiagnostic( - file, - span.start, - span.length, - getStrictModeEvalOrArgumentsMessage(contextNode), - idText(identifier) - )); + file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), idText(identifier))); } } } @@ -312860,14 +314471,9 @@ ${lanes.join("\n")} } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { - if (blockScopeContainer.kind !== 311 /* SourceFile */ && blockScopeContainer.kind !== 266 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { + if (blockScopeContainer.kind !== 312 /* SourceFile */ && blockScopeContainer.kind !== 267 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { const errorSpan = getErrorSpanForNode(file, node); - file.bindDiagnostics.push(createFileDiagnostic( - file, - errorSpan.start, - errorSpan.length, - getStrictModeBlockScopeFunctionDeclarationMessage(node) - )); + file.bindDiagnostics.push(createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); } } } @@ -312922,7 +314528,7 @@ ${lanes.join("\n")} node.tracingPath = file.path; const saveInStrictMode = inStrictMode; bindWorker(node); - if (node.kind > 164 /* LastToken */) { + if (node.kind > 165 /* LastToken */) { const saveParent = parent2; parent2 = node; const containerFlags = getContainerFlags(node); @@ -312979,7 +314585,7 @@ ${lanes.join("\n")} function bindWorker(node) { switch (node.kind) { case 80 /* Identifier */: - if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) { + if (node.flags & 4096 /* IdentifierIsInJSDocNamespace */) { let parentNode = node.parent; while (parentNode && !isJSDocTypeAlias(parentNode)) { parentNode = parentNode.parent; @@ -312988,23 +314594,23 @@ ${lanes.join("\n")} break; } case 110 /* ThisKeyword */: - if (currentFlow && (isExpression(node) || parent2.kind === 303 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (isExpression(node) || parent2.kind === 304 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkContextualIdentifier(node); - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: if (currentFlow && isPartOfTypeQuery(node)) { node.flowNode = currentFlow; } break; - case 235 /* MetaProperty */: + case 236 /* MetaProperty */: case 108 /* SuperKeyword */: node.flowNode = currentFlow; break; case 81 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: const expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -313023,7 +314629,7 @@ ${lanes.join("\n")} ); } break; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: const specialKind = getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -313058,81 +314664,77 @@ ${lanes.join("\n")} Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return checkStrictModeCatchClause(node); - case 219 /* DeleteExpression */: + case 220 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); - case 224 /* PostfixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 253 /* WithStatement */: + case 254 /* WithStatement */: return checkStrictModeWithStatement(node); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 196 /* ThisType */: + case 197 /* ThisType */: seenThisKeyword = true; return; - case 181 /* TypePredicate */: + case 182 /* TypePredicate */: break; - case 167 /* TypeParameter */: + case 168 /* TypeParameter */: return bindTypeParameter(node); - case 168 /* Parameter */: + case 169 /* Parameter */: return bindParameter(node); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 207 /* BindingElement */: + case 208 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: return bindPropertyWorker(node); - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 305 /* EnumMember */: + case 306 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 180 /* IndexSignature */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 181 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - return bindPropertyOrMethodOrAccessor( - node, - 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), - isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */ - ); - case 261 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); + case 262 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 175 /* Constructor */: + case 176 /* Constructor */: return declareSymbolAndAddToSymbolTable( node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */ ); - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 183 /* FunctionType */: - case 323 /* JSDocFunctionType */: - case 329 /* JSDocSignature */: - case 184 /* ConstructorType */: + case 184 /* FunctionType */: + case 324 /* JSDocFunctionType */: + case 330 /* JSDocSignature */: + case 185 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 186 /* TypeLiteral */: - case 328 /* JSDocTypeLiteral */: - case 199 /* MappedType */: + case 187 /* TypeLiteral */: + case 329 /* JSDocTypeLiteral */: + case 200 /* MappedType */: return bindAnonymousTypeWorker(node); - case 338 /* JSDocClassTag */: + case 339 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return bindFunctionExpression(node); - case 212 /* CallExpression */: + case 213 /* CallExpression */: const assignmentKind = getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -313150,60 +314752,60 @@ ${lanes.join("\n")} bindCallExpression(node); } break; - case 230 /* ClassExpression */: - case 262 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 263 /* ClassDeclaration */: inStrictMode = true; return bindClassLikeDeclaration(node); - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 264 /* TypeAliasDeclaration */: + case 265 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return bindModuleDeclaration(node); - case 291 /* JsxAttributes */: + case 292 /* JsxAttributes */: return bindJsxAttributes(node); - case 290 /* JsxAttribute */: + case 291 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 270 /* ImportEqualsDeclaration */: - case 273 /* NamespaceImport */: - case 275 /* ImportSpecifier */: - case 280 /* ExportSpecifier */: + case 271 /* ImportEqualsDeclaration */: + case 274 /* NamespaceImport */: + case 276 /* ImportSpecifier */: + case 281 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 269 /* NamespaceExportDeclaration */: + case 270 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 272 /* ImportClause */: + case 273 /* ImportClause */: return bindImportClause(node); - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: return bindExportDeclaration(node); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return bindExportAssignment(node); - case 311 /* SourceFile */: + case 312 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 240 /* Block */: + case 241 /* Block */: if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) { return; } - case 267 /* ModuleBlock */: + case 268 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 347 /* JSDocParameterTag */: - if (node.parent.kind === 329 /* JSDocSignature */) { + case 348 /* JSDocParameterTag */: + if (node.parent.kind === 330 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 328 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 329 /* JSDocTypeLiteral */) { break; } - case 354 /* JSDocPropertyTag */: + case 355 /* JSDocPropertyTag */: const propTag = node; - const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 322 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; + const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 323 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 352 /* JSDocTypedefTag */: - case 344 /* JSDocCallbackTag */: - case 346 /* JSDocEnumTag */: + case 353 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: + case 347 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); - case 345 /* JSDocOverloadTag */: + case 346 /* JSDocOverloadTag */: return bind(node.typeExpression); } } @@ -313223,7 +314825,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; } } @@ -313235,7 +314837,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); } @@ -313355,8 +314957,8 @@ ${lanes.join("\n")} false ); switch (thisContainer.kind) { - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: let constructorSymbol = thisContainer.symbol; if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 64 /* EqualsToken */) { const l = thisContainer.parent.left; @@ -313374,12 +314976,12 @@ ${lanes.join("\n")} addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 175 /* Constructor */: - case 171 /* PropertyDeclaration */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 174 /* ClassStaticBlockDeclaration */: + case 176 /* Constructor */: + case 172 /* PropertyDeclaration */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 175 /* ClassStaticBlockDeclaration */: const containingClass = thisContainer.parent; const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members; if (hasDynamicName(node)) { @@ -313396,7 +314998,7 @@ ${lanes.join("\n")} ); } break; - case 311 /* SourceFile */: + case 312 /* SourceFile */: if (hasDynamicName(node)) { break; } else if (thisContainer.commonJsModuleIndicator) { @@ -313405,7 +315007,7 @@ ${lanes.join("\n")} declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: break; default: Debug.failBadSyntaxKind(thisContainer); @@ -313433,7 +315035,7 @@ ${lanes.join("\n")} function bindSpecialPropertyDeclaration(node) { if (node.expression.kind === 110 /* ThisKeyword */) { bindThisPropertyAssignment(node); - } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 311 /* SourceFile */) { + } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 312 /* SourceFile */) { if (isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } else { @@ -313482,7 +315084,7 @@ ${lanes.join("\n")} } function bindObjectDefinePropertyAssignment(node) { let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - const isToplevel = node.parent.parent.kind === 311 /* SourceFile */; + const isToplevel = node.parent.parent.kind === 312 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces( namespaceSymbol, node.arguments[0], @@ -313501,7 +315103,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; } @@ -313596,10 +315198,10 @@ ${lanes.join("\n")} declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */); } function isTopLevelNamespaceAssignment(propertyAccess) { - return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 311 /* SourceFile */ : propertyAccess.parent.parent.kind === 311 /* SourceFile */; + 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); @@ -313658,7 +315260,7 @@ ${lanes.join("\n")} } } function bindClassLikeDeclaration(node) { - if (node.kind === 262 /* ClassDeclaration */) { + if (node.kind === 263 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { const bindingName = node.name ? node.name.escapedText : "__class" /* Class */; @@ -313687,8 +315289,8 @@ ${lanes.join("\n")} checkStrictModeEvalOrArguments(node, node.name); } if (!isBindingPattern(node.name)) { - const possibleVariableDecl = node.kind === 259 /* VariableDeclaration */ ? node : node.parent.parent; - if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { + const possibleVariableDecl = node.kind === 260 /* VariableDeclaration */ ? node : node.parent.parent; + 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 */); @@ -313700,10 +315302,10 @@ ${lanes.join("\n")} } } function bindParameter(node) { - if (node.kind === 347 /* JSDocParameterTag */ && container.kind !== 329 /* JSDocSignature */) { + if (node.kind === 348 /* JSDocParameterTag */ && container.kind !== 330 /* JSDocSignature */) { return; } - if (inStrictMode && !(node.flags & 16777216 /* Ambient */)) { + if (inStrictMode && !(node.flags & 33554432 /* Ambient */)) { checkStrictModeEvalOrArguments(node, node.name); } if (isBindingPattern(node.name)) { @@ -313717,9 +315319,9 @@ ${lanes.join("\n")} } } function bindFunctionDeclaration(node) { - if (!file.isDeclarationFile && !(node.flags & 16777216 /* Ambient */)) { + if (!file.isDeclarationFile && !(node.flags & 33554432 /* Ambient */)) { if (isAsyncFunction(node)) { - emitFlags |= 2048 /* HasAsyncFunctions */; + emitFlags |= 4096 /* HasAsyncFunctions */; } } checkStrictModeFunctionName(node); @@ -313731,9 +315333,9 @@ ${lanes.join("\n")} } } function bindFunctionExpression(node) { - if (!file.isDeclarationFile && !(node.flags & 16777216 /* Ambient */)) { + if (!file.isDeclarationFile && !(node.flags & 33554432 /* Ambient */)) { if (isAsyncFunction(node)) { - emitFlags |= 2048 /* HasAsyncFunctions */; + emitFlags |= 4096 /* HasAsyncFunctions */; } } if (currentFlow) { @@ -313744,8 +315346,8 @@ ${lanes.join("\n")} return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); } function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { - if (!file.isDeclarationFile && !(node.flags & 16777216 /* Ambient */) && isAsyncFunction(node)) { - emitFlags |= 2048 /* HasAsyncFunctions */; + if (!file.isDeclarationFile && !(node.flags & 33554432 /* Ambient */) && isAsyncFunction(node)) { + emitFlags |= 4096 /* HasAsyncFunctions */; } if (currentFlow && isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { node.flowNode = currentFlow; @@ -313773,7 +315375,7 @@ ${lanes.join("\n")} } else { declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } - } else if (node.parent.kind === 194 /* InferType */) { + } else if (node.parent.kind === 195 /* InferType */) { const container2 = getInferTypeContainer(node.parent); if (container2) { Debug.assertNode(container2, canHaveLocals); @@ -313804,14 +315406,14 @@ ${lanes.join("\n")} if (currentFlow === unreachableFlow) { const reportError = ( // report error on all statements except empty ones - isStatementButNotDeclaration(node) && node.kind !== 241 /* EmptyStatement */ || // report error on class declarations - node.kind === 262 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - node.kind === 266 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node) + isStatementButNotDeclaration(node) && node.kind !== 242 /* EmptyStatement */ || // report error on class declarations + node.kind === 263 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set + node.kind === 267 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node) ); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { - const isError = unreachableCodeIsError(options) && !(node.flags & 16777216 /* Ambient */) && (!isVariableStatement(node) || !!(getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */) || node.declarationList.declarations.some((d) => !!d.initializer)); + const isError = unreachableCodeIsError(options) && !(node.flags & 33554432 /* Ambient */) && (!isVariableStatement(node) || !!(getCombinedNodeFlags(node.declarationList) & 7 /* BlockScoped */) || node.declarationList.declarations.some((d) => !!d.initializer)); eachUnreachableRange(node, (start, end) => errorOrSuggestionOnRange(isError, start, end, Diagnostics.Unreachable_code_detected)); } } @@ -313830,17 +315432,17 @@ ${lanes.join("\n")} } function isExecutableStatement(s) { return !isFunctionDeclaration(s) && !isPurelyTypeDeclaration(s) && !isEnumDeclaration(s) && // `var x;` may declare a variable used above - !(isVariableStatement(s) && !(getCombinedNodeFlags(s) & (1 /* Let */ | 2 /* Const */)) && s.declarationList.declarations.some((d) => !d.initializer)); + !(isVariableStatement(s) && !(getCombinedNodeFlags(s) & 7 /* BlockScoped */) && s.declarationList.declarations.some((d) => !d.initializer)); } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: return true; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 265 /* EnumDeclaration */: - return hasSyntacticModifier(s, 2048 /* Const */); + case 266 /* EnumDeclaration */: + return hasSyntacticModifier(s, 4096 /* Const */); default: return false; } @@ -313874,54 +315476,54 @@ ${lanes.join("\n")} } function getContainerFlags(node) { switch (node.kind) { - case 230 /* ClassExpression */: - case 262 /* ClassDeclaration */: - case 265 /* EnumDeclaration */: - case 209 /* ObjectLiteralExpression */: - case 186 /* TypeLiteral */: - case 328 /* JSDocTypeLiteral */: - case 291 /* JsxAttributes */: + case 231 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 266 /* EnumDeclaration */: + case 210 /* ObjectLiteralExpression */: + case 187 /* TypeLiteral */: + case 329 /* JSDocTypeLiteral */: + case 292 /* JsxAttributes */: return 1 /* IsContainer */; - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 266 /* ModuleDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 199 /* MappedType */: - case 180 /* IndexSignature */: + case 267 /* ModuleDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 200 /* MappedType */: + case 181 /* IndexSignature */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 311 /* SourceFile */: + case 312 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 173 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */; } - case 175 /* Constructor */: - case 261 /* FunctionDeclaration */: - case 172 /* MethodSignature */: - case 178 /* CallSignature */: - case 329 /* JSDocSignature */: - case 323 /* JSDocFunctionType */: - case 183 /* FunctionType */: - case 179 /* ConstructSignature */: - case 184 /* ConstructorType */: - case 174 /* ClassStaticBlockDeclaration */: + case 176 /* Constructor */: + case 262 /* FunctionDeclaration */: + case 173 /* MethodSignature */: + case 179 /* CallSignature */: + case 330 /* JSDocSignature */: + case 324 /* JSDocFunctionType */: + case 184 /* FunctionType */: + case 180 /* ConstructSignature */: + case 185 /* ConstructorType */: + case 175 /* ClassStaticBlockDeclaration */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 267 /* ModuleBlock */: + case 268 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 298 /* CatchClause */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 268 /* CaseBlock */: + case 299 /* CatchClause */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 269 /* CaseBlock */: return 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */; - case 240 /* Block */: + case 241 /* Block */: return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */; } return 0 /* None */; @@ -313939,7 +315541,7 @@ ${lanes.join("\n")} return (_d = (_c = container.symbol) == null ? void 0 : _c.exports) == null ? void 0 : _d.get(name); } } - var ModuleInstanceState, binder; + var ModuleInstanceState, ContainerFlags, binder; var init_binder = __esm({ "src/compiler/binder.ts"() { "use strict"; @@ -313951,6 +315553,18 @@ ${lanes.join("\n")} ModuleInstanceState2[ModuleInstanceState2["ConstEnumOnly"] = 2] = "ConstEnumOnly"; return ModuleInstanceState2; })(ModuleInstanceState || {}); + ContainerFlags = /* @__PURE__ */ ((ContainerFlags2) => { + ContainerFlags2[ContainerFlags2["None"] = 0] = "None"; + ContainerFlags2[ContainerFlags2["IsContainer"] = 1] = "IsContainer"; + ContainerFlags2[ContainerFlags2["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; + ContainerFlags2[ContainerFlags2["IsControlFlowContainer"] = 4] = "IsControlFlowContainer"; + ContainerFlags2[ContainerFlags2["IsFunctionLike"] = 8] = "IsFunctionLike"; + ContainerFlags2[ContainerFlags2["IsFunctionExpression"] = 16] = "IsFunctionExpression"; + ContainerFlags2[ContainerFlags2["HasLocals"] = 32] = "HasLocals"; + ContainerFlags2[ContainerFlags2["IsInterface"] = 64] = "IsInterface"; + ContainerFlags2[ContainerFlags2["IsObjectLiteralOrClassExpressionMethodOrAccessor"] = 128] = "IsObjectLiteralOrClassExpressionMethodOrAccessor"; + return ContainerFlags2; + })(ContainerFlags || {}); binder = /* @__PURE__ */ createBinder(); } }); @@ -314097,7 +315711,7 @@ ${lanes.join("\n")} symbol.exports.forEach(visitSymbol); } forEach(symbol.declarations, (d) => { - if (d.type && d.type.kind === 185 /* TypeQuery */) { + if (d.type && d.type.kind === 186 /* TypeQuery */) { const query = d.type; const entity = getResolvedSymbol(getFirstIdentifier2(query.exprName)); visitSymbol(entity); @@ -314115,11 +315729,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 */]; @@ -314144,7 +315759,7 @@ ${lanes.join("\n")} } } }; - function getPreferredEnding() { + function getPreferredEnding(resolutionMode) { if (oldImportSpecifier !== void 0) { if (hasJSFileExtension(oldImportSpecifier)) return 2 /* JsExtension */; @@ -314153,42 +315768,39 @@ ${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); - return firstDefined( - modulePaths, - (modulePath) => tryGetModuleNameAsNodeModule( - modulePath, - info, - importingSourceFile, - host, - compilerOptions, - preferences, - /*packageNameOnly*/ - true, - options.overrideImportMode - ) - ); + const info = getInfo(importingSourceFile.fileName, host); + const modulePaths = getAllModulePaths(info, nodeModulesFileName, host, preferences, options); + return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule( + modulePath, + info, + importingSourceFile, + host, + compilerOptions, + preferences, + /*packageNameOnly*/ + true, + options.overrideImportMode + )); } 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, @@ -314228,10 +315840,12 @@ ${lanes.join("\n")} importingSourceFile, host, userPreferences, - options + options, + /*forAutoImport*/ + false ).moduleSpecifiers; } - function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}) { + function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) { let computedWithoutCache = false; const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker); if (ambient) @@ -314248,20 +315862,28 @@ ${lanes.join("\n")} if (!moduleSourceFile) return { moduleSpecifiers: emptyArray, computedWithoutCache }; computedWithoutCache = true; - modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host)); - const result = computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options); + modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host)); + const result = computeModuleSpecifiers( + modulePaths, + compilerOptions, + importingSourceFile, + host, + userPreferences, + options, + forAutoImport + ); cache == null ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, modulePaths, result); return { moduleSpecifiers: result, computedWithoutCache }; } - function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}) { - const info = getInfo(importingSourceFile.path, host); - const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile); + function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) { + 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; @@ -314309,8 +315931,12 @@ ${lanes.join("\n")} if (modulePath.isRedirect) { redirectPathsSpecifiers = append(redirectPathsSpecifiers, local); } else if (pathIsBareSpecifier(local)) { - pathsSpecifiers = append(pathsSpecifiers, local); - } else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) { + if (pathContainsNodeModules(local)) { + relativeSpecifiers = append(relativeSpecifiers, local); + } else { + pathsSpecifiers = append(pathsSpecifiers, local); + } + } else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) { relativeSpecifiers = append(relativeSpecifiers, local); } } @@ -314318,19 +315944,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()); @@ -314338,11 +315970,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; } @@ -314352,7 +315985,7 @@ ${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; @@ -314381,8 +316014,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) { @@ -314425,8 +316058,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) { @@ -314434,30 +316068,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) => { const isInNodeModules = pathContainsNodeModules(path); - allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect, isInNodeModules }); + 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) => { @@ -314478,7 +316111,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); @@ -314493,32 +316129,29 @@ ${lanes.join("\n")} if (decl) { return decl.name.text; } - const ambientModuleDeclareCandidates = mapDefined( - moduleSymbol.declarations, - (d) => { - var _a2, _b, _c, _d; - if (!isModuleDeclaration(d)) - return; - const topNamespace = getTopNamespace(d); - if (!(((_a2 = topNamespace == null ? void 0 : topNamespace.parent) == null ? void 0 : _a2.parent) && isModuleBlock(topNamespace.parent) && isAmbientModule(topNamespace.parent.parent) && isSourceFile(topNamespace.parent.parent.parent))) - return; - const exportAssignment = (_d = (_c = (_b = topNamespace.parent.parent.symbol.exports) == null ? void 0 : _b.get("export=")) == null ? void 0 : _c.valueDeclaration) == null ? void 0 : _d.expression; - if (!exportAssignment) - return; - const exportSymbol = checker.getSymbolAtLocation(exportAssignment); - if (!exportSymbol) - return; - const originalExportSymbol = (exportSymbol == null ? void 0 : exportSymbol.flags) & 2097152 /* Alias */ ? checker.getAliasedSymbol(exportSymbol) : exportSymbol; - if (originalExportSymbol === d.symbol) - return topNamespace.parent.parent; - function getTopNamespace(namespaceDeclaration) { - while (namespaceDeclaration.flags & 4 /* NestedNamespace */) { - namespaceDeclaration = namespaceDeclaration.parent; - } - return namespaceDeclaration; + const ambientModuleDeclareCandidates = mapDefined(moduleSymbol.declarations, (d) => { + var _a2, _b, _c, _d; + if (!isModuleDeclaration(d)) + return; + const topNamespace = getTopNamespace(d); + if (!(((_a2 = topNamespace == null ? void 0 : topNamespace.parent) == null ? void 0 : _a2.parent) && isModuleBlock(topNamespace.parent) && isAmbientModule(topNamespace.parent.parent) && isSourceFile(topNamespace.parent.parent.parent))) + return; + const exportAssignment = (_d = (_c = (_b = topNamespace.parent.parent.symbol.exports) == null ? void 0 : _b.get("export=")) == null ? void 0 : _c.valueDeclaration) == null ? void 0 : _d.expression; + if (!exportAssignment) + return; + const exportSymbol = checker.getSymbolAtLocation(exportAssignment); + if (!exportSymbol) + return; + const originalExportSymbol = (exportSymbol == null ? void 0 : exportSymbol.flags) & 2097152 /* Alias */ ? checker.getAliasedSymbol(exportSymbol) : exportSymbol; + if (originalExportSymbol === d.symbol) + return topNamespace.parent.parent; + function getTopNamespace(namespaceDeclaration) { + while (namespaceDeclaration.flags & 8 /* NestedNamespace */) { + namespaceDeclaration = namespaceDeclaration.parent; } + return namespaceDeclaration; } - ); + }); const ambientModuleDeclare = ambientModuleDeclareCandidates[0]; if (ambientModuleDeclare) { return ambientModuleDeclare.name.text; @@ -314542,7 +316175,9 @@ ${lanes.join("\n")} for (const { ending, value } of candidates) { 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); - return pathIsRelative(matchedStar) ? void 0 : key.replace("*", matchedStar); + if (!pathIsRelative(matchedStar)) { + return replaceFirstStar(key, matchedStar); + } } } } else if (some(candidates, (c) => c.ending !== 0 /* Minimal */ && pattern === c.value) || some(candidates, (c) => c.ending === 0 /* Minimal */ && pattern === c.value && validateEnding(c))) { @@ -314554,8 +316189,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*/ @@ -314564,12 +316203,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, @@ -314582,48 +316234,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 */ : stringContains(k, "*") ? 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.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) { - const subTarget = exports[key]; - const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions); - 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) { @@ -314639,7 +316379,7 @@ ${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; } @@ -314647,7 +316387,7 @@ ${lanes.join("\n")} 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; @@ -314683,7 +316423,7 @@ ${lanes.join("\n")} } const globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); const pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex)); - if (!(startsWith(sourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) { + if (!(startsWith(canonicalSourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) { return void 0; } const nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1); @@ -314696,23 +316436,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 packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2); - const conditions = getConditions(options, importMode === 99 /* ESNext */); - const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0; + const conditions = getConditions(options, importMode); + 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( @@ -314728,13 +316467,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 }; } } @@ -314778,7 +316517,7 @@ ${lanes.join("\n")} return fileName; } else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) { return noExtension + getJSExtensionForFile(fileName, options); - } else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && stringContains(fileName, ".d.")) { + } else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) { return tryGetRealFileNameForNonJsDeclarationFileName(fileName); } switch (allowedEndings[0]) { @@ -314804,7 +316543,7 @@ ${lanes.join("\n")} } function tryGetRealFileNameForNonJsDeclarationFileName(fileName) { const baseName = getBaseFileName(fileName); - if (!endsWith(fileName, ".ts" /* Ts */) || !stringContains(baseName, ".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */])) + if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */])) return void 0; const noExtension = removeExtension(fileName, ".ts" /* Ts */); const ext = noExtension.substring(noExtension.lastIndexOf(".")); @@ -314851,19 +316590,29 @@ ${lanes.join("\n")} function isPathRelativeToParent(path) { return startsWith(path, ".."); } + var RelativePreference; var init_moduleSpecifiers = __esm({ "src/compiler/moduleSpecifiers.ts"() { "use strict"; init_ts2(); + 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, @@ -314911,8 +316660,8 @@ ${lanes.join("\n")} var requestedExternalEmitHelpers; var externalHelpersModule; var Symbol47 = objectAllocator.getSymbolConstructor(); - var Type27 = objectAllocator.getTypeConstructor(); - var Signature15 = objectAllocator.getSignatureConstructor(); + var Type28 = objectAllocator.getTypeConstructor(); + var Signature14 = objectAllocator.getSignatureConstructor(); var typeCount = 0; var symbolCount = 0; var totalInstantiationCount = 0; @@ -314929,6 +316678,7 @@ ${lanes.join("\n")} var moduleKind = getEmitModuleKind(compilerOptions); var legacyDecorators = !!compilerOptions.experimentalDecorators; var useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + var emitStandardClassFields = getEmitStandardClassFields(compilerOptions); var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); @@ -314956,6 +316706,10 @@ ${lanes.join("\n")} var isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; var canCollectSymbolAliasAccessabilityData = !compilerOptions.verbatimModuleSyntax || !!compilerOptions.importsNotUsedAsValues; var apparentArgumentCount; + var lastGetCombinedNodeFlagsNode; + var lastGetCombinedNodeFlagsResult = 0 /* None */; + var lastGetCombinedModifierFlagsNode; + var lastGetCombinedModifierFlagsResult = 0 /* None */; const checker = { getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0), getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0), @@ -315015,7 +316769,7 @@ ${lanes.join("\n")} return node ? getTypeFromTypeNode(node) : errorType; }, getParameterType: getTypeAtPosition, - getParameterIdentifierNameAtPosition, + getParameterIdentifierInfoAtPosition, getPromisedTypeOfPromise, getAwaitedType: (type) => getAwaitedType(type), getReturnTypeOfSignature, @@ -315133,13 +316887,7 @@ ${lanes.join("\n")} getTypeOfPropertyOfContextualType, getFullyQualifiedName, getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */), - getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker( - call, - candidatesOutArray, - /*argumentCount*/ - void 0, - 32 /* IsForStringLiteralArgumentCompletions */ - )), + getCandidateSignaturesForStringLiteralCompletions, getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)), getExpandedParameters, hasEffectiveRestParameter, @@ -315313,7 +317061,7 @@ ${lanes.join("\n")} Debug.assert(!!(getNodeLinks(file).flags & 1 /* TypeChecked */)); diagnostics2 = addRange(diagnostics2, suggestionDiagnostics.getDiagnostics(file.fileName)); checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), (containingNode, kind, diag2) => { - if (!containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 16777216 /* Ambient */))) { + if (!containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 33554432 /* Ambient */))) { (diagnostics2 || (diagnostics2 = [])).push({ ...diag2, category: 2 /* Suggestion */ }); } }); @@ -315338,17 +317086,59 @@ ${lanes.join("\n")} isTypeParameterPossiblyReferenced, typeHasCallOrConstructSignatures }; - function runWithoutResolvedSignatureCaching(node, fn) { - const containingCall = findAncestor(node, isCallLikeExpression); - const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature; - if (containingCall) { - getNodeLinks(containingCall).resolvedSignature = void 0; + function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) { + const candidatesSet = /* @__PURE__ */ new Set(); + const candidates = []; + runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker( + call, + candidates, + /*argumentCount*/ + void 0, + 0 /* Normal */ + )); + for (const candidate of candidates) { + candidatesSet.add(candidate); } - const result = fn(); - if (containingCall) { - getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; + candidates.length = 0; + runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker( + call, + candidates, + /*argumentCount*/ + void 0, + 0 /* Normal */ + )); + for (const candidate of candidates) { + candidatesSet.add(candidate); } - return result; + return arrayFrom(candidatesSet); + } + function runWithoutResolvedSignatureCaching(node, fn) { + node = findAncestor(node, isCallLikeOrFunctionLikeExpression); + if (node) { + const cachedResolvedSignatures = []; + const cachedTypes2 = []; + while (node) { + const nodeLinks2 = getNodeLinks(node); + cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]); + nodeLinks2.resolvedSignature = void 0; + if (isFunctionExpressionOrArrowFunction(node)) { + const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node)); + const type = symbolLinks2.type; + cachedTypes2.push([symbolLinks2, type]); + symbolLinks2.type = void 0; + } + node = findAncestor(node.parent, isCallLikeOrFunctionLikeExpression); + } + const result = fn(); + for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) { + nodeLinks2.resolvedSignature = resolvedSignature; + } + for (const [symbolLinks2, type] of cachedTypes2) { + symbolLinks2.type = type; + } + return result; + } + return fn(); } function runWithInferenceBlockedFromSourceNode(node, fn) { const containingCall = findAncestor(node, isCallLikeExpression); @@ -315400,28 +317190,72 @@ ${lanes.join("\n")} var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); var unresolvedSymbols = /* @__PURE__ */ new Map(); var errorTypes = /* @__PURE__ */ new Map(); + var seenIntrinsicNames = /* @__PURE__ */ new Set(); var anyType = createIntrinsicType(1 /* Any */, "any"); - var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */); - var wildcardType = createIntrinsicType(1 /* Any */, "any"); + var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */, "auto"); + var wildcardType = createIntrinsicType( + 1 /* Any */, + "any", + /*objectFlags*/ + void 0, + "wildcard" + ); + var blockedStringType = createIntrinsicType( + 1 /* Any */, + "any", + /*objectFlags*/ + void 0, + "blocked string" + ); var errorType = createIntrinsicType(1 /* Any */, "error"); var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved"); - var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */); + var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */, "non-inferrable"); var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - var nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown"); + var nonNullUnknownType = createIntrinsicType( + 2 /* Unknown */, + "unknown", + /*objectFlags*/ + void 0, + "non-null" + ); var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); - var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */); - var missingType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */, "widening"); + var missingType = createIntrinsicType( + 32768 /* Undefined */, + "undefined", + /*objectFlags*/ + void 0, + "missing" + ); var undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType; - var optionalType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var optionalType = createIntrinsicType( + 32768 /* Undefined */, + "undefined", + /*objectFlags*/ + void 0, + "optional" + ); var nullType = createIntrinsicType(65536 /* Null */, "null"); - var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */, "widening"); var stringType = createIntrinsicType(4 /* String */, "string"); var numberType = createIntrinsicType(8 /* Number */, "number"); var bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); - var falseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); + var falseType = createIntrinsicType( + 512 /* BooleanLiteral */, + "false", + /*objectFlags*/ + void 0, + "fresh" + ); var regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false"); - var trueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); + var trueType = createIntrinsicType( + 512 /* BooleanLiteral */, + "true", + /*objectFlags*/ + void 0, + "fresh" + ); var regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true"); trueType.regularType = regularTrueType; trueType.freshType = trueType; @@ -315435,9 +317269,21 @@ ${lanes.join("\n")} var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol"); var voidType = createIntrinsicType(16384 /* Void */, "void"); var neverType = createIntrinsicType(131072 /* Never */, "never"); - var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */); - var implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); - var unreachableNeverType = createIntrinsicType(131072 /* Never */, "never"); + var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */, "silent"); + var implicitNeverType = createIntrinsicType( + 131072 /* Never */, + "never", + /*objectFlags*/ + void 0, + "implicit" + ); + var unreachableNeverType = createIntrinsicType( + 131072 /* Never */, + "never", + /*objectFlags*/ + void 0, + "unreachable" + ); var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); var stringOrNumberType = getUnionType([stringType, numberType]); var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); @@ -315447,7 +317293,13 @@ ${lanes.join("\n")} var numericStringType = getTemplateLiteralType(["", ""], [numberType]); var restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)"); var permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)"); - var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); + var uniqueLiteralType = createIntrinsicType( + 131072 /* Never */, + "never", + /*objectFlags*/ + void 0, + "unique literal" + ); var uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)"); var outofbandVarianceMarkerHandler; var reportUnreliableMapper = makeFunctionTypeMapper((t) => { @@ -315652,7 +317504,7 @@ ${lanes.join("\n")} }; var amalgamatedDuplicates; var reverseMappedCache = /* @__PURE__ */ new Map(); - var inInferTypeForHomomorphicMappedType = false; + var homomorphicMappedTypeInferenceStack = []; var ambientModulesCache; var patternAmbientModules; var patternAmbientModuleAugmentations; @@ -315693,6 +317545,9 @@ ${lanes.join("\n")} var deferredGlobalImportMetaType; var deferredGlobalImportMetaExpressionType; var deferredGlobalImportCallOptionsType; + var deferredGlobalImportAttributesType; + var deferredGlobalDisposableType; + var deferredGlobalAsyncDisposableType; var deferredGlobalExtractSymbol; var deferredGlobalOmitSymbol; var deferredGlobalAwaitedSymbol; @@ -315847,7 +317702,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); @@ -315864,14 +317724,14 @@ ${lanes.join("\n")} } } function errorSkippedOn(key, location, message, ...args) { - const diagnostic = error(location, message, ...args); + const diagnostic = error2(location, message, ...args); diagnostic.skippedOn = key; return diagnostic; } function createError(location, message, ...args) { return location ? createDiagnosticForNode(location, message, ...args) : createCompilerDiagnostic(message, ...args); } - function error(location, message, ...args) { + function error2(location, message, ...args) { const diagnostic = createError(location, message, ...args); diagnostics.add(diagnostic); return diagnostic; @@ -315895,7 +317755,7 @@ ${lanes.join("\n")} addErrorOrSuggestion(isError, "message" in message ? createDiagnosticForNode(location, message, ...args) : createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(location), location, message)); } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, ...args) { - const diagnostic = error(location, message, ...args); + const diagnostic = error2(location, message, ...args); if (maybeMissingAwait) { const related = createDiagnosticForNode(location, Diagnostics.Did_you_forget_to_use_await); addRelatedInfo(diagnostic, related); @@ -315921,7 +317781,7 @@ ${lanes.join("\n")} return !!symbol.valueDeclaration && isDeprecatedDeclaration2(symbol.valueDeclaration) || length(symbol.declarations) && every(symbol.declarations, isDeprecatedDeclaration2); } function isDeprecatedDeclaration2(declaration) { - return !!(getCombinedNodeFlags(declaration) & 268435456 /* Deprecated */); + return !!(getCombinedNodeFlagsCached(declaration) & 536870912 /* Deprecated */); } function addDeprecatedSuggestion(location, declarations, deprecatedEntity) { const diagnostic = createDiagnosticForNode(location, Diagnostics._0_is_deprecated, deprecatedEntity); @@ -315938,7 +317798,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; @@ -316041,7 +317901,7 @@ ${lanes.join("\n")} } } else if (target.flags & 1024 /* NamespaceModule */) { if (target !== globalThisSymbol) { - error( + error2( source.declarations && getNameOfDeclaration(source.declarations[0]), Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target) @@ -316135,7 +317995,7 @@ ${lanes.join("\n")} if (isGlobalScopeAugmentation(moduleAugmentation)) { mergeSymbolTable(globals, moduleAugmentation.symbol.exports); } else { - const moduleNotFoundError = !(moduleName.parent.parent.flags & 16777216 /* Ambient */) ? Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found : void 0; + const moduleNotFoundError = !(moduleName.parent.parent.flags & 33554432 /* Ambient */) ? Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found : void 0; let mainModule = resolveExternalModuleNameWorker( moduleName, moduleName, @@ -316171,7 +318031,7 @@ ${lanes.join("\n")} mergeSymbol(mainModule, moduleAugmentation.symbol); } } else { - error(moduleName, Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity, moduleName.text); + error2(moduleName, Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity, moduleName.text); } } } @@ -316199,7 +318059,7 @@ ${lanes.join("\n")} return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 311 /* SourceFile */ && !isExternalOrCommonJsModule(node); + return node.kind === 312 /* SourceFile */ && !isExternalOrCommonJsModule(node); } function getSymbol2(symbols, name, meaning) { if (meaning) { @@ -316210,7 +318070,7 @@ ${lanes.join("\n")} return symbol; } if (symbol.flags & 2097152 /* Alias */) { - const targetFlags = getAllSymbolFlags(symbol); + const targetFlags = getSymbolFlags(symbol); if (targetFlags & meaning) { return symbol; } @@ -316233,7 +318093,7 @@ ${lanes.join("\n")} const useFile = getSourceFileOfNode(usage); const declContainer = getEnclosingBlockScopeContainer(declaration); if (declarationFile !== useFile) { - if (moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator) || !outFile(compilerOptions) || isInTypeQuery(usage) || declaration.flags & 16777216 /* Ambient */) { + if (moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator) || !outFile(compilerOptions) || isInTypeQuery(usage) || declaration.flags & 33554432 /* Ambient */) { return true; } if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { @@ -316242,16 +318102,19 @@ ${lanes.join("\n")} const sourceFiles = host.getSourceFiles(); return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); } + if (!!(usage.flags & 16777216 /* JSDoc */) || isInTypeQuery(usage) || isInAmbientOrTypeNode(usage)) { + return true; + } if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { - if (declaration.kind === 207 /* BindingElement */) { - const errorBindingElement = getAncestor(usage, 207 /* BindingElement */); + if (declaration.kind === 208 /* BindingElement */) { + const errorBindingElement = getAncestor(usage, 208 /* BindingElement */); if (errorBindingElement) { return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos; } - return isBlockScopedNameDeclaredBeforeUse(getAncestor(declaration, 259 /* VariableDeclaration */), usage); - } else if (declaration.kind === 259 /* VariableDeclaration */) { + 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( @@ -316261,21 +318124,18 @@ ${lanes.join("\n")} false ); } else if (isParameterPropertyDeclaration(declaration, declaration.parent)) { - return !(getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration)); + return !(emitStandardClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration)); } return true; } - if (usage.parent.kind === 280 /* ExportSpecifier */ || usage.parent.kind === 276 /* ExportAssignment */ && usage.parent.isExportEquals) { - return true; - } - if (usage.kind === 276 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.parent.kind === 281 /* ExportSpecifier */ || usage.parent.kind === 277 /* ExportAssignment */ && usage.parent.isExportEquals) { return true; } - if (!!(usage.flags & 8388608 /* JSDoc */) || isInTypeQuery(usage) || isInAmbientOrTypeNode(usage)) { + if (usage.kind === 277 /* ExportAssignment */ && usage.isExportEquals) { return true; } if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { - if (getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ && useDefineForClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) { + if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) { return !isPropertyImmediatelyReferencedWithinDeclaration( declaration, usage, @@ -316289,9 +318149,9 @@ ${lanes.join("\n")} return false; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) { switch (declaration2.parent.parent.kind) { - case 242 /* VariableStatement */: - case 247 /* ForStatement */: - case 249 /* ForOfStatement */: + case 243 /* VariableStatement */: + case 248 /* ForStatement */: + case 250 /* ForOfStatement */: if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) { return true; } @@ -316316,7 +318176,7 @@ ${lanes.join("\n")} const initializerOfProperty = propertyDeclaration.initializer === current; if (initializerOfProperty) { if (isStatic(current.parent)) { - if (declaration2.kind === 173 /* MethodDeclaration */) { + if (declaration2.kind === 174 /* MethodDeclaration */) { return true; } if (isPropertyDeclaration(declaration2) && getContainingClass(usage2) === getContainingClass(declaration2)) { @@ -316330,7 +318190,7 @@ ${lanes.join("\n")} } } } else { - const isDeclarationInstanceProperty = declaration2.kind === 171 /* PropertyDeclaration */ && !isStatic(declaration2); + const isDeclarationInstanceProperty = declaration2.kind === 172 /* PropertyDeclaration */ && !isStatic(declaration2); if (!isDeclarationInstanceProperty || getContainingClass(usage2) !== getContainingClass(declaration2)) { return true; } @@ -316349,15 +318209,15 @@ ${lanes.join("\n")} return "quit"; } switch (node.kind) { - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return true; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return stopAtAnyPropertyDeclaration && (isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true; - case 240 /* Block */: + case 241 /* Block */: switch (node.parent.kind) { - case 176 /* GetAccessor */: - case 173 /* MethodDeclaration */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 174 /* MethodDeclaration */: + case 178 /* SetAccessor */: return true; default: return false; @@ -316387,19 +318247,19 @@ ${lanes.join("\n")} } function requiresScopeChangeWorker(node) { switch (node.kind) { - case 218 /* ArrowFunction */: - case 217 /* FunctionExpression */: - case 261 /* FunctionDeclaration */: - case 175 /* Constructor */: + case 219 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 176 /* Constructor */: return false; - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 302 /* PropertyAssignment */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 303 /* PropertyAssignment */: return requiresScopeChangeWorker(node.name); - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: if (hasStaticModifier(node)) { - return target < 99 /* ESNext */ || !useDefineForClassFields; + return !emitStandardClassFields; } return requiresScopeChangeWorker(node.name); default: @@ -316438,7 +318298,7 @@ ${lanes.join("\n")} if (name === "const" && isConstAssertion(location)) { return void 0; } - if (isModuleDeclaration(location) && lastLocation && location.name === lastLocation) { + if (isModuleOrEnumDeclaration(location) && lastLocation && location.name === lastLocation) { lastLocation = location; location = location.parent; } @@ -316446,17 +318306,17 @@ ${lanes.join("\n")} if (result = lookup(location.locals, name, meaning)) { let useResult = true; if (isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 326 /* JSDoc */) { - useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || lastLocation.kind === 168 /* Parameter */ || lastLocation.kind === 347 /* JSDocParameterTag */ || lastLocation.kind === 348 /* JSDocReturnTag */ || lastLocation.kind === 167 /* TypeParameter */ : false; + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 327 /* JSDoc */) { + useResult = result.flags & 262144 /* TypeParameter */ ? lastLocation === location.type || lastLocation.kind === 169 /* Parameter */ || lastLocation.kind === 348 /* JSDocParameterTag */ || lastLocation.kind === 349 /* JSDocReturnTag */ || lastLocation.kind === 168 /* TypeParameter */ : false; } if (meaning & result.flags & 3 /* Variable */) { if (useOuterVariableScopeInParameter(result, location, lastLocation)) { useResult = false; } else if (result.flags & 1 /* FunctionScopedVariable */) { - useResult = lastLocation.kind === 168 /* Parameter */ || lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter); + useResult = lastLocation.kind === 169 /* Parameter */ || lastLocation === location.type && !!findAncestor(result.valueDeclaration, isParameter); } } - } else if (location.kind === 193 /* ConditionalType */) { + } else if (location.kind === 194 /* ConditionalType */) { useResult = lastLocation === location.trueType; } if (useResult) { @@ -316468,13 +318328,13 @@ ${lanes.join("\n")} } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 311 /* SourceFile */: + case 312 /* SourceFile */: if (!isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: const moduleExports = ((_a = getSymbolOfDeclaration(location)) == null ? void 0 : _a.exports) || emptySymbols; - if (location.kind === 311 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 16777216 /* Ambient */ && !isGlobalScopeAugmentation(location)) { + if (location.kind === 312 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 33554432 /* Ambient */ && !isGlobalScopeAugmentation(location)) { if (result = moduleExports.get("default" /* Default */)) { const localSymbol = getLocalSymbolForExportDefault(result); if (localSymbol && result.flags & meaning && localSymbol.escapedName === name) { @@ -316483,7 +318343,7 @@ ${lanes.join("\n")} result = void 0; } const moduleExport = moduleExports.get(name); - if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 280 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 279 /* NamespaceExport */))) { + if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && (getDeclarationOfKind(moduleExport, 281 /* ExportSpecifier */) || getDeclarationOfKind(moduleExport, 280 /* NamespaceExport */))) { break; } } @@ -316495,10 +318355,10 @@ ${lanes.join("\n")} } } break; - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: if (result = lookup(((_c = getSymbolOfDeclaration(location)) == null ? void 0 : _c.exports) || emptySymbols, name, meaning & 8 /* EnumMember */)) { - if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location.flags & 16777216 /* Ambient */) && getSourceFileOfNode(location) !== getSourceFileOfNode(result.valueDeclaration)) { - error( + if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location.flags & 33554432 /* Ambient */) && getSourceFileOfNode(location) !== getSourceFileOfNode(result.valueDeclaration)) { + error2( errorLocation, Diagnostics.Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead, unescapeLeadingUnderscores(name), @@ -316509,7 +318369,7 @@ ${lanes.join("\n")} break loop; } break; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: if (!isStatic(location)) { const ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -316520,9 +318380,9 @@ ${lanes.join("\n")} } } break; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: if (result = lookup(getSymbolOfDeclaration(location).members || emptySymbols, name, meaning & 788968 /* Type */)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { result = void 0; @@ -316530,7 +318390,7 @@ ${lanes.join("\n")} } if (lastLocation && isStatic(lastLocation)) { if (nameNotFoundMessage) { - error(errorLocation, Diagnostics.Static_members_cannot_reference_class_type_parameters); + error2(errorLocation, Diagnostics.Static_members_cannot_reference_class_type_parameters); } return void 0; } @@ -316544,43 +318404,43 @@ ${lanes.join("\n")} } } break; - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: if (lastLocation === location.expression && location.parent.token === 96 /* ExtendsKeyword */) { const container = location.parent.parent; if (isClassLike(container) && (result = lookup(getSymbolOfDeclaration(container).members, name, meaning & 788968 /* Type */))) { if (nameNotFoundMessage) { - error(errorLocation, Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); + error2(errorLocation, Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); } return void 0; } } break; - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (isClassLike(grandparent) || grandparent.kind === 263 /* InterfaceDeclaration */) { + if (isClassLike(grandparent) || grandparent.kind === 264 /* InterfaceDeclaration */) { if (result = lookup(getSymbolOfDeclaration(grandparent).members, name, meaning & 788968 /* Type */)) { if (nameNotFoundMessage) { - error(errorLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); + error2(errorLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); } return void 0; } } break; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) { break; } - case 173 /* MethodDeclaration */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 261 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 262 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -316593,37 +318453,37 @@ ${lanes.join("\n")} } } break; - case 169 /* Decorator */: - if (location.parent && location.parent.kind === 168 /* Parameter */) { + case 170 /* Decorator */: + if (location.parent && location.parent.kind === 169 /* Parameter */) { location = location.parent; } - if (location.parent && (isClassElement(location.parent) || location.parent.kind === 262 /* ClassDeclaration */)) { + if (location.parent && (isClassElement(location.parent) || location.parent.kind === 263 /* ClassDeclaration */)) { location = location.parent; } break; - case 352 /* JSDocTypedefTag */: - case 344 /* JSDocCallbackTag */: - case 346 /* JSDocEnumTag */: + case 353 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: + case 347 /* JSDocEnumTag */: const root = getJSDocRoot(location); if (root) { location = root.parent; } break; - case 168 /* Parameter */: + case 169 /* Parameter */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) { if (!associatedDeclarationForContainingInitializerOrBindingName) { associatedDeclarationForContainingInitializerOrBindingName = location; } } break; - case 207 /* BindingElement */: + case 208 /* BindingElement */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && isBindingPattern(lastLocation))) { if (isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { associatedDeclarationForContainingInitializerOrBindingName = location; } } break; - case 194 /* InferType */: + case 195 /* InferType */: if (meaning & 262144 /* TypeParameter */) { const parameterName = location.typeParameter.name; if (parameterName && name === parameterName.escapedText) { @@ -316632,7 +318492,7 @@ ${lanes.join("\n")} } } break; - case 280 /* ExportSpecifier */: + case 281 /* ExportSpecifier */: if (lastLocation && lastLocation === location.propertyName && location.parent.parent.moduleSpecifier) { location = location.parent.parent.parent; } @@ -316670,8 +318530,8 @@ ${lanes.join("\n")} } } function checkAndReportErrorForInvalidInitializer() { - if (propertyWithInvalidInitializer && !(useDefineForClassFields && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */)) { - error( + if (propertyWithInvalidInitializer && !emitStandardClassFields) { + error2( errorLocation, errorLocation && propertyWithInvalidInitializer.type && textRangeContainsPositionInclusive(propertyWithInvalidInitializer.type, errorLocation.pos) ? Diagnostics.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor : Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, declarationNameToString(propertyWithInvalidInitializer.name), @@ -316684,14 +318544,14 @@ ${lanes.join("\n")} if (!result) { if (nameNotFoundMessage) { addLazyDiagnostic(() => { - if (!errorLocation || errorLocation.parent.kind !== 330 /* JSDocLink */ && !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217 + if (!errorLocation || errorLocation.parent.kind !== 331 /* JSDocLink */ && !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217 !checkAndReportErrorForInvalidInitializer() && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) && !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { let suggestion; let suggestedLib; if (nameArg) { suggestedLib = getSuggestedLibForNonExistentName(nameArg); if (suggestedLib) { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), suggestedLib); + error2(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), suggestedLib); } } if (!suggestedLib && getSpellingSuggestions && suggestionCount < maximumSuggestionCount) { @@ -316720,7 +318580,7 @@ ${lanes.join("\n")} } } if (!suggestion && !suggestedLib && nameArg) { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); + error2(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); } suggestionCount++; } @@ -316732,13 +318592,14 @@ ${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 */) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } - if (result && isInExternalModule && (meaning & 111551 /* Value */) === 111551 /* Value */ && !(originalLocation.flags & 8388608 /* JSDoc */)) { + if (result && isInExternalModule && (meaning & 111551 /* Value */) === 111551 /* Value */ && !(originalLocation.flags & 16777216 /* JSDoc */)) { const merged = getMergedSymbol(result); if (length(merged.declarations) && every(merged.declarations, (d) => isNamespaceExportDeclaration(d) || isSourceFile(d) && !!d.symbol.globalExports)) { errorOrSuggestion(!compilerOptions.allowUmdGlobalAccess, errorLocation, Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, unescapeLeadingUnderscores(name)); @@ -316748,23 +318609,33 @@ ${lanes.join("\n")} const candidate = getMergedSymbol(getLateBoundSymbol(result)); const root = getRootDeclaration(associatedDeclarationForContainingInitializerOrBindingName); if (candidate === getSymbolOfDeclaration(associatedDeclarationForContainingInitializerOrBindingName)) { - error(errorLocation, Diagnostics.Parameter_0_cannot_reference_itself, declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name)); + error2(errorLocation, Diagnostics.Parameter_0_cannot_reference_itself, declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name)); } else if (candidate.valueDeclaration && candidate.valueDeclaration.pos > associatedDeclarationForContainingInitializerOrBindingName.pos && root.parent.locals && lookup(root.parent.locals, candidate.escapedName, meaning) === candidate) { - error(errorLocation, Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), declarationNameToString(errorLocation)); + error2(errorLocation, Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), declarationNameToString(errorLocation)); } } if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */); if (typeOnlyDeclaration) { - const message = typeOnlyDeclaration.kind === 280 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 277 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 279 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; + const message = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; const unescapedName = unescapeLeadingUnderscores(name); addTypeOnlyDeclarationRelatedInfo( - error(errorLocation, message, unescapedName), + error2(errorLocation, message, unescapedName), typeOnlyDeclaration, unescapedName ); } } + 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; @@ -316776,31 +318647,31 @@ ${lanes.join("\n")} diagnostic, createDiagnosticForNode( typeOnlyDeclaration, - typeOnlyDeclaration.kind === 280 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 277 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 279 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, + typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, unescapedName ) ); } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 218 /* ArrowFunction */ && location.kind !== 217 /* FunctionExpression */) { - return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 171 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name); + if (location.kind !== 219 /* ArrowFunction */ && location.kind !== 218 /* FunctionExpression */) { + return isTypeQueryNode(location) || (isFunctionLikeDeclaration(location) || location.kind === 172 /* PropertyDeclaration */ && !isStatic(location)) && (!lastLocation || lastLocation !== location.name); } if (lastLocation && lastLocation === location.name) { return false; } - if (location.asteriskToken || hasSyntacticModifier(location, 512 /* Async */)) { + if (location.asteriskToken || hasSyntacticModifier(location, 1024 /* Async */)) { return true; } return !getImmediatelyInvokedFunctionExpression(location); } function isSelfReferenceLocation(node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 266 /* ModuleDeclaration */: + case 262 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 267 /* ModuleDeclaration */: return true; default: return false; @@ -316812,7 +318683,7 @@ ${lanes.join("\n")} function isTypeParameterSymbolDeclaredInContainer(symbol, container) { if (symbol.declarations) { for (const decl of symbol.declarations) { - if (decl.kind === 167 /* TypeParameter */) { + if (decl.kind === 168 /* TypeParameter */) { const parent2 = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent; if (parent2 === container) { return !(isJSDocTemplateTag(decl.parent) && find(decl.parent.parent.tags, isJSDocTypeAlias)); @@ -316842,13 +318713,13 @@ ${lanes.join("\n")} } const constructorType = getTypeOfSymbol(classSymbol); if (getPropertyOfType(constructorType, name)) { - error(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, diagnosticName(nameArg), symbolToString(classSymbol)); + error2(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, diagnosticName(nameArg), symbolToString(classSymbol)); return true; } if (location === container && !isStatic(location)) { const instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; if (getPropertyOfType(instanceType, name)) { - error(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); + error2(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); return true; } } @@ -316865,7 +318736,7 @@ ${lanes.join("\n")} /*ignoreErrors*/ true )) { - error(errorLocation, Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements, getTextOfNode(expression)); + error2(errorLocation, Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements, getTextOfNode(expression)); return true; } return false; @@ -316873,9 +318744,9 @@ ${lanes.join("\n")} function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 80 /* Identifier */: - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0; - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: if (isEntityNameExpression(node.expression)) { return node.expression; } @@ -316904,7 +318775,7 @@ ${lanes.join("\n")} const propName = parent2.right.escapedText; const propType = getPropertyOfType(getDeclaredTypeOfSymbol(symbol), propName); if (propType) { - error( + error2( parent2, Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, unescapeLeadingUnderscores(name), @@ -316913,7 +318784,7 @@ ${lanes.join("\n")} return true; } } - error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here, unescapeLeadingUnderscores(name)); + error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here, unescapeLeadingUnderscores(name)); return true; } } @@ -316933,7 +318804,7 @@ ${lanes.join("\n")} false )); if (symbol && !(symbol.flags & 1920 /* Namespace */)) { - error(errorLocation, Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, unescapeLeadingUnderscores(name)); + error2(errorLocation, Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, unescapeLeadingUnderscores(name)); return true; } } @@ -316943,8 +318814,8 @@ ${lanes.join("\n")} return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 280 /* ExportSpecifier */) { - error(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 281 /* ExportSpecifier */) { + error2(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } return false; @@ -316952,10 +318823,19 @@ ${lanes.join("\n")} function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) { if (meaning & 111551 /* Value */) { if (isPrimitiveTypeName(name)) { - if (isExtendedByInterface(errorLocation)) { - error(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, unescapeLeadingUnderscores(name)); + const grandparent = errorLocation.parent.parent; + if (grandparent && grandparent.parent && isHeritageClause(grandparent)) { + const heritageKind = grandparent.token; + const containerKind = grandparent.parent.kind; + if (containerKind === 264 /* InterfaceDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) { + error2(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name)); + } else if (containerKind === 263 /* ClassDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) { + error2(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name)); + } else if (containerKind === 263 /* ClassDeclaration */ && heritageKind === 119 /* ImplementsKeyword */) { + error2(errorLocation, Diagnostics.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types, unescapeLeadingUnderscores(name)); + } } else { - error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, unescapeLeadingUnderscores(name)); + error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, unescapeLeadingUnderscores(name)); } return true; } @@ -316970,31 +318850,21 @@ ${lanes.join("\n")} /*isUse*/ false )); - const allFlags = symbol && getAllSymbolFlags(symbol); + const allFlags = symbol && getSymbolFlags(symbol); if (symbol && allFlags !== void 0 && !(allFlags & 111551 /* Value */)) { const rawName = unescapeLeadingUnderscores(name); if (isES2015OrLaterConstructorName(name)) { - error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); + error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); } else if (maybeMappedType(errorLocation, symbol)) { - error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); + error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); } else { - error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); + error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); } return true; } } return false; } - function isExtendedByInterface(node) { - const grandparent = node.parent.parent; - const parentOfGrandparent = grandparent.parent; - if (grandparent && parentOfGrandparent) { - const isExtending = isHeritageClause(grandparent) && grandparent.token === 96 /* ExtendsKeyword */; - const isInterface = isInterfaceDeclaration(parentOfGrandparent); - return isExtending && isInterface; - } - return false; - } function maybeMappedType(node, symbol) { const container = findAncestor(node.parent, (n) => isComputedPropertyName(n) || isPropertySignature(n) ? false : isTypeLiteralNode(n) || "quit"); if (container && container.members.length === 1) { @@ -317034,7 +318904,7 @@ ${lanes.join("\n")} false )); if (symbol) { - error( + error2( errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_value, unescapeLeadingUnderscores(name) @@ -317054,7 +318924,7 @@ ${lanes.join("\n")} false )); if (symbol) { - error(errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_type, unescapeLeadingUnderscores(name)); + error2(errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_type, unescapeLeadingUnderscores(name)); return true; } } @@ -317067,40 +318937,42 @@ ${lanes.join("\n")} return; } const declaration = (_a = result.declarations) == null ? void 0 : _a.find( - (d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 265 /* EnumDeclaration */ + (d) => isBlockOrCatchScoped(d) || isClassLike(d) || d.kind === 266 /* EnumDeclaration */ ); if (declaration === void 0) return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); - if (!(declaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { + if (!(declaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { let diagnosticMessage; const declarationName = declarationNameToString(getNameOfDeclaration(declaration)); if (result.flags & 2 /* BlockScopedVariable */) { - diagnosticMessage = error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationName); + diagnosticMessage = error2(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationName); } else if (result.flags & 32 /* Class */) { - diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName); + diagnosticMessage = error2(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName); } else if (result.flags & 256 /* RegularEnum */) { - diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName); + 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) - ); + addRelatedInfo(diagnosticMessage, createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName)); } } } function isSameScopeDescendentOf(initial, parent2, stopAt) { - return !!parent2 && !!findAncestor(initial, (n) => n === parent2 || (n === stopAt || isFunctionLike(n) && (!getImmediatelyInvokedFunctionExpression(n) || isAsyncFunction(n)) ? "quit" : false)); + return !!parent2 && !!findAncestor(initial, (n) => n === parent2 || (n === stopAt || isFunctionLike(n) && (!getImmediatelyInvokedFunctionExpression(n) || getFunctionFlags(n) & 3 /* AsyncGenerator */) ? "quit" : false)); } function getAnyImportSyntax(node) { switch (node.kind) { - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return node; - case 272 /* ImportClause */: + case 273 /* ImportClause */: return node.parent; - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: return node.parent.parent; - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: return node.parent.parent.parent; default: return void 0; @@ -317110,7 +318982,7 @@ ${lanes.join("\n")} return symbol.declarations && findLast(symbol.declarations, isAliasSymbolDeclaration2); } function isAliasSymbolDeclaration2(node) { - return node.kind === 270 /* ImportEqualsDeclaration */ || node.kind === 269 /* NamespaceExportDeclaration */ || node.kind === 272 /* ImportClause */ && !!node.name || node.kind === 273 /* NamespaceImport */ || node.kind === 279 /* NamespaceExport */ || node.kind === 275 /* ImportSpecifier */ || node.kind === 280 /* ExportSpecifier */ || node.kind === 276 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 303 /* ShorthandPropertyAssignment */ || node.kind === 302 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 259 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 207 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); + return node.kind === 271 /* ImportEqualsDeclaration */ || node.kind === 270 /* NamespaceExportDeclaration */ || node.kind === 273 /* ImportClause */ && !!node.name || node.kind === 274 /* NamespaceImport */ || node.kind === 280 /* NamespaceExport */ || node.kind === 276 /* ImportSpecifier */ || node.kind === 281 /* ExportSpecifier */ || node.kind === 277 /* ExportAssignment */ && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */ && isAliasableOrJsExpression(node.parent.right) || node.kind === 304 /* ShorthandPropertyAssignment */ || node.kind === 303 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) || node.kind === 260 /* VariableDeclaration */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 208 /* BindingElement */ && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); } function isAliasableOrJsExpression(e) { return isAliasableExpression(e) || isFunctionExpression(e) && isJSConstructor(e); @@ -317121,7 +318993,7 @@ ${lanes.join("\n")} const name = getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; return isIdentifier(commonJSPropertyAccess.name) ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) : void 0; } - if (isVariableDeclaration(node) || node.moduleReference.kind === 282 /* ExternalModuleReference */) { + if (isVariableDeclaration(node) || node.moduleReference.kind === 283 /* ExternalModuleReference */) { const immediate = resolveExternalModuleName( node, getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node) @@ -317150,11 +319022,11 @@ ${lanes.join("\n")} false ) && !node.isTypeOnly) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node)); - const isExport = typeOnlyDeclaration.kind === 280 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 277 /* ExportDeclaration */; + const isExport = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */; const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type; const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here; - const name = typeOnlyDeclaration.kind === 277 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); - addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name)); + const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); + addRelatedInfo(error2(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name)); } } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { @@ -317176,10 +319048,10 @@ ${lanes.join("\n")} return resolved; } function isSyntacticDefault(node) { - return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 1024 /* Default */) || isExportSpecifier(node); + 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 */; @@ -317190,7 +319062,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; @@ -317259,13 +319131,16 @@ ${lanes.join("\n")} const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; const exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */); const exportAssignment = exportEqualsSymbol.valueDeclaration; - const err = error(node.name, Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName); + const err = error2(node.name, Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName); if (exportAssignment) { - addRelatedInfo(err, createDiagnosticForNode( - exportAssignment, - Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, - compilerOptionName - )); + addRelatedInfo( + err, + createDiagnosticForNode( + exportAssignment, + Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, + compilerOptionName + ) + ); } } else if (isImportClause(node)) { reportNonDefaultExport(moduleSymbol, node); @@ -317295,15 +319170,15 @@ ${lanes.join("\n")} } function getModuleSpecifierForImportOrExport(node) { switch (node.kind) { - case 272 /* ImportClause */: + case 273 /* ImportClause */: return node.parent.moduleSpecifier; - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0; - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: return node.parent.parent.moduleSpecifier; - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: return node.parent.parent.parent.moduleSpecifier; - case 280 /* ExportSpecifier */: + case 281 /* ExportSpecifier */: return node.parent.parent.moduleSpecifier; default: return Debug.assertNever(node); @@ -317312,20 +319187,22 @@ ${lanes.join("\n")} function reportNonDefaultExport(moduleSymbol, node) { var _a, _b, _c; if ((_a = moduleSymbol.exports) == null ? void 0 : _a.has(node.symbol.escapedName)) { - error( + error2( node.name, Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead, symbolToString(moduleSymbol), symbolToString(node.symbol) ); } else { - const diagnostic = error(node.name, Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); + const diagnostic = error2(node.name, Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); const exportStar = (_b = moduleSymbol.exports) == null ? void 0 : _b.get("__export" /* ExportStar */); if (exportStar) { - const defaultExport = (_c = exportStar.declarations) == null ? void 0 : _c.find((decl) => { - var _a2, _b2; - return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (_a2 = resolveExternalModuleName(decl, decl.moduleSpecifier)) == null ? void 0 : _a2.exports) == null ? void 0 : _b2.has("default" /* Default */))); - }); + const defaultExport = (_c = exportStar.declarations) == null ? void 0 : _c.find( + (decl) => { + var _a2, _b2; + return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (_a2 = resolveExternalModuleName(decl, decl.moduleSpecifier)) == null ? void 0 : _a2.exports) == null ? void 0 : _b2.has("default" /* Default */))); + } + ); if (defaultExport) { addRelatedInfo(diagnostic, createDiagnosticForNode(defaultExport, Diagnostics.export_Asterisk_does_not_re_export_a_default)); } @@ -317470,16 +319347,13 @@ ${lanes.join("\n")} const suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol); if (suggestion !== void 0) { const suggestionName = symbolToString(suggestion); - const diagnostic = error(name, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName); + const diagnostic = error2(name, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName); if (suggestion.valueDeclaration) { - addRelatedInfo( - diagnostic, - createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName) - ); + addRelatedInfo(diagnostic, createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName)); } } else { if ((_a = moduleSymbol.exports) == null ? void 0 : _a.has("default" /* Default */)) { - error( + error2( name, Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, @@ -317497,32 +319371,29 @@ ${lanes.join("\n")} if (localSymbol) { const exportedEqualsSymbol = exports == null ? void 0 : exports.get("export=" /* ExportEquals */); if (exportedEqualsSymbol) { - getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) : error(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName); + getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) : error2(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName); } else { const exportedSymbol = exports ? find(symbolsToArray(exports), (symbol) => !!getSymbolIfSameReference(symbol, localSymbol)) : void 0; - const diagnostic = exportedSymbol ? error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) : error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName); + const diagnostic = exportedSymbol ? error2(name, Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) : error2(name, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName); if (localSymbol.declarations) { - addRelatedInfo( - diagnostic, - ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName)) - ); + addRelatedInfo(diagnostic, ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName))); } } } else { - error(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName); + error2(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName); } } function reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) { if (moduleKind >= 5 /* ES2015 */) { const message = getESModuleInterop(compilerOptions) ? Diagnostics._0_can_only_be_imported_by_using_a_default_import : Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import; - error(name, message, declarationName); + error2(name, message, declarationName); } else { if (isInJSFile(node)) { const message = getESModuleInterop(compilerOptions) ? Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import : Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import; - error(name, message, declarationName); + error2(name, message, declarationName); } else { const message = getESModuleInterop(compilerOptions) ? Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import : Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import; - error(name, message, declarationName, declarationName, moduleName); + error2(name, message, declarationName, declarationName, moduleName); } } } @@ -317636,26 +319507,26 @@ ${lanes.join("\n")} } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve = false) { switch (node.kind) { - case 270 /* ImportEqualsDeclaration */: - case 259 /* VariableDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 260 /* VariableDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 272 /* ImportClause */: + case 273 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 279 /* NamespaceExport */: + case 280 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 275 /* ImportSpecifier */: - case 207 /* BindingElement */: + case 276 /* ImportSpecifier */: + case 208 /* BindingElement */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 280 /* ExportSpecifier */: + case 281 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 276 /* ExportAssignment */: - case 225 /* BinaryExpression */: + case 277 /* ExportAssignment */: + case 226 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 269 /* NamespaceExportDeclaration */: + case 270 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return resolveEntityName( node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, @@ -317663,10 +319534,10 @@ ${lanes.join("\n")} true, dontRecursivelyResolve ); - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve); - case 211 /* ElementAccessExpression */: - case 210 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: return getTargetOfAccessExpression(node, dontRecursivelyResolve); default: return Debug.fail(); @@ -317692,7 +319563,7 @@ ${lanes.join("\n")} if (links.aliasTarget === resolvingSymbol) { links.aliasTarget = target || unknownSymbol; } else { - error(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); + error2(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); } } else if (links.aliasTarget === resolvingSymbol) { links.aliasTarget = unknownSymbol; @@ -317706,13 +319577,25 @@ ${lanes.join("\n")} } return void 0; } - function getAllSymbolFlags(symbol) { - let flags = symbol.flags; + function getSymbolFlags(symbol, excludeTypeOnlyMeanings, excludeLocalMeanings) { + const typeOnlyDeclaration = excludeTypeOnlyMeanings && getTypeOnlyAliasDeclaration(symbol); + const typeOnlyDeclarationIsExportStar = typeOnlyDeclaration && isExportDeclaration(typeOnlyDeclaration); + const typeOnlyResolution = typeOnlyDeclaration && (typeOnlyDeclarationIsExportStar ? resolveExternalModuleName( + typeOnlyDeclaration.moduleSpecifier, + typeOnlyDeclaration.moduleSpecifier, + /*ignoreErrors*/ + true + ) : resolveAlias(typeOnlyDeclaration.symbol)); + const typeOnlyExportStarTargets = typeOnlyDeclarationIsExportStar && typeOnlyResolution ? getExportsOfModule(typeOnlyResolution) : void 0; + let flags = excludeLocalMeanings ? 0 /* None */ : symbol.flags; let seenSymbols; while (symbol.flags & 2097152 /* Alias */) { - const target = resolveAlias(symbol); + const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol)); + if (!typeOnlyDeclarationIsExportStar && target === typeOnlyResolution || (typeOnlyExportStarTargets == null ? void 0 : typeOnlyExportStarTargets.get(target.escapedName)) === target) { + break; + } if (target === unknownSymbol) { - return 67108863 /* All */; + return -1 /* All */; } if (target === symbol || (seenSymbols == null ? void 0 : seenSymbols.has(target))) { break; @@ -317767,8 +319650,8 @@ ${lanes.join("\n")} return links.typeOnlyDeclaration || void 0; } if (links.typeOnlyDeclaration) { - const resolved = links.typeOnlyDeclaration.kind === 277 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); - return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0; + const resolved = links.typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); + return getSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0; } return void 0; } @@ -317779,7 +319662,11 @@ ${lanes.join("\n")} const symbol = getSymbolOfDeclaration(node); const target = resolveAlias(symbol); if (target) { - const markAlias = target === unknownSymbol || getAllSymbolFlags(target) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */); + const markAlias = target === unknownSymbol || getSymbolFlags( + symbol, + /*excludeTypeOnlyMeanings*/ + true + ) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); if (markAlias) { markAliasSymbolAsReferenced(symbol); } @@ -317794,7 +319681,7 @@ ${lanes.join("\n")} if (!node) return Debug.fail(); if (isInternalModuleImportEqualsDeclaration(node)) { - if (getAllSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) { + if (getSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) { checkExpressionCached(node.moduleReference); } } @@ -317810,7 +319697,7 @@ ${lanes.join("\n")} if (entityName.kind === 80 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 80 /* Identifier */ || entityName.parent.kind === 165 /* QualifiedName */) { + if (entityName.kind === 80 /* Identifier */ || entityName.parent.kind === 166 /* QualifiedName */) { return resolveEntityName( entityName, 1920 /* Namespace */, @@ -317819,7 +319706,7 @@ ${lanes.join("\n")} dontResolveAlias ); } else { - Debug.assert(entityName.parent.kind === 270 /* ImportEqualsDeclaration */); + Debug.assert(entityName.parent.kind === 271 /* ImportEqualsDeclaration */); return resolveEntityName( entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, @@ -317892,9 +319779,9 @@ ${lanes.join("\n")} if (!symbol) { return getMergedSymbol(symbolFromJSPrototype); } - } else if (name.kind === 165 /* QualifiedName */ || name.kind === 210 /* PropertyAccessExpression */) { - const left = name.kind === 165 /* QualifiedName */ ? name.left : name.expression; - const right = name.kind === 165 /* QualifiedName */ ? name.right : name.name; + } else if (name.kind === 166 /* QualifiedName */ || name.kind === 211 /* PropertyAccessExpression */) { + const left = name.kind === 166 /* QualifiedName */ ? name.left : name.expression; + const right = name.kind === 166 /* QualifiedName */ ? name.right : name.name; let namespace = resolveEntityName( left, namespaceMeaning, @@ -317928,13 +319815,13 @@ ${lanes.join("\n")} const declarationName = declarationNameToString(right); const suggestionForNonexistentModule = getSuggestedSymbolForNonexistentModule(right, namespace); if (suggestionForNonexistentModule) { - error(right, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestionForNonexistentModule)); + error2(right, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestionForNonexistentModule)); return void 0; } const containingQualifiedName = isQualifiedName(name) && getContainingQualifiedNameNode(name); const canSuggestTypeof = globalObjectType && meaning & 788968 /* Type */ && containingQualifiedName && !isTypeOfExpression(containingQualifiedName.parent) && tryGetQualifiedNameAsValue(containingQualifiedName); if (canSuggestTypeof) { - error( + error2( containingQualifiedName, Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, entityNameToString(containingQualifiedName) @@ -317944,7 +319831,7 @@ ${lanes.join("\n")} if (meaning & 1920 /* Namespace */ && isQualifiedName(name.parent)) { const exportedTypeSymbol = getMergedSymbol(getSymbol2(getExportsOfSymbol(namespace), right.escapedText, 788968 /* Type */)); if (exportedTypeSymbol) { - error( + error2( name.parent.right, Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, symbolToString(exportedTypeSymbol), @@ -317953,7 +319840,7 @@ ${lanes.join("\n")} return void 0; } } - error(right, Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); + error2(right, Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); } return void 0; } @@ -317961,7 +319848,7 @@ ${lanes.join("\n")} Debug.assertNever(name, "Unknown entity name kind."); } Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 276 /* ExportAssignment */)) { + if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 277 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly( getAliasDeclarationFromName(name), symbol, @@ -317991,7 +319878,7 @@ ${lanes.join("\n")} } } function getAssignmentDeclarationLocation(node) { - const typeAlias = findAncestor(node, (node2) => !(isJSDocNode(node2) || node2.flags & 8388608 /* JSDoc */) ? "quit" : isJSDocTypeAlias(node2)); + const typeAlias = findAncestor(node, (node2) => !(isJSDocNode(node2) || node2.flags & 16777216 /* JSDoc */) ? "quit" : isJSDocTypeAlias(node2)); if (typeAlias) { return; } @@ -318054,11 +319941,11 @@ ${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; + 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/"); - error(errorNode, diag2, withoutAtTypePrefix, moduleReference); + error2(errorNode, diag2, withoutAtTypePrefix, moduleReference); } const ambientModule = tryFindAmbientModule( moduleReference, @@ -318069,28 +319956,35 @@ ${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 = getResolvedModule(currentSourceFile, moduleReference, mode); + const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule; const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile); const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (resolutionDiagnostic) { - error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); + error2(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); } if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) { - const importOrExport = ((_g = findAncestor(location, isImportDeclaration)) == null ? void 0 : _g.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration)); + const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration)); if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) { - error( + error2( errorNode, Diagnostics.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead, getSuggestedImportSource(Debug.checkDefined(tryExtractTSExtension(moduleReference))) ); } } else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) { - const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference)); - error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension); + const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration)); + if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) { + const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference)); + error2(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension); + } } if (sourceFile.symbol) { if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) { @@ -318106,11 +320000,10 @@ ${lanes.join("\n")} } if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) { const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration); - const overrideClauseHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l)); - const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_h = overrideClauseHost.assertions) == null ? void 0 : _h.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause; - if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) { + const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l)); + if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) { if (findAncestor(location, isImportEqualsDeclaration)) { - error(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference); + error2(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference); } else { let diagnosticDetails; const ext = tryGetExtensionFromPath2(currentSourceFile.fileName); @@ -318151,18 +320044,22 @@ ${lanes.join("\n")} } } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chainDiagnosticMessages( - diagnosticDetails, - Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead, - moduleReference - ))); + diagnostics.add(createDiagnosticForNodeFromMessageChain( + getSourceFileOfNode(errorNode), + errorNode, + chainDiagnosticMessages( + diagnosticDetails, + Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead, + moduleReference + ) + )); } } } return getMergedSymbol(sourceFile.symbol); } if (moduleNotFoundError) { - error(errorNode, Diagnostics.File_0_is_not_a_module, sourceFile.fileName); + error2(errorNode, Diagnostics.File_0_is_not_a_module, sourceFile.fileName); } return void 0; } @@ -318179,7 +320076,7 @@ ${lanes.join("\n")} if (resolvedModule && !resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === void 0 || resolutionDiagnostic === Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) { if (isForAugmentation) { const diag2 = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; - error(errorNode, diag2, moduleReference, resolvedModule.resolvedFileName); + error2(errorNode, diag2, moduleReference, resolvedModule.resolvedFileName); } else { errorOnImplicitAnyModule( /*isError*/ @@ -318197,31 +320094,37 @@ ${lanes.join("\n")} if (resolvedModule) { const redirect = host.getProjectReferenceRedirect(resolvedModule.resolvedFileName); if (redirect) { - error(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName); + error2(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName); return void 0; } } if (resolutionDiagnostic) { - error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); + error2(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); } else { const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); const resolutionIsNode16OrNext = moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */; if (!getResolveJsonModule(compilerOptions) && fileExtensionIs(moduleReference, ".json" /* Json */) && moduleResolutionKind !== 1 /* Classic */ && hasJsonModuleEmitEnabled(compilerOptions)) { - error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); + error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); - const suggestedExt = (_i = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _i[1]; + const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1]; if (suggestedExt) { - error( + error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt); + } else { + 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 { + if ((_k = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _k.alternateResult) { + const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference); + errorOrSuggestion( + /*isError*/ + true, errorNode, - Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, - moduleReference + suggestedExt + chainDiagnosticMessages(errorInfo, moduleNotFoundError, moduleReference) ); } else { - error(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); + error2(errorNode, moduleNotFoundError, moduleReference); } - } else { - error(errorNode, moduleNotFoundError, moduleReference); } } } @@ -318241,12 +320144,16 @@ ${lanes.join("\n")} if (!isExternalModuleNameRelative(moduleReference) && packageId) { errorInfo = createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageId.name); } - errorOrSuggestion(isError, errorNode, chainDiagnosticMessages( - errorInfo, - Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, - moduleReference, - resolvedFileName - )); + errorOrSuggestion( + isError, + errorNode, + chainDiagnosticMessages( + errorInfo, + Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, + moduleReference, + resolvedFileName + ) + ); } function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { if (moduleSymbol == null ? void 0 : moduleSymbol.exports) { @@ -318285,9 +320192,9 @@ ${lanes.join("\n")} var _a; const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 311 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !getDeclarationOfKind(symbol, 312 /* SourceFile */)) { const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop"; - error(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName); + error2(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName); return symbol; } const referenceParent = referencingLocation.parent; @@ -318483,10 +320390,12 @@ ${lanes.join("\n")} } if (exportStar == null ? void 0 : exportStar.isTypeOnly) { typeOnlyExportStarMap ?? (typeOnlyExportStarMap = /* @__PURE__ */ new Map()); - symbols.forEach((_, escapedName) => typeOnlyExportStarMap.set( - escapedName, - exportStar - )); + symbols.forEach( + (_, escapedName) => typeOnlyExportStarMap.set( + escapedName, + exportStar + ) + ); } return symbols; } @@ -318504,6 +320413,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); @@ -318552,29 +320465,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) { @@ -318596,7 +320487,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); } @@ -318634,6 +320558,13 @@ ${lanes.join("\n")} }); } function getSymbolIfSameReference(s1, s2) { + var _a, _b; + if (s1.flags & 524288 /* TypeAlias */ && ((_a = s2.declarations) == null ? void 0 : _a.find(isTypeAlias))) { + s2 = getDeclaredTypeOfTypeAlias(s2).aliasSymbol || s2; + } + if (s2.flags & 524288 /* TypeAlias */ && ((_b = s1.declarations) == null ? void 0 : _b.find(isTypeAlias))) { + s1 = getDeclaredTypeOfTypeAlias(s1).aliasSymbol || s1; + } if (getMergedSymbol(resolveSymbol(getMergedSymbol(s1))) === getMergedSymbol(resolveSymbol(getMergedSymbol(s2)))) { return s1; } @@ -318642,19 +320573,19 @@ ${lanes.join("\n")} return getMergedSymbol(symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 && symbol.exportSymbol || symbol); } function symbolIsValue(symbol, includeTypeOnlyMembers) { - return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getAllSymbolFlags(symbol) & 111551 /* Value */ && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol))); + return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551 /* Value */); } function findConstructorDeclaration(node) { const members = node.members; for (const member of members) { - if (member.kind === 175 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 176 /* Constructor */ && nodeIsPresent(member.body)) { return member; } } } 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); @@ -318666,14 +320597,23 @@ ${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 */) { + function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */, debugIntrinsicName) { + checkIntrinsicName(intrinsicName, debugIntrinsicName); const type = createType(kind); type.intrinsicName = intrinsicName; - type.objectFlags = objectFlags; + type.debugIntrinsicName = debugIntrinsicName; + type.objectFlags = objectFlags | 524288 /* CouldContainTypeVariablesComputed */ | 2097152 /* IsGenericTypeComputed */ | 33554432 /* IsUnknownLikeUnionComputed */ | 16777216 /* IsNeverIntersectionComputed */; return type; } + function checkIntrinsicName(name, debug) { + const key = `${name},${debug ?? ""}`; + if (seenIntrinsicNames.has(key)) { + Debug.fail(`Duplicate intrinsic type name ${name}${debug ? ` (${debug})` : ""}; you may need to pass a name to createIntrinsicType.`); + } + seenIntrinsicNames.add(key); + } function createObjectType(objectFlags, symbol) { const type = createTypeWithSymbol(524288 /* Object */, symbol); type.objectFlags = objectFlags; @@ -318722,13 +320662,7 @@ ${lanes.join("\n")} return resolved; } function createAnonymousType(symbol, members, callSignatures, constructSignatures, indexInfos) { - return setStructuredTypeMembers( - createObjectType(16 /* Anonymous */, symbol), - members, - callSignatures, - constructSignatures, - indexInfos - ); + return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, indexInfos); } function getResolvedTypeWithoutAbstractConstructSignatures(type) { if (type.constructSignatures.length === 0) @@ -318765,11 +320699,11 @@ ${lanes.join("\n")} } } switch (location.kind) { - case 311 /* SourceFile */: + case 312 /* SourceFile */: if (!isExternalOrCommonJsModule(location)) { break; } - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: const sym = getSymbolOfDeclaration(location); if (result = callback( (sym == null ? void 0 : sym.exports) || emptySymbols, @@ -318782,9 +320716,9 @@ ${lanes.join("\n")} return result; } break; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: let table; (getSymbolOfDeclaration(location).members || emptySymbols).forEach((memberSymbol, key) => { if (memberSymbol.flags & (788968 /* Type */ & ~67108864 /* Assignment */)) { @@ -318862,7 +320796,7 @@ ${lanes.join("\n")} return [symbol]; } const result2 = forEachEntry(symbols, (symbolFromSymbolTable) => { - if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 280 /* ExportSpecifier */))) { + if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ && symbolFromSymbolTable.escapedName !== "default" /* Default */ && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */))) { const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); const candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -318907,9 +320841,9 @@ ${lanes.join("\n")} if (symbolFromSymbolTable === symbol) { return true; } - const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 280 /* ExportSpecifier */); + const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */); symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; - const flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags; + const flags = shouldResolveAlias ? getSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags; if (flags & meaning) { qualify = true; return true; @@ -318922,10 +320856,10 @@ ${lanes.join("\n")} if (symbol.declarations && symbol.declarations.length) { for (const declaration of symbol.declarations) { switch (declaration.kind) { - case 171 /* PropertyDeclaration */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 172 /* PropertyDeclaration */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: continue; default: return false; @@ -319061,10 +320995,10 @@ ${lanes.join("\n")} return node && getSymbolOfDeclaration(node); } function hasExternalModuleSymbol(declaration) { - return isAmbientModule(declaration) || declaration.kind === 311 /* SourceFile */ && isExternalOrCommonJsModule(declaration); + return isAmbientModule(declaration) || declaration.kind === 312 /* SourceFile */ && isExternalOrCommonJsModule(declaration); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return isModuleWithStringLiteralName(declaration) || declaration.kind === 311 /* SourceFile */ && isExternalOrCommonJsModule(declaration); + return isModuleWithStringLiteralName(declaration) || declaration.kind === 312 /* SourceFile */ && isExternalOrCommonJsModule(declaration); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { let aliasesToMakeVisible; @@ -319076,20 +321010,20 @@ ${lanes.join("\n")} var _a, _b; if (!isDeclarationVisible(declaration)) { const anyImportSyntax = getAnyImportSyntax(declaration); - if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 1 /* Export */) && // import clause without export + if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export isDeclarationVisible(anyImportSyntax.parent)) { return addVisibleAlias(declaration, anyImportSyntax); - } else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent, 1 /* Export */) && // unexported variable statement + } else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier(declaration.parent.parent, 32 /* Export */) && // unexported variable statement isDeclarationVisible(declaration.parent.parent.parent)) { return addVisibleAlias(declaration, declaration.parent.parent); - } else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration, 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + } else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier(declaration, 32 /* Export */) && isDeclarationVisible(declaration.parent)) { return addVisibleAlias(declaration, declaration); } else if (isBindingElement(declaration)) { - if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent, 1 /* Export */) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { + if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent, 32 /* Export */) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); } else if (symbol.flags & 2 /* BlockScopedVariable */) { const variableStatement = findAncestor(declaration, isVariableStatement); - if (hasSyntacticModifier(variableStatement, 1 /* Export */)) { + if (hasSyntacticModifier(variableStatement, 32 /* Export */)) { return true; } if (!isDeclarationVisible(variableStatement.parent)) { @@ -319112,9 +321046,9 @@ ${lanes.join("\n")} } function isEntityNameVisible(entityName, enclosingDeclaration) { let meaning; - if (entityName.parent.kind === 185 /* TypeQuery */ || entityName.parent.kind === 232 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 166 /* ComputedPropertyName */) { + 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 === 165 /* QualifiedName */ || entityName.kind === 210 /* PropertyAccessExpression */ || entityName.parent.kind === 270 /* ImportEqualsDeclaration */) { + } else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */) { meaning = 1920 /* Namespace */; } else { meaning = 788968 /* Type */; @@ -319180,7 +321114,7 @@ ${lanes.join("\n")} return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker); function symbolToStringWorker(writer2) { const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); - const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 311 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); + const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 312 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); printer.writeNode( 4 /* Unspecified */, @@ -319197,9 +321131,9 @@ ${lanes.join("\n")} function signatureToStringWorker(writer2) { let sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 184 /* ConstructorType */ : 183 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 185 /* ConstructorType */ : 184 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 179 /* ConstructSignature */ : 178 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 180 /* ConstructSignature */ : 179 /* CallSignature */; } const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); @@ -319256,7 +321190,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 */)); @@ -319301,7 +321235,7 @@ ${lanes.join("\n")} return symbolToExpression(symbol, context, meaning); } function withContext(enclosingDeclaration, flags, tracker, cb) { - Debug.assert(enclosingDeclaration === void 0 || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + Debug.assert(enclosingDeclaration === void 0 || (enclosingDeclaration.flags & 16 /* Synthesized */) === 0); const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost : flags & 134217728 /* DoNotIncludeSymbolChain */ ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) : void 0; const context = { enclosingDeclaration, @@ -319312,7 +321246,8 @@ ${lanes.join("\n")} visitedTypes: void 0, symbolDepth: void 0, inferTypeParameters: void 0, - approximateLength: 0 + approximateLength: 0, + trackedSymbols: void 0 }; context.tracker = new SymbolTrackerImpl(context, tracker, moduleResolverHost); const resultingNode = cb(context); @@ -319373,7 +321308,7 @@ ${lanes.join("\n")} } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return factory.createKeywordTypeNode(162 /* BigIntKeyword */); + return factory.createKeywordTypeNode(163 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */ && !type.aliasSymbol) { context.approximateLength += 7; @@ -319504,7 +321439,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( @@ -319583,7 +321518,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) { @@ -319646,11 +321587,13 @@ ${lanes.join("\n")} return !!type2.target && isMappedTypeHomomorphic(type2.target) && !isMappedTypeHomomorphic(type2); } function createMappedTypeNodeFromType(type2) { + var _a2; Debug.assert(!!(type2.flags & 524288 /* Object */)); const readonlyToken = type2.declaration.readonlyToken ? factory.createToken(type2.declaration.readonlyToken.kind) : void 0; const questionToken = type2.declaration.questionToken ? factory.createToken(type2.declaration.questionToken.kind) : void 0; let appropriateConstraintTypeNode; let newTypeVariable; + const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((_a2 = getConstraintOfTypeParameter(getConstraintTypeFromMappedType(type2))) == null ? void 0 : _a2.flags) & 4194304 /* Index */); if (isMappedTypeWithKeyofConstraintDeclaration(type2)) { if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type2) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) { const newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T")); @@ -319658,6 +321601,11 @@ ${lanes.join("\n")} newTypeVariable = factory.createTypeReferenceNode(name); } appropriateConstraintTypeNode = factory.createTypeOperatorNode(143 /* KeyOfKeyword */, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type2), context)); + } else if (needsModifierPreservingWrapper) { + const newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T")); + const name = typeParameterToName(newParam, context); + newTypeVariable = factory.createTypeReferenceNode(name); + appropriateConstraintTypeNode = newTypeVariable; } else { appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type2), context); } @@ -319688,6 +321636,18 @@ ${lanes.join("\n")} result, factory.createKeywordTypeNode(146 /* NeverKeyword */) ); + } else if (needsModifierPreservingWrapper) { + return factory.createConditionalTypeNode( + typeToTypeNodeHelper(getConstraintTypeFromMappedType(type2), context), + factory.createInferTypeNode(factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + factory.cloneNode(newTypeVariable.typeName), + factory.createTypeOperatorNode(143 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type2), context)) + )), + result, + factory.createKeywordTypeNode(146 /* NeverKeyword */) + ); } return result; } @@ -319696,6 +321656,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); @@ -319707,7 +321682,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 */); @@ -319718,20 +321693,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() { @@ -319739,7 +321700,7 @@ ${lanes.join("\n")} const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method some(symbol.declarations, (declaration) => isStatic(declaration)); const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol - forEach(symbol.declarations, (declaration) => declaration.parent.kind === 311 /* SourceFile */ || declaration.parent.kind === 267 /* ModuleBlock */)); + forEach(symbol.declarations, (declaration) => declaration.parent.kind === 312 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */)); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a3 = context.visitedTypes) == null ? void 0 : _a3.has(typeId))) && // it is type of the symbol uses itself recursively (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); @@ -319747,7 +321708,7 @@ ${lanes.join("\n")} } } function visitAndTransformType(type2, transform2) { - var _a2, _b2; + var _a2, _b2, _c; const typeId = type2.id; const isConstructorObject = getObjectFlags(type2) & 16 /* Anonymous */ && type2.symbol && type2.symbol.flags & 32 /* Class */; const id = getObjectFlags(type2) & 4 /* Reference */ && type2.node ? "N" + getNodeId(type2.node) : type2.flags & 16777216 /* Conditional */ ? "N" + getNodeId(type2.root.node) : type2.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type2.symbol) : void 0; @@ -319764,6 +321725,13 @@ ${lanes.join("\n")} } const cachedResult = (_a2 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _a2.get(key); if (cachedResult) { + (_b2 = cachedResult.trackedSymbols) == null ? void 0 : _b2.forEach( + ([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol( + symbol, + enclosingDeclaration, + meaning + ) + ); if (cachedResult.truncating) { context.truncating = true; } @@ -319779,22 +321747,36 @@ ${lanes.join("\n")} context.symbolDepth.set(id, depth + 1); } context.visitedTypes.add(typeId); + const prevTrackedSymbols = context.trackedSymbols; + context.trackedSymbols = void 0; const startLength = context.approximateLength; const result = transform2(type2); const addedLength = context.approximateLength - startLength; if (!context.reportedDiagnostic && !context.encounteredError) { - (_b2 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _b2.set(key, { node: result, truncating: context.truncating, addedLength }); + (_c = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _c.set(key, { + node: result, + truncating: context.truncating, + addedLength, + trackedSymbols: context.trackedSymbols + }); } context.visitedTypes.delete(typeId); if (id) { context.symbolDepth.set(id, depth); } + context.trackedSymbols = prevTrackedSymbols; return result; function deepCloneOrReuseNode(node) { 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) { @@ -319822,12 +321804,12 @@ ${lanes.join("\n")} } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { const signature = resolved.callSignatures[0]; - const signatureNode = signatureToSignatureDeclarationHelper(signature, 183 /* FunctionType */, context); + const signatureNode = signatureToSignatureDeclarationHelper(signature, 184 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { const signature = resolved.constructSignatures[0]; - const signatureNode = signatureToSignatureDeclarationHelper(signature, 184 /* ConstructorType */, context); + const signatureNode = signatureToSignatureDeclarationHelper(signature, 185 /* ConstructorType */, context); return signatureNode; } } @@ -319867,19 +321849,18 @@ ${lanes.join("\n")} const arity = getTypeReferenceArity(type2); const tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context); if (tupleConstituentNodes) { - if (type2.target.labeledElementDeclarations) { - for (let i = 0; i < tupleConstituentNodes.length; i++) { - const flags = type2.target.elementFlags[i]; + const { labeledElementDeclarations } = type2.target; + for (let i = 0; i < tupleConstituentNodes.length; i++) { + const flags = type2.target.elementFlags[i]; + const labeledElementDeclaration = labeledElementDeclarations == null ? void 0 : labeledElementDeclarations[i]; + if (labeledElementDeclaration) { tupleConstituentNodes[i] = factory.createNamedTupleMember( flags & 12 /* Variable */ ? factory.createToken(26 /* DotDotDotToken */) : void 0, - factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(type2.target.labeledElementDeclarations[i]))), + factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(labeledElementDeclaration))), flags & 2 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i] ); - } - } else { - for (let i = 0; i < Math.min(arity, tupleConstituentNodes.length); i++) { - const flags = type2.target.elementFlags[i]; + } else { tupleConstituentNodes[i] = flags & 12 /* Variable */ ? factory.createRestTypeNode(flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]) : flags & 2 /* Optional */ ? factory.createOptionalTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]; } } @@ -319940,11 +321921,7 @@ ${lanes.join("\n")} } } else { if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) { - qualifier = factory.updateQualifiedName( - qualifier, - qualifier.left, - setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments) - ); + qualifier = factory.updateQualifiedName(qualifier, qualifier.left, setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments)); } } } @@ -319956,7 +321933,7 @@ ${lanes.join("\n")} return factory.updateImportTypeNode( root, root.argument, - root.assertions, + root.attributes, qualifier, typeArguments, root.isTypeOf @@ -319970,11 +321947,7 @@ ${lanes.join("\n")} } } else { if (typeArguments !== getIdentifierTypeArguments(typeName.right)) { - typeName = factory.updateQualifiedName( - typeName, - typeName.left, - setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments) - ); + typeName = factory.updateQualifiedName(typeName, typeName.left, setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments)); } } typeArguments = ref.typeArguments; @@ -320013,12 +321986,12 @@ ${lanes.join("\n")} } const typeElements = []; for (const signature of resolvedType.callSignatures) { - typeElements.push(signatureToSignatureDeclarationHelper(signature, 178 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 179 /* CallSignature */, context)); } for (const signature of resolvedType.constructSignatures) { if (signature.flags & 4 /* Abstract */) continue; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 179 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context)); } for (const info of resolvedType.indexInfos) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0)); @@ -320034,7 +322007,7 @@ ${lanes.join("\n")} if (propertySymbol.flags & 4194304 /* Prototype */) { continue; } - if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (8 /* Private */ | 16 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) { + if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (2 /* Private */ | 4 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) { context.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName)); } } @@ -320098,44 +322071,68 @@ ${lanes.join("\n")} const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context); context.enclosingDeclaration = saveEnclosingDeclaration; context.approximateLength += symbolName(propertySymbol).length + 1; + if (propertySymbol.flags & 98304 /* Accessor */) { + const writeType = getWriteTypeOfSymbol(propertySymbol); + if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) { + const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */); + const getterSignature = getSignatureFromDeclaration(getterDeclaration); + typeElements.push( + setCommentRange( + signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }), + getterDeclaration + ) + ); + const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */); + const setterSignature = getSignatureFromDeclaration(setterDeclaration); + typeElements.push( + setCommentRange( + signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }), + setterDeclaration + ) + ); + return; + } + } const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0; if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) { const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */); for (const signature of signatures) { - const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 172 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); + const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); typeElements.push(preserveCommentsOn(methodDeclaration)); } + if (signatures.length || !optionalToken) { + return; + } + } + let propertyTypeNode; + if (shouldUsePlaceholderForProperty(propertySymbol, context)) { + propertyTypeNode = createElidedInformationPlaceholder(context); } else { - let propertyTypeNode; - if (shouldUsePlaceholderForProperty(propertySymbol, context)) { - propertyTypeNode = createElidedInformationPlaceholder(context); - } else { - if (propertyIsReverseMapped) { - context.reverseMappedStack || (context.reverseMappedStack = []); - context.reverseMappedStack.push(propertySymbol); - } - propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */); - if (propertyIsReverseMapped) { - context.reverseMappedStack.pop(); - } + if (propertyIsReverseMapped) { + context.reverseMappedStack || (context.reverseMappedStack = []); + context.reverseMappedStack.push(propertySymbol); } - const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0; - if (modifiers) { - context.approximateLength += 9; + propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */); + if (propertyIsReverseMapped) { + context.reverseMappedStack.pop(); } - const propertySignature = factory.createPropertySignature( - modifiers, - propertyName, - optionalToken, - propertyTypeNode - ); - typeElements.push(preserveCommentsOn(propertySignature)); } + const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0; + if (modifiers) { + context.approximateLength += 9; + } + const propertySignature = factory.createPropertySignature( + modifiers, + propertyName, + optionalToken, + propertyTypeNode + ); + typeElements.push(preserveCommentsOn(propertySignature)); function preserveCommentsOn(node) { var _a2; - if (some(propertySymbol.declarations, (d) => d.kind === 354 /* JSDocPropertyTag */)) { - const d = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d2) => d2.kind === 354 /* JSDocPropertyTag */); - const commentText = getTextOfJSDocComment(d.comment); + const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 355 /* JSDocPropertyTag */); + if (jsdocPropertyTag) { + const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment); if (commentText) { setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); } @@ -320240,6 +322237,7 @@ ${lanes.join("\n")} ); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { + var _a; const suppressAny = context.flags & 256 /* SuppressAnyReturnType */; if (suppressAny) context.flags &= ~256 /* SuppressAnyReturnType */; @@ -320257,39 +322255,68 @@ ${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 === 175 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports)); + 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)); const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context); if (thisParameter) { parameters.unshift(thisParameter); @@ -320310,11 +322337,11 @@ ${lanes.join("\n")} } } let modifiers = options == null ? void 0 : options.modifiers; - if (kind === 184 /* ConstructorType */ && signature.flags & 4 /* Abstract */) { + if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) { const flags = modifiersToFlags(modifiers); - modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */); + modifiers = factory.createModifiersFromModifierFlags(flags | 64 /* Abstract */); } - const node = kind === 178 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 179 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 172 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodDeclaration */ ? factory.createMethodDeclaration( + const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration( modifiers, /*asteriskToken*/ void 0, @@ -320326,25 +322353,25 @@ ${lanes.join("\n")} returnTypeNode, /*body*/ void 0 - ) : kind === 175 /* Constructor */ ? factory.createConstructorDeclaration( + ) : kind === 176 /* Constructor */ ? factory.createConstructorDeclaration( modifiers, parameters, /*body*/ void 0 - ) : kind === 176 /* GetAccessor */ ? factory.createGetAccessorDeclaration( + ) : kind === 177 /* GetAccessor */ ? factory.createGetAccessorDeclaration( modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ void 0 - ) : kind === 177 /* SetAccessor */ ? factory.createSetAccessorDeclaration( + ) : kind === 178 /* SetAccessor */ ? factory.createSetAccessorDeclaration( modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), parameters, /*body*/ void 0 - ) : kind === 180 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 323 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 183 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 184 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 261 /* FunctionDeclaration */ ? factory.createFunctionDeclaration( + ) : kind === 181 /* IndexSignature */ ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 324 /* JSDocFunctionType */ ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 184 /* FunctionType */ ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 185 /* ConstructorType */ ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 262 /* FunctionDeclaration */ ? factory.createFunctionDeclaration( modifiers, /*asteriskToken*/ void 0, @@ -320354,7 +322381,7 @@ ${lanes.join("\n")} returnTypeNode, /*body*/ void 0 - ) : kind === 217 /* FunctionExpression */ ? factory.createFunctionExpression( + ) : kind === 218 /* FunctionExpression */ ? factory.createFunctionExpression( modifiers, /*asteriskToken*/ void 0, @@ -320363,7 +322390,7 @@ ${lanes.join("\n")} parameters, returnTypeNode, factory.createBlock([]) - ) : kind === 218 /* ArrowFunction */ ? factory.createArrowFunction( + ) : kind === 219 /* ArrowFunction */ ? factory.createArrowFunction( modifiers, typeParameters, parameters, @@ -320375,6 +322402,20 @@ ${lanes.join("\n")} if (typeArguments) { node.typeArguments = factory.createNodeArray(typeArguments); } + if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 330 /* JSDocSignature */ && signature.declaration.parent.kind === 346 /* JSDocOverloadTag */) { + const comment = getTextOfNode( + signature.declaration.parent.parent, + /*includeTrivia*/ + true + ).slice(2, -2).split(/\r\n|\n|\r/).map((line) => line.replace(/^\s+/, " ")).join("\n"); + addSyntheticLeadingComment( + node, + 3 /* MultiLineCommentTrivia */, + comment, + /*hasTrailingNewLine*/ + true + ); + } cleanup == null ? void 0 : cleanup(); return node; } @@ -320412,11 +322453,17 @@ ${lanes.join("\n")} const constraintNode = constraint && typeToTypeNodeHelper(constraint, context); return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } - function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) { - let parameterDeclaration = getDeclarationOfKind(parameterSymbol, 168 /* Parameter */); - if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) { - parameterDeclaration = getDeclarationOfKind(parameterSymbol, 347 /* JSDocParameterTag */); + function getEffectiveParameterDeclaration(parameterSymbol) { + const parameterDeclaration = getDeclarationOfKind(parameterSymbol, 169 /* Parameter */); + if (parameterDeclaration) { + return parameterDeclaration; + } + if (!isTransientSymbol(parameterSymbol)) { + return getDeclarationOfKind(parameterSymbol, 348 /* JSDocParameterTag */); } + } + function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) { + const parameterDeclaration = getEffectiveParameterDeclaration(parameterSymbol); let parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { parameterType = getOptionalType(parameterType); @@ -320425,7 +322472,7 @@ ${lanes.join("\n")} const modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ? map(getModifiers(parameterDeclaration), factory.cloneNode) : void 0; const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 32768 /* RestParameter */; const dotDotDotToken = isRest ? factory.createToken(26 /* DotDotDotToken */) : void 0; - const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 80 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 165 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol); + const name = parameterToParameterDeclarationName(parameterSymbol, parameterDeclaration, context); const isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 16384 /* OptionalParameter */; const questionToken = isOptional ? factory.createToken(58 /* QuestionToken */) : void 0; const parameterNode = factory.createParameterDeclaration( @@ -320439,6 +322486,9 @@ ${lanes.join("\n")} ); context.approximateLength += symbolName(parameterSymbol).length + 3; return parameterNode; + } + function parameterToParameterDeclarationName(parameterSymbol, parameterDeclaration, context) { + return parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 80 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 166 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol); function cloneBindingName(node) { return elideInitializerAndSetEmitFlags(node); function elideInitializerAndSetEmitFlags(node2) { @@ -320448,7 +322498,8 @@ ${lanes.join("\n")} let visited = visitEachChild( node2, elideInitializerAndSetEmitFlags, - nullTransformationContext, + /*context*/ + void 0, /*nodesVisitor*/ void 0, elideInitializerAndSetEmitFlags @@ -320514,7 +322565,9 @@ ${lanes.join("\n")} if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning2 : getQualifiedLeftMeaning(meaning2))) { const parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol2, context.enclosingDeclaration, meaning2); if (length(parents)) { - parentSpecifiers = parents.map((symbol3) => some(symbol3.declarations, hasNonGlobalAugmentationExternalModuleSymbol) ? getSpecifierForModuleSymbol(symbol3, context) : void 0); + parentSpecifiers = parents.map( + (symbol3) => some(symbol3.declarations, hasNonGlobalAugmentationExternalModuleSymbol) ? getSpecifierForModuleSymbol(symbol3, context) : void 0 + ); const indices = parents.map((_, i) => i); indices.sort(sortByBestName); const sortedParents = indices.map((i) => parents[i]); @@ -320605,11 +322658,11 @@ ${lanes.join("\n")} return top; } function getSpecifierForModuleSymbol(symbol, context, overrideImportMode) { - let file = getDeclarationOfKind(symbol, 311 /* SourceFile */); + let file = getDeclarationOfKind(symbol, 312 /* SourceFile */); if (!file) { const equivalentFileSymbol = firstDefined(symbol.declarations, (d) => getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol)); if (equivalentFileSymbol) { - file = getDeclarationOfKind(equivalentFileSymbol, 311 /* SourceFile */); + file = getDeclarationOfKind(equivalentFileSymbol, 312 /* SourceFile */); } } if (file && file.moduleName !== void 0) { @@ -320665,7 +322718,6 @@ ${lanes.join("\n")} return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier; } function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) { - var _a, _b, _c, _d; const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */)); const isTypeOf = meaning === 111551 /* Value */; if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { @@ -320674,40 +322726,42 @@ ${lanes.join("\n")} const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration)); const targetFile = getSourceFileOfModule(chain[0]); let specifier; - let assertion; + let attributes; if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) { if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) { specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */); - assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([ - factory.createAssertEntry( - factory.createStringLiteral("resolution-mode"), - factory.createStringLiteral("import") - ) - ]))); - (_b = (_a = context.tracker).reportImportTypeNodeResolutionModeOverride) == null ? void 0 : _b.call(_a); + attributes = factory.createImportAttributes( + factory.createNodeArray([ + factory.createImportAttribute( + factory.createStringLiteral("resolution-mode"), + factory.createStringLiteral("import") + ) + ]) + ); } } if (!specifier) { specifier = getSpecifierForModuleSymbol(chain[0], context); } - if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.indexOf("/node_modules/") >= 0) { + if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) { const oldSpecifier = specifier; if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) { const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */; specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode); - if (specifier.indexOf("/node_modules/") >= 0) { + if (specifier.includes("/node_modules/")) { specifier = oldSpecifier; } else { - assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([ - factory.createAssertEntry( - factory.createStringLiteral("resolution-mode"), - factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require") - ) - ]))); - (_d = (_c = context.tracker).reportImportTypeNodeResolutionModeOverride) == null ? void 0 : _d.call(_c); + attributes = factory.createImportAttributes( + factory.createNodeArray([ + factory.createImportAttribute( + factory.createStringLiteral("resolution-mode"), + factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require") + ) + ]) + ); } } - if (!assertion) { + if (!attributes) { context.encounteredError = true; if (context.tracker.reportLikelyUnsafeImportRequiredError) { context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier); @@ -320727,11 +322781,11 @@ ${lanes.join("\n")} void 0 ); } - return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf); + return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf); } else { const splitNode = getTopmostIndexedAccessType(nonRootParts); const qualifier = splitNode.objectType.typeName; - return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, assertion, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType); + return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType); } } const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0); @@ -320805,7 +322859,7 @@ ${lanes.join("\n")} return identifier; } } - function typeParameterShadowsNameInScope(escapedName, context, type) { + function typeParameterShadowsOtherTypeParameterInScope(escapedName, context, type) { const result = resolveName( context.enclosingDeclaration, escapedName, @@ -320816,11 +322870,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; } @@ -320846,7 +322897,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}`; } @@ -320857,7 +322908,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; } @@ -320931,7 +322982,18 @@ ${lanes.join("\n")} } function isStringNamed(d) { const name = getNameOfDeclaration(d); - return !!name && isStringLiteral(name); + if (!name) { + return false; + } + if (isComputedPropertyName(name)) { + const type = checkExpression(name.expression); + return !!(type.flags & 402653316 /* StringLike */); + } + if (isElementAccessExpression(name)) { + const type = checkExpression(name.argumentExpression); + return !!(type.flags & 402653316 /* StringLike */); + } + return isStringLiteral(name); } function isSingleQuotedStringNamed(d) { const name = getNameOfDeclaration(d); @@ -320944,14 +323006,15 @@ ${lanes.join("\n")} function getPropertyNameNodeForSymbol(symbol, context) { const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed); const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed); - const fromNameType = getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed); + const isMethod = !!(symbol.flags & 8192 /* Method */); + const fromNameType = getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed, isMethod); if (fromNameType) { return fromNameType; } const rawName = unescapeLeadingUnderscores(symbol.escapedName); - return createPropertyNameNodeForIdentifierOrLiteral(rawName, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed); + return createPropertyNameNodeForIdentifierOrLiteral(rawName, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod); } - function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed) { + function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed, isMethod) { const nameType = getSymbolLinks(symbol).nameType; if (nameType) { if (nameType.flags & 384 /* StringOrNumberLiteral */) { @@ -320960,9 +323023,9 @@ ${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)); + return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod); } if (nameType.flags & 8192 /* UniqueESSymbol */) { return factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, 111551 /* Value */)); @@ -320990,7 +323053,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) { @@ -321049,7 +323115,7 @@ ${lanes.join("\n")} } const sym = resolveEntityName( leftmost, - 67108863 /* All */, + -1 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ @@ -321059,18 +323125,18 @@ ${lanes.join("\n")} if (isSymbolAccessible( sym, context.enclosingDeclaration, - 67108863 /* All */, + -1 /* All */, /*shouldComputeAliasesToMakeVisible*/ false ).accessibility !== 0 /* Accessible */) { introducesError = true; } else { - context.tracker.trackSymbol(sym, context.enclosingDeclaration, 67108863 /* All */); + context.tracker.trackSymbol(sym, context.enclosingDeclaration, -1 /* All */); 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 */) }; } @@ -321089,7 +323155,7 @@ ${lanes.join("\n")} } return transformed === existing ? setTextRange(factory.cloneNode(existing), existing) : transformed; function visitExistingNodeTreeSymbols(node) { - if (isJSDocAllType(node) || node.kind === 325 /* JSDocNamepathType */) { + if (isJSDocAllType(node) || node.kind === 326 /* JSDocNamepathType */) { return factory.createKeywordTypeNode(133 /* AnyKeyword */); } if (isJSDocUnknownType(node)) { @@ -321195,7 +323261,7 @@ ${lanes.join("\n")} return factory.updateImportTypeNode( node, factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)), - node.assertions, + node.attributes, node.qualifier, visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode), node.isTypeOf @@ -321211,7 +323277,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); } @@ -321251,15 +323322,16 @@ ${lanes.join("\n")} } } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { + var _a; const serializePropertySymbolForClass = makeSerializePropertySymbol( factory.createPropertyDeclaration, - 173 /* MethodDeclaration */, + 174 /* MethodDeclaration */, /*useAccessors*/ true ); const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol( (mods, name, question, type) => factory.createPropertySignature(mods, name, question, type), - 172 /* MethodSignature */, + 173 /* MethodSignature */, /*useAccessors*/ false ); @@ -321272,12 +323344,15 @@ ${lanes.join("\n")} ...oldcontext, usedSymbolNames: new Set(oldcontext.usedSymbolNames), remappedSymbolNames: /* @__PURE__ */ new Map(), + remappedSymbolReferences: new Map((_a = oldcontext.remappedSymbolReferences) == null ? void 0 : _a.entries()), tracker: void 0 }; const tracker = { ...oldcontext.tracker.inner, trackSymbol: (sym, decl, meaning) => { - var _a; + var _a2, _b; + if ((_a2 = context.remappedSymbolNames) == null ? void 0 : _a2.has(getSymbolId(sym))) + return false; const accessibleResult = isSymbolAccessible( sym, decl, @@ -321288,9 +323363,13 @@ ${lanes.join("\n")} if (accessibleResult.accessibility === 0 /* Accessible */) { const chain = lookupSymbolChainWorker(sym, context, meaning); if (!(sym.flags & 4 /* Property */)) { - includePrivateSymbol(chain[0]); + const root = chain[0]; + const contextFile = getSourceFileOfNode(oldcontext.enclosingDeclaration); + if (some(root.declarations, (d) => getSourceFileOfNode(d) === contextFile)) { + includePrivateSymbol(root); + } } - } else if ((_a = oldcontext.tracker.inner) == null ? void 0 : _a.trackSymbol) { + } else if ((_b = oldcontext.tracker.inner) == null ? void 0 : _b.trackSymbol) { return oldcontext.tracker.inner.trackSymbol(sym, decl, meaning); } return false; @@ -321303,7 +323382,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); } @@ -321323,7 +323402,7 @@ ${lanes.join("\n")} const nsIndex = findIndex(statements, isModuleDeclaration); let ns = nsIndex !== -1 ? statements[nsIndex] : void 0; if (ns && exportAssignment && exportAssignment.isExportEquals && isIdentifier(exportAssignment.expression) && isIdentifier(ns.name) && idText(ns.name) === idText(exportAssignment.expression) && ns.body && isModuleBlock(ns.body)) { - const excessExports = filter(statements, (s) => !!(getEffectiveModifierFlags(s) & 1 /* Export */)); + const excessExports = filter(statements, (s) => !!(getEffectiveModifierFlags(s) & 32 /* Export */)); const name = ns.name; let body = ns.body; if (length(excessExports)) { @@ -321333,30 +323412,33 @@ ${lanes.join("\n")} ns.name, body = factory.updateModuleBlock( body, - factory.createNodeArray([...ns.body.statements, factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports(map(flatMap(excessExports, (e) => getNamesOfDeclaration(e)), (id) => factory.createExportSpecifier( + factory.createNodeArray([ + ...ns.body.statements, + factory.createExportDeclaration( + /*modifiers*/ + void 0, /*isTypeOnly*/ false, - /*propertyName*/ - void 0, - id - ))), - /*moduleSpecifier*/ - void 0 - )]) + factory.createNamedExports(map(flatMap(excessExports, (e) => getNamesOfDeclaration(e)), (id) => factory.createExportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + id + ))), + /*moduleSpecifier*/ + void 0 + ) + ]) ) ); statements = [...statements.slice(0, nsIndex), ns, ...statements.slice(nsIndex + 1)]; } if (!find(statements, (s) => s !== ns && nodeHasName(s, name))) { results = []; - const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s, 1 /* Export */) || isExportAssignment(s) || isExportDeclaration(s)); + const mixinExportFlag = !some(body.statements, (s) => hasSyntacticModifier(s, 32 /* Export */) || isExportAssignment(s) || isExportDeclaration(s)); forEach(body.statements, (s) => { - addResult(s, mixinExportFlag ? 1 /* Export */ : 0 /* None */); + addResult(s, mixinExportFlag ? 32 /* Export */ : 0 /* None */); }); statements = [...filter(statements, (s) => s !== ns && s !== exportAssignment), ...results]; } @@ -321367,15 +323449,18 @@ ${lanes.join("\n")} const exports = filter(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause)); if (length(exports) > 1) { const nonExports = filter(statements, (d) => !isExportDeclaration(d) || !!d.moduleSpecifier || !d.exportClause); - statements = [...nonExports, factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports(flatMap(exports, (e) => cast(e.exportClause, isNamedExports).elements)), - /*moduleSpecifier*/ - void 0 - )]; + statements = [ + ...nonExports, + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports(flatMap(exports, (e) => cast(e.exportClause, isNamedExports).elements)), + /*moduleSpecifier*/ + void 0 + ) + ]; } const reexports = filter(statements, (d) => isExportDeclaration(d) && !!d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause)); if (length(reexports) > 1) { @@ -321384,7 +323469,7 @@ ${lanes.join("\n")} for (const group2 of groups) { if (group2.length > 1) { statements = [ - ...filter(statements, (s) => group2.indexOf(s) === -1), + ...filter(statements, (s) => !group2.includes(s)), factory.createExportDeclaration( /*modifiers*/ void 0, @@ -321401,7 +323486,7 @@ ${lanes.join("\n")} return statements; } function inlineExportModifiers(statements) { - const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.assertClause && !!d.exportClause && isNamedExports(d.exportClause)); + const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause)); if (index >= 0) { const exportDecl = statements[index]; const replacements = mapDefined(exportDecl.exportClause.elements, (e) => { @@ -321429,7 +323514,7 @@ ${lanes.join("\n")} replacements ), exportDecl.moduleSpecifier, - exportDecl.assertClause + exportDecl.attributes ); } } @@ -321445,12 +323530,12 @@ ${lanes.join("\n")} return statements; } function addExportModifier(node) { - const flags = (getEffectiveModifierFlags(node) | 1 /* Export */) & ~2 /* Ambient */; - return factory.updateModifiers(node, flags); + const flags = (getEffectiveModifierFlags(node) | 32 /* Export */) & ~128 /* Ambient */; + return factory.replaceModifiers(node, flags); } function removeExportModifier(node) { - const flags = getEffectiveModifierFlags(node) & ~1 /* Export */; - return factory.updateModifiers(node, flags); + const flags = getEffectiveModifierFlags(node) & ~32 /* Export */; + return factory.replaceModifiers(node, flags); } function visitSymbolTable(symbolTable2, suppressNewPrivateContext, propertyAsAlias) { if (!suppressNewPrivateContext) { @@ -321490,13 +323575,19 @@ ${lanes.join("\n")} if (context.reportedDiagnostic) { oldcontext.reportedDiagnostic = context.reportedDiagnostic; } + if (context.trackedSymbols) { + if (!oldContext.trackedSymbols) + oldContext.trackedSymbols = context.trackedSymbols; + else + Debug.assert(context.trackedSymbols === oldContext.trackedSymbols); + } context = oldContext; } } - function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) { - var _a, _b, _c, _d; - const symbolName2 = unescapeLeadingUnderscores(symbol.escapedName); - const isDefault = symbol.escapedName === "default" /* Default */; + function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) { + var _a2, _b, _c, _d, _e, _f; + const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName); + const isDefault = escapedSymbolName === "default" /* Default */; if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && isStringANonContextualKeyword(symbolName2) && !isDefault) { context.encounteredError = true; return; @@ -321506,8 +323597,8 @@ ${lanes.join("\n")} if (needsPostExportDefault || needsExportDeclaration) { isPrivate = true; } - const modifierFlags = (!isPrivate ? 1 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 1024 /* Default */ : 0); - const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && symbol.escapedName !== "export=" /* ExportEquals */; + const modifierFlags = (!isPrivate ? 32 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 2048 /* Default */ : 0); + const isConstMergedWithNS = symbol.flags & 1536 /* Module */ && symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && escapedSymbolName !== "export=" /* ExportEquals */; const isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol); if (symbol.flags & (16 /* Function */ | 8192 /* Method */) || isConstMergedWithNSPrintableAsSignatureMerge) { serializeAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags); @@ -321515,7 +323606,7 @@ ${lanes.join("\n")} if (symbol.flags & 524288 /* TypeAlias */) { serializeTypeAlias(symbol, symbolName2, modifierFlags); } - if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) { + if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) && escapedSymbolName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) { if (propertyAsAlias) { const createdExport = serializeMaybeAliasAssignment(symbol); if (createdExport) { @@ -321525,17 +323616,24 @@ ${lanes.join("\n")} } else { const type = getTypeOfSymbol(symbol); const localName = getInternalSymbolName(symbol, symbolName2); - if (!(symbol.flags & 16 /* Function */) && isTypeRepresentableAsFunctionNamespaceMerge(type, symbol)) { + if (type.symbol && type.symbol !== symbol && type.symbol.flags & 16 /* Function */ && some(type.symbol.declarations, isFunctionExpressionOrArrowFunction) && (((_a2 = type.symbol.members) == null ? void 0 : _a2.size) || ((_b = type.symbol.exports) == null ? void 0 : _b.size))) { + if (!context.remappedSymbolReferences) { + context.remappedSymbolReferences = /* @__PURE__ */ new Map(); + } + context.remappedSymbolReferences.set(getSymbolId(type.symbol), symbol); + serializeSymbolWorker(type.symbol, isPrivate, propertyAsAlias, escapedSymbolName); + context.remappedSymbolReferences.delete(getSymbolId(type.symbol)); + } else if (!(symbol.flags & 16 /* Function */) && isTypeRepresentableAsFunctionNamespaceMerge(type, symbol)) { serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags); } else { - const flags = !(symbol.flags & 2 /* BlockScopedVariable */) ? ((_a = symbol.parent) == null ? void 0 : _a.valueDeclaration) && isSourceFile((_b = symbol.parent) == null ? void 0 : _b.valueDeclaration) ? 2 /* Const */ : void 0 : isConstVariable(symbol) ? 2 /* Const */ : 1 /* Let */; + const flags = !(symbol.flags & 2 /* BlockScopedVariable */) ? ((_c = symbol.parent) == null ? void 0 : _c.valueDeclaration) && isSourceFile((_d = symbol.parent) == null ? void 0 : _d.valueDeclaration) ? 2 /* Const */ : void 0 : isConstantVariable(symbol) ? 2 /* Const */ : 1 /* Let */; const name = needsPostExportDefault || !(symbol.flags & 4 /* Property */) ? localName : getUnusedName(localName, symbol); let textRange = symbol.declarations && find(symbol.declarations, (d) => isVariableDeclaration(d)); if (textRange && isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) { textRange = textRange.parent.parent; } - const propertyAccessRequire = (_c = symbol.declarations) == null ? void 0 : _c.find(isPropertyAccessExpression); - if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((_d = type.symbol) == null ? void 0 : _d.valueDeclaration) && isSourceFile(type.symbol.valueDeclaration)) { + const propertyAccessRequire = (_e = symbol.declarations) == null ? void 0 : _e.find(isPropertyAccessExpression); + if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((_f = type.symbol) == null ? void 0 : _f.valueDeclaration) && isSourceFile(type.symbol.valueDeclaration)) { const alias = localName === propertyAccessRequire.parent.right.escapedText ? void 0 : propertyAccessRequire.parent.right; addResult( factory.createExportDeclaration( @@ -321554,19 +323652,22 @@ ${lanes.join("\n")} ); context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */); } else { - const statement = setTextRange(factory.createVariableStatement( - /*modifiers*/ - void 0, - factory.createVariableDeclarationList([ - factory.createVariableDeclaration( - name, - /*exclamationToken*/ - void 0, - serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) - ) - ], flags) - ), textRange); - addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); + const statement = setTextRange( + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + name, + /*exclamationToken*/ + void 0, + serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) + ) + ], flags) + ), + textRange + ); + addResult(statement, name !== localName ? modifierFlags & ~32 /* Export */ : modifierFlags); if (name !== localName && !isPrivate) { addResult( factory.createExportDeclaration( @@ -321639,18 +323740,21 @@ ${lanes.join("\n")} factory.createIdentifier(getInternalSymbolName(symbol, symbolName2)) ), 0 /* None */); } else if (needsExportDeclaration) { - addResult(factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports([factory.createExportSpecifier( + addResult( + factory.createExportDeclaration( + /*modifiers*/ + void 0, /*isTypeOnly*/ false, - getInternalSymbolName(symbol, symbolName2), - symbolName2 - )]) - ), 0 /* None */); + factory.createNamedExports([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + getInternalSymbolName(symbol, symbolName2), + symbolName2 + )]) + ), + 0 /* None */ + ); } } function includePrivateSymbol(symbol) { @@ -321658,10 +323762,7 @@ ${lanes.join("\n")} return; Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]); getUnusedName(unescapeLeadingUnderscores(symbol.escapedName), symbol); - const isExternalImportAlias = !!(symbol.flags & 2097152 /* Alias */) && !some( - symbol.declarations, - (d) => !!findAncestor(d, isExportDeclaration) || isNamespaceExport(d) || isImportEqualsDeclaration(d) && !isExternalModuleReference(d.moduleReference) - ); + const isExternalImportAlias = !!(symbol.flags & 2097152 /* Alias */) && !some(symbol.declarations, (d) => !!findAncestor(d, isExportDeclaration) || isNamespaceExport(d) || isImportEqualsDeclaration(d) && !isExternalModuleReference(d.moduleReference)); deferredPrivatesStack[isExternalImportAlias ? 0 : deferredPrivatesStack.length - 1].set(getSymbolId(symbol), symbol); } function isExportingScope(enclosingDeclaration2) { @@ -321671,43 +323772,46 @@ ${lanes.join("\n")} if (canHaveModifiers(node)) { let newModifierFlags = 0 /* None */; const enclosingDeclaration2 = context.enclosingDeclaration && (isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration); - if (additionalModifierFlags & 1 /* Export */ && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) { - newModifierFlags |= 1 /* Export */; + if (additionalModifierFlags & 32 /* Export */ && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) { + newModifierFlags |= 32 /* Export */; } - if (addingDeclare && !(newModifierFlags & 1 /* Export */) && (!enclosingDeclaration2 || !(enclosingDeclaration2.flags & 16777216 /* Ambient */)) && (isEnumDeclaration(node) || isVariableStatement(node) || isFunctionDeclaration(node) || isClassDeclaration(node) || isModuleDeclaration(node))) { - newModifierFlags |= 2 /* Ambient */; + if (addingDeclare && !(newModifierFlags & 32 /* Export */) && (!enclosingDeclaration2 || !(enclosingDeclaration2.flags & 33554432 /* Ambient */)) && (isEnumDeclaration(node) || isVariableStatement(node) || isFunctionDeclaration(node) || isClassDeclaration(node) || isModuleDeclaration(node))) { + newModifierFlags |= 128 /* Ambient */; } - if (additionalModifierFlags & 1024 /* Default */ && (isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionDeclaration(node))) { - newModifierFlags |= 1024 /* Default */; + if (additionalModifierFlags & 2048 /* Default */ && (isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionDeclaration(node))) { + newModifierFlags |= 2048 /* Default */; } if (newModifierFlags) { - node = factory.updateModifiers(node, newModifierFlags | getEffectiveModifierFlags(node)); + node = factory.replaceModifiers(node, newModifierFlags | getEffectiveModifierFlags(node)); } } results.push(node); } function serializeTypeAlias(symbol, symbolName2, modifierFlags) { - var _a; + var _a2; const aliasType = getDeclaredTypeOfTypeAlias(symbol); const typeParams = getSymbolLinks(symbol).typeParameters; const typeParamDecls = map(typeParams, (p) => typeParameterToDeclaration(p, context)); - const jsdocAliasDecl = (_a = symbol.declarations) == null ? void 0 : _a.find(isJSDocTypeAlias); + const jsdocAliasDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isJSDocTypeAlias); const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0); const oldFlags = context.flags; context.flags |= 8388608 /* InTypeAlias */; const oldEnclosingDecl = context.enclosingDeclaration; context.enclosingDeclaration = jsdocAliasDecl; const typeNode = jsdocAliasDecl && jsdocAliasDecl.typeExpression && isJSDocTypeExpression(jsdocAliasDecl.typeExpression) && serializeExistingTypeNode(context, jsdocAliasDecl.typeExpression.type, includePrivateSymbol, bundled) || typeToTypeNodeHelper(aliasType, context); - addResult(setSyntheticLeadingComments( - factory.createTypeAliasDeclaration( - /*modifiers*/ - void 0, - getInternalSymbolName(symbol, symbolName2), - typeParamDecls, - typeNode + addResult( + setSyntheticLeadingComments( + factory.createTypeAliasDeclaration( + /*modifiers*/ + void 0, + getInternalSymbolName(symbol, symbolName2), + typeParamDecls, + typeNode + ), + !commentText ? [] : [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }] ), - !commentText ? [] : [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }] - ), modifierFlags); + modifierFlags + ); context.flags = oldFlags; context.enclosingDeclaration = oldEnclosingDecl; } @@ -321718,25 +323822,38 @@ ${lanes.join("\n")} const baseTypes = getBaseTypes(interfaceType); const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0; const members = flatMap(getPropertiesOfType(interfaceType), (p) => serializePropertySymbolForInterface(p, baseType)); - const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 178 /* CallSignature */); - const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 179 /* ConstructSignature */); + const callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 179 /* CallSignature */); + const constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 180 /* ConstructSignature */); const indexSignatures = serializeIndexSignatures(interfaceType, baseType); const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(96 /* ExtendsKeyword */, mapDefined(baseTypes, (b) => trySerializeAsTypeReference(b, 111551 /* Value */)))]; - addResult(factory.createInterfaceDeclaration( - /*modifiers*/ - void 0, - getInternalSymbolName(symbol, symbolName2), - typeParamDecls, - heritageClauses, - [...indexSignatures, ...constructSignatures, ...callSignatures, ...members] - ), modifierFlags); + addResult( + factory.createInterfaceDeclaration( + /*modifiers*/ + void 0, + getInternalSymbolName(symbol, symbolName2), + typeParamDecls, + heritageClauses, + [...indexSignatures, ...constructSignatures, ...callSignatures, ...members] + ), + modifierFlags + ); } 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) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */)); + return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */)); } function serializeModule(symbol, symbolName2, modifierFlags) { const members = getNamespaceMembersForSerialization(symbol); @@ -321756,12 +323873,12 @@ ${lanes.join("\n")} /*isTypeOnly*/ false, factory.createNamedExports(mapDefined(filter(mergedMembers, (n) => n.escapedName !== "export=" /* ExportEquals */), (s) => { - var _a, _b; + var _a2, _b; const name = unescapeLeadingUnderscores(s.escapedName); const localName2 = getInternalSymbolName(s, name); const aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s); if (containingFile && (aliasDecl ? containingFile !== getSourceFileOfNode(aliasDecl) : !some(s.declarations, (d) => getSourceFileOfNode(d) === containingFile))) { - (_b = (_a = context.tracker) == null ? void 0 : _a.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a, containingFile, symbol, s); + (_b = (_a2 = context.tracker) == null ? void 0 : _a2.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a2, containingFile, symbol, s); return void 0; } const target = aliasDecl && getTargetOfAliasDeclaration( @@ -321779,29 +323896,38 @@ ${lanes.join("\n")} ); })) )]); - addResult(factory.createModuleDeclaration( - /*modifiers*/ - void 0, - factory.createIdentifier(localName), - nsBody, - 16 /* Namespace */ - ), 0 /* None */); + addResult( + factory.createModuleDeclaration( + /*modifiers*/ + void 0, + factory.createIdentifier(localName), + nsBody, + 32 /* Namespace */ + ), + 0 /* None */ + ); } } function serializeEnum(symbol, symbolName2, modifierFlags) { - addResult(factory.createEnumDeclaration( - factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 2048 /* Const */ : 0), - getInternalSymbolName(symbol, symbolName2), - map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => { - const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0; - return factory.createEnumMember(unescapeLeadingUnderscores(p.escapedName), initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue)); - }) - ), modifierFlags); + addResult( + factory.createEnumDeclaration( + factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 4096 /* Const */ : 0), + getInternalSymbolName(symbol, symbolName2), + map(filter(getPropertiesOfType(getTypeOfSymbol(symbol)), (p) => !!(p.flags & 8 /* EnumMember */)), (p) => { + const initializedValue = p.declarations && p.declarations[0] && isEnumMember(p.declarations[0]) ? getConstantValue2(p.declarations[0]) : void 0; + return factory.createEnumMember( + unescapeLeadingUnderscores(p.escapedName), + initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue) + ); + }) + ), + modifierFlags + ); } function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) { const signatures = getSignaturesOfType(type, 0 /* Call */); for (const sig of signatures) { - const decl = signatureToSignatureDeclarationHelper(sig, 261 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); + const decl = signatureToSignatureDeclarationHelper(sig, 262 /* FunctionDeclaration */, context, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); addResult(setTextRange(decl, getSignatureTextRangeLocation(sig)), modifierFlags); } if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) { @@ -321828,20 +323954,14 @@ ${lanes.join("\n")} } function serializeAsNamespaceDeclaration(props, localName, modifierFlags, suppressNewPrivateContext) { if (length(props)) { - const localVsRemoteMap = arrayToMultiMap( - props, - (p) => !length(p.declarations) || some( - p.declarations, - (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration) - ) ? "local" : "remote" - ); + const localVsRemoteMap = arrayToMultiMap(props, (p) => !length(p.declarations) || some(p.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)) ? "local" : "remote"); const localProps = localVsRemoteMap.get("local") || emptyArray; let fakespace = parseNodeFactory.createModuleDeclaration( /*modifiers*/ void 0, factory.createIdentifier(localName), factory.createModuleBlock([]), - 16 /* Namespace */ + 32 /* Namespace */ ); setParent(fakespace, enclosingDeclaration); fakespace.locals = createSymbolTable(props); @@ -321875,7 +323995,7 @@ ${lanes.join("\n")} factory.createIdentifier("default" /* Default */) )]) ) : d); - const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d, 1 /* Export */)) ? map(defaultReplaced, removeExportModifier) : defaultReplaced; + const exportModifierStripped = every(defaultReplaced, (d) => hasSyntacticModifier(d, 32 /* Export */)) ? map(defaultReplaced, removeExportModifier) : defaultReplaced; fakespace = factory.updateModuleDeclaration( fakespace, fakespace.modifiers, @@ -321911,10 +324031,7 @@ ${lanes.join("\n")} } return cleanup(factory.createExpressionWithTypeArguments( expr, - map( - e.typeArguments, - (a) => serializeExistingTypeNode(context, a, includePrivateSymbol, bundled) || typeToTypeNodeHelper(getTypeFromTypeNode(a), context) - ) + map(e.typeArguments, (a) => serializeExistingTypeNode(context, a, includePrivateSymbol, bundled) || typeToTypeNodeHelper(getTypeFromTypeNode(a), context)) )); function cleanup(result2) { context.enclosingDeclaration = oldEnclosing; @@ -321927,8 +324044,8 @@ ${lanes.join("\n")} return void 0; } function serializeAsClass(symbol, localName, modifierFlags) { - var _a, _b; - const originalDecl = (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike); + var _a2, _b; + const originalDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike); const oldEnclosing = context.enclosingDeclaration; context.enclosingDeclaration = originalDecl || oldEnclosing; const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -321981,21 +324098,27 @@ ${lanes.join("\n")} ); const isNonConstructableClassLikeInJsFile = !isClass && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some(getSignaturesOfType(staticType, 1 /* Construct */)); const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration( - factory.createModifiersFromModifierFlags(8 /* Private */), + factory.createModifiersFromModifierFlags(2 /* Private */), [], /*body*/ void 0 - )] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 175 /* Constructor */); + )] : serializeSignatures(1 /* Construct */, staticType, staticBaseType, 176 /* Constructor */); const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); context.enclosingDeclaration = oldEnclosing; - addResult(setTextRange(factory.createClassDeclaration( - /*modifiers*/ - void 0, - localName, - typeParamDecls, - heritageClauses, - [...indexSignatures, ...staticMembers, ...constructors, ...publicProperties, ...privateProperties] - ), symbol.declarations && filter(symbol.declarations, (d) => isClassDeclaration(d) || isClassExpression(d))[0]), modifierFlags); + addResult( + setTextRange( + factory.createClassDeclaration( + /*modifiers*/ + void 0, + localName, + typeParamDecls, + heritageClauses, + [...indexSignatures, ...staticMembers, ...constructors, ...publicProperties, ...privateProperties] + ), + symbol.declarations && filter(symbol.declarations, (d) => isClassDeclaration(d) || isClassExpression(d))[0] + ), + modifierFlags + ); } function getSomeTargetNameFromDeclarations(declarations) { return firstDefined(declarations, (d) => { @@ -322018,7 +324141,7 @@ ${lanes.join("\n")} }); } function serializeAsAlias(symbol, localName, modifierFlags) { - var _a, _b, _c, _d, _e; + var _a2, _b, _c, _d, _e, _f; const node = getDeclarationOfAliasSymbol(symbol); if (!node) return Debug.fail(); @@ -322037,173 +324160,200 @@ ${lanes.join("\n")} const targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); switch (node.kind) { - case 207 /* BindingElement */: - if (((_b = (_a = node.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 259 /* VariableDeclaration */) { + case 208 /* BindingElement */: + if (((_b = (_a2 = node.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 260 /* VariableDeclaration */) { const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context); const { propertyName } = node; - addResult(factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /*isTypeOnly*/ - false, - /*name*/ + addResult( + factory.createImportDeclaration( + /*modifiers*/ void 0, - factory.createNamedImports([factory.createImportSpecifier( + factory.createImportClause( /*isTypeOnly*/ false, - propertyName && isIdentifier(propertyName) ? factory.createIdentifier(idText(propertyName)) : void 0, - factory.createIdentifier(localName) - )]) + /*name*/ + void 0, + factory.createNamedImports([factory.createImportSpecifier( + /*isTypeOnly*/ + false, + propertyName && isIdentifier(propertyName) ? factory.createIdentifier(idText(propertyName)) : void 0, + factory.createIdentifier(localName) + )]) + ), + factory.createStringLiteral(specifier2), + /*attributes*/ + void 0 ), - factory.createStringLiteral(specifier2), - /*assertClause*/ - void 0 - ), 0 /* None */); + 0 /* None */ + ); break; } Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); break; - case 303 /* ShorthandPropertyAssignment */: - if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 225 /* BinaryExpression */) { + case 304 /* ShorthandPropertyAssignment */: + if (((_e = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e.kind) === 226 /* BinaryExpression */) { serializeExportSpecifier( unescapeLeadingUnderscores(symbol.escapedName), targetName ); } break; - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: if (isPropertyAccessExpression(node.initializer)) { const initializer = node.initializer; const uniqueName = factory.createUniqueName(localName); const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context); - addResult(factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - uniqueName, - factory.createExternalModuleReference(factory.createStringLiteral(specifier2)) - ), 0 /* None */); - addResult(factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createIdentifier(localName), - factory.createQualifiedName(uniqueName, initializer.name) - ), modifierFlags); + addResult( + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + uniqueName, + factory.createExternalModuleReference(factory.createStringLiteral(specifier2)) + ), + 0 /* None */ + ); + addResult( + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createIdentifier(localName), + factory.createQualifiedName(uniqueName, initializer.name) + ), + modifierFlags + ); break; } - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, (d) => isSourceFile(d) && isJsonSourceFile(d))) { serializeMaybeAliasAssignment(symbol); break; } const isLocalImport = !(target.flags & 512 /* ValueModule */) && !isVariableDeclaration(node); - addResult(factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createIdentifier(localName), - isLocalImport ? symbolToName( - target, - context, - 67108863 /* All */, - /*expectsIdentifier*/ - false - ) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))) - ), isLocalImport ? modifierFlags : 0 /* None */); + addResult( + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createIdentifier(localName), + isLocalImport ? symbolToName( + target, + context, + -1 /* All */, + /*expectsIdentifier*/ + false + ) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))) + ), + isLocalImport ? modifierFlags : 0 /* None */ + ); break; - case 269 /* NamespaceExportDeclaration */: + case 270 /* NamespaceExportDeclaration */: addResult(factory.createNamespaceExportDeclaration(idText(node.name)), 0 /* None */); break; - case 272 /* ImportClause */: { + case 273 /* ImportClause */: { const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier; - addResult(factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /*isTypeOnly*/ - false, - factory.createIdentifier(localName), - /*namedBindings*/ - void 0 + addResult( + factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + factory.createIdentifier(localName), + /*namedBindings*/ + void 0 + ), + specifier2, + node.parent.attributes ), - specifier2, - node.parent.assertClause - ), 0 /* None */); + 0 /* None */ + ); break; } - case 273 /* NamespaceImport */: { + case 274 /* NamespaceImport */: { const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier; - addResult(factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /*isTypeOnly*/ - false, - /*name*/ + addResult( + factory.createImportDeclaration( + /*modifiers*/ void 0, - factory.createNamespaceImport(factory.createIdentifier(localName)) + factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory.createNamespaceImport(factory.createIdentifier(localName)) + ), + specifier2, + node.parent.attributes ), - specifier2, - node.parent.parent.assertClause - ), 0 /* None */); + 0 /* None */ + ); break; } - case 279 /* NamespaceExport */: - addResult(factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamespaceExport(factory.createIdentifier(localName)), - factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)) - ), 0 /* None */); + case 280 /* NamespaceExport */: + addResult( + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamespaceExport(factory.createIdentifier(localName)), + factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)) + ), + 0 /* None */ + ); break; - case 275 /* ImportSpecifier */: { + case 276 /* ImportSpecifier */: { const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context); const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier; - addResult(factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( - /*isTypeOnly*/ - false, - /*name*/ + addResult( + factory.createImportDeclaration( + /*modifiers*/ void 0, - factory.createNamedImports([ - factory.createImportSpecifier( - /*isTypeOnly*/ - false, - localName !== verbatimTargetName ? factory.createIdentifier(verbatimTargetName) : void 0, - factory.createIdentifier(localName) - ) - ]) + factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory.createNamedImports([ + factory.createImportSpecifier( + /*isTypeOnly*/ + false, + localName !== verbatimTargetName ? factory.createIdentifier(verbatimTargetName) : void 0, + factory.createIdentifier(localName) + ) + ]) + ), + specifier2, + node.parent.parent.parent.attributes ), - specifier2, - node.parent.parent.parent.assertClause - ), 0 /* None */); + 0 /* None */ + ); break; } - case 280 /* ExportSpecifier */: + 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, specifier && isStringLiteralLike(specifier) ? factory.createStringLiteral(specifier.text) : void 0 ); break; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 225 /* BinaryExpression */: - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 226 /* BinaryExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: if (symbol.escapedName === "default" /* Default */ || symbol.escapedName === "export=" /* ExportEquals */) { serializeMaybeAliasAssignment(symbol); } else { @@ -322215,22 +324365,25 @@ ${lanes.join("\n")} } } function serializeExportSpecifier(localName, targetName, specifier) { - addResult(factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports([factory.createExportSpecifier( + addResult( + factory.createExportDeclaration( + /*modifiers*/ + void 0, /*isTypeOnly*/ false, - localName !== targetName ? targetName : void 0, - localName - )]), - specifier - ), 0 /* None */); + factory.createNamedExports([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + localName !== targetName ? targetName : void 0, + localName + )]), + specifier + ), + 0 /* None */ + ); } function serializeMaybeAliasAssignment(symbol) { - var _a; + var _a2; if (symbol.flags & 4194304 /* Prototype */) { return false; } @@ -322249,7 +324402,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*/ @@ -322266,7 +324419,7 @@ ${lanes.join("\n")} /*modifiers*/ void 0, isExportEquals, - symbolToExpression(target, context, 67108863 /* All */) + symbolToExpression(target, context, -1 /* All */) )); } else { if (first2 === expr && first2) { @@ -322275,20 +324428,23 @@ ${lanes.join("\n")} serializeExportSpecifier(name, getInternalSymbolName(target, symbolName(target))); } else { const varName = getUnusedName(name, symbol); - addResult(factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createIdentifier(varName), - symbolToName( - target, - context, - 67108863 /* All */, - /*expectsIdentifier*/ - false - ) - ), 0 /* None */); + addResult( + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createIdentifier(varName), + symbolToName( + target, + context, + -1 /* All */, + /*expectsIdentifier*/ + false + ) + ), + 0 /* None */ + ); serializeExportSpecifier(name, varName); } } @@ -322298,8 +324454,9 @@ ${lanes.join("\n")} const varName = getUnusedName(name, symbol); const typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { - serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 1 /* Export */); + serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 32 /* Export */); } else { + const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */; const statement = factory.createVariableStatement( /*modifiers*/ void 0, @@ -322310,11 +324467,11 @@ ${lanes.join("\n")} void 0, serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled) ) - ], ((_a = context.enclosingDeclaration) == null ? void 0 : _a.kind) === 266 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */) + ], flags) ); addResult( statement, - target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 2 /* Ambient */ : name === varName ? 1 /* Export */ : 0 /* None */ + target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 128 /* Ambient */ : name === varName ? 32 /* Export */ : 0 /* None */ ); } if (isExportAssignmentCompatibleSymbolName) { @@ -322336,79 +324493,114 @@ ${lanes.join("\n")} const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration); return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class !!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK - !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => isIdentifierText(symbolName(p), languageVersion)); + !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => { + if (!isIdentifierText(symbolName(p), languageVersion)) { + return false; + } + if (!(p.flags & 98304 /* Accessor */)) { + return true; + } + return getNonMissingTypeOfSymbol(p) === getWriteTypeOfSymbol(p); + }); } function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) { return function serializePropertySymbol(p, isStatic2, baseType) { - var _a, _b, _c, _d, _e; + var _a2, _b, _c, _d, _e; const modifierFlags = getDeclarationModifierFlagsFromSymbol(p); - const isPrivate = !!(modifierFlags & 8 /* Private */); + const isPrivate = !!(modifierFlags & 2 /* Private */); if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) { return []; } if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) { return []; } - const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0); + const flag = modifierFlags & ~1024 /* Async */ | (isStatic2 ? 256 /* Static */ : 0); const name = getPropertyNameNodeForSymbol(p, context); - const firstPropertyLikeDecl = (_a = p.declarations) == null ? void 0 : _a.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression)); + const firstPropertyLikeDecl = (_a2 = p.declarations) == null ? void 0 : _a2.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression)); if (p.flags & 98304 /* Accessor */ && useAccessors) { const result = []; if (p.flags & 65536 /* SetAccessor */) { - result.push(setTextRange(factory.createSetAccessorDeclaration( - factory.createModifiersFromModifierFlags(flag), - name, - [factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "arg", - /*questionToken*/ - void 0, - isPrivate ? void 0 : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled) - )], - /*body*/ - void 0 - ), ((_b = p.declarations) == null ? void 0 : _b.find(isSetAccessor)) || firstPropertyLikeDecl)); + const setter = p.declarations && forEach(p.declarations, (d) => { + if (d.kind === 178 /* SetAccessor */) { + return d; + } + if (isCallExpression(d) && isBindableObjectDefinePropertyCall(d)) { + return forEach(d.arguments[2].properties, (propDecl) => { + const id = getNameOfDeclaration(propDecl); + if (!!id && isIdentifier(id) && idText(id) === "set") { + return propDecl; + } + }); + } + }); + Debug.assert(!!setter); + const paramSymbol = isFunctionLikeDeclaration(setter) ? getSignatureFromDeclaration(setter).parameters[0] : void 0; + result.push(setTextRange( + factory.createSetAccessorDeclaration( + factory.createModifiersFromModifierFlags(flag), + name, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + paramSymbol ? parameterToParameterDeclarationName(paramSymbol, getEffectiveParameterDeclaration(paramSymbol), context) : "value", + /*questionToken*/ + void 0, + isPrivate ? void 0 : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled) + )], + /*body*/ + void 0 + ), + ((_b = p.declarations) == null ? void 0 : _b.find(isSetAccessor)) || firstPropertyLikeDecl + )); } if (p.flags & 32768 /* GetAccessor */) { - const isPrivate2 = modifierFlags & 8 /* Private */; - result.push(setTextRange(factory.createGetAccessorDeclaration( - factory.createModifiersFromModifierFlags(flag), - name, - [], - isPrivate2 ? void 0 : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), - /*body*/ - void 0 - ), ((_c = p.declarations) == null ? void 0 : _c.find(isGetAccessor)) || firstPropertyLikeDecl)); + const isPrivate2 = modifierFlags & 2 /* Private */; + result.push(setTextRange( + factory.createGetAccessorDeclaration( + factory.createModifiersFromModifierFlags(flag), + name, + [], + isPrivate2 ? void 0 : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), + /*body*/ + void 0 + ), + ((_c = p.declarations) == null ? void 0 : _c.find(isGetAccessor)) || firstPropertyLikeDecl + )); } return result; } else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { - return setTextRange(createProperty2( - factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), - name, - p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, - isPrivate ? void 0 : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), - // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 - // interface members can't have initializers, however class members _can_ - /*initializer*/ - void 0 - ), ((_d = p.declarations) == null ? void 0 : _d.find(or(isPropertyDeclaration, isVariableDeclaration))) || firstPropertyLikeDecl); - } - if (p.flags & (8192 /* Method */ | 16 /* Function */)) { - const type = getTypeOfSymbol(p); - const signatures = getSignaturesOfType(type, 0 /* Call */); - if (flag & 8 /* Private */) { - return setTextRange(createProperty2( - factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), + return setTextRange( + createProperty2( + factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, - /*type*/ - void 0, + isPrivate ? void 0 : serializeTypeForDeclaration(context, getWriteTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), + // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 + // interface members can't have initializers, however class members _can_ /*initializer*/ void 0 - ), ((_e = p.declarations) == null ? void 0 : _e.find(isFunctionLikeDeclaration)) || signatures[0] && signatures[0].declaration || p.declarations && p.declarations[0]); + ), + ((_d = p.declarations) == null ? void 0 : _d.find(or(isPropertyDeclaration, isVariableDeclaration))) || firstPropertyLikeDecl + ); + } + if (p.flags & (8192 /* Method */ | 16 /* Function */)) { + const type = getTypeOfSymbol(p); + const signatures = getSignaturesOfType(type, 0 /* Call */); + if (flag & 2 /* Private */) { + return setTextRange( + createProperty2( + factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 8 /* Readonly */ : 0) | flag), + name, + p.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), + ((_e = p.declarations) == null ? void 0 : _e.find(isFunctionLikeDeclaration)) || signatures[0] && signatures[0].declaration || p.declarations && p.declarations[0] + ); } const results2 = []; for (const sig of signatures) { @@ -322475,17 +324667,20 @@ ${lanes.join("\n")} let privateProtected = 0; for (const s of signatures) { if (s.declaration) { - privateProtected |= getSelectedEffectiveModifierFlags(s.declaration, 8 /* Private */ | 16 /* Protected */); + privateProtected |= getSelectedEffectiveModifierFlags(s.declaration, 2 /* Private */ | 4 /* Protected */); } } if (privateProtected) { - return [setTextRange(factory.createConstructorDeclaration( - factory.createModifiersFromModifierFlags(privateProtected), - /*parameters*/ - [], - /*body*/ - void 0 - ), signatures[0].declaration)]; + return [setTextRange( + factory.createConstructorDeclaration( + factory.createModifiersFromModifierFlags(privateProtected), + /*parameters*/ + [], + /*body*/ + void 0 + ), + signatures[0].declaration + )]; } } const results2 = []; @@ -322567,7 +324762,7 @@ ${lanes.join("\n")} } } function getUnusedName(input, symbol) { - var _a, _b; + var _a2, _b; const id = symbol ? getSymbolId(symbol) : void 0; if (id) { if (context.remappedSymbolNames.has(id)) { @@ -322579,7 +324774,7 @@ ${lanes.join("\n")} } let i = 0; const original = input; - while ((_a = context.usedSymbolNames) == null ? void 0 : _a.has(input)) { + while ((_a2 = context.usedSymbolNames) == null ? void 0 : _a2.has(input)) { i++; input = `${original}_${i}`; } @@ -322665,10 +324860,10 @@ ${lanes.join("\n")} return result || types; } function visibilityToString(flags) { - if (flags === 8 /* Private */) { + if (flags === 2 /* Private */) { return "private"; } - if (flags === 16 /* Protected */) { + if (flags === 4 /* Protected */) { return "protected"; } return "public"; @@ -322683,10 +324878,10 @@ ${lanes.join("\n")} return void 0; } function isTopLevelInExternalModuleAugmentation(node) { - return node && node.parent && node.parent.kind === 267 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent); + return node && node.parent && node.parent.kind === 268 /* ModuleBlock */ && isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 311 /* SourceFile */ || isAmbientModule(location); + return location.kind === 312 /* SourceFile */ || isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { const nameType = getSymbolLinks(symbol).nameType; @@ -322707,6 +324902,10 @@ ${lanes.join("\n")} } } function getNameOfSymbolAsWritten(symbol, context) { + var _a; + if ((_a = context == null ? void 0 : context.remappedSymbolReferences) == null ? void 0 : _a.has(getSymbolId(symbol))) { + symbol = context.remappedSymbolReferences.get(getSymbolId(symbol)); + } if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && // If it's not the first part of an entity name, it must print as `default` (!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default` !symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default` @@ -322734,17 +324933,17 @@ ${lanes.join("\n")} if (!declaration) { declaration = symbol.declarations[0]; } - if (declaration.parent && declaration.parent.kind === 259 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 260 /* VariableDeclaration */) { return declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 230 /* ClassExpression */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 231 /* ClassExpression */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 230 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 231 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } const name = getNameOfSymbolFromNameType(symbol, context); @@ -322761,66 +324960,66 @@ ${lanes.join("\n")} return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 344 /* JSDocCallbackTag */: - case 352 /* JSDocTypedefTag */: - case 346 /* JSDocEnumTag */: + case 345 /* JSDocCallbackTag */: + case 353 /* JSDocTypedefTag */: + case 347 /* JSDocEnumTag */: return !!(node.parent && node.parent.parent && node.parent.parent.parent && isSourceFile(node.parent.parent.parent)); - case 207 /* BindingElement */: + case 208 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: if (isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 266 /* ModuleDeclaration */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 261 /* FunctionDeclaration */: - case 265 /* EnumDeclaration */: - case 270 /* ImportEqualsDeclaration */: + case 267 /* ModuleDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 262 /* FunctionDeclaration */: + case 266 /* EnumDeclaration */: + case 271 /* ImportEqualsDeclaration */: if (isExternalModuleAugmentation(node)) { return true; } const parent2 = getDeclarationContainer(node); - if (!(getCombinedModifierFlags(node) & 1 /* Export */) && !(node.kind !== 270 /* ImportEqualsDeclaration */ && parent2.kind !== 311 /* SourceFile */ && parent2.flags & 16777216 /* Ambient */)) { + if (!(getCombinedModifierFlagsCached(node) & 32 /* Export */) && !(node.kind !== 271 /* ImportEqualsDeclaration */ && parent2.kind !== 312 /* SourceFile */ && parent2.flags & 33554432 /* Ambient */)) { return isGlobalSourceFile(parent2); } return isDeclarationVisible(parent2); - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - if (hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) { + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) { return false; } - case 175 /* Constructor */: - case 179 /* ConstructSignature */: - case 178 /* CallSignature */: - case 180 /* IndexSignature */: - case 168 /* Parameter */: - case 267 /* ModuleBlock */: - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 186 /* TypeLiteral */: - case 182 /* TypeReference */: - case 187 /* ArrayType */: - case 188 /* TupleType */: - case 191 /* UnionType */: - case 192 /* IntersectionType */: - case 195 /* ParenthesizedType */: - case 201 /* NamedTupleMember */: + case 176 /* Constructor */: + case 180 /* ConstructSignature */: + case 179 /* CallSignature */: + case 181 /* IndexSignature */: + case 169 /* Parameter */: + case 268 /* ModuleBlock */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 187 /* TypeLiteral */: + case 183 /* TypeReference */: + case 188 /* ArrayType */: + case 189 /* TupleType */: + case 192 /* UnionType */: + case 193 /* IntersectionType */: + case 196 /* ParenthesizedType */: + case 202 /* NamedTupleMember */: return isDeclarationVisible(node.parent); - case 272 /* ImportClause */: - case 273 /* NamespaceImport */: - case 275 /* ImportSpecifier */: + case 273 /* ImportClause */: + case 274 /* NamespaceImport */: + case 276 /* ImportSpecifier */: return false; - case 167 /* TypeParameter */: - case 311 /* SourceFile */: - case 269 /* NamespaceExportDeclaration */: + case 168 /* TypeParameter */: + case 312 /* SourceFile */: + case 270 /* NamespaceExportDeclaration */: return true; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return false; default: return false; @@ -322829,7 +325028,7 @@ ${lanes.join("\n")} } function collectLinkedAliases(node, setVisibility) { let exportSymbol; - if (node.parent && node.parent.kind === 276 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 277 /* ExportAssignment */) { exportSymbol = resolveName( node, node.escapedText, @@ -322840,7 +325039,7 @@ ${lanes.join("\n")} /*isUse*/ false ); - } else if (node.parent.kind === 280 /* ExportSpecifier */) { + } else if (node.parent.kind === 281 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } let result; @@ -322944,12 +325143,12 @@ ${lanes.join("\n")} function getDeclarationContainer(node) { return findAncestor(getRootDeclaration(node), (node2) => { switch (node2.kind) { - case 259 /* VariableDeclaration */: - case 260 /* VariableDeclarationList */: - case 275 /* ImportSpecifier */: - case 274 /* NamedImports */: - case 273 /* NamespaceImport */: - case 272 /* ImportClause */: + case 260 /* VariableDeclaration */: + case 261 /* VariableDeclarationList */: + case 276 /* ImportSpecifier */: + case 275 /* NamedImports */: + case 274 /* NamespaceImport */: + case 273 /* ImportClause */: return false; default: return true; @@ -322964,9 +325163,16 @@ ${lanes.join("\n")} const prop = getPropertyOfType(type, name); return prop ? getTypeOfSymbol(prop) : void 0; } - function getTypeOfPropertyOrIndexSignature(type, name) { + function getTypeOfPropertyOrIndexSignatureOfType(type, name) { var _a; - return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType; + let propType; + return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality( + propType, + /*isProperty*/ + true, + /*isOptional*/ + true + ); } function isTypeAny(type) { return type && (type.flags & 1 /* Any */) !== 0; @@ -323004,7 +325210,7 @@ ${lanes.join("\n")} const unspreadableToRestKeys = []; for (const prop of getPropertiesOfType(source)) { const literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */); - if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */)) && isSpreadableProperty(prop)) { + if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) && isSpreadableProperty(prop)) { spreadableProperties.push(prop); } else { unspreadableToRestKeys.push(literalTypeFromProperty); @@ -323067,23 +325273,23 @@ ${lanes.join("\n")} function getParentElementAccess(node) { const ancestor = node.parent.parent; switch (ancestor.kind) { - case 207 /* BindingElement */: - case 302 /* PropertyAssignment */: + case 208 /* BindingElement */: + case 303 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return ancestor.initializer; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { const parent2 = node.parent; - if (node.kind === 207 /* BindingElement */ && parent2.kind === 205 /* ObjectBindingPattern */) { + if (node.kind === 208 /* BindingElement */ && parent2.kind === 206 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 302 /* PropertyAssignment */ || node.kind === 303 /* ShorthandPropertyAssignment */) { + if (node.kind === 303 /* PropertyAssignment */ || node.kind === 304 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent2.elements.indexOf(node); @@ -323093,26 +325299,31 @@ ${lanes.join("\n")} return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0; } function getTypeForBindingElement(declaration) { - const checkMode = declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */; + const checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */; const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode); - return parentType && getBindingElementTypeFromParentType(declaration, parentType); + return parentType && getBindingElementTypeFromParentType( + declaration, + parentType, + /*noTupleBoundsCheck*/ + false + ); } - function getBindingElementTypeFromParentType(declaration, parentType) { + function getBindingElementTypeFromParentType(declaration, parentType, noTupleBoundsCheck) { if (isTypeAny(parentType)) { return parentType; } const pattern = declaration.parent; - if (strictNullChecks && declaration.flags & 16777216 /* Ambient */ && isParameterDeclaration(declaration)) { + if (strictNullChecks && declaration.flags & 33554432 /* Ambient */ && isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); - } else if (strictNullChecks && pattern.parent.initializer && !(getTypeFacts(getTypeOfInitializer(pattern.parent.initializer)) & 65536 /* EQUndefined */)) { + } else if (strictNullChecks && pattern.parent.initializer && !hasTypeFacts(getTypeOfInitializer(pattern.parent.initializer), 65536 /* EQUndefined */)) { parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } let type; - if (pattern.kind === 205 /* ObjectBindingPattern */) { + if (pattern.kind === 206 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { - error(declaration, Diagnostics.Rest_types_may_only_be_created_from_object_types); + error2(declaration, Diagnostics.Rest_types_may_only_be_created_from_object_types); return errorType; } const literalMembers = []; @@ -323136,7 +325347,7 @@ ${lanes.join("\n")} type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType); } else if (isArrayLikeType(parentType)) { const indexType = getNumberLiteralType(index); - const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0); + const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0); const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType; type = getFlowTypeOfDestructuring(declaration, declaredType); } else { @@ -323147,7 +325358,7 @@ ${lanes.join("\n")} return type; } if (getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(declaration))) { - return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type; + return strictNullChecks && !hasTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */), 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type; } return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */)); } @@ -323172,13 +325383,13 @@ ${lanes.join("\n")} /*excludeJSDocTypeAssertions*/ true ); - return expr.kind === 208 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 209 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, isProperty = false, isOptional = true) { return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) { - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 248 /* ForInStatement */) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 249 /* ForInStatement */) { const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression( declaration.parent.parent.expression, /*checkMode*/ @@ -323186,7 +325397,7 @@ ${lanes.join("\n")} ))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 249 /* ForOfStatement */) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForOfStatement */) { const forOfStatement = declaration.parent.parent; return checkRightHandSideOfForOf(forOfStatement) || anyType; } @@ -323205,8 +325416,8 @@ ${lanes.join("\n")} if (declaredType) { return addOptionality(declaredType, isProperty, isOptional); } - if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 16777216 /* Ambient */)) { - if (!(getCombinedNodeFlags(declaration) & 2 /* Const */) && (!declaration.initializer || isNullOrUndefined3(declaration.initializer))) { + if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) & 32 /* Export */) && !(declaration.flags & 33554432 /* Ambient */)) { + if (!(getCombinedNodeFlagsCached(declaration) & 6 /* Constant */) && (!declaration.initializer || isNullOrUndefined3(declaration.initializer))) { return autoType; } if (declaration.initializer && isEmptyArrayLiteral2(declaration.initializer)) { @@ -323215,8 +325426,8 @@ ${lanes.join("\n")} } if (isParameter(declaration)) { const func = declaration.parent; - if (func.kind === 177 /* SetAccessor */ && hasBindableName(func)) { - const getter = getDeclarationOfKind(getSymbolOfDeclaration(declaration.parent), 176 /* GetAccessor */); + if (func.kind === 178 /* SetAccessor */ && hasBindableName(func)) { + const getter = getDeclarationOfKind(getSymbolOfDeclaration(declaration.parent), 177 /* GetAccessor */); if (getter) { const getterSignature = getSignatureFromDeclaration(getter); const thisParameter = getAccessorThisParameter(func); @@ -323253,7 +325464,7 @@ ${lanes.join("\n")} if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) { if (!hasStaticModifier(declaration)) { const constructor = findConstructorDeclaration(declaration.parent); - const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) & 2 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; + const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; return type && addOptionality( type, /*isProperty*/ @@ -323262,7 +325473,7 @@ ${lanes.join("\n")} ); } else { const staticBlocks = filter(declaration.parent.members, isClassStaticBlockDeclaration); - const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) & 2 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; + const type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) & 128 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; return type && addOptionality( type, /*isProperty*/ @@ -323290,7 +325501,7 @@ ${lanes.join("\n")} const links = getSymbolLinks(symbol); if (links.isConstructorDeclaredProperty === void 0) { links.isConstructorDeclaredProperty = false; - links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 211 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration( + links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 212 /* ElementAccessExpression */ || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration( /*declaredType*/ void 0, declaration, @@ -323318,7 +325529,7 @@ ${lanes.join("\n")} /*includeClassComputedPropertyName*/ false ); - if (container && (container.kind === 175 /* Constructor */ || isJSConstructor(container))) { + if (container && (container.kind === 176 /* Constructor */ || isJSConstructor(container))) { return container; } } @@ -323345,7 +325556,7 @@ ${lanes.join("\n")} reference.flowNode = staticBlock.returnFlowNode; const flowType = getFlowTypeOfProperty(reference, symbol); if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) { - error(symbol.valueDeclaration, Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); + error2(symbol.valueDeclaration, Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); } if (everyType(flowType, isNullableType)) { continue; @@ -323361,12 +325572,12 @@ ${lanes.join("\n")} reference.flowNode = constructor.returnFlowNode; const flowType = getFlowTypeOfProperty(reference, symbol); if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) { - error(symbol.valueDeclaration, Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); + error2(symbol.valueDeclaration, Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); } return everyType(flowType, isNullableType) ? void 0 : convertAutoToAny(flowType); } function getFlowTypeOfProperty(reference, prop) { - const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) & 2 /* Ambient */) && getTypeOfPropertyInBaseClass(prop) || undefinedType; + const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) & 128 /* Ambient */) && getTypeOfPropertyInBaseClass(prop) || undefinedType; return getFlowTypeOfReference(reference, autoType, initialType); } function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) { @@ -323433,7 +325644,7 @@ ${lanes.join("\n")} false, definedInMethod && !definedInConstructor )); - if (symbol.valueDeclaration && filterType(widened, (t) => !!(t.flags & ~98304 /* Nullable */)) === neverType) { + if (symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && filterType(widened, (t) => !!(t.flags & ~98304 /* Nullable */)) === neverType) { reportImplicitAny(symbol.valueDeclaration, anyType); return anyType; } @@ -323478,11 +325689,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); + } } } } @@ -323536,11 +325750,11 @@ ${lanes.join("\n")} const unescapedName = unescapeLeadingUnderscores(s.escapedName); const exportedMemberName = ((_a = tryCast(exportedMember.valueDeclaration, isNamedDeclaration)) == null ? void 0 : _a.name) || exportedMember.valueDeclaration; addRelatedInfo( - error(s.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName), + error2(s.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName), createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here, unescapedName) ); addRelatedInfo( - error(exportedMemberName, Diagnostics.Duplicate_identifier_0, unescapedName), + error2(exportedMemberName, Diagnostics.Duplicate_identifier_0, unescapedName), createDiagnosticForNode(s.valueDeclaration, Diagnostics._0_was_also_declared_here, unescapedName) ); } @@ -323598,7 +325812,7 @@ ${lanes.join("\n")} /*includeClassComputedPropertyName*/ false ); - return thisContainer.kind === 175 /* Constructor */ || thisContainer.kind === 261 /* FunctionDeclaration */ || thisContainer.kind === 217 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent); + return thisContainer.kind === 176 /* Constructor */ || thisContainer.kind === 262 /* FunctionDeclaration */ || thisContainer.kind === 218 /* FunctionExpression */ && !isPrototypePropertyAssignment(thisContainer.parent); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { Debug.assert(types.length === declarations.length); @@ -323617,7 +325831,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); @@ -323672,7 +325886,7 @@ ${lanes.join("\n")} function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2) { const elements = pattern.elements; const lastElement = lastOrUndefined(elements); - const restElement = lastElement && lastElement.kind === 207 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0; + const restElement = lastElement && lastElement.kind === 208 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : void 0; if (elements.length === 0 || elements.length === 1 && restElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -323688,7 +325902,7 @@ ${lanes.join("\n")} return result; } function getTypeFromBindingPattern(pattern, includePatternInType = false, reportErrors2 = false) { - return pattern.kind === 205 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2); + return pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors2); } function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors2) { return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration( @@ -323698,6 +325912,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( @@ -323729,7 +325961,7 @@ ${lanes.join("\n")} } function declarationBelongsToPrivateAmbientMember(declaration) { const root = getRootDeclaration(declaration); - const memberDeclaration = root.kind === 168 /* Parameter */ ? root.parent : root; + const memberDeclaration = root.kind === 169 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(node) { @@ -323751,18 +325983,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); } @@ -323800,10 +326032,13 @@ ${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; - if (declaration.kind === 276 /* ExportAssignment */) { + if (declaration.kind === 277 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration); } else if (isBinaryExpression(declaration) || isInJSFile(declaration) && (isCallExpression(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression(declaration.parent))) { type = getWidenedTypeForAssignmentDeclaration(symbol); @@ -323837,6 +326072,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; @@ -323844,13 +326082,13 @@ ${lanes.join("\n")} function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { switch (accessor.kind) { - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor); return setterTypeAnnotation; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: Debug.assert(hasAccessorModifier(accessor)); const accessorTypeAnnotation = getEffectiveTypeAnnotationNode(accessor); return accessorTypeAnnotation; @@ -323875,9 +326113,9 @@ ${lanes.join("\n")} if (!pushTypeResolution(symbol, 0 /* Type */)) { return errorType; } - const getter = getDeclarationOfKind(symbol, 176 /* GetAccessor */); - const setter = getDeclarationOfKind(symbol, 177 /* SetAccessor */); - const accessor = tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); + const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */); + const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */); + const accessor = tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); let type = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration( accessor, /*reportErrors*/ @@ -323895,13 +326133,13 @@ ${lanes.join("\n")} } if (!popTypeResolution()) { if (getAnnotatedAccessorTypeNode(getter)) { - error(getter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + error2(getter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); } else if (getAnnotatedAccessorTypeNode(setter)) { - error(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); } else if (getAnnotatedAccessorTypeNode(accessor)) { - error(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); } else if (getter && noImplicitAny) { - error(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); + error2(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } type = anyType; } @@ -323915,11 +326153,11 @@ ${lanes.join("\n")} if (!pushTypeResolution(symbol, 8 /* WriteType */)) { return errorType; } - const setter = getDeclarationOfKind(symbol, 177 /* SetAccessor */) ?? tryCast(getDeclarationOfKind(symbol, 171 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); + const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */) ?? tryCast(getDeclarationOfKind(symbol, 172 /* PropertyDeclaration */), isAutoAccessorPropertyDeclaration); let writeType = getAnnotatedAccessorType(setter); if (!popTypeResolution()) { if (getAnnotatedAccessorTypeNode(setter)) { - error(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); } writeType = anyType; } @@ -323955,7 +326193,7 @@ ${lanes.join("\n")} const declaration = symbol.valueDeclaration; if (symbol.flags & 1536 /* Module */ && isShorthandAmbientModuleSymbol(symbol)) { return anyType; - } else if (declaration && (declaration.kind === 225 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 225 /* BinaryExpression */)) { + } else if (declaration && (declaration.kind === 226 /* BinaryExpression */ || isAccessExpression(declaration) && declaration.parent.kind === 226 /* BinaryExpression */)) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) { const resolvedModule = resolveExternalModuleSymbol(symbol); @@ -323990,6 +326228,9 @@ ${lanes.join("\n")} function getTypeOfAlias(symbol) { const links = getSymbolLinks(symbol); if (!links.type) { + if (!pushTypeResolution(symbol, 0 /* Type */)) { + return errorType; + } const targetSymbol = resolveAlias(symbol); const exportSymbol = symbol.declarations && getTargetOfAliasDeclaration( getDeclarationOfAliasSymbol(symbol), @@ -323997,7 +326238,11 @@ ${lanes.join("\n")} true ); const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0); - links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getAllSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType; + links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType; + if (!popTypeResolution()) { + reportCircularityError(exportSymbol ?? symbol); + return links.type = errorType; + } } return links.type; } @@ -324011,20 +326256,19 @@ ${lanes.join("\n")} } function reportCircularityError(symbol) { const declaration = symbol.valueDeclaration; - if (getEffectiveTypeAnnotationNode(declaration)) { - error( - symbol.valueDeclaration, - Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, - symbolToString(symbol) - ); - return errorType; - } - if (noImplicitAny && (declaration.kind !== 168 /* Parameter */ || declaration.initializer)) { - error( - symbol.valueDeclaration, - Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, - symbolToString(symbol) - ); + if (declaration) { + if (getEffectiveTypeAnnotationNode(declaration)) { + error2(symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); + return errorType; + } + if (noImplicitAny && (declaration.kind !== 169 /* Parameter */ || declaration.initializer)) { + error2(symbol.valueDeclaration, Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); + } + } else if (symbol.flags & 2097152 /* Alias */) { + const node = getDeclarationOfAliasSymbol(symbol); + if (node) { + error2(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); + } } return anyType; } @@ -324052,14 +326296,14 @@ ${lanes.join("\n")} return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : ( // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty symbol.links.writeType || symbol.links.type - ) : getTypeOfSymbol(symbol); + ) : removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */)); } if (symbol.flags & 98304 /* Accessor */) { return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol); } return getTypeOfSymbol(symbol); } - function getTypeOfSymbol(symbol) { + function getTypeOfSymbol(symbol, checkMode) { const checkFlags = getCheckFlags(symbol); if (checkFlags & 65536 /* DeferredType */) { return getTypeOfSymbolWithDeferredType(symbol); @@ -324074,7 +326318,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); @@ -324133,43 +326377,43 @@ ${lanes.join("\n")} return void 0; } switch (node.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 172 /* MethodSignature */: - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 323 /* JSDocFunctionType */: - case 261 /* FunctionDeclaration */: - case 173 /* MethodDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 264 /* TypeAliasDeclaration */: - case 351 /* JSDocTemplateTag */: - case 352 /* JSDocTypedefTag */: - case 346 /* JSDocEnumTag */: - case 344 /* JSDocCallbackTag */: - case 199 /* MappedType */: - case 193 /* ConditionalType */: { + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 173 /* MethodSignature */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 324 /* JSDocFunctionType */: + case 262 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 265 /* TypeAliasDeclaration */: + case 352 /* JSDocTemplateTag */: + case 353 /* JSDocTypedefTag */: + case 347 /* JSDocEnumTag */: + case 345 /* JSDocCallbackTag */: + case 200 /* MappedType */: + case 194 /* ConditionalType */: { const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 199 /* MappedType */) { + if (node.kind === 200 /* MappedType */) { return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))); - } else if (node.kind === 193 /* ConditionalType */) { + } else if (node.kind === 194 /* ConditionalType */) { return concatenate(outerTypeParameters, getInferTypeParameters(node)); } const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node)); - const thisType = includeThisTypes && (node.kind === 262 /* ClassDeclaration */ || node.kind === 230 /* ClassExpression */ || node.kind === 263 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node)).thisType; + const thisType = includeThisTypes && (node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */ || node.kind === 264 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node)).thisType; return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } - case 347 /* JSDocParameterTag */: + case 348 /* JSDocParameterTag */: const paramSymbol = getParameterSymbolFromJSDoc(node); if (paramSymbol) { node = paramSymbol.valueDeclaration; } break; - case 326 /* JSDoc */: { + case 327 /* JSDoc */: { const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); return node.tags ? appendTypeParameters(outerTypeParameters, flatMap(node.tags, (t) => isJSDocTemplateTag(t) ? t.typeParameters : void 0)) : outerTypeParameters; } @@ -324179,14 +326423,14 @@ ${lanes.join("\n")} function getOuterTypeParametersOfClassOrInterface(symbol) { var _a; const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a = symbol.declarations) == null ? void 0 : _a.find((decl) => { - if (decl.kind === 263 /* InterfaceDeclaration */) { + if (decl.kind === 264 /* InterfaceDeclaration */) { return true; } - if (decl.kind !== 259 /* VariableDeclaration */) { + if (decl.kind !== 260 /* VariableDeclaration */) { return false; } const initializer = decl.initializer; - return !!initializer && (initializer.kind === 217 /* FunctionExpression */ || initializer.kind === 218 /* ArrowFunction */); + return !!initializer && (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 219 /* ArrowFunction */); }); Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); @@ -324197,7 +326441,7 @@ ${lanes.join("\n")} } let result; for (const node of symbol.declarations) { - if (node.kind === 263 /* InterfaceDeclaration */ || node.kind === 262 /* ClassDeclaration */ || node.kind === 230 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) { + if (node.kind === 264 /* InterfaceDeclaration */ || node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */ || isJSConstructor(node) || isTypeAlias(node)) { const declaration = node; result = appendTypeParameters(result, getEffectiveTypeParameterDeclarations(declaration)); } @@ -324235,10 +326479,7 @@ ${lanes.join("\n")} function getConstructorsForTypeArguments(type, typeArgumentNodes, location) { const typeArgCount = length(typeArgumentNodes); const isJavascript = isInJSFile(location); - return filter( - getSignaturesOfType(type, 1 /* Construct */), - (sig) => (isJavascript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= length(sig.typeParameters) - ); + return filter(getSignaturesOfType(type, 1 /* Construct */), (sig) => (isJavascript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= length(sig.typeParameters)); } function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) { const signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location); @@ -324265,11 +326506,11 @@ ${lanes.join("\n")} resolveStructuredTypeMembers(baseConstructorType); } if (!popTypeResolution()) { - error(type.symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol)); + error2(type.symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol)); return type.resolvedBaseConstructorType = errorType; } if (!(baseConstructorType.flags & 1 /* Any */) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { - const err = error(baseTypeNode.expression, Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); + const err = error2(baseTypeNode.expression, Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); if (baseConstructorType.flags & 262144 /* TypeParameter */) { const constraint = getConstraintFromTypeParameter(baseConstructorType); let ctorReturn = unknownType; @@ -324311,7 +326552,7 @@ ${lanes.join("\n")} return resolvedImplementsTypes; } function reportCircularBaseType(node, type) { - error(node, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString( + error2(node, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString( type, /*enclosingDeclaration*/ void 0, @@ -324335,7 +326576,7 @@ ${lanes.join("\n")} } if (!popTypeResolution() && type.symbol.declarations) { for (const declaration of type.symbol.declarations) { - if (declaration.kind === 262 /* ClassDeclaration */ || declaration.kind === 263 /* InterfaceDeclaration */) { + if (declaration.kind === 263 /* ClassDeclaration */ || declaration.kind === 264 /* InterfaceDeclaration */) { reportCircularBaseType(declaration, type); } } @@ -324365,7 +326606,7 @@ ${lanes.join("\n")} } else { const constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { - error(baseTypeNode.expression, Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); + error2(baseTypeNode.expression, Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); return type.resolvedBaseTypes = emptyArray; } baseType = getReturnTypeOfSignature(constructors[0]); @@ -324385,16 +326626,12 @@ ${lanes.join("\n")} return type.resolvedBaseTypes = emptyArray; } if (type === reducedBaseType || hasBaseType(reducedBaseType, type)) { - error( - type.symbol.valueDeclaration, - Diagnostics.Type_0_recursively_references_itself_as_a_base_type, - typeToString( - type, - /*enclosingDeclaration*/ - void 0, - 2 /* WriteArrayAsGenericType */ - ) - ); + error2(type.symbol.valueDeclaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString( + type, + /*enclosingDeclaration*/ + void 0, + 2 /* WriteArrayAsGenericType */ + )); return type.resolvedBaseTypes = emptyArray; } if (type.resolvedBaseTypes === resolvingEmptyArray) { @@ -324424,7 +326661,7 @@ ${lanes.join("\n")} type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray; if (type.symbol.declarations) { for (const declaration of type.symbol.declarations) { - if (declaration.kind === 263 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 264 /* InterfaceDeclaration */ && getInterfaceBaseTypeNodes(declaration)) { for (const node of getInterfaceBaseTypeNodes(declaration)) { const baseType = getReducedType(getTypeFromTypeNode(node)); if (!isErrorType(baseType)) { @@ -324439,7 +326676,7 @@ ${lanes.join("\n")} reportCircularBaseType(declaration, type); } } else { - error(node, Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); + error2(node, Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -324452,8 +326689,8 @@ ${lanes.join("\n")} return true; } for (const declaration of symbol.declarations) { - if (declaration.kind === 263 /* InterfaceDeclaration */) { - if (declaration.flags & 128 /* ContainsThis */) { + if (declaration.kind === 264 /* InterfaceDeclaration */) { + if (declaration.flags & 256 /* ContainsThis */) { return false; } const baseTypeNodes = getInterfaceBaseTypeNodes(declaration); @@ -324524,10 +326761,10 @@ ${lanes.join("\n")} } } else { type = errorType; - if (declaration.kind === 346 /* JSDocEnumTag */) { - error(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + if (declaration.kind === 347 /* JSDocEnumTag */) { + error2(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } else { - error(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + error2(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } } links.declaredType = type; @@ -324543,12 +326780,14 @@ ${lanes.join("\n")} const memberTypeList = []; if (symbol.declarations) { for (const declaration of symbol.declarations) { - if (declaration.kind === 265 /* EnumDeclaration */) { + if (declaration.kind === 266 /* EnumDeclaration */) { for (const member of declaration.members) { if (hasBindableName(member)) { const memberSymbol = getSymbolOfDeclaration(member); const value = getEnumMemberValue(member); - const memberType = getFreshTypeOfLiteralType(value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol)); + const memberType = getFreshTypeOfLiteralType( + value !== void 0 ? getEnumLiteralType(value, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol) + ); getSymbolLinks(memberSymbol).declaredType = memberType; memberTypeList.push(getRegularTypeOfLiteralType(memberType)); } @@ -324628,18 +326867,18 @@ ${lanes.join("\n")} case 159 /* UnknownKeyword */: case 154 /* StringKeyword */: case 150 /* NumberKeyword */: - case 162 /* BigIntKeyword */: + case 163 /* BigIntKeyword */: case 136 /* BooleanKeyword */: case 155 /* SymbolKeyword */: case 151 /* ObjectKeyword */: case 116 /* VoidKeyword */: case 157 /* UndefinedKeyword */: case 146 /* NeverKeyword */: - case 200 /* LiteralType */: + case 201 /* LiteralType */: return true; - case 187 /* ArrayType */: + case 188 /* ArrayType */: return isThislessType(node.elementType); - case 182 /* TypeReference */: + case 183 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -324655,21 +326894,21 @@ ${lanes.join("\n")} function isThislessFunctionLikeDeclaration(node) { const returnType = getEffectiveReturnTypeNode(node); const typeParameters = getEffectiveTypeParameterDeclarations(node); - return (node.kind === 175 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); + return (node.kind === 176 /* Constructor */ || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } function isThisless(symbol) { if (symbol.declarations && symbol.declarations.length === 1) { const declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -324712,9 +326951,6 @@ ${lanes.join("\n")} } return type; } - function isTypeUsableAsPropertyName(type) { - return !!(type.flags & 8576 /* StringOrNumberLiteralOrUnique */); - } function isLateBindableName(node) { if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) { return false; @@ -324735,15 +326971,6 @@ ${lanes.join("\n")} function isNonBindableDynamicName(node) { return isDynamicName(node) && !isLateBindableName(node); } - function getPropertyNameFromType(type) { - if (type.flags & 8192 /* UniqueESSymbol */) { - return type.escapedName; - } - if (type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) { - return escapeLeadingUnderscores("" + type.value); - } - return Debug.fail(); - } function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) { Debug.assert(!!(getCheckFlags(symbol) & 4096 /* Late */), "Expected a late-bound symbol."); symbol.flags |= symbolFlags; @@ -324773,11 +327000,11 @@ ${lanes.join("\n")} if (!lateSymbol) lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */)); const earlySymbol = earlySymbols && earlySymbols.get(memberName); - if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) { + if (!(parent2.flags & 32 /* Class */) && (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol)) { const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations; const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName); - forEach(declarations, (declaration) => error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name)); - error(declName || decl, Diagnostics.Duplicate_property_0, name); + forEach(declarations, (declaration) => error2(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name)); + error2(declName || decl, Diagnostics.Duplicate_property_0, name); lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */); } lateSymbol.links.nameType = type; @@ -324811,7 +327038,7 @@ ${lanes.join("\n")} } } } - const assignments = symbol.assignmentDeclarationMembers; + const assignments = getFunctionExpressionParentSymbolOrSymbol(symbol).assignmentDeclarationMembers; if (assignments) { const decls = arrayFrom(assignments.values()); for (const member of decls) { @@ -324824,7 +327051,28 @@ ${lanes.join("\n")} } } } - links[resolutionKind] = combineSymbolTables(earlySymbols, lateSymbols) || emptySymbols; + let resolved = combineSymbolTables(earlySymbols, lateSymbols); + if (symbol.flags & 33554432 /* Transient */ && links.cjsExportMerged && symbol.declarations) { + for (const decl of symbol.declarations) { + const original = getSymbolLinks(decl.symbol)[resolutionKind]; + if (!resolved) { + resolved = original; + continue; + } + if (!original) + continue; + original.forEach((s, name) => { + const existing = resolved.get(name); + if (!existing) + resolved.set(name, s); + else if (existing === s) + return; + else + resolved.set(name, mergeSymbol(existing, s)); + }); + } + } + links[resolutionKind] = resolved || emptySymbols; } return links[resolutionKind]; } @@ -324883,7 +327131,12 @@ ${lanes.join("\n")} const baseTypes = getBaseTypes(source); if (baseTypes.length) { if (source.symbol && members === getMembersOfSymbol(source.symbol)) { - members = createSymbolTable(source.declaredProperties); + const symbolTable = createSymbolTable(source.declaredProperties); + const sourceIndex = getIndexSymbol(source.symbol); + if (sourceIndex) { + symbolTable.set("__index" /* Index */, sourceIndex); + } + members = symbolTable; } setStructuredTypeMembers(type, members, callSignatures, constructSignatures, indexInfos); const thisArgument = lastOrUndefined(typeArguments); @@ -324914,7 +327167,7 @@ ${lanes.join("\n")} resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments); } function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) { - const sig = new Signature15(checker, flags); + const sig = new Signature14(checker, flags); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; @@ -324940,7 +327193,7 @@ ${lanes.join("\n")} /*resolvedTypePredicate*/ void 0, sig.minArgumentCount, - sig.flags & 39 /* PropagatingFlags */ + sig.flags & 167 /* PropagatingFlags */ ); result.target = sig.target; result.mapper = sig.mapper; @@ -324967,10 +327220,7 @@ ${lanes.join("\n")} return signature.optionalCallSignatureCache[key] || (signature.optionalCallSignatureCache[key] = createOptionalCallSignature(signature, callChainFlags)); } function createOptionalCallSignature(signature, callChainFlags) { - Debug.assert( - callChainFlags === 8 /* IsInnerCallChain */ || callChainFlags === 16 /* IsOuterCallChain */, - "An optional call signature can either be for an inner call chain or an outer call chain, but not both." - ); + Debug.assert(callChainFlags === 8 /* IsInnerCallChain */ || callChainFlags === 16 /* IsOuterCallChain */, "An optional call signature can either be for an inner call chain or an outer call chain, but not both."); const result = cloneSignature(signature); result.flags |= callChainFlags; return result; @@ -324978,17 +327228,18 @@ ${lanes.join("\n")} function getExpandedParameters(sig, skipUnionExpanding) { if (signatureHasRestParameter(sig)) { const restIndex = sig.parameters.length - 1; + const restName = sig.parameters[restIndex].escapedName; const restType = getTypeOfSymbol(sig.parameters[restIndex]); if (isTupleType(restType)) { - return [expandSignatureParametersWithTupleMembers(restType, restIndex)]; + return [expandSignatureParametersWithTupleMembers(restType, restIndex, restName)]; } else if (!skipUnionExpanding && restType.flags & 1048576 /* Union */ && every(restType.types, isTupleType)) { - return map(restType.types, (t) => expandSignatureParametersWithTupleMembers(t, restIndex)); + return map(restType.types, (t) => expandSignatureParametersWithTupleMembers(t, restIndex, restName)); } } return [sig.parameters]; - function expandSignatureParametersWithTupleMembers(restType, restIndex) { - const elementTypes = getElementTypes(restType); - const associatedNames = getUniqAssociatedNamesFromTupleType(restType); + function expandSignatureParametersWithTupleMembers(restType, restIndex, restName) { + const elementTypes = getTypeArguments(restType); + const associatedNames = getUniqAssociatedNamesFromTupleType(restType, restName); const restParams = map(elementTypes, (t, i) => { const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType); const flags = restType.target.elementFlags[i]; @@ -324999,10 +327250,10 @@ ${lanes.join("\n")} }); return concatenate(sig.parameters.slice(0, restIndex), restParams); } - function getUniqAssociatedNamesFromTupleType(type) { + function getUniqAssociatedNamesFromTupleType(type, restName) { const associatedNamesMap = /* @__PURE__ */ new Map(); - return map(type.target.labeledElementDeclarations, (labeledElement) => { - const name = getTupleElementLabel(labeledElement); + return map(type.target.labeledElementDeclarations, (labeledElement, i) => { + const name = getTupleElementLabel(labeledElement, i, restName); const prevCounter = associatedNamesMap.get(name); if (prevCounter === void 0) { associatedNamesMap.set(name, 1); @@ -325018,7 +327269,7 @@ ${lanes.join("\n")} const baseConstructorType = getBaseConstructorTypeOfClass(classType); const baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */); const declaration = getClassLikeDeclarationOfSymbol(classType.symbol); - const isAbstract = !!declaration && hasSyntacticModifier(declaration, 256 /* Abstract */); + const isAbstract = !!declaration && hasSyntacticModifier(declaration, 64 /* Abstract */); if (baseSignatures.length === 0) { return [createSignature( /*declaration*/ @@ -325083,6 +327334,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*/ @@ -325205,13 +327465,14 @@ ${lanes.join("\n")} const paramName = leftName === rightName ? leftName : !leftName ? rightName : !rightName ? leftName : void 0; const paramSymbol = createSymbol( 1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), - paramName || `arg${i}` + paramName || `arg${i}`, + isRestParam ? 32768 /* RestParameter */ : isOptional ? 16384 /* OptionalParameter */ : 0 ); paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType; params[i] = paramSymbol; } if (needsExtraRestElement) { - const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args"); + const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args", 32768 /* RestParameter */); restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount)); if (shorter === right) { restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper); @@ -325240,12 +327501,14 @@ ${lanes.join("\n")} /*resolvedTypePredicate*/ void 0, minArgCount, - (left.flags | right.flags) & 39 /* PropagatingFlags */ + (left.flags | right.flags) & 167 /* PropagatingFlags */ ); result.compositeKind = 1048576 /* Union */; 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; } @@ -325256,11 +327519,7 @@ ${lanes.join("\n")} for (const info of sourceInfos) { const indexType = info.keyType; if (every(types, (t) => !!getIndexInfoOfType(t, indexType))) { - result.push(createIndexInfo( - indexType, - getUnionType(map(types, (t) => getIndexTypeOfType(t, indexType))), - some(types, (t) => getIndexInfoOfType(t, indexType).isReadonly) - )); + result.push(createIndexInfo(indexType, getUnionType(map(types, (t) => getIndexTypeOfType(t, indexType))), some(types, (t) => getIndexInfoOfType(t, indexType).isReadonly))); } } return result; @@ -325352,11 +327611,7 @@ ${lanes.join("\n")} for (let i = 0; i < indexInfos.length; i++) { const info = indexInfos[i]; if (info.keyType === newInfo.keyType) { - indexInfos[i] = createIndexInfo( - info.keyType, - union ? getUnionType([info.type, newInfo.type]) : getIntersectionType([info.type, newInfo.type]), - union ? info.isReadonly || newInfo.isReadonly : info.isReadonly && newInfo.isReadonly - ); + indexInfos[i] = createIndexInfo(info.keyType, union ? getUnionType([info.type, newInfo.type]) : getIntersectionType([info.type, newInfo.type]), union ? info.isReadonly || newInfo.isReadonly : info.isReadonly && newInfo.isReadonly); return indexInfos; } } @@ -325388,20 +327643,17 @@ ${lanes.join("\n")} setStructuredTypeMembers(type, members2, callSignatures, constructSignatures, indexInfos2); return; } - let members = emptySymbols; + let members = getExportsOfSymbol(symbol); let indexInfos; - if (symbol.exports) { - members = getExportsOfSymbol(symbol); - if (symbol === globalThisSymbol) { - const varsOnly = /* @__PURE__ */ new Map(); - members.forEach((p) => { - var _a; - if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((_a = p.declarations) == null ? void 0 : _a.length) && every(p.declarations, isAmbientModule))) { - varsOnly.set(p.escapedName, p); - } - }); - members = varsOnly; - } + if (symbol === globalThisSymbol) { + const varsOnly = /* @__PURE__ */ new Map(); + members.forEach((p) => { + var _a; + if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((_a = p.declarations) == null ? void 0 : _a.length) && every(p.declarations, isAmbientModule))) { + varsOnly.set(p.escapedName, p); + } + }); + members = varsOnly; } let baseConstructorIndexInfo; setStructuredTypeMembers(type, members, emptyArray, emptyArray, emptyArray); @@ -325439,20 +327691,23 @@ ${lanes.join("\n")} const classType = getDeclaredTypeOfClassOrInterface(symbol); let constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get("__constructor" /* Constructor */)) : emptyArray; if (symbol.flags & 16 /* Function */) { - constructSignatures = addRange(constructSignatures.slice(), mapDefined( - type.callSignatures, - (sig) => isJSConstructor(sig.declaration) ? createSignature( - sig.declaration, - sig.typeParameters, - sig.thisParameter, - sig.parameters, - classType, - /*resolvedTypePredicate*/ - void 0, - sig.minArgumentCount, - sig.flags & 39 /* PropagatingFlags */ - ) : void 0 - )); + constructSignatures = addRange( + constructSignatures.slice(), + mapDefined( + type.callSignatures, + (sig) => isJSConstructor(sig.declaration) ? createSignature( + sig.declaration, + sig.typeParameters, + sig.thisParameter, + sig.parameters, + classType, + /*resolvedTypePredicate*/ + void 0, + sig.minArgumentCount, + sig.flags & 167 /* PropagatingFlags */ + ) : void 0 + ) + ); } if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); @@ -325463,6 +327718,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); @@ -325470,7 +327737,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; @@ -325499,7 +327773,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; @@ -325546,7 +327825,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); @@ -325574,11 +327853,7 @@ ${lanes.join("\n")} const isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || !(templateModifiers & 2 /* ExcludeReadonly */) && modifiersProp && isReadonlySymbol(modifiersProp)); const stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */; const lateFlag = modifiersProp ? getIsLateCheckFlag(modifiersProp) : 0; - const prop = createSymbol( - 4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), - propName, - lateFlag | 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0) - ); + const prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, lateFlag | 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)); prop.links.mappedType = type; prop.links.nameType = propNameType; prop.links.keyType = keyType; @@ -325591,7 +327866,9 @@ ${lanes.join("\n")} } else if (isValidIndexKeyType(propNameType) || propNameType.flags & (1 /* Any */ | 32 /* Enum */)) { const indexKeyType = propNameType.flags & (1 /* Any */ | 4 /* String */) ? stringType : propNameType.flags & (8 /* Number */ | 32 /* Enum */) ? numberType : propNameType; const propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType)); - const indexInfo = createIndexInfo(indexKeyType, propType, !!(templateModifiers & 1 /* IncludeReadonly */)); + const modifiersIndexInfo = getApplicableIndexInfo(modifiersType, propNameType); + const isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || !(templateModifiers & 2 /* ExcludeReadonly */) && (modifiersIndexInfo == null ? void 0 : modifiersIndexInfo.isReadonly)); + const indexInfo = createIndexInfo(indexKeyType, propType, isReadonly); indexInfos = appendIndexInfo( indexInfos, indexInfo, @@ -325617,7 +327894,7 @@ ${lanes.join("\n")} true ) : symbol.links.checkFlags & 524288 /* StripOptional */ ? removeMissingOrUndefinedType(propType) : propType; if (!popTypeResolution()) { - error(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType)); + error2(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType)); type = errorType; } symbol.links.type = type; @@ -325646,7 +327923,7 @@ ${lanes.join("\n")} } function isMappedTypeWithKeyofConstraintDeclaration(type) { const constraintDeclaration = getConstraintDeclarationForMappedType(type); - return constraintDeclaration.kind === 197 /* TypeOperator */ && constraintDeclaration.operator === 143 /* KeyOfKeyword */; + return constraintDeclaration.kind === 198 /* TypeOperator */ && constraintDeclaration.operator === 143 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -325690,9 +327967,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) { @@ -325741,7 +328021,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); } @@ -325801,9 +328086,13 @@ ${lanes.join("\n")} function getConstraintOfTypeParameter(typeParameter) { return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : void 0; } - function isConstTypeVariable(type) { + function isConstMappedType(type, depth) { + const typeVariable = getHomomorphicTypeVariable(type); + return !!typeVariable && isConstTypeVariable(typeVariable, depth); + } + function isConstTypeVariable(type, depth = 0) { var _a; - return !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || type.flags & 1048576 /* Union */ && some(type.types, isConstTypeVariable) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type)) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t)) >= 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; @@ -325817,7 +328106,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); @@ -325853,7 +328142,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; @@ -325943,7 +328237,7 @@ ${lanes.join("\n")} if (t.flags & 262144 /* TypeParameter */) { const errorNode = getConstraintDeclaration(t); if (errorNode) { - const diagnostic = error(errorNode, Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(t)); + const diagnostic = error2(errorNode, Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(t)); if (currentNode && !isNodeDescendantOf(errorNode, currentNode) && !isNodeDescendantOf(currentNode, errorNode)) { addRelatedInfo(diagnostic, createDiagnosticForNode(currentNode, Diagnostics.Circularity_originates_in_type_at_this_location)); } @@ -326062,11 +328356,15 @@ ${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 constraint = getConstraintTypeFromMappedType(type); + if (constraint.flags & 4194304 /* Index */) { + const baseConstraint = getBaseConstraintOfType(constraint.type); + if (baseConstraint && everyType(baseConstraint, isArrayOrTupleType)) { + return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper)); + } } } return type; @@ -326129,7 +328427,7 @@ ${lanes.join("\n")} } else if (!isUnion && !isReadonlySymbol(prop)) { checkFlags &= ~8 /* Readonly */; } - checkFlags |= (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 256 /* ContainsPublic */ : 0) | (modifiers & 16 /* Protected */ ? 512 /* ContainsProtected */ : 0) | (modifiers & 8 /* Private */ ? 1024 /* ContainsPrivate */ : 0) | (modifiers & 32 /* Static */ ? 2048 /* ContainsStatic */ : 0); + checkFlags |= (!(modifiers & 6 /* NonPublicAccessibilityModifier */) ? 256 /* ContainsPublic */ : 0) | (modifiers & 4 /* Protected */ ? 512 /* ContainsProtected */ : 0) | (modifiers & 2 /* Private */ ? 1024 /* ContainsPrivate */ : 0) | (modifiers & 256 /* Static */ ? 2048 /* ContainsStatic */ : 0); if (!isPrototypeProperty(prop)) { syntheticFlag = 2 /* SyntheticProperty */; } @@ -326157,6 +328455,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; @@ -326185,7 +328484,8 @@ ${lanes.join("\n")} const writeType = getWriteTypeOfSymbol(prop); if (writeTypes || writeType !== type) { writeTypes = append(!writeTypes ? propTypes.slice() : writeTypes, writeType); - } else if (type !== firstType) { + } + if (type !== firstType) { checkFlags |= 64 /* HasNonUniformType */; } if (isLiteralType(type) || isPatternLiteralType(type)) { @@ -326221,13 +328521,17 @@ ${lanes.join("\n")} return result; } function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) { - var _a, _b; + var _a, _b, _c; let property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a.get(name)) || !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) == null ? void 0 : _b.get(name) : void 0; 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 && !((_c = type.propertyCache) == null ? void 0 : _c.get(name))) { + const properties2 = type.propertyCache || (type.propertyCache = createSymbolTable()); + properties2.set(name, property); + } } } return property; @@ -326299,40 +328603,34 @@ ${lanes.join("\n")} if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) { const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType); if (neverProp) { - return chainDiagnosticMessages( - errorInfo, - Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, - typeToString( - type, - /*enclosingDeclaration*/ - void 0, - 536870912 /* NoTypeReduction */ - ), - symbolToString(neverProp) - ); + return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString( + type, + /*enclosingDeclaration*/ + void 0, + 536870912 /* NoTypeReduction */ + ), symbolToString(neverProp)); } const privateProp = find(getPropertiesOfUnionOrIntersectionType(type), isConflictingPrivateProperty); if (privateProp) { - return chainDiagnosticMessages( - errorInfo, - Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some, - typeToString( - type, - /*enclosingDeclaration*/ - void 0, - 536870912 /* NoTypeReduction */ - ), - symbolToString(privateProp) - ); + return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some, typeToString( + type, + /*enclosingDeclaration*/ + void 0, + 536870912 /* NoTypeReduction */ + ), symbolToString(privateProp)); } } 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; } @@ -326347,7 +328645,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; @@ -326360,7 +328673,35 @@ ${lanes.join("\n")} return emptyArray; } function getSignaturesOfType(type, kind) { - return getSignaturesOfStructuredType(getReducedApparentType(type), kind); + const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind); + if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) { + if (type.arrayFallbackSignatures) { + return type.arrayFallbackSignatures; + } + let memberName; + if (everyType(type, (t) => { + var _a; + return !!((_a = t.symbol) == null ? void 0 : _a.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName); + })) { + const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper)); + const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent))); + return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind); + } + type.arrayFallbackSignatures = result; + } + return result; + } + function isArrayOrTupleSymbol(symbol) { + if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) { + return false; + } + return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol); + } + function isReadonlyArraySymbol(symbol) { + if (!symbol || !globalReadonlyArrayType.symbol) { + return false; + } + return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol); } function findIndexInfo(indexInfos, keyType) { return find(indexInfos, (info) => info.keyType === keyType); @@ -326380,16 +328721,12 @@ ${lanes.join("\n")} } } } - return applicableInfos ? createIndexInfo( - unknownType, - getIntersectionType(map(applicableInfos, (info) => info.type)), - reduceLeft( - applicableInfos, - (isReadonly, info) => isReadonly && info.isReadonly, - /*initial*/ - true - ) - ) : applicableInfo ? applicableInfo : stringIndexInfo && isApplicableIndexType(keyType, stringType) ? stringIndexInfo : void 0; + return applicableInfos ? createIndexInfo(unknownType, getIntersectionType(map(applicableInfos, (info) => info.type)), reduceLeft( + applicableInfos, + (isReadonly, info) => isReadonly && info.isReadonly, + /*initial*/ + true + )) : applicableInfo ? applicableInfo : stringIndexInfo && isApplicableIndexType(keyType, stringType) ? stringIndexInfo : void 0; } function isApplicableIndexType(source, target) { return isTypeAssignableTo(source, target) || target === stringType && isTypeAssignableTo(source, numberType) || target === numberType && (source === numericStringType || !!(source.flags & 128 /* StringLiteral */) && isNumericLiteralName(source.value)); @@ -326456,7 +328793,7 @@ ${lanes.join("\n")} } const iife = getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { - return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= iife.arguments.length; + return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= getEffectiveCallArguments(iife).length; } return false; } @@ -326508,6 +328845,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); @@ -326517,6 +328855,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)) { @@ -326539,7 +328881,7 @@ ${lanes.join("\n")} } else { parameters.push(paramSymbol); } - if (type && type.kind === 200 /* LiteralType */) { + if (type && type.kind === 201 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } const isOptionalParameter2 = isOptionalJSDocPropertyLikeTag(param) || param.initializer || param.questionToken || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type || isJSDocOptionalParameter(param); @@ -326547,18 +328889,15 @@ ${lanes.join("\n")} minArgumentCount = parameters.length; } } - if ((declaration.kind === 176 /* GetAccessor */ || declaration.kind === 177 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) { - const otherKind = declaration.kind === 176 /* GetAccessor */ ? 177 /* SetAccessor */ : 176 /* GetAccessor */; + if ((declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) { + const otherKind = declaration.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */; const other = getDeclarationOfKind(getSymbolOfDeclaration(declaration), otherKind); if (other) { 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; @@ -326566,7 +328905,7 @@ ${lanes.join("\n")} if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) { flags |= 1 /* HasRestParameter */; } - if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration, 256 /* Abstract */) || isConstructorDeclaration(declaration) && hasSyntacticModifier(declaration.parent, 256 /* Abstract */)) { + if (isConstructorTypeNode(declaration) && hasSyntacticModifier(declaration, 64 /* Abstract */) || isConstructorDeclaration(declaration) && hasSyntacticModifier(declaration.parent, 64 /* Abstract */)) { flags |= 4 /* Abstract */; } links.resolvedSignature = createSignature( @@ -326639,15 +328978,15 @@ ${lanes.join("\n")} switch (node.kind) { case 80 /* Identifier */: return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol; - case 171 /* PropertyDeclaration */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - return node.name.kind === 166 /* ComputedPropertyName */ && traverse(node.name); - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 172 /* PropertyDeclaration */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + return node.name.kind === 167 /* ComputedPropertyName */ && traverse(node.name); + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: return traverse(node.expression); - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return traverse(node.initializer); default: return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse); @@ -326669,22 +329008,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; } } @@ -326734,19 +329066,14 @@ ${lanes.join("\n")} function createTypePredicateFromTypePredicateNode(node, signature) { const parameterName = node.parameterName; const type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 196 /* ThisType */ ? createTypePredicate( + return parameterName.kind === 197 /* ThisType */ ? createTypePredicate( node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ void 0, /*parameterIndex*/ void 0, type - ) : createTypePredicate( - node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, - parameterName.escapedText, - findIndex(signature.parameters, (p) => p.escapedName === parameterName.escapedText), - type - ); + ) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, findIndex(signature.parameters, (p) => p.escapedName === parameterName.escapedText), type); } function getUnionOrIntersectionType(types, kind, unionReduction) { return kind !== 2097152 /* Intersection */ ? getUnionType(types, unionReduction) : getIntersectionType(types); @@ -326766,14 +329093,14 @@ ${lanes.join("\n")} if (signature.declaration) { const typeNode = getEffectiveReturnTypeNode(signature.declaration); if (typeNode) { - error(typeNode, Diagnostics.Return_type_annotation_circularly_references_itself); + error2(typeNode, Diagnostics.Return_type_annotation_circularly_references_itself); } else if (noImplicitAny) { const declaration = signature.declaration; const name = getNameOfDeclaration(declaration); if (name) { - error(name, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, declarationNameToString(name)); + error2(name, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, declarationNameToString(name)); } else { - error(declaration, Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); + error2(declaration, Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); } } } @@ -326784,7 +329111,7 @@ ${lanes.join("\n")} return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 175 /* Constructor */) { + if (declaration.kind === 176 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } const typeNode = getEffectiveReturnTypeNode(declaration); @@ -326800,12 +329127,12 @@ ${lanes.join("\n")} if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 176 /* GetAccessor */ && hasBindableName(declaration)) { + if (declaration.kind === 177 /* GetAccessor */ && hasBindableName(declaration)) { const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - const setter = getDeclarationOfKind(getSymbolOfDeclaration(declaration), 177 /* SetAccessor */); + const setter = getDeclarationOfKind(getSymbolOfDeclaration(declaration), 178 /* SetAccessor */); const setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -326814,7 +329141,7 @@ ${lanes.join("\n")} return getReturnTypeOfTypeTag(declaration); } function isResolvingReturnTypeOfSignature(signature) { - return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0; + return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0; } function getRestTypeOfSignature(signature) { return tryGetRestTypeOfSignature(signature) || anyType; @@ -326908,7 +329235,7 @@ ${lanes.join("\n")} var _a; if (!signature.isolatedSignatureType) { const kind = (_a = signature.declaration) == null ? void 0 : _a.kind; - const isConstructor = kind === void 0 || kind === 175 /* Constructor */ || kind === 179 /* ConstructSignature */ || kind === 184 /* ConstructorType */; + const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */; const type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = emptyArray; @@ -326941,12 +329268,7 @@ ${lanes.join("\n")} if (parameter.type) { forEachType(getTypeFromTypeNode(parameter.type), (keyType) => { if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) { - indexInfos.push(createIndexInfo( - keyType, - declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, - hasEffectiveModifier(declaration, 64 /* Readonly */), - declaration - )); + indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration)); } }); } @@ -326967,9 +329289,9 @@ ${lanes.join("\n")} let inferences; if ((_a = typeParameter.symbol) == null ? void 0 : _a.declarations) { for (const declaration of typeParameter.symbol.declarations) { - if (declaration.parent.kind === 194 /* InferType */) { + if (declaration.parent.kind === 195 /* InferType */) { const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); - if (grandParent.kind === 182 /* TypeReference */ && !omitTypeReferences) { + if (grandParent.kind === 183 /* TypeReference */ && !omitTypeReferences) { const typeReference = grandParent; const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReference); if (typeParameters) { @@ -326977,9 +329299,12 @@ ${lanes.join("\n")} if (index < typeParameters.length) { const declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); if (declaredConstraint) { - const mapper = makeDeferredTypeMapper(typeParameters, typeParameters.map((_, index2) => () => { - return getEffectiveTypeArgumentAtIndex(typeReference, typeParameters, index2); - })); + const mapper = makeDeferredTypeMapper( + typeParameters, + typeParameters.map((_, index2) => () => { + return getEffectiveTypeArgumentAtIndex(typeReference, typeParameters, index2); + }) + ); const constraint = instantiateType(declaredConstraint, mapper); if (constraint !== typeParameter) { inferences = append(inferences, constraint); @@ -326987,19 +329312,16 @@ ${lanes.join("\n")} } } } - } else if (grandParent.kind === 168 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 190 /* RestType */ || grandParent.kind === 201 /* NamedTupleMember */ && grandParent.dotDotDotToken) { + } else if (grandParent.kind === 169 /* Parameter */ && grandParent.dotDotDotToken || grandParent.kind === 191 /* RestType */ || grandParent.kind === 202 /* NamedTupleMember */ && grandParent.dotDotDotToken) { inferences = append(inferences, createArrayType(unknownType)); - } else if (grandParent.kind === 203 /* TemplateLiteralTypeSpan */) { + } else if (grandParent.kind === 204 /* TemplateLiteralTypeSpan */) { inferences = append(inferences, stringType); - } else if (grandParent.kind === 167 /* TypeParameter */ && grandParent.parent.kind === 199 /* MappedType */) { + } else if (grandParent.kind === 168 /* TypeParameter */ && grandParent.parent.kind === 200 /* MappedType */) { inferences = append(inferences, keyofConstraintType); - } else if (grandParent.kind === 199 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 193 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 199 /* MappedType */ && grandParent.parent.checkType.type) { + } else if (grandParent.kind === 200 /* MappedType */ && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 194 /* ConditionalType */ && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 200 /* MappedType */ && grandParent.parent.checkType.type) { const checkMappedType2 = grandParent.parent.checkType; const nodeType = getTypeFromTypeNode(checkMappedType2.type); - inferences = append(inferences, instantiateType( - nodeType, - makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(checkMappedType2.typeParameter)), checkMappedType2.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType2.typeParameter.constraint) : keyofConstraintType) - )); + inferences = append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(checkMappedType2.typeParameter)), checkMappedType2.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType2.typeParameter.constraint) : keyofConstraintType))); } } } @@ -327018,7 +329340,7 @@ ${lanes.join("\n")} } else { let type = getTypeFromTypeNode(constraintDeclaration); if (type.flags & 1 /* Any */ && !isErrorType(type)) { - type = constraintDeclaration.parent.parent.kind === 199 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 200 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -327027,7 +329349,7 @@ ${lanes.join("\n")} return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - const tp = getDeclarationOfKind(typeParameter.symbol, 167 /* TypeParameter */); + const tp = getDeclarationOfKind(typeParameter.symbol, 168 /* TypeParameter */); const host2 = isJSDocTemplateTag(tp.parent) ? getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent; return host2 && getSymbolOfNode(host2); } @@ -327112,12 +329434,12 @@ ${lanes.join("\n")} return ((_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray; } const node = type.node; - const typeArguments = !node ? emptyArray : node.kind === 182 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 187 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); + const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; } else { type.resolvedTypeArguments = ((_b = type.target.localTypeParameters) == null ? void 0 : _b.map(() => errorType)) || emptyArray; - error( + error2( type.node || currentNode, type.target.symbol ? Diagnostics.Type_arguments_for_0_circularly_reference_themselves : Diagnostics.Tuple_type_arguments_circularly_reference_themselves, type.target.symbol && symbolToString(type.target.symbol) @@ -327146,12 +329468,12 @@ ${lanes.join("\n")} void 0, 2 /* WriteArrayAsGenericType */ ); - error(node, diag2, typeStr, minTypeArgumentCount, typeParameters.length); + error2(node, diag2, typeStr, minTypeArgumentCount, typeParameters.length); if (!isJs) { return errorType; } } - if (node.kind === 182 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference( type, node, @@ -327166,20 +329488,18 @@ ${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; const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments); let instantiation = links.instantiations.get(id); if (!instantiation) { - links.instantiations.set(id, instantiation = instantiateTypeWithAlias( - type, - createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), - aliasSymbol, - aliasTypeArguments - )); + links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments)); } return instantiation; } @@ -327189,7 +329509,13 @@ ${lanes.join("\n")} const id = getAliasId(symbol, typeArguments); let errorType2 = errorTypes.get(id); if (!errorType2) { - errorType2 = createIntrinsicType(1 /* Any */, "error"); + errorType2 = createIntrinsicType( + 1 /* Any */, + "error", + /*objectFlags*/ + void 0, + `alias ${id}` + ); errorType2.aliasSymbol = symbol; errorType2.aliasTypeArguments = typeArguments; errorTypes.set(id, errorType2); @@ -327202,7 +329528,7 @@ ${lanes.join("\n")} const numTypeArguments = length(node.typeArguments); const minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { - error( + error2( node, minTypeArgumentCount === typeParameters.length ? Diagnostics.Generic_type_0_requires_1_type_argument_s : Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), @@ -327242,9 +329568,9 @@ ${lanes.join("\n")} } function getTypeReferenceName(node) { switch (node.kind) { - case 182 /* TypeReference */: + case 183 /* TypeReference */: return node.typeName; - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: const expr = node.expression; if (isEntityNameExpression(expr)) { return expr; @@ -327256,10 +329582,10 @@ ${lanes.join("\n")} return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName; } function getUnresolvedSymbolForEntityName(name) { - const identifier = name.kind === 165 /* QualifiedName */ ? name.right : name.kind === 210 /* PropertyAccessExpression */ ? name.name : name; + const identifier = name.kind === 166 /* QualifiedName */ ? name.right : name.kind === 211 /* PropertyAccessExpression */ ? name.name : name; const text = identifier.escapedText; if (text) { - const parentSymbol = name.kind === 165 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 210 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0; + const parentSymbol = name.kind === 166 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 211 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) : void 0; const path = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text; let result = unresolvedSymbols.get(path); if (!result) { @@ -327311,7 +329637,7 @@ ${lanes.join("\n")} const valueType = getTypeOfSymbol(symbol); let typeType = valueType; if (symbol.valueDeclaration) { - const isImportTypeWithQualifier = node.kind === 204 /* ImportType */ && node.qualifier; + const isImportTypeWithQualifier = node.kind === 205 /* ImportType */ && node.qualifier; if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { typeType = getTypeReferenceType(node, valueType.symbol); } @@ -327320,10 +329646,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) { @@ -327336,10 +329671,10 @@ ${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 === 188 /* TupleType */ && node.elements.length === 1; + return node.kind === 189 /* TupleType */ && node.elements.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) : void 0; @@ -327347,17 +329682,17 @@ ${lanes.join("\n")} function getConditionalFlowTypeOfType(type, node) { let constraints; let covariant = true; - while (node && !isStatement(node) && node.kind !== 326 /* JSDoc */) { + while (node && !isStatement(node) && node.kind !== 327 /* JSDoc */) { const parent2 = node.parent; - if (parent2.kind === 168 /* Parameter */) { + if (parent2.kind === 169 /* Parameter */) { covariant = !covariant; } - if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 193 /* ConditionalType */ && node === parent2.trueType) { + if ((covariant || type.flags & 8650752 /* TypeVariable */) && parent2.kind === 194 /* ConditionalType */ && node === parent2.trueType) { const constraint = getImpliedConstraint(type, parent2.checkType, parent2.extendsType); if (constraint) { constraints = append(constraints, constraint); } - } else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 199 /* 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); @@ -327374,11 +329709,11 @@ ${lanes.join("\n")} return constraints ? getSubstitutionType(type, getIntersectionType(constraints)) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 8388608 /* JSDoc */) && (node.kind === 182 /* TypeReference */ || node.kind === 204 /* ImportType */); + return !!(node.flags & 16777216 /* JSDoc */) && (node.kind === 183 /* TypeReference */ || node.kind === 205 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { - error(node, Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : node.typeName ? declarationNameToString(node.typeName) : anon); + error2(node, Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : node.typeName ? declarationNameToString(node.typeName) : anon); return false; } return true; @@ -327497,9 +329832,9 @@ ${lanes.join("\n")} if (declarations) { for (const declaration of declarations) { switch (declaration.kind) { - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: return declaration; } } @@ -327510,11 +329845,11 @@ ${lanes.join("\n")} } const type = getDeclaredTypeOfSymbol(symbol); if (!(type.flags & 524288 /* Object */)) { - error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbolName(symbol)); + error2(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbolName(symbol)); return arity ? emptyGenericType : emptyObjectType; } if (length(type.typeParameters) !== arity) { - error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbolName(symbol), arity); + error2(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbolName(symbol), arity); return arity ? emptyGenericType : emptyObjectType; } return type; @@ -327531,7 +329866,7 @@ ${lanes.join("\n")} getDeclaredTypeOfSymbol(symbol); if (length(getSymbolLinks(symbol).typeParameters) !== arity) { const decl = symbol.declarations && find(symbol.declarations, isTypeAliasDeclaration); - error(decl, Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbolName(symbol), arity); + error2(decl, Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbolName(symbol), arity); return void 0; } } @@ -327605,6 +329940,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)); } @@ -327727,6 +330070,22 @@ ${lanes.join("\n")} reportErrors2 )) || emptyGenericType; } + function getGlobalDisposableType(reportErrors2) { + return deferredGlobalDisposableType || (deferredGlobalDisposableType = getGlobalType( + "Disposable", + /*arity*/ + 0, + reportErrors2 + )) || emptyObjectType; + } + function getGlobalAsyncDisposableType(reportErrors2) { + return deferredGlobalAsyncDisposableType || (deferredGlobalAsyncDisposableType = getGlobalType( + "AsyncDisposable", + /*arity*/ + 0, + reportErrors2 + )) || emptyObjectType; + } function getGlobalTypeOrUndefined(name, arity = 0) { const symbol = getGlobalSymbol( name, @@ -327872,11 +330231,11 @@ ${lanes.join("\n")} } function getTupleElementFlags(node) { switch (node.kind) { - case 189 /* OptionalType */: + case 190 /* OptionalType */: return 2 /* Optional */; - case 190 /* RestType */: + case 191 /* RestType */: return getRestTypeElementFlags(node); - case 201 /* NamedTupleMember */: + case 202 /* NamedTupleMember */: return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */; default: return 1 /* Required */; @@ -327892,60 +330251,57 @@ ${lanes.join("\n")} return readonly ? globalReadonlyArrayType : globalArrayType; } const elementFlags = map(node.elements, getTupleElementFlags); - const missingName = some(node.elements, (e) => e.kind !== 201 /* NamedTupleMember */); - return getTupleTargetType( - elementFlags, - readonly, - /*associatedNames*/ - missingName ? void 0 : node.elements - ); + return getTupleTargetType(elementFlags, readonly, map(node.elements, memberIfLabeledElementDeclaration)); + } + function memberIfLabeledElementDeclaration(member) { + return isNamedTupleMember(member) || isParameter(member) ? member : void 0; } function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 187 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 188 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)); + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)); } function isResolvedByTypeAlias(node) { const parent2 = node.parent; switch (parent2.kind) { - case 195 /* ParenthesizedType */: - case 201 /* NamedTupleMember */: - case 182 /* TypeReference */: - case 191 /* UnionType */: - case 192 /* IntersectionType */: - case 198 /* IndexedAccessType */: - case 193 /* ConditionalType */: - case 197 /* TypeOperator */: - case 187 /* ArrayType */: - case 188 /* TupleType */: + case 196 /* ParenthesizedType */: + case 202 /* NamedTupleMember */: + case 183 /* TypeReference */: + case 192 /* UnionType */: + case 193 /* IntersectionType */: + case 199 /* IndexedAccessType */: + case 194 /* ConditionalType */: + case 198 /* TypeOperator */: + case 188 /* ArrayType */: + case 189 /* TupleType */: return isResolvedByTypeAlias(parent2); - case 264 /* TypeAliasDeclaration */: + case 265 /* TypeAliasDeclaration */: return true; } return false; } function mayResolveTypeAlias(node) { switch (node.kind) { - case 182 /* TypeReference */: + case 183 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 185 /* TypeQuery */: + case 186 /* TypeQuery */: return true; - case 197 /* TypeOperator */: + case 198 /* TypeOperator */: return node.operator !== 158 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 195 /* ParenthesizedType */: - case 189 /* OptionalType */: - case 201 /* NamedTupleMember */: - case 322 /* JSDocOptionalType */: - case 320 /* JSDocNullableType */: - case 321 /* JSDocNonNullableType */: - case 315 /* JSDocTypeExpression */: + case 196 /* ParenthesizedType */: + case 190 /* OptionalType */: + case 202 /* NamedTupleMember */: + case 323 /* JSDocOptionalType */: + case 321 /* JSDocNullableType */: + case 322 /* JSDocNonNullableType */: + case 316 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 190 /* RestType */: - return node.type.kind !== 187 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 191 /* UnionType */: - case 192 /* IntersectionType */: + case 191 /* RestType */: + return node.type.kind !== 188 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 192 /* UnionType */: + case 193 /* IntersectionType */: return some(node.types, mayResolveTypeAlias); - case 198 /* IndexedAccessType */: + case 199 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 193 /* ConditionalType */: + case 194 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } return false; @@ -327956,15 +330312,15 @@ ${lanes.join("\n")} const target = getArrayOrTupleTargetType(node); if (target === emptyGenericType) { links.resolvedType = emptyObjectType; - } else if (!(node.kind === 188 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 188 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference( + } else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference( target, node, /*mapper*/ void 0 ); } else { - const elementTypes = node.kind === 187 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); + const elementTypes = node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); links.resolvedType = createNormalizedTypeReference(target, elementTypes); } } @@ -327973,7 +330329,7 @@ ${lanes.join("\n")} function isReadonlyTypeOperator(node) { return isTypeOperatorNode(node) && node.operator === 148 /* ReadonlyKeyword */; } - function createTupleType(elementTypes, elementFlags, readonly = false, namedMemberDeclarations) { + function createTupleType(elementTypes, elementFlags, readonly = false, namedMemberDeclarations = []) { const tupleTarget = getTupleTargetType(elementFlags || map(elementTypes, (_) => 1 /* Required */), readonly, namedMemberDeclarations); return tupleTarget === emptyGenericType ? emptyObjectType : elementTypes.length ? createNormalizedTypeReference(tupleTarget, elementTypes) : tupleTarget; } @@ -327981,7 +330337,7 @@ ${lanes.join("\n")} if (elementFlags.length === 1 && elementFlags[0] & 4 /* Rest */) { return readonly ? globalReadonlyArrayType : globalArrayType; } - const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (namedMemberDeclarations && namedMemberDeclarations.length ? "," + map(namedMemberDeclarations, getNodeId).join(",") : ""); + const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (some(namedMemberDeclarations, (node) => !!node) ? "," + map(namedMemberDeclarations, (node) => node ? getNodeId(node) : "_").join(",") : ""); let type = tupleTypes.get(key); if (!type) { tupleTypes.set(key, type = createTupleTargetType(elementFlags, readonly, namedMemberDeclarations)); @@ -328001,11 +330357,7 @@ ${lanes.join("\n")} const flags = elementFlags[i]; combinedFlags |= flags; if (!(combinedFlags & 12 /* Variable */)) { - const property = createSymbol( - 4 /* Property */ | (flags & 2 /* Optional */ ? 16777216 /* Optional */ : 0), - "" + i, - readonly ? 8 /* Readonly */ : 0 - ); + const property = createSymbol(4 /* Property */ | (flags & 2 /* Optional */ ? 16777216 /* Optional */ : 0), "" + i, readonly ? 8 /* Readonly */ : 0); property.links.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i]; property.links.type = typeParameter; properties.push(property); @@ -328051,7 +330403,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); } @@ -328063,7 +330415,7 @@ ${lanes.join("\n")} } const expandedTypes = []; const expandedFlags = []; - let expandedDeclarations = []; + const expandedDeclarations = []; let lastRequiredIndex = -1; let firstRestIndex = -1; let lastOptionalOrRestIndex = -1; @@ -328071,12 +330423,17 @@ ${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) { - error(currentNode, isPartOfTypeNode(currentNode) ? Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent : Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent); + error2( + currentNode, + isPartOfTypeNode(currentNode) ? Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent : Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent + ); return errorType; } forEach(elements, (t, n) => { @@ -328084,10 +330441,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++) { @@ -328095,13 +330452,10 @@ ${lanes.join("\n")} expandedFlags[i] = 1 /* Required */; } if (firstRestIndex >= 0 && firstRestIndex < lastOptionalOrRestIndex) { - expandedTypes[firstRestIndex] = getUnionType(sameMap( - expandedTypes.slice(firstRestIndex, lastOptionalOrRestIndex + 1), - (t, i) => expandedFlags[firstRestIndex + i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t - )); + expandedTypes[firstRestIndex] = getUnionType(sameMap(expandedTypes.slice(firstRestIndex, lastOptionalOrRestIndex + 1), (t, i) => expandedFlags[firstRestIndex + i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t)); expandedTypes.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); expandedFlags.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); - expandedDeclarations == null ? void 0 : expandedDeclarations.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); + expandedDeclarations.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); } const tupleTarget = getTupleTargetType(expandedFlags, target.readonly, expandedDeclarations); return tupleTarget === emptyGenericType ? emptyObjectType : expandedFlags.length ? createTypeReference(tupleTarget, expandedTypes) : tupleTarget; @@ -328121,11 +330475,7 @@ ${lanes.join("\n")} true ) : type); expandedFlags.push(flags); - if (expandedDeclarations && declaration) { - expandedDeclarations.push(declaration); - } else { - expandedDeclarations = void 0; - } + expandedDeclarations.push(declaration); } } function sliceTupleType(type, index, endSkipCount = 0) { @@ -328140,10 +330490,7 @@ ${lanes.join("\n")} ); } function getKnownKeysOfTupleType(type) { - return getUnionType(append( - arrayOf(type.target.fixedLength, (i) => getStringLiteralType("" + i)), - getIndexType(type.target.readonly ? globalReadonlyArrayType : globalArrayType) - )); + return getUnionType(append(arrayOf(type.target.fixedLength, (i) => getStringLiteralType("" + i)), getIndexType(type.target.readonly ? globalReadonlyArrayType : globalArrayType))); } function getStartElementCount(type, flags) { const index = findIndex(type.elementFlags, (f) => !(f & flags)); @@ -328152,6 +330499,9 @@ ${lanes.join("\n")} function getEndElementCount(type, flags) { return type.elementFlags.length - findLastIndex(type.elementFlags, (f) => !(f & flags)) - 1; } + function getTotalFixedElementCount(type) { + return type.fixedLength + getEndElementCount(type, 3 /* Fixed */); + } function getElementTypes(type) { const typeArguments = getTypeArguments(type); const arity = getTypeReferenceArity(type); @@ -328184,6 +330534,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 */) { @@ -328241,7 +330593,7 @@ ${lanes.join("\n")} const estimatedCount = count / (len - i) * len; if (estimatedCount > 1e6) { (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "removeSubtypes_DepthLimit", { typeIds: types.map((t) => t.id) }); - error(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); + error2(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return void 0; } } @@ -328276,18 +330628,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)); } @@ -328350,9 +330740,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) { @@ -328446,12 +330839,7 @@ ${lanes.join("\n")} const links = getNodeLinks(node); if (!links.resolvedType) { const aliasSymbol = getAliasSymbolForTypeNode(node); - links.resolvedType = getUnionType( - map(node.types, getTypeFromTypeNode), - 1 /* Literal */, - aliasSymbol, - getTypeArgumentsForAliasSymbol(aliasSymbol) - ); + links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNode), 1 /* Literal */, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)); } return links.resolvedType; } @@ -328519,7 +330907,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)) { @@ -328570,9 +330958,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 */ @@ -328586,13 +330974,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 */) { @@ -328614,6 +331003,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 */) || 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) { @@ -328636,7 +331044,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); } @@ -328650,7 +331058,7 @@ ${lanes.join("\n")} const size = getCrossProductUnionSize(types); if (size >= 1e5) { (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkCrossProductUnion_DepthLimit", { typeIds: types.map((t) => t.id), size }); - error(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); + error2(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return false; } return true; @@ -328681,15 +331089,14 @@ ${lanes.join("\n")} function getConstituentCountOfTypes(types) { return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0); } - function areIntersectedTypesAvoidingPrimitiveReduction(t1, t2) { - return !!(t1.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) && t2 === emptyTypeLiteralType; - } function getTypeFromIntersectionTypeNode(node) { const links = getNodeLinks(node); if (!links.resolvedType) { const aliasSymbol = getAliasSymbolForTypeNode(node); const types = map(node.types, getTypeFromTypeNode); - const noSupertypeReduction = types.length === 2 && (areIntersectedTypesAvoidingPrimitiveReduction(types[0], types[1]) || areIntersectedTypesAvoidingPrimitiveReduction(types[1], types[0])); + const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1; + const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType; + const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t)); links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction); } return links.resolvedType; @@ -328716,19 +331123,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; @@ -328766,7 +331171,7 @@ ${lanes.join("\n")} return neverType; } function getLiteralTypeFromProperty(prop, include, includeNonPublic) { - if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */)) { + if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) & 6 /* NonPublicAccessibilityModifier */)) { let type = getSymbolLinks(getLateBoundSymbol(prop)).nameType; if (!type) { const name = getNameOfDeclaration(prop.valueDeclaration); @@ -328796,15 +331201,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) { @@ -328905,11 +331306,6 @@ ${lanes.join("\n")} } function createTemplateLiteralType(texts, types) { const type = createType(134217728 /* TemplateLiteral */); - type.objectFlags = getPropagatingFlagsOfTypes( - types, - /*excludeKinds*/ - 98304 /* Nullable */ - ); type.texts = texts; type.types = types; return type; @@ -329002,12 +331398,12 @@ ${lanes.join("\n")} if (isCallLikeExpression(parent2)) { return isCallOrNewExpression(parent2) && isIdentifier(node) && hasMatchingArgument(parent2, node); } - return every(symbol.declarations, (d) => !isFunctionLike(d) || !!(getCombinedNodeFlags(d) & 268435456 /* Deprecated */)); + return every(symbol.declarations, (d) => !isFunctionLike(d) || isDeprecatedDeclaration2(d)); } return true; } function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, accessNode, accessFlags) { - const accessExpression = accessNode && accessNode.kind === 211 /* ElementAccessExpression */ ? accessNode : void 0; + const accessExpression = accessNode && accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode : void 0; const propName = accessNode && isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode); if (propName !== void 0) { if (accessFlags & 256 /* Contextual */) { @@ -329022,7 +331418,7 @@ ${lanes.join("\n")} if (accessExpression) { markPropertyAsReferenced(prop, accessExpression, isSelfTypeAccess(accessExpression.expression, objectType.symbol)); if (isAssignmentToReadonlyEntity(accessExpression, prop, getAssignmentTargetKind(accessExpression))) { - error(accessExpression.argumentExpression, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); + error2(accessExpression.argumentExpression, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); return void 0; } if (accessFlags & 8 /* CacheSymbol */) { @@ -329032,7 +331428,7 @@ ${lanes.join("\n")} return autoType; } } - const propType = getTypeOfSymbol(prop); + const propType = accessFlags & 4 /* Writing */ ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop); return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : accessNode && isIndexedAccessTypeNode(accessNode) && containsMissingType(propType) ? getUnionType([propType, undefinedType]) : propType; } if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) { @@ -329041,26 +331437,17 @@ ${lanes.join("\n")} const indexNode = getIndexNodeForAccessExpression(accessNode); if (isTupleType(objectType)) { if (index < 0) { - error(indexNode, Diagnostics.A_tuple_type_cannot_be_indexed_with_a_negative_value); + error2(indexNode, Diagnostics.A_tuple_type_cannot_be_indexed_with_a_negative_value); return undefinedType; } - error( - indexNode, - Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, - typeToString(objectType), - getTypeReferenceArity(objectType), - unescapeLeadingUnderscores(propName) - ); + error2(indexNode, Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, typeToString(objectType), getTypeReferenceArity(objectType), unescapeLeadingUnderscores(propName)); } else { - error(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType)); + error2(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType)); } } if (index >= 0) { errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, numberType)); - return mapType(objectType, (t) => { - const restType = getRestTypeOfTupleType(t) || undefinedType; - return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([restType, missingType]) : restType; - }); + return getTupleElementTypeOutOfStartCount(objectType, index, accessFlags & 1 /* IncludeUndefined */ ? missingType : void 0); } } } @@ -329072,13 +331459,17 @@ ${lanes.join("\n")} if (indexInfo) { if (accessFlags & 2 /* NoIndexSignatures */ && indexInfo.keyType !== numberType) { if (accessExpression) { - error(accessExpression, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(originalObjectType)); + if (accessFlags & 4 /* Writing */) { + error2(accessExpression, Diagnostics.Type_0_is_generic_and_can_only_be_indexed_for_reading, typeToString(originalObjectType)); + } else { + error2(accessExpression, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(originalObjectType)); + } } return void 0; } if (accessNode && indexInfo.keyType === stringType && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { const indexNode = getIndexNodeForAccessExpression(accessNode); - error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); + error2(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); return accessFlags & 1 /* IncludeUndefined */ ? getUnionType([indexInfo.type, missingType]) : indexInfo.type; } errorIfWritingToReadonlyIndex(indexInfo); @@ -329106,23 +331497,23 @@ ${lanes.join("\n")} } } if (objectType.symbol === globalThisSymbol && propName !== void 0 && globalThisSymbol.exports.has(propName) && globalThisSymbol.exports.get(propName).flags & 418 /* BlockScoped */) { - error(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType)); + error2(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType)); } else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !(accessFlags & 128 /* SuppressNoImplicitAnyError */)) { if (propName !== void 0 && typeHasStaticProperty(propName, objectType)) { const typeName = typeToString(objectType); - error(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName, typeName, typeName + "[" + getTextOfNode(accessExpression.argumentExpression) + "]"); + error2(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName, typeName, typeName + "[" + getTextOfNode(accessExpression.argumentExpression) + "]"); } else if (getIndexTypeOfType(objectType, numberType)) { - error(accessExpression.argumentExpression, Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); + error2(accessExpression.argumentExpression, Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); } else { let suggestion; if (propName !== void 0 && (suggestion = getSuggestionForNonexistentProperty(propName, objectType))) { if (suggestion !== void 0) { - error(accessExpression.argumentExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(objectType), suggestion); + error2(accessExpression.argumentExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(objectType), suggestion); } } else { const suggestion2 = getSuggestionForNonexistentIndexSignature(objectType, accessExpression, indexType); if (suggestion2 !== void 0) { - error(accessExpression, Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1, typeToString(objectType), suggestion2); + error2(accessExpression, Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1, typeToString(objectType), suggestion2); } else { let errorInfo; if (indexType.flags & 1024 /* EnumLiteral */) { @@ -329187,11 +331578,11 @@ ${lanes.join("\n")} if (accessNode) { const indexNode = getIndexNodeForAccessExpression(accessNode); if (indexType.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) { - error(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); + error2(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); } else if (indexType.flags & (4 /* String */ | 8 /* Number */)) { - error(indexNode, Diagnostics.Type_0_has_no_matching_index_signature_for_type_1, typeToString(objectType), typeToString(indexType)); + error2(indexNode, Diagnostics.Type_0_has_no_matching_index_signature_for_type_1, typeToString(objectType), typeToString(indexType)); } else { - error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); + error2(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); } } if (isTypeAny(indexType)) { @@ -329200,16 +331591,24 @@ ${lanes.join("\n")} return void 0; function errorIfWritingToReadonlyIndex(indexInfo) { if (indexInfo && indexInfo.isReadonly && accessExpression && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression))) { - error(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); + error2(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 211 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 198 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 166 /* ComputedPropertyName */ ? accessNode.expression : accessNode; + return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } function isPatternLiteralPlaceholderType(type) { if (type.flags & 2097152 /* Intersection */) { - return some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) || isPatternLiteralPlaceholderType(t)); + let seenPlaceholder = false; + for (const t of type.types) { + if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) { + seenPlaceholder = true; + } else if (!(t.flags & 524288 /* Object */)) { + return false; + } + } + return seenPlaceholder; } return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type); } @@ -329226,7 +331625,7 @@ ${lanes.join("\n")} return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */); } function getGenericObjectFlags(type) { - if (type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */)) { + if (type.flags & 3145728 /* UnionOrIntersection */) { if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) { type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0); } @@ -329238,7 +331637,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 */ | 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 */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0); } function getSimplifiedType(type, writing) { return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type; @@ -329286,7 +331685,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)); } } @@ -329345,7 +331744,7 @@ ${lanes.join("\n")} } if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */) accessFlags |= 1 /* IncludeUndefined */; - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 198 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)) || isGenericReducibleType(objectType))) { + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target)) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType.target))) || isGenericReducibleType(objectType))) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -329409,23 +331808,19 @@ ${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; while (true) { if (tailCount === 1e3) { - error(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); + error2(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } const checkType = instantiateType(getActualTypeVariable(root.checkType), mapper); @@ -329436,36 +331831,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 (const p of freshParams) { - if (root.inferTypeParameters.indexOf(p) === -1) { - p.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); @@ -329575,7 +331964,9 @@ ${lanes.join("\n")} links.resolvedType = getConditionalType( root, /*mapper*/ - void 0 + void 0, + /*forConstraint*/ + false ); if (outerTypeParameters) { root.instantiations = /* @__PURE__ */ new Map(); @@ -329603,11 +331994,11 @@ ${lanes.join("\n")} const links = getNodeLinks(node); if (!links.resolvedType) { if (!isLiteralImportTypeNode(node)) { - error(node.argument, Diagnostics.String_literal_expected); + error2(node.argument, Diagnostics.String_literal_expected); links.resolvedSymbol = unknownSymbol; return links.resolvedType = errorType; } - const targetMeaning = node.isTypeOf ? 111551 /* Value */ : node.flags & 8388608 /* JSDoc */ ? 111551 /* Value */ | 788968 /* Type */ : 788968 /* Type */; + const targetMeaning = node.isTypeOf ? 111551 /* Value */ : node.flags & 16777216 /* JSDoc */ ? 111551 /* Value */ | 788968 /* Type */ : 788968 /* Type */; const innerModuleSymbol = resolveExternalModuleName(node, node.argument.literal); if (!innerModuleSymbol) { links.resolvedSymbol = unknownSymbol; @@ -329637,7 +332028,7 @@ ${lanes.join("\n")} const symbolFromModule = node.isTypeOf ? void 0 : getSymbol2(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); const next = symbolFromModule ?? symbolFromVariable; if (!next) { - error(current, Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), declarationNameToString(current)); + error2(current, Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), declarationNameToString(current)); return links.resolvedType = errorType; } getNodeLinks(current).resolvedSymbol = next; @@ -329650,7 +332041,7 @@ ${lanes.join("\n")} links.resolvedType = resolveImportSymbolType(node, links, moduleSymbol, targetMeaning); } else { const errorMessage = targetMeaning === 111551 /* Value */ ? Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here : Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0; - error(node, errorMessage, node.argument.literal.text); + error2(node, errorMessage, node.argument.literal.text); links.resolvedSymbol = unknownSymbol; links.resolvedType = errorType; } @@ -329720,7 +332111,7 @@ ${lanes.join("\n")} function getAnonymousPartialType(type2) { const members = createSymbolTable(); for (const prop of getPropertiesOfType(type2)) { - if (getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */)) { + if (getDeclarationModifierFlagsFromSymbol(prop) & (2 /* Private */ | 4 /* Protected */)) { } else if (isSpreadableProperty(prop)) { const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */); const flags = 4 /* Property */ | 16777216 /* Optional */; @@ -329782,7 +332173,7 @@ ${lanes.join("\n")} const skippedPrivateMembers = /* @__PURE__ */ new Set(); const indexInfos = left === emptyObjectType ? getIndexInfosOfType(right) : getUnionIndexInfos([left, right]); for (const rightProp of getPropertiesOfType(right)) { - if (getDeclarationModifierFlagsFromSymbol(rightProp) & (8 /* Private */ | 16 /* Protected */)) { + if (getDeclarationModifierFlagsFromSymbol(rightProp) & (2 /* Private */ | 4 /* Protected */)) { skippedPrivateMembers.add(rightProp.escapedName); } else if (isSpreadableProperty(rightProp)) { members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly)); @@ -329895,6 +332286,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) { @@ -329913,7 +332310,7 @@ ${lanes.join("\n")} false ); const parent2 = container && container.parent; - if (parent2 && (isClassLike(parent2) || parent2.kind === 263 /* InterfaceDeclaration */)) { + if (parent2 && (isClassLike(parent2) || parent2.kind === 264 /* InterfaceDeclaration */)) { if (!isStatic(container) && (!isConstructorDeclaration(container) || isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(parent2)).thisType; } @@ -329921,14 +332318,14 @@ ${lanes.join("\n")} if (parent2 && isObjectLiteralExpression(parent2) && isBinaryExpression(parent2.parent) && getAssignmentDeclarationKind(parent2.parent) === 6 /* Prototype */) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent2.parent.left).parent).thisType; } - const host2 = node.flags & 8388608 /* JSDoc */ ? getHostSignatureFromJSDoc(node) : void 0; + const host2 = node.flags & 16777216 /* JSDoc */ ? getHostSignatureFromJSDoc(node) : void 0; if (host2 && isFunctionExpression(host2) && isBinaryExpression(host2.parent) && getAssignmentDeclarationKind(host2.parent) === 3 /* PrototypeProperty */) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(host2.parent.left).parent).thisType; } if (isJSConstructor(container) && isNodeDescendantOf(node, container.body)) { return getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(container)).thisType; } - error(node, Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface); + error2(node, Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface); return errorType; } function getTypeFromThisTypeNode(node) { @@ -329943,17 +332340,17 @@ ${lanes.join("\n")} } function getArrayElementTypeNode(node) { switch (node.kind) { - case 195 /* ParenthesizedType */: + case 196 /* ParenthesizedType */: return getArrayElementTypeNode(node.type); - case 188 /* TupleType */: + case 189 /* TupleType */: if (node.elements.length === 1) { node = node.elements[0]; - if (node.kind === 190 /* RestType */ || node.kind === 201 /* NamedTupleMember */ && node.dotDotDotToken) { + if (node.kind === 191 /* RestType */ || node.kind === 202 /* NamedTupleMember */ && node.dotDotDotToken) { return getArrayElementTypeNode(node.type); } } break; - case 187 /* ArrayType */: + case 188 /* ArrayType */: return node.elementType; } return void 0; @@ -329973,8 +332370,8 @@ ${lanes.join("\n")} function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 133 /* AnyKeyword */: - case 318 /* JSDocAllType */: - case 319 /* JSDocUnknownType */: + case 319 /* JSDocAllType */: + case 320 /* JSDocUnknownType */: return anyType; case 159 /* UnknownKeyword */: return unknownType; @@ -329982,7 +332379,7 @@ ${lanes.join("\n")} return stringType; case 150 /* NumberKeyword */: return numberType; - case 162 /* BigIntKeyword */: + case 163 /* BigIntKeyword */: return bigintType; case 136 /* BooleanKeyword */: return booleanType; @@ -329997,69 +332394,69 @@ ${lanes.join("\n")} case 146 /* NeverKeyword */: return neverType; case 151 /* ObjectKeyword */: - return node.flags & 262144 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; + return node.flags & 524288 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; case 141 /* IntrinsicKeyword */: return intrinsicMarkerType; - case 196 /* ThisType */: + case 197 /* ThisType */: case 110 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 200 /* LiteralType */: + case 201 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 182 /* TypeReference */: + case 183 /* TypeReference */: return getTypeFromTypeReference(node); - case 181 /* TypePredicate */: + case 182 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 185 /* TypeQuery */: + case 186 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 187 /* ArrayType */: - case 188 /* TupleType */: + case 188 /* ArrayType */: + case 189 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 189 /* OptionalType */: + case 190 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 191 /* UnionType */: + case 192 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 192 /* IntersectionType */: + case 193 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 320 /* JSDocNullableType */: + case 321 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 322 /* JSDocOptionalType */: + case 323 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 201 /* NamedTupleMember */: + case 202 /* NamedTupleMember */: return getTypeFromNamedTupleTypeNode(node); - case 195 /* ParenthesizedType */: - case 321 /* JSDocNonNullableType */: - case 315 /* JSDocTypeExpression */: + case 196 /* ParenthesizedType */: + case 322 /* JSDocNonNullableType */: + case 316 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 190 /* RestType */: + case 191 /* RestType */: return getTypeFromRestTypeNode(node); - case 324 /* JSDocVariadicType */: + case 325 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 186 /* TypeLiteral */: - case 328 /* JSDocTypeLiteral */: - case 323 /* JSDocFunctionType */: - case 329 /* JSDocSignature */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 187 /* TypeLiteral */: + case 329 /* JSDocTypeLiteral */: + case 324 /* JSDocFunctionType */: + case 330 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 197 /* TypeOperator */: + case 198 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 198 /* IndexedAccessType */: + case 199 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 199 /* MappedType */: + case 200 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 193 /* ConditionalType */: + case 194 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 194 /* InferType */: + case 195 /* InferType */: return getTypeFromInferTypeNode(node); - case 202 /* TemplateLiteralType */: + case 203 /* TemplateLiteralType */: return getTypeFromTemplateTypeNode(node); - case 204 /* ImportType */: + case 205 /* ImportType */: return getTypeFromImportTypeNode(node); case 80 /* Identifier */: - case 165 /* QualifiedName */: - case 210 /* PropertyAccessExpression */: + case 166 /* QualifiedName */: + case 211 /* PropertyAccessExpression */: const symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -330195,7 +332592,7 @@ ${lanes.join("\n")} /*resolvedTypePredicate*/ void 0, signature.minArgumentCount, - signature.flags & 39 /* PropagatingFlags */ + signature.flags & 167 /* PropagatingFlags */ ); result.target = signature; result.mapper = mapper; @@ -330204,7 +332601,12 @@ ${lanes.join("\n")} function instantiateSymbol(symbol, mapper) { const links = getSymbolLinks(symbol); if (links.type && !couldContainTypeVariables(links.type)) { - return symbol; + if (!(symbol.flags & 65536 /* SetAccessor */)) { + return symbol; + } + if (links.writeType && !couldContainTypeVariables(links.writeType)) { + return symbol; + } } if (getCheckFlags(symbol) & 1 /* Instantiated */) { symbol = links.target; @@ -330257,26 +332659,31 @@ ${lanes.join("\n")} if (!result) { const newMapper = createTypeMapper(typeParameters, typeArguments); result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments); - if (result.flags & 138117121 /* ObjectFlagsType */ && !(result.objectFlags & 524288 /* CouldContainTypeVariablesComputed */)) { + target.instantiations.set(id, result); + const resultObjectFlags = getObjectFlags(result); + if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) { const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables); - if (!(result.objectFlags & 524288 /* CouldContainTypeVariablesComputed */)) { - result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariables */ : 0); + if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) { + if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) { + result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariables */ : 0); + } else { + result.objectFlags |= !resultCouldContainTypeVariables ? 524288 /* CouldContainTypeVariablesComputed */ : 0; + } } } - target.instantiations.set(id, result); } return result; } return type; } function maybeTypeParameterReference(node) { - return !(node.parent.kind === 182 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 204 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.parent.kind === 183 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 205 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { const container = tp.symbol.declarations[0].parent; for (let n = node; n !== container; n = n.parent) { - if (!n || n.kind === 240 /* Block */ || n.kind === 193 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 241 /* Block */ || n.kind === 194 /* ConditionalType */ && forEachChild(n.extendsType, containsReference)) { return true; } } @@ -330285,17 +332692,17 @@ ${lanes.join("\n")} return true; function containsReference(node2) { switch (node2.kind) { - case 196 /* ThisType */: + case 197 /* ThisType */: return !!tp.isThisType; case 80 /* Identifier */: return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp; - case 185 /* TypeQuery */: + case 186 /* TypeQuery */: const entityName = node2.exprName; const firstIdentifier = getFirstIdentifier(entityName); if (!isThisIdentifier(firstIdentifier)) { const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier); const tpDeclaration = tp.symbol.declarations[0]; - const tpScope = tpDeclaration.kind === 167 /* TypeParameter */ ? tpDeclaration.parent : ( + const tpScope = tpDeclaration.kind === 168 /* TypeParameter */ ? tpDeclaration.parent : ( // Type parameter is a regular type parameter, e.g. foo tp.isThisType ? tpDeclaration : ( // Type parameter is the this type, and its declaration is the class declaration. @@ -330307,8 +332714,8 @@ ${lanes.join("\n")} } } return true; - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: return !node2.type && !!node2.body || some(node2.typeParameters, containsReference) || some(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type); } return !!forEachChild(node2, containsReference); @@ -330329,24 +332736,26 @@ ${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 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 (isTupleType(t)) { + return instantiateMappedTupleType(t, type, typeVariable, mapper); + } } + return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper)); } - return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper)); - } - return t; - }, aliasSymbol, aliasTypeArguments); + return t; + }, + aliasSymbol, + aliasTypeArguments + ); } } return instantiateType(getConstraintTypeFromMappedType(type), mapper) === wildcardType ? wildcardType : instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments); @@ -330354,14 +332763,18 @@ ${lanes.join("\n")} 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]]); - 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( @@ -330373,14 +332786,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); @@ -330392,6 +332797,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; @@ -330411,17 +332817,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; @@ -330445,7 +332851,7 @@ ${lanes.join("\n")} } if (instantiationDepth === 100 || instantiationCount >= 5e6) { (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth, instantiationCount }); - error(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); + error2(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } totalInstantiationCount++; @@ -330509,10 +332915,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); @@ -330561,32 +332977,32 @@ ${lanes.join("\n")} return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration); } function isContextSensitive(node) { - Debug.assert(node.kind !== 173 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); switch (node.kind) { - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: - case 261 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + case 262 /* FunctionDeclaration */: return isContextSensitiveFunctionLikeDeclaration(node); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return some(node.properties, isContextSensitive); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return some(node.elements, isContextSensitive); - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return (node.operatorToken.kind === 57 /* BarBarToken */ || node.operatorToken.kind === 61 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 291 /* JsxAttributes */: + case 292 /* JsxAttributes */: return some(node.properties, isContextSensitive) || isJsxOpeningElement(node.parent) && some(node.parent.parent.children, isContextSensitive); - case 290 /* JsxAttribute */: { + case 291 /* JsxAttribute */: { const { initializer } = node; return !!initializer && isContextSensitive(initializer); } - case 293 /* JsxExpression */: { + case 294 /* JsxExpression */: { const { expression } = node; return !!expression && isContextSensitive(expression); } @@ -330600,7 +333016,7 @@ ${lanes.join("\n")} if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) { return false; } - if (node.body.kind !== 240 /* Block */) { + if (node.body.kind !== 241 /* Block */) { return isContextSensitive(node.body); } return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && isContextSensitive(statement.expression)); @@ -330695,23 +333111,27 @@ ${lanes.join("\n")} return true; } switch (node.kind) { - case 293 /* JsxExpression */: - case 216 /* ParenthesizedExpression */: + case 234 /* AsExpression */: + if (!isConstAssertion(node)) { + break; + } + case 294 /* JsxExpression */: + case 217 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 28 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 291 /* JsxAttributes */: + case 292 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -330733,10 +333153,13 @@ ${lanes.join("\n")} const resultObj = errorOutputContainer || {}; checkTypeAssignableTo(source, target, node, headMessage, containingMessageChain, resultObj); const diagnostic = resultObj.errors[resultObj.errors.length - 1]; - addRelatedInfo(diagnostic, createDiagnosticForNode( - node, - signatures === constructSignatures ? Diagnostics.Did_you_mean_to_use_new_with_this_expression : Diagnostics.Did_you_mean_to_call_this_expression - )); + addRelatedInfo( + diagnostic, + createDiagnosticForNode( + node, + signatures === constructSignatures ? Diagnostics.Did_you_mean_to_use_new_with_this_expression : Diagnostics.Did_you_mean_to_call_this_expression + ) + ); return true; } } @@ -330793,10 +333216,13 @@ ${lanes.join("\n")} ); if (resultObj.errors) { if (target.symbol && length(target.symbol.declarations)) { - addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], createDiagnosticForNode( - target.symbol.declarations[0], - Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature - )); + addRelatedInfo( + resultObj.errors[resultObj.errors.length - 1], + createDiagnosticForNode( + target.symbol.declarations[0], + Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature + ) + ); } if ((getFunctionFlags(node) & 2 /* Async */) === 0 && !getTypeOfPropertyOfType(sourceReturn, "then") && checkTypeRelatedTo( createPromiseType(sourceReturn), @@ -330805,10 +333231,13 @@ ${lanes.join("\n")} /*errorNode*/ void 0 )) { - addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], createDiagnosticForNode( - node, - Diagnostics.Did_you_mean_to_mark_this_function_as_async - )); + addRelatedInfo( + resultObj.errors[resultObj.errors.length - 1], + createDiagnosticForNode( + node, + Diagnostics.Did_you_mean_to_mark_this_function_as_async + ) + ); } return true; } @@ -330903,12 +333332,15 @@ ${lanes.join("\n")} if (!issuedElaboration && (targetProp && length(targetProp.declarations) || target.symbol && length(target.symbol.declarations))) { const targetNode = targetProp && length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0]; if (!getSourceFileOfNode(targetNode).hasNoDefaultLib) { - addRelatedInfo(reportedDiag, createDiagnosticForNode( - targetNode, - Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, - propertyName && !(nameType.flags & 8192 /* UniqueESSymbol */) ? unescapeLeadingUnderscores(propertyName) : typeToString(nameType), - typeToString(target) - )); + addRelatedInfo( + reportedDiag, + createDiagnosticForNode( + targetNode, + Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, + propertyName && !(nameType.flags & 8192 /* UniqueESSymbol */) ? unescapeLeadingUnderscores(propertyName) : typeToString(nameType), + typeToString(target) + ) + ); } } } @@ -331011,16 +333443,16 @@ ${lanes.join("\n")} } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 293 /* JsxExpression */: + case 294 /* JsxExpression */: return { errorNode: child, innerExpression: child.expression, nameType }; case 12 /* JsxText */: if (child.containsOnlyTriviaWhiteSpaces) { break; } return { errorNode: child, innerExpression: void 0, nameType, errorMessage: getInvalidTextDiagnostic() }; - case 283 /* JsxElement */: - case 284 /* JsxSelfClosingElement */: - case 287 /* JsxFragment */: + case 284 /* JsxElement */: + case 285 /* JsxSelfClosingElement */: + case 288 /* JsxFragment */: return { errorNode: child, innerExpression: child, nameType }; default: return Debug.assertNever(child, "Found invalid jsx child"); @@ -331061,7 +333493,7 @@ ${lanes.join("\n")} result = elaborateIterableOrArrayLikeTargetElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result; } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { result = true; - const diag2 = error( + const diag2 = error2( containingElement.openingElement.tagName, Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided, childrenPropName, @@ -331089,7 +333521,7 @@ ${lanes.join("\n")} } } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { result = true; - const diag2 = error( + const diag2 = error2( containingElement.openingElement.tagName, Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided, childrenPropName, @@ -331109,14 +333541,7 @@ ${lanes.join("\n")} const childrenPropName = childPropName === void 0 ? "children" : unescapeLeadingUnderscores(childPropName); const childrenTargetType = getIndexedAccessType(target, getStringLiteralType(childrenPropName)); const diagnostic = Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2; - invalidTextDiagnostic = { ...diagnostic, key: "!!ALREADY FORMATTED!!", message: formatMessage( - /*dummy*/ - void 0, - diagnostic, - tagNameText, - childrenPropName, - typeToString(childrenTargetType) - ) }; + invalidTextDiagnostic = { ...diagnostic, key: "!!ALREADY FORMATTED!!", message: formatMessage(diagnostic, tagNameText, childrenPropName, typeToString(childrenTargetType)) }; } return invalidTextDiagnostic; } @@ -331132,7 +333557,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) { @@ -331170,13 +333596,13 @@ ${lanes.join("\n")} continue; } switch (prop.kind) { - case 177 /* SetAccessor */: - case 176 /* GetAccessor */: - case 173 /* MethodDeclaration */: - case 303 /* ShorthandPropertyAssignment */: + case 178 /* SetAccessor */: + case 177 /* GetAccessor */: + case 174 /* MethodDeclaration */: + case 304 /* ShorthandPropertyAssignment */: yield { errorNode: prop.name, innerExpression: void 0, nameType: type }; break; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 }; break; default: @@ -331251,7 +333677,7 @@ ${lanes.join("\n")} void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers); } const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 173 /* MethodDeclaration */ && kind !== 172 /* MethodSignature */ && kind !== 175 /* Constructor */; + const strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 174 /* MethodDeclaration */ && kind !== 173 /* MethodSignature */ && kind !== 176 /* Constructor */; let result = -1 /* True */; const sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -331275,12 +333701,12 @@ ${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 callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && (getTypeFacts(sourceType) & 50331648 /* IsUndefinedOrNull */) === (getTypeFacts(targetType) & 50331648 /* IsUndefinedOrNull */); + 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, targetType, @@ -331297,11 +333723,7 @@ ${lanes.join("\n")} } if (!related) { if (reportErrors2) { - errorReporter( - Diagnostics.Types_of_parameters_0_and_1_are_incompatible, - unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), - unescapeLeadingUnderscores(getParameterNameAtPosition(target, i)) - ); + errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); } return 0 /* False */; } @@ -331417,27 +333839,52 @@ ${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( - getDeclaredTypeOfSymbol(targetSymbol), - /*enclosingDeclaration*/ - void 0, - 64 /* UseFullyQualifiedType */ - ) - ); + errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(sourceProperty), typeToString( + getDeclaredTypeOfSymbol(targetSymbol), + /*enclosingDeclaration*/ + void 0, + 64 /* UseFullyQualifiedType */ + )); enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */); } else { enumRelation.set(id, 2 /* Failed */); } 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 */); @@ -331570,6 +334017,7 @@ ${lanes.join("\n")} let errorInfo; let relatedInfo; let maybeKeys; + let maybeKeysSet; let sourceStack; let targetStack; let maybeCount = 0; @@ -331578,8 +334026,10 @@ ${lanes.join("\n")} let expandingFlags = 0 /* None */; let overflow = false; let overrideNextErrorInfo = 0; + let skipParentCounter = 0; let lastSkippedInfo; let incompatibleStack; + let relationCount = 16e6 - relation.size >> 3; Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); const result = isRelatedTo( source, @@ -331593,8 +334043,19 @@ ${lanes.join("\n")} reportIncompatibleStack(); } if (overflow) { + const id = getRelationKey( + source, + target, + /*intersectionState*/ + 0 /* None */, + relation, + /*ignoreConstraints*/ + false + ); + relation.set(id, 4 /* Reported */ | 2 /* Failed */); (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth }); - const diag2 = error(errorNode || currentNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); + const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1; + const diag2 = error2(errorNode || currentNode, message, typeToString(source), typeToString(target)); if (errorOutputContainer) { (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); } @@ -331643,6 +334104,7 @@ ${lanes.join("\n")} lastSkippedInfo = saved.lastSkippedInfo; incompatibleStack = saved.incompatibleStack; overrideNextErrorInfo = saved.overrideNextErrorInfo; + skipParentCounter = saved.skipParentCounter; relatedInfo = saved.relatedInfo; } function captureErrorCalculationState() { @@ -331651,6 +334113,7 @@ ${lanes.join("\n")} lastSkippedInfo, incompatibleStack: incompatibleStack == null ? void 0 : incompatibleStack.slice(), overrideNextErrorInfo, + skipParentCounter, relatedInfo: relatedInfo == null ? void 0 : relatedInfo.slice() }; } @@ -331755,7 +334218,15 @@ ${lanes.join("\n")} reportIncompatibleStack(); if (message.elidedInCompatabilityPyramid) return; - errorInfo = chainDiagnosticMessages(errorInfo, message, ...args); + if (skipParentCounter === 0) { + errorInfo = chainDiagnosticMessages(errorInfo, message, ...args); + } else { + skipParentCounter--; + } + } + function reportParentSkippedError(message, ...args) { + reportError(message, ...args); + skipParentCounter++; } function associateRelatedInfo(info) { Debug.assert(!!errorInfo); @@ -332092,18 +334563,9 @@ ${lanes.join("\n")} } } if (suggestion !== void 0) { - reportError( - Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, - symbolToString(prop), - typeToString(errorTarget), - suggestion - ); + reportParentSkippedError(Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString(prop), typeToString(errorTarget), suggestion); } else { - reportError( - Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, - symbolToString(prop), - typeToString(errorTarget) - ); + reportParentSkippedError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(errorTarget)); } } } @@ -332124,10 +334586,20 @@ ${lanes.join("\n")} } function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) { if (source2.flags & 1048576 /* Union */) { + if (target2.flags & 1048576 /* Union */) { + const sourceOrigin = source2.origin; + if (sourceOrigin && sourceOrigin.flags & 2097152 /* Intersection */ && target2.aliasSymbol && contains(sourceOrigin.types, target2)) { + return -1 /* True */; + } + const targetOrigin = target2.origin; + if (targetOrigin && targetOrigin.flags & 1048576 /* Union */ && source2.aliasSymbol && contains(targetOrigin.types, source2)) { + return -1 /* True */; + } + } 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 */); @@ -332172,7 +334644,8 @@ ${lanes.join("\n")} sourceType, target2, /*reportErrors*/ - false + false, + 0 /* None */ ); if (!related) { return 0 /* False */; @@ -332181,7 +334654,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)) { @@ -332199,7 +334672,10 @@ ${lanes.join("\n")} match, 2 /* Target */, /*reportErrors*/ - false + false, + /*headMessage*/ + void 0, + intersectionState ); if (related) { return related; @@ -332212,7 +334688,10 @@ ${lanes.join("\n")} type, 2 /* Target */, /*reportErrors*/ - false + false, + /*headMessage*/ + void 0, + intersectionState ); if (related) { return related; @@ -332226,7 +334705,10 @@ ${lanes.join("\n")} bestMatchingType, 2 /* Target */, /*reportErrors*/ - true + true, + /*headMessage*/ + void 0, + intersectionState ); } } @@ -332437,11 +334919,19 @@ ${lanes.join("\n")} return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; } } + if (relationCount <= 0) { + overflow = true; + return 0 /* False */; + } if (!maybeKeys) { maybeKeys = []; + maybeKeysSet = /* @__PURE__ */ new Set(); sourceStack = []; targetStack = []; } else { + if (maybeKeysSet.has(id)) { + return 3 /* Maybe */; + } const broadestEquivalentId = id.startsWith("*") ? getRelationKey( source2, target2, @@ -332450,10 +334940,8 @@ ${lanes.join("\n")} /*ignoreConstraints*/ true ) : void 0; - for (let i = 0; i < maybeCount; i++) { - if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) { - return 3 /* Maybe */; - } + if (broadestEquivalentId && maybeKeysSet.has(broadestEquivalentId)) { + return 3 /* Maybe */; } if (sourceDepth === 100 || targetDepth === 100) { overflow = true; @@ -332462,6 +334950,7 @@ ${lanes.join("\n")} } const maybeStart = maybeCount; maybeKeys[maybeCount] = id; + maybeKeysSet.add(id); maybeCount++; const saveExpandingFlags = expandingFlags; if (recursionFlags & 1 /* Source */) { @@ -332514,17 +335003,36 @@ ${lanes.join("\n")} if (result2) { if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) { if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) { - for (let i = maybeStart; i < maybeCount; i++) { - relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); - } + resetMaybeStack( + /*markAllAsSucceeded*/ + true + ); + } else { + resetMaybeStack( + /*markAllAsSucceeded*/ + false + ); } - maybeCount = maybeStart; } } else { relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags); - maybeCount = maybeStart; + relationCount--; + resetMaybeStack( + /*markAllAsSucceeded*/ + false + ); } return result2; + function resetMaybeStack(markAllAsSucceeded) { + for (let i = maybeStart; i < maybeCount; i++) { + maybeKeysSet.delete(maybeKeys[i]); + if (markAllAsSucceeded) { + relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); + relationCount--; + } + } + maybeCount = maybeStart; + } } function structuredTypeRelatedTo(source2, target2, reportErrors2, intersectionState) { const saveErrorInfo = captureErrorCalculationState(); @@ -332584,6 +335092,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; @@ -332722,7 +335242,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, @@ -332766,16 +335286,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; } @@ -332936,26 +335448,6 @@ ${lanes.join("\n")} )) { return result2; } - if (sourceFlags & 8388608 /* IndexedAccess */) { - const indexType = source2.indexType; - if (indexType.flags & 4194304 /* Index */) { - const unresolvedIndexConstraint = getBaseConstraintOfType(indexType.type); - const indexConstraint = unresolvedIndexConstraint && unresolvedIndexConstraint !== noConstraintType ? getIndexType(unresolvedIndexConstraint) : keyofConstraintType; - const constraint2 = getIndexedAccessType(source2.objectType, indexConstraint); - if (result2 = isRelatedTo( - constraint2, - target2, - 1 /* Source */, - /*reportErrors*/ - false, - /*headMessage*/ - void 0, - intersectionState - )) { - return result2; - } - } - } if (isMappedTypeGenericIndexedAccess(source2)) { const indexConstraint = getConstraintOfType(source2.indexType); if (indexConstraint) { @@ -332966,9 +335458,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); @@ -333018,13 +335519,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) { @@ -333032,6 +335526,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 */; @@ -333299,42 +335800,27 @@ ${lanes.join("\n")} function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState, skipOptional) { const sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp); const targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp); - if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { + if (sourcePropFlags & 2 /* Private */ || targetPropFlags & 2 /* Private */) { if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { if (reportErrors2) { - if (sourcePropFlags & 8 /* Private */ && targetPropFlags & 8 /* Private */) { + if (sourcePropFlags & 2 /* Private */ && targetPropFlags & 2 /* Private */) { reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); } else { - reportError( - Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, - symbolToString(targetProp), - typeToString(sourcePropFlags & 8 /* Private */ ? source2 : target2), - typeToString(sourcePropFlags & 8 /* Private */ ? target2 : source2) - ); + reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags & 2 /* Private */ ? source2 : target2), typeToString(sourcePropFlags & 2 /* Private */ ? target2 : source2)); } } return 0 /* False */; } - } else if (targetPropFlags & 16 /* Protected */) { + } else if (targetPropFlags & 4 /* Protected */) { if (!isValidOverrideOf(sourceProp, targetProp)) { if (reportErrors2) { - reportError( - Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, - symbolToString(targetProp), - typeToString(getDeclaringClass(sourceProp) || source2), - typeToString(getDeclaringClass(targetProp) || target2) - ); + reportError(Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source2), typeToString(getDeclaringClass(targetProp) || target2)); } return 0 /* False */; } - } else if (sourcePropFlags & 16 /* Protected */) { + } else if (sourcePropFlags & 4 /* Protected */) { if (reportErrors2) { - reportError( - Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, - symbolToString(targetProp), - typeToString(source2), - typeToString(target2) - ); + reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source2), typeToString(target2)); } return 0 /* False */; } @@ -333350,12 +335836,7 @@ ${lanes.join("\n")} } if (!skipOptional && sourceProp.flags & 16777216 /* Optional */ && targetProp.flags & 106500 /* ClassMember */ && !(targetProp.flags & 16777216 /* Optional */)) { if (reportErrors2) { - reportError( - Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, - symbolToString(targetProp), - typeToString(source2), - typeToString(target2) - ); + reportError(Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source2), typeToString(target2)); } return 0 /* False */; } @@ -333601,8 +336082,14 @@ ${lanes.join("\n")} } const sourceIsJSConstructor = source2.symbol && isJSConstructor(source2.symbol.valueDeclaration); const targetIsJSConstructor = target2.symbol && isJSConstructor(target2.symbol.valueDeclaration); - const sourceSignatures = getSignaturesOfType(source2, sourceIsJSConstructor && kind === 1 /* Construct */ ? 0 /* Call */ : kind); - const targetSignatures = getSignaturesOfType(target2, targetIsJSConstructor && kind === 1 /* Construct */ ? 0 /* Call */ : kind); + const sourceSignatures = getSignaturesOfType( + source2, + sourceIsJSConstructor && kind === 1 /* Construct */ ? 0 /* Call */ : kind + ); + const targetSignatures = getSignaturesOfType( + target2, + targetIsJSConstructor && kind === 1 /* Construct */ ? 0 /* Call */ : kind + ); if (kind === 1 /* Construct */ && sourceSignatures.length && targetSignatures.length) { const sourceIsAbstract = !!(sourceSignatures[0].flags & 4 /* Abstract */); const targetIsAbstract = !!(targetSignatures[0].flags & 4 /* Abstract */); @@ -333621,6 +336108,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], @@ -333641,7 +336129,7 @@ ${lanes.join("\n")} const sourceSignature = first(sourceSignatures); const targetSignature = first(targetSignatures); result2 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature)); - if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a2 = targetSignature.declaration) == null ? void 0 : _a2.kind) === 175 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 175 /* Constructor */)) { + if (!result2 && reportErrors2 && kind === 1 /* Construct */ && sourceObjectFlags & targetObjectFlags && (((_a2 = targetSignature.declaration) == null ? void 0 : _a2.kind) === 176 /* Constructor */ || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176 /* Constructor */)) { const constructSignatureToString = (signature) => signatureToString( signature, /*enclosingDeclaration*/ @@ -333676,18 +336164,14 @@ ${lanes.join("\n")} shouldElaborateErrors = false; } if (shouldElaborateErrors) { - reportError( - Diagnostics.Type_0_provides_no_match_for_the_signature_1, - typeToString(source2), - signatureToString( - t, - /*enclosingDeclaration*/ - void 0, - /*flags*/ - void 0, - kind - ) - ); + reportError(Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source2), signatureToString( + t, + /*enclosingDeclaration*/ + void 0, + /*flags*/ + void 0, + kind + )); } return 0 /* False */; } @@ -333720,16 +336204,7 @@ ${lanes.join("\n")} } function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) { const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */; - return compareSignaturesRelated( - erase ? getErasedSignature(source2) : source2, - erase ? getErasedSignature(target2) : target2, - checkMode, - reportErrors2, - reportError, - incompatibleReporter, - isRelatedToWorker2, - reportUnreliableMapper - ); + return compareSignaturesRelated(erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, checkMode, reportErrors2, reportError, incompatibleReporter, isRelatedToWorker2, reportUnreliableMapper); function isRelatedToWorker2(source3, target3, reportErrors3) { return isRelatedTo( source3, @@ -333874,15 +336349,15 @@ ${lanes.join("\n")} if (!sourceSignature.declaration || !targetSignature.declaration) { return true; } - const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration, 24 /* NonPublicAccessibilityModifier */); - const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration, 24 /* NonPublicAccessibilityModifier */); - if (targetAccessibility === 8 /* Private */) { + const sourceAccessibility = getSelectedEffectiveModifierFlags(sourceSignature.declaration, 6 /* NonPublicAccessibilityModifier */); + const targetAccessibility = getSelectedEffectiveModifierFlags(targetSignature.declaration, 6 /* NonPublicAccessibilityModifier */); + if (targetAccessibility === 2 /* Private */) { return true; } - if (targetAccessibility === 16 /* Protected */ && sourceAccessibility !== 8 /* Private */) { + if (targetAccessibility === 4 /* Protected */ && sourceAccessibility !== 2 /* Private */) { return true; } - if (targetAccessibility !== 16 /* Protected */ && !sourceAccessibility) { + if (targetAccessibility !== 4 /* Protected */ && !sourceAccessibility) { return true; } if (reportErrors2) { @@ -333927,7 +336402,7 @@ ${lanes.join("\n")} let matched = false; for (let i = 0; i < types.length; i++) { if (include[i]) { - const targetType = getTypeOfPropertyOfType(types[i], propertyName); + const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName); if (targetType && related(getDiscriminatingType(), targetType)) { matched = true; } else { @@ -333941,7 +336416,7 @@ ${lanes.join("\n")} } } } - const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target; + const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target; return filtered.flags & 131072 /* Never */ ? target : filtered; } function isWeakType(type) { @@ -333982,7 +336457,7 @@ ${lanes.join("\n")} const variances = []; for (const tp of typeParameters) { const modifiers = getTypeParameterModifiers(tp); - let variance = modifiers & 65536 /* Out */ ? modifiers & 32768 /* In */ ? 0 /* Invariant */ : 1 /* Covariant */ : modifiers & 32768 /* In */ ? 2 /* Contravariant */ : void 0; + let variance = modifiers & 16384 /* Out */ ? modifiers & 8192 /* In */ ? 0 /* Invariant */ : 1 /* Covariant */ : modifiers & 8192 /* In */ ? 2 /* Contravariant */ : void 0; if (variance === void 0) { let unmeasurable = false; let unreliable = false; @@ -334030,7 +336505,7 @@ ${lanes.join("\n")} } function getTypeParameterModifiers(tp) { var _a; - return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (32768 /* In */ | 65536 /* Out */ | 2048 /* Const */); + return reduceLeft((_a = tp.symbol) == null ? void 0 : _a.declarations, (modifiers, d) => modifiers | getEffectiveModifierFlags(d), 0 /* None */) & (8192 /* In */ | 16384 /* Out */ | 4096 /* Const */); } function hasCovariantVoidArgument(typeArguments, variances) { for (let i = 0; i < variances.length; i++) { @@ -334115,13 +336590,16 @@ ${lanes.join("\n")} }); } function isValidOverrideOf(sourceProp, targetProp) { - return !forEachProperty2(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) & 16 /* Protected */ ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false); + return !forEachProperty2(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) & 4 /* Protected */ ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false); } function isClassDerivedFromDeclaringClasses(checkClass, prop, writing) { - return forEachProperty2(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) & 16 /* Protected */ ? !hasBaseType(checkClass, getDeclaringClass(p)) : false) ? void 0 : checkClass; + return forEachProperty2(prop, (p) => getDeclarationModifierFlagsFromSymbol(p, writing) & 4 /* Protected */ ? !hasBaseType(checkClass, getDeclaringClass(p)) : false) ? void 0 : checkClass; } function isDeeplyNestedType(type, stack, depth, maxDepth = 3) { if (depth >= maxDepth) { + if ((getObjectFlags(type) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */) { + type = getMappedTargetWithSymbol(type); + } if (type.flags & 2097152 /* Intersection */) { return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth)); } @@ -334130,7 +336608,7 @@ ${lanes.join("\n")} let lastTypeId = 0; for (let i = 0; i < depth; i++) { const t = stack[i]; - if (t.flags & 2097152 /* Intersection */ ? some(t.types, (u) => getRecursionIdentity(u) === identity2) : getRecursionIdentity(t) === identity2) { + if (hasMatchingRecursionIdentity(t, identity2)) { if (t.id >= lastTypeId) { count++; if (count >= maxDepth) { @@ -334143,9 +336621,25 @@ ${lanes.join("\n")} } return false; } + function getMappedTargetWithSymbol(type) { + let target; + while ((getObjectFlags(type) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */ && (target = getModifiersTypeFromMappedType(type)) && (target.symbol || target.flags & 2097152 /* Intersection */ && some(target.types, (t) => !!t.symbol))) { + type = target; + } + return type; + } + function hasMatchingRecursionIdentity(type, identity2) { + if ((getObjectFlags(type) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */) { + type = getMappedTargetWithSymbol(type); + } + if (type.flags & 2097152 /* Intersection */) { + return some(type.types, (t) => hasMatchingRecursionIdentity(t, identity2)); + } + return getRecursionIdentity(type) === identity2; + } function getRecursionIdentity(type) { if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) { - if (getObjectFlags(type) && 4 /* Reference */ && type.node) { + if (getObjectFlags(type) & 4 /* Reference */ && type.node) { return type.node; } if (type.symbol && !(getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) { @@ -334176,8 +336670,8 @@ ${lanes.join("\n")} if (sourceProp === targetProp) { return -1 /* True */; } - const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) & 24 /* NonPublicAccessibilityModifier */; - const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) & 24 /* NonPublicAccessibilityModifier */; + const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) & 6 /* NonPublicAccessibilityModifier */; + const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) & 6 /* NonPublicAccessibilityModifier */; if (sourcePropAccessibility !== targetPropAccessibility) { return 0 /* False */; } @@ -334315,6 +336809,9 @@ ${lanes.join("\n")} function isArrayLikeType(type) { return isArrayType(type) || !(type.flags & 98304 /* Nullable */) && isTypeAssignableTo(type, anyReadonlyArrayType); } + function isMutableArrayLikeType(type) { + return isMutableArrayOrTuple(type) || !(type.flags & (1 /* Any */ | 98304 /* Nullable */)) && isTypeAssignableTo(type, anyArrayType); + } function getSingleBaseForNonAugmentingSubtype(type) { if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) { return void 0; @@ -334326,7 +336823,7 @@ ${lanes.join("\n")} const target = type.target; if (getObjectFlags(target) & 1 /* Class */) { const baseTypeNode = getBaseTypeNodeOfClass(target); - if (baseTypeNode && baseTypeNode.expression.kind !== 80 /* Identifier */ && baseTypeNode.expression.kind !== 210 /* PropertyAccessExpression */) { + if (baseTypeNode && baseTypeNode.expression.kind !== 80 /* Identifier */ && baseTypeNode.expression.kind !== 211 /* PropertyAccessExpression */) { return void 0; } } @@ -334352,7 +336849,8 @@ ${lanes.join("\n")} return !!elementType && isEmptyLiteralType(elementType); } function isTupleLikeType(type) { - return isTupleType(type) || !!getPropertyOfType(type, "0"); + let lengthType; + return isTupleType(type) || !!getPropertyOfType(type, "0") || isArrayLikeType(type) && !!(lengthType = getTypeOfPropertyOfType(type, "length")) && everyType(lengthType, (t) => !!(t.flags & 256 /* NumberLiteral */)); } function isArrayOrTupleLikeType(type) { return isArrayLikeType(type) || isTupleLikeType(type); @@ -334363,17 +336861,7 @@ ${lanes.join("\n")} return propType; } if (everyType(type, isTupleType)) { - return mapType(type, (t) => { - const tupleType = t; - const restType = getRestTypeOfTupleType(tupleType); - if (!restType) { - return undefinedType; - } - if (compilerOptions.noUncheckedIndexedAccess && index >= tupleType.target.fixedLength + getEndElementCount(tupleType.target, 3 /* Fixed */)) { - return getUnionType([restType, undefinedType]); - } - return restType; - }); + return getTupleElementTypeOutOfStartCount(type, index, compilerOptions.noUncheckedIndexedAccess ? undefinedType : void 0); } return void 0; } @@ -334441,6 +336929,19 @@ ${lanes.join("\n")} function getRestTypeOfTupleType(type) { return getElementTypeOfSliceOfTupleType(type, type.target.fixedLength); } + function getTupleElementTypeOutOfStartCount(type, index, undefinedOrMissingType2) { + return mapType(type, (t) => { + const tupleType = t; + const restType = getRestTypeOfTupleType(tupleType); + if (!restType) { + return undefinedType; + } + if (undefinedOrMissingType2 && index >= getTotalFixedElementCount(tupleType.target)) { + return getUnionType([restType, undefinedOrMissingType2]); + } + return restType; + }); + } function getRestArrayTypeOfTupleType(type) { const restType = getRestTypeOfTupleType(type); return restType && createArrayType(restType); @@ -334465,7 +336966,7 @@ ${lanes.join("\n")} return value.base10Value === "0"; } function removeDefinitelyFalsyTypes(type) { - return filterType(type, (t) => !!(getTypeFacts(t) & 4194304 /* Truthy */)); + return filterType(type, (t) => hasTypeFacts(t, 4194304 /* Truthy */)); } function extractDefinitelyFalsyTypes(type) { return mapType(type, getDefinitelyFalsyPartOfType); @@ -334634,13 +337135,7 @@ ${lanes.join("\n")} } } } - const result = createAnonymousType( - type.symbol, - members, - emptyArray, - emptyArray, - sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)) - ); + const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly))); result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */); return result; } @@ -334709,7 +337204,7 @@ ${lanes.join("\n")} const t = getTypeOfSymbol(p); if (getObjectFlags(t) & 65536 /* ContainsWideningType */) { if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); + error2(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); } errorReported = true; } @@ -334725,16 +337220,16 @@ ${lanes.join("\n")} } let diagnostic; switch (declaration.kind) { - case 225 /* BinaryExpression */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: + case 226 /* BinaryExpression */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: diagnostic = noImplicitAny ? Diagnostics.Member_0_implicitly_has_an_1_type : Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 168 /* Parameter */: + case 169 /* Parameter */: const param = declaration; if (isIdentifier(param.name)) { const originalKeywordKind = identifierToKeywordKind(param.name); - if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( + if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName( param, param.name.escapedText, 788968 /* Type */, @@ -334752,40 +337247,40 @@ ${lanes.join("\n")} } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 207 /* BindingElement */: + case 208 /* BindingElement */: diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { return; } break; - case 323 /* JSDocFunctionType */: - error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); + case 324 /* JSDocFunctionType */: + error2(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 329 /* JSDocSignature */: + case 330 /* JSDocSignature */: if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) { - error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); + error2(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); } return; - case 261 /* FunctionDeclaration */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 3 /* GeneratorYield */) { - error(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); + error2(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); } else { - error(declaration, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); + error2(declaration, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); } return; } diagnostic = !noImplicitAny ? Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : wideningKind === 3 /* GeneratorYield */ ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 199 /* MappedType */: + case 200 /* MappedType */: if (noImplicitAny) { - error(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); + error2(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } return; default: @@ -334820,7 +337315,12 @@ ${lanes.join("\n")} callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } if (targetRestType) { - callback(getRestTypeAtPosition(source, paramCount), targetRestType); + callback(getRestTypeAtPosition( + source, + paramCount, + /*readonly*/ + isConstTypeVariable(targetRestType) && !someType(targetRestType, isMutableArrayLikeType) + ), targetRestType); } } function applyToReturnTypes(source, target, callback) { @@ -334853,19 +337353,25 @@ ${lanes.join("\n")} return context; } function makeFixingMapperForContext(context) { - return makeDeferredTypeMapper(map(context.inferences, (i) => i.typeParameter), map(context.inferences, (inference, i) => () => { - if (!inference.isFixed) { - inferFromIntraExpressionSites(context); - clearCachedInferences(context.inferences); - inference.isFixed = true; - } - return getInferredType(context, i); - })); + return makeDeferredTypeMapper( + map(context.inferences, (i) => i.typeParameter), + map(context.inferences, (inference, i) => () => { + if (!inference.isFixed) { + inferFromIntraExpressionSites(context); + clearCachedInferences(context.inferences); + inference.isFixed = true; + } + return getInferredType(context, i); + }) + ); } function makeNonFixingMapperForContext(context) { - return makeDeferredTypeMapper(map(context.inferences, (i) => i.typeParameter), map(context.inferences, (_, i) => () => { - return getInferredType(context, i); - })); + return makeDeferredTypeMapper( + map(context.inferences, (i) => i.typeParameter), + map(context.inferences, (_, i) => () => { + return getInferredType(context, i); + }) + ); } function clearCachedInferences(inferences) { for (const inference of inferences) { @@ -334880,7 +337386,7 @@ ${lanes.join("\n")} function inferFromIntraExpressionSites(context) { if (context.intraExpressionInferenceSites) { for (const { node, type } of context.intraExpressionInferenceSites) { - const contextualType = node.kind === 173 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */); + const contextualType = node.kind === 174 /* MethodDeclaration */ ? getContextualTypeForObjectLiteralMethod(node, 2 /* NoConstraints */) : getContextualType2(node, 2 /* NoConstraints */); if (contextualType) { inferTypes(context.inferences, type, contextualType); } @@ -334924,16 +337430,16 @@ ${lanes.join("\n")} if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 1048576 /* CouldContainTypeVariables */); } - const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables)); - if (type.flags & 138117121 /* ObjectFlagsType */) { + const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables)); + if (type.flags & 3899393 /* ObjectFlagsType */) { type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0); } return result; } function isNonGenericTopLevelType(type) { if (type.aliasSymbol && !type.aliasTypeArguments) { - const declaration = getDeclarationOfKind(type.aliasSymbol, 264 /* TypeAliasDeclaration */); - return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 311 /* SourceFile */ ? true : n.kind === 266 /* ModuleDeclaration */ ? false : "quit")); + const declaration = getDeclarationOfKind(type.aliasSymbol, 265 /* TypeAliasDeclaration */); + return !!(declaration && findAncestor(declaration.parent, (n) => n.kind === 312 /* SourceFile */ ? true : n.kind === 267 /* ModuleDeclaration */ ? false : "quit")); } return false; } @@ -334975,17 +337481,18 @@ ${lanes.join("\n")} ); } function inferTypeForHomomorphicMappedType(source, target, constraint) { - if (inInferTypeForHomomorphicMappedType) { - return void 0; + const cacheKey = source.id + "," + target.id + "," + constraint.id; + if (reverseMappedCache.has(cacheKey)) { + return reverseMappedCache.get(cacheKey); } - const key = source.id + "," + target.id + "," + constraint.id; - if (reverseMappedCache.has(key)) { - return reverseMappedCache.get(key); + const recursionKey = source.id + "," + (target.target || target).id; + if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) { + return void 0; } - inInferTypeForHomomorphicMappedType = true; + homomorphicMappedTypeInferenceStack.push(recursionKey); const type = createReverseMappedType(source, target, constraint); - inInferTypeForHomomorphicMappedType = false; - reverseMappedCache.set(key, type); + homomorphicMappedTypeInferenceStack.pop(); + reverseMappedCache.set(cacheKey, type); return type; } function isPartiallyInferableType(type) { @@ -335118,7 +337625,10 @@ ${lanes.join("\n")} return false; } function isValidTypeForTemplateLiteralPlaceholder(source, target) { - if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) { + 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 */) { @@ -335131,13 +337641,13 @@ ${lanes.join("\n")} value, /*roundTripOnly*/ false - ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target)); + ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target)); } if (source.flags & 134217728 /* TemplateLiteral */) { 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; @@ -335206,17 +337716,16 @@ ${lanes.join("\n")} let bivariant = false; let propagationType; let inferencePriority = 2048 /* MaxValue */; - let allowComplexConstraintInference = true; let visited; let sourceStack; let targetStack; let expandingFlags = 0 /* None */; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { - if (!couldContainTypeVariables(target)) { + if (!couldContainTypeVariables(target) || isNoInferType(target)) { return; } - if (source === wildcardType) { + if (source === wildcardType || source === blockedStringType) { const savePropagationType = propagationType; propagationType = source; inferFromTypes(target, target); @@ -335260,7 +337769,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 */) { @@ -335273,6 +337786,10 @@ ${lanes.join("\n")} return; } if (!inference.isFixed) { + const candidate = propagationType || source; + if (candidate === blockedStringType) { + return; + } if (inference.priority === void 0 || priority < inference.priority) { inference.candidates = void 0; inference.contraCandidates = void 0; @@ -335280,7 +337797,6 @@ ${lanes.join("\n")} inference.priority = priority; } if (priority === inference.priority) { - const candidate = propagationType || source; if (contravariant && !bivariant) { if (!contains(inference.contraCandidates, candidate)) { inference.contraCandidates = append(inference.contraCandidates, candidate); @@ -335359,10 +337875,12 @@ ${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 && allowComplexConstraintInference && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) { - allowComplexConstraintInference = false; + if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) { return inferFromTypes(apparentSource, target); } source = apparentSource; @@ -335533,7 +338051,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; @@ -335611,11 +338129,7 @@ ${lanes.join("\n")} )) { allTypeFlags &= ~2112 /* BigIntLike */; } - const matchingType = reduceLeft( - constraintTypes, - (left, right) => !(right.flags & allTypeFlags) ? left : left.flags & 4 /* String */ ? left : right.flags & 4 /* String */ ? source2 : left.flags & 134217728 /* TemplateLiteral */ ? left : right.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source2, right) ? source2 : left.flags & 268435456 /* StringMapping */ ? left : right.flags & 268435456 /* StringMapping */ && str === applyStringMapping(right.symbol, str) ? source2 : left.flags & 128 /* StringLiteral */ ? left : right.flags & 128 /* StringLiteral */ && right.value === str ? right : left.flags & 8 /* Number */ ? left : right.flags & 8 /* Number */ ? getNumberLiteralType(+str) : left.flags & 32 /* Enum */ ? left : right.flags & 32 /* Enum */ ? getNumberLiteralType(+str) : left.flags & 256 /* NumberLiteral */ ? left : right.flags & 256 /* NumberLiteral */ && right.value === +str ? right : left.flags & 64 /* BigInt */ ? left : right.flags & 64 /* BigInt */ ? parseBigIntLiteralType(str) : left.flags & 2048 /* BigIntLiteral */ ? left : right.flags & 2048 /* BigIntLiteral */ && pseudoBigIntToString(right.value) === str ? right : left.flags & 16 /* Boolean */ ? left : right.flags & 16 /* Boolean */ ? str === "true" ? trueType : str === "false" ? falseType : booleanType : left.flags & 512 /* BooleanLiteral */ ? left : right.flags & 512 /* BooleanLiteral */ && right.intrinsicName === str ? right : left.flags & 32768 /* Undefined */ ? left : right.flags & 32768 /* Undefined */ && right.intrinsicName === str ? right : left.flags & 65536 /* Null */ ? left : right.flags & 65536 /* Null */ && right.intrinsicName === str ? right : left, - neverType - ); + const matchingType = reduceLeft(constraintTypes, (left, right) => !(right.flags & allTypeFlags) ? left : left.flags & 4 /* String */ ? left : right.flags & 4 /* String */ ? source2 : left.flags & 134217728 /* TemplateLiteral */ ? left : right.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source2, right) ? source2 : left.flags & 268435456 /* StringMapping */ ? left : right.flags & 268435456 /* StringMapping */ && str === applyStringMapping(right.symbol, str) ? source2 : left.flags & 128 /* StringLiteral */ ? left : right.flags & 128 /* StringLiteral */ && right.value === str ? right : left.flags & 8 /* Number */ ? left : right.flags & 8 /* Number */ ? getNumberLiteralType(+str) : left.flags & 32 /* Enum */ ? left : right.flags & 32 /* Enum */ ? getNumberLiteralType(+str) : left.flags & 256 /* NumberLiteral */ ? left : right.flags & 256 /* NumberLiteral */ && right.value === +str ? right : left.flags & 64 /* BigInt */ ? left : right.flags & 64 /* BigInt */ ? parseBigIntLiteralType(str) : left.flags & 2048 /* BigIntLiteral */ ? left : right.flags & 2048 /* BigIntLiteral */ && pseudoBigIntToString(right.value) === str ? right : left.flags & 16 /* Boolean */ ? left : right.flags & 16 /* Boolean */ ? str === "true" ? trueType : str === "false" ? falseType : booleanType : left.flags & 512 /* BooleanLiteral */ ? left : right.flags & 512 /* BooleanLiteral */ && right.intrinsicName === str ? right : left.flags & 32768 /* Undefined */ ? left : right.flags & 32768 /* Undefined */ && right.intrinsicName === str ? right : left.flags & 65536 /* Null */ ? left : right.flags & 65536 /* Null */ && right.intrinsicName === str ? right : left, neverType); if (!(matchingType.flags & 131072 /* Never */)) { inferFromTypes(matchingType, target2); continue; @@ -335627,6 +338141,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))) { @@ -335634,12 +338156,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); @@ -335661,10 +338178,7 @@ ${lanes.join("\n")} return; } const startLength = isTupleType(source) ? Math.min(source.target.fixedLength, target.target.fixedLength) : 0; - const endLength = Math.min( - isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, - target.target.hasRestElement ? getEndElementCount(target.target, 3 /* Fixed */) : 0 - ); + const endLength = Math.min(isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, target.target.hasRestElement ? getEndElementCount(target.target, 3 /* Fixed */) : 0); for (let i = 0; i < startLength; i++) { inferFromTypes(getTypeArguments(source)[i], elementTypes[i]); } @@ -335746,19 +338260,21 @@ ${lanes.join("\n")} } function inferFromSignatures(source, target, kind) { const sourceSignatures = getSignaturesOfType(source, kind); - const targetSignatures = getSignaturesOfType(target, kind); const sourceLen = sourceSignatures.length; - const targetLen = targetSignatures.length; - const len = sourceLen < targetLen ? sourceLen : targetLen; - for (let i = 0; i < len; i++) { - inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i])); + if (sourceLen > 0) { + const targetSignatures = getSignaturesOfType(target, kind); + const targetLen = targetSignatures.length; + for (let i = 0; i < targetLen; i++) { + const sourceIndex = Math.max(sourceLen - targetLen + i, 0); + inferFromSignature(getBaseSignature(sourceSignatures[sourceIndex]), getErasedSignature(targetSignatures[i])); + } } } function inferFromSignature(source, target) { if (!(source.flags & 64 /* IsNonInferrable */)) { const saveBivariant = bivariant; const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */; + bivariant = bivariant || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 176 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes); bivariant = saveBivariant; } @@ -335892,6 +338408,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": @@ -335916,7 +338434,7 @@ ${lanes.join("\n")} return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function; } default: - if (node.parent.kind === 303 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) { return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { return Diagnostics.Cannot_find_name_0; @@ -335939,14 +338457,8 @@ ${lanes.join("\n")} } return links.resolvedSymbol; } - function isInTypeQuery(node) { - return !!findAncestor( - node, - (n) => n.kind === 185 /* TypeQuery */ ? true : n.kind === 80 /* Identifier */ || n.kind === 165 /* QualifiedName */ ? false : "quit" - ); - } function isInAmbientOrTypeNode(node) { - return !!(node.flags & 16777216 /* Ambient */ || findAncestor(node, (n) => isInterfaceDeclaration(n) || isTypeAliasDeclaration(n) || isTypeLiteralNode(n))); + return !!(node.flags & 33554432 /* Ambient */ || findAncestor(node, (n) => isInterfaceDeclaration(n) || isTypeAliasDeclaration(n) || isTypeLiteralNode(n))); } function getFlowCacheKey(node, declaredType, initialType, flowContainer) { switch (node.kind) { @@ -335957,41 +338469,41 @@ ${lanes.join("\n")} } case 110 /* ThisKeyword */: return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`; - case 234 /* NonNullExpression */: - case 216 /* ParenthesizedExpression */: + case 235 /* NonNullExpression */: + case 217 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer); return left && left + "." + node.right.escapedText; - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: const propName = getAccessedPropertyName(node); if (propName !== void 0) { const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); return key && key + "." + propName; } break; - case 205 /* ObjectBindingPattern */: - case 206 /* ArrayBindingPattern */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: + case 206 /* ObjectBindingPattern */: + case 207 /* ArrayBindingPattern */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: return `${getNodeId(node)}#${getTypeId(declaredType)}`; } return void 0; } function isMatchingReference(source, target) { switch (target.kind) { - case 216 /* ParenthesizedExpression */: - case 234 /* NonNullExpression */: + case 217 /* ParenthesizedExpression */: + case 235 /* NonNullExpression */: return isMatchingReference(source, target.expression); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return isAssignmentExpression(target) && isMatchingReference(source, target.left) || isBinaryExpression(target) && target.operatorToken.kind === 28 /* CommaToken */ && isMatchingReference(source, target.right); } switch (source.kind) { - case 235 /* MetaProperty */: - return target.kind === 235 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText; + case 236 /* MetaProperty */: + return target.kind === 236 /* MetaProperty */ && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText; case 80 /* Identifier */: case 81 /* PrivateIdentifier */: return isThisInTypeQuery(source) ? target.kind === 110 /* ThisKeyword */ : target.kind === 80 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || (isVariableDeclaration(target) || isBindingElement(target)) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfDeclaration(target); @@ -335999,17 +338511,17 @@ ${lanes.join("\n")} return target.kind === 110 /* ThisKeyword */; case 108 /* SuperKeyword */: return target.kind === 108 /* SuperKeyword */; - case 234 /* NonNullExpression */: - case 216 /* ParenthesizedExpression */: + case 235 /* NonNullExpression */: + case 217 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: const sourcePropertyName = getAccessedPropertyName(source); const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0; return sourcePropertyName !== void 0 && targetPropertyName !== void 0 && targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression); - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return isBinaryExpression(source) && source.operatorToken.kind === 28 /* CommaToken */ && isMatchingReference(source.right, target); } return false; @@ -336043,7 +338555,7 @@ ${lanes.join("\n")} /*ignoreErrors*/ true ); - if (!symbol || !(isConstVariable(symbol) || symbol.flags & 8 /* EnumMember */)) + if (!symbol || !(isConstantVariable(symbol) || symbol.flags & 8 /* EnumMember */)) return void 0; const declaration = symbol.valueDeclaration; if (declaration === void 0) @@ -336058,7 +338570,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); @@ -336162,7 +338675,7 @@ ${lanes.join("\n")} } function getMatchingUnionConstituentForObjectLiteral(unionType, node) { const keyPropertyName = getKeyPropertyName(unionType); - const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 302 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer)); + const propNode = keyPropertyName && find(node.properties, (p) => p.symbol && p.kind === 303 /* PropertyAssignment */ && p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer)); const propType = propNode && getContextFreeTypeOfExpression(propNode.initializer); return propType && getConstituentTypeForKeyType(unionType, propType); } @@ -336172,16 +338685,46 @@ ${lanes.join("\n")} function hasMatchingArgument(expression, reference) { if (expression.arguments) { for (const argument of expression.arguments) { - if (isOrContainsMatchingReference(reference, argument)) { + if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference) || getCandidateDiscriminantPropertyAccess(argument, reference)) { return true; } } } - if (expression.expression.kind === 210 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) { + if (expression.expression.kind === 211 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, expression.expression.expression)) { return true; } return false; } + function getCandidateDiscriminantPropertyAccess(expr, reference) { + if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) { + if (isIdentifier(expr)) { + const symbol = getResolvedSymbol(expr); + const declaration = symbol.valueDeclaration; + if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) { + return declaration; + } + } + } else if (isAccessExpression(expr)) { + if (isMatchingReference(reference, expr.expression)) { + return expr; + } + } else if (isIdentifier(expr)) { + const symbol = getResolvedSymbol(expr); + if (isConstantVariable(symbol)) { + const declaration = symbol.valueDeclaration; + if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) { + return declaration.initializer; + } + if (isBindingElement(declaration) && !declaration.initializer) { + const parent2 = declaration.parent.parent; + if (isVariableDeclaration(parent2) && !parent2.type && parent2.initializer && (isIdentifier(parent2.initializer) || isAccessExpression(parent2.initializer)) && isMatchingReference(reference, parent2.initializer)) { + return declaration; + } + } + } + } + return void 0; + } function getFlowNodeId(flow) { if (!flow.id || flow.id < 0) { flow.id = nextFlowId; @@ -336219,7 +338762,13 @@ ${lanes.join("\n")} const resolved = resolveStructuredTypeMembers(type); return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType)); } - function getTypeFacts(type) { + function getTypeFacts(type, mask2) { + return getTypeFactsWorker(type, mask2) & mask2; + } + function hasTypeFacts(type, mask2) { + return getTypeFacts(type, mask2) !== 0; + } + function getTypeFactsWorker(type, callerOnlyNeeds) { if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) { type = getBaseConstraintOfType(type) || unknownType; } @@ -336252,6 +338801,10 @@ ${lanes.join("\n")} return strictNullChecks ? type === falseType || type === regularFalseType ? 12121864 /* FalseStrictFacts */ : 7927560 /* TrueStrictFacts */ : type === falseType || type === regularFalseType ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */; } if (flags & 524288 /* Object */) { + const possibleFacts = strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ | 7880640 /* FunctionStrictFacts */ | 7888800 /* ObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ | 16728e3 /* FunctionFacts */ | 16736160 /* ObjectFacts */; + if ((callerOnlyNeeds & possibleFacts) === 0) { + return 0; + } return getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ? strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ : isFunctionObjectType(type) ? strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728e3 /* FunctionFacts */ : strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } if (flags & 16384 /* Void */) { @@ -336273,20 +338826,20 @@ ${lanes.join("\n")} return 0 /* None */; } if (flags & 1048576 /* Union */) { - return reduceLeft(type.types, (facts, t) => facts | getTypeFacts(t), 0 /* None */); + return reduceLeft(type.types, (facts, t) => facts | getTypeFactsWorker(t, callerOnlyNeeds), 0 /* None */); } if (flags & 2097152 /* Intersection */) { - return getIntersectionTypeFacts(type); + return getIntersectionTypeFacts(type, callerOnlyNeeds); } return 83886079 /* UnknownFacts */; } - function getIntersectionTypeFacts(type) { + function getIntersectionTypeFacts(type, callerOnlyNeeds) { const ignoreObjects = maybeTypeOfKind(type, 402784252 /* Primitive */); let oredFacts = 0 /* None */; let andedFacts = 134217727 /* All */; for (const t of type.types) { if (!(ignoreObjects && t.flags & 524288 /* Object */)) { - const f = getTypeFacts(t); + const f = getTypeFactsWorker(t, callerOnlyNeeds); oredFacts |= f; andedFacts &= f; } @@ -336294,19 +338847,19 @@ ${lanes.join("\n")} return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */; } function getTypeWithFacts(type, include) { - return filterType(type, (t) => (getTypeFacts(t) & include) !== 0); + return filterType(type, (t) => hasTypeFacts(t, include)); } function getAdjustedTypeWithFacts(type, facts) { const reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 /* Unknown */ ? unknownUnionType : type, facts)); if (strictNullChecks) { switch (facts) { case 524288 /* NEUndefined */: - return mapType(reduced, (t) => getTypeFacts(t) & 65536 /* EQUndefined */ ? getIntersectionType([t, getTypeFacts(t) & 131072 /* EQNull */ && !maybeTypeOfKind(reduced, 65536 /* Null */) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t); + return mapType(reduced, (t) => hasTypeFacts(t, 65536 /* EQUndefined */) ? getIntersectionType([t, hasTypeFacts(t, 131072 /* EQNull */) && !maybeTypeOfKind(reduced, 65536 /* Null */) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t); case 1048576 /* NENull */: - return mapType(reduced, (t) => getTypeFacts(t) & 131072 /* EQNull */ ? getIntersectionType([t, getTypeFacts(t) & 65536 /* EQUndefined */ && !maybeTypeOfKind(reduced, 32768 /* Undefined */) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t); + return mapType(reduced, (t) => hasTypeFacts(t, 131072 /* EQNull */) ? getIntersectionType([t, hasTypeFacts(t, 65536 /* EQUndefined */) && !maybeTypeOfKind(reduced, 32768 /* Undefined */) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t); case 2097152 /* NEUndefinedOrNull */: case 4194304 /* Truthy */: - return mapType(reduced, (t) => getTypeFacts(t) & 262144 /* EQUndefinedOrNull */ ? getGlobalNonNullableTypeInstantiation(t) : t); + return mapType(reduced, (t) => hasTypeFacts(t, 262144 /* EQUndefinedOrNull */) ? getGlobalNonNullableTypeInstantiation(t) : t); } } return reduced; @@ -336349,11 +338902,11 @@ ${lanes.join("\n")} ) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - const isDestructuringDefaultAssignment = node.parent.kind === 208 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 302 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + const isDestructuringDefaultAssignment = node.parent.kind === 209 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 303 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent2) { - return parent2.parent.kind === 225 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 249 /* ForOfStatement */ && parent2.parent.initializer === parent2; + return parent2.parent.kind === 226 /* BinaryExpression */ && parent2.parent.left === parent2 || parent2.parent.kind === 250 /* ForOfStatement */ && parent2.parent.initializer === parent2; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -336370,21 +338923,21 @@ ${lanes.join("\n")} function getAssignedType(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return stringType; - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return checkRightHandSideOfForOf(parent2) || errorType; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent2); - case 219 /* DeleteExpression */: + case 220 /* DeleteExpression */: return undefinedType; - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent2, node); - case 229 /* SpreadElement */: + case 230 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent2); - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent2); - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent2); } return errorType; @@ -336392,7 +338945,7 @@ ${lanes.join("\n")} function getInitialTypeOfBindingElement(node) { const pattern = node.parent; const parentType = getInitialType(pattern.parent); - const type = pattern.kind === 205 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); + const type = pattern.kind === 206 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); return getTypeWithDefault(type, node.initializer); } function getTypeOfInitializer(node) { @@ -336403,25 +338956,25 @@ ${lanes.join("\n")} if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 248 /* ForInStatement */) { + if (node.parent.parent.kind === 249 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 249 /* ForOfStatement */) { + if (node.parent.parent.kind === 250 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 259 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); + return node.kind === 260 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 259 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 207 /* BindingElement */ && node.parent.kind === 225 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right); + return node.kind === 260 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 208 /* BindingElement */ && node.parent.kind === 226 /* BinaryExpression */ && isEmptyArrayLiteral2(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: switch (node.operatorToken.kind) { case 64 /* EqualsToken */: case 76 /* BarBarEqualsToken */: @@ -336436,10 +338989,10 @@ ${lanes.join("\n")} } function getReferenceRoot(node) { const { parent: parent2 } = node; - return parent2.kind === 216 /* ParenthesizedExpression */ || parent2.kind === 225 /* BinaryExpression */ && parent2.operatorToken.kind === 64 /* EqualsToken */ && parent2.left === node || parent2.kind === 225 /* BinaryExpression */ && parent2.operatorToken.kind === 28 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node; + return parent2.kind === 217 /* ParenthesizedExpression */ || parent2.kind === 226 /* BinaryExpression */ && parent2.operatorToken.kind === 64 /* EqualsToken */ && parent2.left === node || parent2.kind === 226 /* BinaryExpression */ && parent2.operatorToken.kind === 28 /* CommaToken */ && parent2.right === node ? getReferenceRoot(parent2) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 295 /* CaseClause */) { + if (clause.kind === 296 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -336455,12 +339008,12 @@ ${lanes.join("\n")} return links.switchTypes; } function getSwitchClauseTypeOfWitnesses(switchStatement) { - if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 295 /* CaseClause */ && !isStringLiteralLike(clause.expression))) { + if (some(switchStatement.caseBlock.clauses, (clause) => clause.kind === 296 /* CaseClause */ && !isStringLiteralLike(clause.expression))) { return void 0; } const witnesses = []; for (const clause of switchStatement.caseBlock.clauses) { - const text = clause.kind === 295 /* CaseClause */ ? clause.expression.text : void 0; + const text = clause.kind === 296 /* CaseClause */ ? clause.expression.text : void 0; witnesses.push(text && !contains(witnesses, text) ? text : void 0); } return witnesses; @@ -336592,7 +339145,9 @@ ${lanes.join("\n")} return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType])); } function createFinalArrayType(elementType) { - return elementType.flags & 131072 /* Never */ ? autoArrayType : createArrayType(elementType.flags & 1048576 /* Union */ ? getUnionType(elementType.types, 2 /* Subtype */) : elementType); + return elementType.flags & 131072 /* Never */ ? autoArrayType : createArrayType( + elementType.flags & 1048576 /* Union */ ? getUnionType(elementType.types, 2 /* Subtype */) : elementType + ); } function getFinalArrayType(evolvingArrayType) { return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType)); @@ -336618,8 +339173,8 @@ ${lanes.join("\n")} function isEvolvingArrayOperationTarget(node) { const root = getReferenceRoot(node); const parent2 = root.parent; - const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 212 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name)); - const isElementAssignment = parent2.kind === 211 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 225 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 64 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */); + const isLengthPushOrUnshift = isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 213 /* CallExpression */ && isIdentifier(parent2.name) && isPushOrUnshiftIdentifier(parent2.name)); + const isElementAssignment = parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === root && parent2.parent.kind === 226 /* BinaryExpression */ && parent2.parent.operatorToken.kind === 64 /* EqualsToken */ && parent2.parent.left === parent2 && !isAssignmentTarget(parent2.parent) && isTypeAssignableToKind(getTypeOfExpression(parent2.argumentExpression), 296 /* NumberLike */); return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(node) { @@ -336642,7 +339197,7 @@ ${lanes.join("\n")} if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 249 /* ForOfStatement */) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250 /* ForOfStatement */) { const statement = declaration.parent.parent; const expressionType = getTypeOfDottedName( statement.expression, @@ -336667,7 +339222,7 @@ ${lanes.join("\n")} } } function getTypeOfDottedName(node, diagnostic) { - if (!(node.flags & 33554432 /* InWithStatement */)) { + if (!(node.flags & 67108864 /* InWithStatement */)) { switch (node.kind) { case 80 /* Identifier */: const symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node)); @@ -336676,7 +339231,7 @@ ${lanes.join("\n")} return getExplicitThisType(node); case 108 /* SuperKeyword */: return checkSuperExpression(node); - case 210 /* PropertyAccessExpression */: { + case 211 /* PropertyAccessExpression */: { const type = getTypeOfDottedName(node.expression, diagnostic); if (type) { const name = node.name; @@ -336693,7 +339248,7 @@ ${lanes.join("\n")} } return void 0; } - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -336703,7 +339258,10 @@ ${lanes.join("\n")} let signature = links.effectsSignature; if (signature === void 0) { let funcType; - if (node.parent.kind === 243 /* ExpressionStatement */) { + if (isBinaryExpression(node)) { + const rightType = checkNonNullExpression(node.right); + funcType = getSymbolHasInstanceMethodOfObjectType(rightType); + } else if (node.parent.kind === 244 /* ExpressionStatement */) { funcType = getTypeOfDottedName( node.expression, /*diagnostic*/ @@ -336757,7 +339315,7 @@ ${lanes.join("\n")} /*excludeJSDocTypeAssertions*/ true ); - return node.kind === 97 /* FalseKeyword */ || node.kind === 225 /* BinaryExpression */ && (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 57 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); + return node.kind === 97 /* FalseKeyword */ || node.kind === 226 /* BinaryExpression */ && (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 57 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { while (true) { @@ -336876,15 +339434,21 @@ ${lanes.join("\n")} } function isConstantReference(node) { switch (node.kind) { + case 110 /* ThisKeyword */: + return true; case 80 /* Identifier */: if (!isThisInTypeQuery(node)) { const symbol = getResolvedSymbol(node); - return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); + return isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol); } break; - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + 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; } @@ -336903,7 +339467,7 @@ ${lanes.join("\n")} const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode)); sharedFlowCount = sharedFlowStart; const resultType = getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 234 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType === nonNullUnknownType ? unknownType : resultType; @@ -336972,7 +339536,7 @@ ${lanes.join("\n")} target.antecedents = saveAntecedents; } else if (flags & 2 /* Start */) { const container = flow.node; - if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && reference.kind !== 110 /* ThisKeyword */) { + if (container && container !== flowContainer && reference.kind !== 211 /* PropertyAccessExpression */ && reference.kind !== 212 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 219 /* ArrowFunction */)) { flow = container.flowNode; continue; } @@ -336991,7 +339555,10 @@ ${lanes.join("\n")} } function getInitialOrAssignedType(flow) { const node = flow.node; - return getNarrowableTypeForReference(node.kind === 259 /* VariableDeclaration */ || node.kind === 207 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); + return getNarrowableTypeForReference( + node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), + reference + ); } function getTypeAtFlowAssignment(flow) { const node = flow.node; @@ -337010,24 +339577,25 @@ ${lanes.join("\n")} const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow)); return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType; } - if (declaredType.flags & 1048576 /* Union */) { - return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow)); + const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType; + if (t.flags & 1048576 /* Union */) { + return getAssignmentReducedType(t, getInitialOrAssignedType(flow)); } - return declaredType; + return t; } if (containsMatchingReference(reference, node)) { if (!isReachableFlowNode(flow)) { return unreachableNeverType; } - if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConst(node))) { + if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConstLike(node))) { const init = getDeclaredExpandoInitializer(node); - if (init && (init.kind === 217 /* FunctionExpression */ || init.kind === 218 /* ArrowFunction */)) { + if (init && (init.kind === 218 /* FunctionExpression */ || init.kind === 219 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } - if (isVariableDeclaration(node) && node.parent.parent.kind === 248 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { + if (isVariableDeclaration(node) && node.parent.parent.kind === 249 /* ForInStatement */ && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)))); } return void 0; @@ -337041,7 +339609,7 @@ ${lanes.join("\n")} if (node.kind === 97 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 225 /* BinaryExpression */) { + if (node.kind === 226 /* BinaryExpression */) { if (node.operatorToken.kind === 56 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -337081,13 +339649,13 @@ ${lanes.join("\n")} function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { const node = flow.node; - const expr = node.kind === 212 /* CallExpression */ ? node.expression.expression : node.left.expression; + const expr = node.kind === 213 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { const flowType = getTypeAtFlowNode(flow.antecedent); const type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & 256 /* EvolvingArray */) { let evolvedType2 = type; - if (node.kind === 212 /* CallExpression */) { + if (node.kind === 213 /* CallExpression */) { for (const arg of node.arguments) { evolvedType2 = addEvolvingArrayElementType(evolvedType2, arg); } @@ -337119,31 +339687,21 @@ ${lanes.join("\n")} return createFlowType(narrowedType, isIncomplete(flowType)); } function getTypeAtSwitchClause(flow) { - const expr = flow.switchStatement.expression; + const expr = skipParentheses(flow.switchStatement.expression); const flowType = getTypeAtFlowNode(flow.antecedent); let type = getTypeFromFlowType(flowType); if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); - } else if (expr.kind === 220 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + } else if (expr.kind === 221 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); + } else if (expr.kind === 112 /* TrueKeyword */) { + type = narrowTypeBySwitchOnTrue(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { if (strictNullChecks) { if (optionalChainContainsReference(expr, reference)) { - type = narrowTypeBySwitchOptionalChainContainment( - type, - flow.switchStatement, - flow.clauseStart, - flow.clauseEnd, - (t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)) - ); - } else if (expr.kind === 220 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { - type = narrowTypeBySwitchOptionalChainContainment( - type, - flow.switchStatement, - flow.clauseStart, - flow.clauseEnd, - (t) => !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined") - ); + type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, (t) => !(t.flags & (32768 /* Undefined */ | 131072 /* Never */))); + } else if (expr.kind === 221 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, (t) => !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined")); } } const access = getDiscriminantPropertyAccess(expr, type); @@ -337266,44 +339824,16 @@ ${lanes.join("\n")} } return result; } - function getCandidateDiscriminantPropertyAccess(expr) { - if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) { - if (isIdentifier(expr)) { - const symbol = getResolvedSymbol(expr); - const declaration = symbol.valueDeclaration; - if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) { - return declaration; - } - } - } else if (isAccessExpression(expr)) { - if (isMatchingReference(reference, expr.expression)) { - return expr; - } - } else if (isIdentifier(expr)) { - const symbol = getResolvedSymbol(expr); - if (isConstVariable(symbol)) { - const declaration = symbol.valueDeclaration; - if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) { - return declaration.initializer; - } - if (isBindingElement(declaration) && !declaration.initializer) { - const parent2 = declaration.parent.parent; - if (isVariableDeclaration(parent2) && !parent2.type && parent2.initializer && (isIdentifier(parent2.initializer) || isAccessExpression(parent2.initializer)) && isMatchingReference(reference, parent2.initializer)) { - return declaration; - } - } - } - } - return void 0; - } function getDiscriminantPropertyAccess(expr, computedType) { - const type = declaredType.flags & 1048576 /* Union */ ? declaredType : computedType; - if (type.flags & 1048576 /* Union */) { - const access = getCandidateDiscriminantPropertyAccess(expr); + if (declaredType.flags & 1048576 /* Union */ || computedType.flags & 1048576 /* Union */) { + const access = getCandidateDiscriminantPropertyAccess(expr, reference); if (access) { const name = getAccessedPropertyName(access); - if (name && isDiscriminantProperty(type, name)) { - return access; + if (name) { + const type = declaredType.flags & 1048576 /* Union */ && isTypeSubsetOf(computedType, declaredType) ? declaredType : computedType; + if (isDiscriminantProperty(type, name)) { + return access; + } } } } @@ -337323,7 +339853,7 @@ ${lanes.join("\n")} propType = removeNullable && optionalChain ? getOptionalType(propType) : propType; const narrowedPropType = narrowType2(propType); return filterType(type, (t) => { - const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName); + const discriminantType = getTypeOfPropertyOrIndexSignatureOfType(t, propName) || unknownType; return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType); }); } @@ -337385,6 +339915,10 @@ ${lanes.join("\n")} } return type; } + function narrowTypeByBooleanComparison(type, expr, bool, operator, assumeTrue) { + assumeTrue = assumeTrue !== (bool.kind === 112 /* TrueKeyword */) !== (operator !== 38 /* ExclamationEqualsEqualsToken */ && operator !== 36 /* ExclamationEqualsToken */); + return narrowType(type, expr, assumeTrue); + } function narrowTypeByBinaryExpression(type, expr, assumeTrue) { switch (expr.operatorToken.kind) { case 64 /* EqualsToken */: @@ -337399,10 +339933,10 @@ ${lanes.join("\n")} const operator = expr.operatorToken.kind; const left = getReferenceCandidate(expr.left); const right = getReferenceCandidate(expr.right); - if (left.kind === 220 /* TypeOfExpression */ && isStringLiteralLike(right)) { + if (left.kind === 221 /* TypeOfExpression */ && isStringLiteralLike(right)) { return narrowTypeByTypeof(type, left, operator, right, assumeTrue); } - if (right.kind === 220 /* TypeOfExpression */ && isStringLiteralLike(left)) { + if (right.kind === 221 /* TypeOfExpression */ && isStringLiteralLike(left)) { return narrowTypeByTypeof(type, right, operator, left, assumeTrue); } if (isMatchingReference(reference, left)) { @@ -337432,6 +339966,12 @@ ${lanes.join("\n")} if (isMatchingConstructorReference(right)) { return narrowTypeByConstructor(type, operator, left, assumeTrue); } + if (isBooleanLiteral(right) && !isAccessExpression(left)) { + return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue); + } + if (isBooleanLiteral(left) && !isAccessExpression(right)) { + return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue); + } break; case 104 /* InstanceOfKeyword */: return narrowTypeByInstanceof(type, expr, assumeTrue); @@ -337440,12 +339980,15 @@ ${lanes.join("\n")} return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue); } const target = getReferenceCandidate(expr.right); - const leftType = getTypeOfExpression(expr.left); - if (leftType.flags & 8576 /* StringOrNumberLiteralOrUnique */) { - if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target) && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) { + if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target)) { + const leftType = getTypeOfExpression(expr.left); + if (isTypeUsableAsPropertyName(leftType) && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) { return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */); } - if (isMatchingReference(reference, target)) { + } + if (isMatchingReference(reference, target)) { + const leftType = getTypeOfExpression(expr.left); + if (isTypeUsableAsPropertyName(leftType)) { return narrowTypeByInKeyword(type, leftType, assumeTrue); } } @@ -337644,14 +340187,14 @@ ${lanes.join("\n")} // the constituent based on its type facts. We use the strict subtype relation because it treats `object` // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`, // but are classified as "function" according to `typeof`. - isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : ( + isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? hasTypeFacts(t, facts) ? t : neverType : ( // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`. isTypeSubtypeOf(impliedType, t) ? impliedType : ( // Neither the constituent nor the implied type is a subtype of the other, however their domains may still // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate // possible overlap, we form an intersection. Otherwise, we eliminate the constituent. - getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType + hasTypeFacts(t, facts) ? getIntersectionType([t, impliedType]) : neverType ) ) )); @@ -337661,15 +340204,51 @@ ${lanes.join("\n")} if (!witnesses) { return type; } - const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 296 /* DefaultClause */); + const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */); const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd; if (hasDefaultClause) { const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses); - return filterType(type, (t) => (getTypeFacts(t) & notEqualFacts) === notEqualFacts); + return filterType(type, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts); } const clauseWitnesses = witnesses.slice(clauseStart, clauseEnd); return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType)); } + function narrowTypeBySwitchOnTrue(type, switchStatement, clauseStart, clauseEnd) { + const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */); + const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd; + for (let i = 0; i < clauseStart; i++) { + const clause = switchStatement.caseBlock.clauses[i]; + if (clause.kind === 296 /* CaseClause */) { + type = narrowType( + type, + clause.expression, + /*assumeTrue*/ + false + ); + } + } + if (hasDefaultClause) { + for (let i = clauseEnd; i < switchStatement.caseBlock.clauses.length; i++) { + const clause = switchStatement.caseBlock.clauses[i]; + if (clause.kind === 296 /* CaseClause */) { + type = narrowType( + type, + clause.expression, + /*assumeTrue*/ + false + ); + } + } + return type; + } + const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd); + return getUnionType(map(clauses, (clause) => clause.kind === 296 /* CaseClause */ ? narrowType( + type, + clause.expression, + /*assumeTrue*/ + true + ) : neverType)); + } function isMatchingConstructorReference(expr) { return (isPropertyAccessExpression(expr) && idText(expr.name) === "constructor" || isElementAccessExpression(expr) && isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor") && isMatchingReference(reference, expr.expression); } @@ -337709,7 +340288,22 @@ ${lanes.join("\n")} } return type; } - const rightType = getTypeOfExpression(expr.right); + const right = expr.right; + const rightType = getTypeOfExpression(right); + if (!isTypeDerivedFrom(rightType, globalObjectType)) { + return type; + } + const signature = getEffectsSignature(expr); + const predicate = signature && getTypePredicateOfSignature(signature); + if (predicate && predicate.kind === 1 /* Identifier */ && predicate.parameterIndex === 0) { + return getNarrowedType( + type, + predicate.type, + assumeTrue, + /*checkDerived*/ + true + ); + } if (!isTypeDerivedFrom(rightType, globalFunctionType)) { return type; } @@ -337742,6 +340336,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)); } @@ -337758,12 +340355,18 @@ ${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) => { const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName); const matching = discriminant && getConstituentTypeForKeyType(type, discriminant); - const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType); + const directlyRelated = mapType( + matching || type, + checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType + ); return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated; }); return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]); @@ -337800,7 +340403,7 @@ ${lanes.join("\n")} false ); } - if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) && !(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) { + if (strictNullChecks && optionalChainContainsReference(predicateArgument, reference) && (assumeTrue && !hasTypeFacts(predicate.type, 65536 /* EQUndefined */) || !assumeTrue && everyType(predicate.type, isNullableType))) { type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */); } const access = getDiscriminantPropertyAccess(predicateArgument, type); @@ -337825,7 +340428,7 @@ ${lanes.join("\n")} case 80 /* Identifier */: if (!isMatchingReference(reference, expr) && inlineLevel < 5) { const symbol = getResolvedSymbol(expr); - if (isConstVariable(symbol)) { + if (isConstantVariable(symbol)) { const declaration = symbol.valueDeclaration; if (declaration && isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isConstantReference(reference)) { inlineLevel++; @@ -337837,17 +340440,17 @@ ${lanes.join("\n")} } case 110 /* ThisKeyword */: case 108 /* SuperKeyword */: - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 216 /* ParenthesizedExpression */: - case 234 /* NonNullExpression */: + case 217 /* ParenthesizedExpression */: + case 235 /* NonNullExpression */: return narrowType(type, expr.expression, assumeTrue); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: if (expr.operator === 54 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -337873,7 +340476,15 @@ ${lanes.join("\n")} location = location.parent; } if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) { - const type = getTypeOfExpression(location); + const type = removeOptionalTypeMarker( + isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression( + location, + /*checkMode*/ + void 0, + /*writeOnly*/ + true + ) : getTypeOfExpression(location) + ); if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) { return type; } @@ -337882,42 +340493,117 @@ ${lanes.join("\n")} if (isDeclarationName(location) && isSetAccessor(location.parent) && getAnnotatedAccessorTypeNode(location.parent)) { return getWriteTypeOfAccessors(location.parent.symbol); } - return getNonMissingTypeOfSymbol(symbol); + return isRightSideOfAccessExpression(location) && isWriteAccess(location.parent) ? getWriteTypeOfSymbol(symbol) : getNonMissingTypeOfSymbol(symbol); } function getControlFlowContainer(node) { - return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 267 /* ModuleBlock */ || node2.kind === 311 /* SourceFile */ || node2.kind === 171 /* PropertyDeclaration */); + 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 & 524288 /* AssignmentsMarked */)) { - links.flags |= 524288 /* AssignmentsMarked */; + if (!(links.flags & 131072 /* AssignmentsMarked */)) { + links.flags |= 131072 /* AssignmentsMarked */; if (!hasParentWithAssignmentsMarked(parent2)) { 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 & 524288 /* 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 isConstVariable(symbol) { - return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0; + 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); @@ -337926,7 +340612,7 @@ ${lanes.join("\n")} reportCircularityError(declaration.symbol); return true; } - const containsUndefined = !!(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */); + const containsUndefined = !!hasTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */), 16777216 /* IsUndefined */); if (!popTypeResolution()) { reportCircularityError(declaration.symbol); return true; @@ -337936,12 +340622,12 @@ ${lanes.join("\n")} return links.parameterInitializerContainsUndefined; } function removeOptionalityFromDeclaredType(declaredType, declaration) { - const removeUndefined = strictNullChecks && declaration.kind === 168 /* Parameter */ && declaration.initializer && getTypeFacts(declaredType) & 16777216 /* IsUndefined */ && !parameterInitializerContainsUndefined(declaration); + const removeUndefined = strictNullChecks && declaration.kind === 169 /* Parameter */ && declaration.initializer && hasTypeFacts(declaredType, 16777216 /* IsUndefined */) && !parameterInitializerContainsUndefined(declaration); return removeUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType; } function isConstraintPosition(type, node) { const parent2 = node.parent; - return parent2.kind === 210 /* PropertyAccessExpression */ || parent2.kind === 165 /* QualifiedName */ || parent2.kind === 212 /* CallExpression */ && parent2.expression === node || parent2.kind === 211 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression))); + return parent2.kind === 211 /* PropertyAccessExpression */ || parent2.kind === 166 /* QualifiedName */ || parent2.kind === 213 /* CallExpression */ && parent2.expression === node || parent2.kind === 212 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression))); } function isGenericTypeWithUnionConstraint(type) { return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithUnionConstraint) : !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */)); @@ -337950,7 +340636,7 @@ ${lanes.join("\n")} return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithoutNullableConstraint) : !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */)); } function hasContextualTypeWithNoGenericTypes(node, checkMode) { - const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 64 /* RestBindingElement */ ? getContextualType2(node, 8 /* SkipBindingPatterns */) : getContextualType2( + const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 32 /* RestBindingElement */ ? getContextualType2(node, 8 /* SkipBindingPatterns */) : getContextualType2( node, /*contextFlags*/ void 0 @@ -337984,9 +340670,13 @@ ${lanes.join("\n")} symbol, /*excludes*/ 111551 /* Value */ - ) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */)) { + ) && !isInTypeQuery(location)) { const target = resolveAlias(symbol); - if (getAllSymbolFlags(target) & (111551 /* Value */ | 1048576 /* ExportValue */)) { + if (getSymbolFlags( + symbol, + /*excludeTypeOnlyMeanings*/ + true + ) & (111551 /* Value */ | 1048576 /* ExportValue */)) { if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { markAliasSymbolAsReferenced(symbol); } else { @@ -337995,21 +340685,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 === 259 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent2.kind === 168 /* 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 & 16777216 /* InCheckIdentifier */)) { - links.flags |= 16777216 /* InCheckIdentifier */; + if (!(links.flags & 4194304 /* InCheckIdentifier */)) { + links.flags |= 4194304 /* InCheckIdentifier */; const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */); const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType); - links.flags &= ~16777216 /* InCheckIdentifier */; - if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 168 /* Parameter */ && isSymbolAssigned(symbol))) { + links.flags &= ~4194304 /* InCheckIdentifier */; + if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) { const pattern = declaration.parent; const narrowedType = getFlowTypeOfReference( pattern, @@ -338022,7 +340713,12 @@ ${lanes.join("\n")} if (narrowedType.flags & 131072 /* Never */) { return neverType; } - return getBindingElementTypeFromParentType(declaration, narrowedType); + return getBindingElementTypeFromParentType( + declaration, + narrowedType, + /*noTupleBoundsCheck*/ + true + ); } } } @@ -338033,7 +340729,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, @@ -338061,18 +340757,26 @@ ${lanes.join("\n")} } if (symbol === argumentsSymbol) { if (isInPropertyInitializerOrClassStaticBlock(node)) { - error(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers); + error2(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers); return errorType; } - const container = getContainingFunction(node); - if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 218 /* ArrowFunction */) { - error(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, 512 /* Async */)) { - error(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)) { @@ -338085,17 +340789,7 @@ ${lanes.join("\n")} } let declaration = localOrExportSymbol.valueDeclaration; if (declaration && localOrExportSymbol.flags & 32 /* Class */) { - if (declaration.kind === 262 /* ClassDeclaration */ && nodeIsDecorated(legacyDecorators, declaration)) { - let container = getContainingClass(node); - while (container !== void 0) { - if (container === declaration && container.name !== node) { - getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */; - getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */; - break; - } - container = getContainingClass(container); - } - } else if (declaration.kind === 230 /* ClassExpression */) { + if (isClassLike(declaration) && declaration.name !== node) { let container = getThisContainer( node, /*includeArrowFunctions*/ @@ -338103,14 +340797,7 @@ ${lanes.join("\n")} /*includeClassComputedPropertyName*/ false ); - while (container.kind !== 311 /* SourceFile */) { - if (container.parent === declaration) { - if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) { - getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */; - getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */; - } - break; - } + while (container.kind !== 312 /* SourceFile */ && container.parent !== declaration) { container = getThisContainer( container, /*includeArrowFunctions*/ @@ -338119,22 +340806,27 @@ ${lanes.join("\n")} false ); } + if (container.kind !== 312 /* SourceFile */) { + getNodeLinks(declaration).flags |= 262144 /* ContainsConstructorReference */; + getNodeLinks(container).flags |= 262144 /* ContainsConstructorReference */; + getNodeLinks(node).flags |= 536870912 /* ConstructorReference */; + } } } 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 */)) { const assignmentError = localOrExportSymbol.flags & 384 /* Enum */ ? Diagnostics.Cannot_assign_to_0_because_it_is_an_enum : localOrExportSymbol.flags & 32 /* Class */ ? Diagnostics.Cannot_assign_to_0_because_it_is_a_class : localOrExportSymbol.flags & 1536 /* Module */ ? Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace : localOrExportSymbol.flags & 16 /* Function */ ? Diagnostics.Cannot_assign_to_0_because_it_is_a_function : localOrExportSymbol.flags & 2097152 /* Alias */ ? Diagnostics.Cannot_assign_to_0_because_it_is_an_import : Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable; - error(node, assignmentError, symbolToString(symbol)); + error2(node, assignmentError, symbolToString(symbol)); return errorType; } if (isReadonlySymbol(localOrExportSymbol)) { if (localOrExportSymbol.flags & 3 /* Variable */) { - error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); + error2(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); } else { - error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); + error2(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); } return errorType; } @@ -338142,7 +340834,7 @@ ${lanes.join("\n")} const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */; if (localOrExportSymbol.flags & 3 /* Variable */) { if (assignmentKind === 1 /* Definite */) { - return type; + return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type; } } else if (isAlias) { declaration = getDeclarationOfAliasSymbol(symbol); @@ -338153,30 +340845,30 @@ ${lanes.join("\n")} return type; } type = getNarrowableTypeForReference(type, node, checkMode); - const isParameter2 = getRootDeclaration(declaration).kind === 168 /* Parameter */; + const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); const isOuterVariable = flowContainer !== declarationContainer; const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); const isModuleExports = symbol.flags & 134217728 /* ModuleExports */; const typeIsAutomatic = type === autoType || type === autoArrayType; - const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 234 /* NonNullExpression */; - while (flowContainer !== declarationContainer && (flowContainer.kind === 217 /* FunctionExpression */ || flowContainer.kind === 218 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) { + 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 || 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 === 280 /* ExportSpecifier */) || node.parent.kind === 234 /* NonNullExpression */ || declaration.kind === 259 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 16777216 /* Ambient */; + 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 */; const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type); const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer); if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) { if (flowType === autoType || flowType === autoArrayType) { if (noImplicitAny) { - error(getNameOfDeclaration(declaration), Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType)); - error(node, Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); + error2(getNameOfDeclaration(declaration), Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType)); + error2(node, Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType)); } return convertAutoToAny(flowType); } } else if (!assumeInitialized && !containsUndefinedType(type) && containsUndefinedType(flowType)) { - error(node, Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol)); + error2(node, Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol)); return type; } return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; @@ -338218,7 +340910,7 @@ ${lanes.join("\n")} )); } function checkNestedBlockScopedBinding(node, symbol) { - if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 298 /* CatchClause */) { + if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 299 /* CatchClause */) { return; } const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -338228,7 +340920,7 @@ ${lanes.join("\n")} if (isCaptured) { let capturesBlockScopeBindingInLoopBody = true; if (isForStatement(container)) { - const varDeclList = getAncestor(symbol.valueDeclaration, 260 /* VariableDeclarationList */); + const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { const part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -338247,9 +340939,9 @@ ${lanes.join("\n")} } } if (isForStatement(container)) { - const varDeclList = getAncestor(symbol.valueDeclaration, 260 /* VariableDeclarationList */); + const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { - getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* NeedsLoopOutParameter */; + getNodeLinks(symbol.valueDeclaration).flags |= 65536 /* NeedsLoopOutParameter */; } } getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */; @@ -338264,13 +340956,13 @@ ${lanes.join("\n")} } function isAssignedInBodyOfForStatement(node, container) { let current = node; - while (current.parent.kind === 216 /* ParenthesizedExpression */) { + while (current.parent.kind === 217 /* ParenthesizedExpression */) { current = current.parent; } let isAssigned = false; if (isAssignmentTarget(current)) { isAssigned = true; - } else if (current.parent.kind === 223 /* PrefixUnaryExpression */ || current.parent.kind === 224 /* PostfixUnaryExpression */) { + } else if (current.parent.kind === 224 /* PrefixUnaryExpression */ || current.parent.kind === 225 /* PostfixUnaryExpression */) { const expr = current.parent; isAssigned = expr.operator === 46 /* PlusPlusToken */ || expr.operator === 47 /* MinusMinusToken */; } @@ -338281,7 +340973,7 @@ ${lanes.join("\n")} } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 171 /* PropertyDeclaration */ || container.kind === 175 /* Constructor */) { + if (container.kind === 172 /* PropertyDeclaration */ || container.kind === 176 /* Constructor */) { const classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -338306,13 +340998,13 @@ ${lanes.join("\n")} /*noCacheCheck*/ false )) { - error(node, diagnosticMessage); + error2(node, diagnosticMessage); } } } function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) { if (isPropertyDeclaration(container) && hasStaticModifier(container) && legacyDecorators && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { - error(thisExpression, Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class); + error2(thisExpression, Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class); } } function checkThisExpression(node) { @@ -338326,11 +341018,11 @@ ${lanes.join("\n")} ); let capturedByArrowFunction = false; let thisInComputedPropertyName = false; - if (container.kind === 175 /* Constructor */) { + if (container.kind === 176 /* Constructor */) { checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } while (true) { - if (container.kind === 218 /* ArrowFunction */) { + if (container.kind === 219 /* ArrowFunction */) { container = getThisContainer( container, /*includeArrowFunctions*/ @@ -338339,7 +341031,7 @@ ${lanes.join("\n")} ); capturedByArrowFunction = true; } - if (container.kind === 166 /* ComputedPropertyName */) { + if (container.kind === 167 /* ComputedPropertyName */) { container = getThisContainer( container, !capturedByArrowFunction, @@ -338353,18 +341045,18 @@ ${lanes.join("\n")} } checkThisInStaticClassFieldInitializerInDecoratedClass(node, container); if (thisInComputedPropertyName) { - error(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); + error2(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); } else { switch (container.kind) { - case 266 /* ModuleDeclaration */: - error(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); + case 267 /* ModuleDeclaration */: + error2(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 265 /* EnumDeclaration */: - error(node, Diagnostics.this_cannot_be_referenced_in_current_location); + case 266 /* EnumDeclaration */: + error2(node, Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 175 /* Constructor */: + case 176 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { - error(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments); + error2(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; } @@ -338381,9 +341073,9 @@ ${lanes.join("\n")} if (noImplicitThis) { const globalThisType2 = getTypeOfSymbol(globalThisSymbol); if (type === globalThisType2 && capturedByArrowFunction) { - error(node, Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this); + error2(node, Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this); } else if (!type) { - const diag2 = error(node, Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); + const diag2 = error2(node, Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); if (!isSourceFile(container)) { const outsideThis = tryGetThisTypeAt(container); if (outsideThis && outsideThis !== globalThisType2) { @@ -338456,36 +341148,33 @@ ${lanes.join("\n")} } } function getClassNameFromPrototypeMethod(container) { - if (container.kind === 217 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { + if (container.kind === 218 /* FunctionExpression */ && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { return container.parent.left.expression.expression; - } else if (container.kind === 173 /* MethodDeclaration */ && container.parent.kind === 209 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { + } else if (container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; - } else if (container.kind === 217 /* FunctionExpression */ && container.parent.kind === 302 /* PropertyAssignment */ && container.parent.parent.kind === 209 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { + } else if (container.kind === 218 /* FunctionExpression */ && container.parent.kind === 303 /* PropertyAssignment */ && container.parent.parent.kind === 210 /* ObjectLiteralExpression */ && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; - } else if (container.kind === 217 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) { + } else if (container.kind === 218 /* FunctionExpression */ && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) { return container.parent.parent.parent.arguments[0].expression; } else if (isMethodDeclaration(container) && isIdentifier(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) { return container.parent.parent.arguments[0].expression; } } function getTypeForThisExpressionFromJSDoc(node) { - const jsdocType = getJSDocType(node); - if (jsdocType && jsdocType.kind === 323 /* JSDocFunctionType */) { - const jsDocFunctionType = jsdocType; - if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && jsDocFunctionType.parameters[0].name.escapedText === "this" /* This */) { - return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type); - } - } const thisTag = getJSDocThisTag(node); if (thisTag && thisTag.typeExpression) { return getTypeFromTypeNode(thisTag.typeExpression); } + const signature = getSignatureOfTypeTag(node); + if (signature) { + return getThisTypeOfSignature(signature); + } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 168 /* Parameter */ && n.parent === constructorDecl); + return !!findAncestor(node, (n) => isFunctionLikeDeclaration(n) ? "quit" : n.kind === 169 /* Parameter */ && n.parent === constructorDecl); } function checkSuperExpression(node) { - const isCallExpression2 = node.parent.kind === 212 /* CallExpression */ && node.parent.expression === node; + const isCallExpression2 = node.parent.kind === 213 /* CallExpression */ && node.parent.expression === node; const immediateContainer = getSuperContainer( node, /*stopOnFunctions*/ @@ -338495,8 +341184,8 @@ ${lanes.join("\n")} let needToCaptureLexicalThis = false; let inAsyncFunction = false; if (!isCallExpression2) { - while (container && container.kind === 218 /* ArrowFunction */) { - if (hasSyntacticModifier(container, 512 /* Async */)) + while (container && container.kind === 219 /* ArrowFunction */) { + if (hasSyntacticModifier(container, 1024 /* Async */)) inAsyncFunction = true; container = getSuperContainer( container, @@ -338505,24 +341194,24 @@ ${lanes.join("\n")} ); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } - if (container && hasSyntacticModifier(container, 512 /* Async */)) + if (container && hasSyntacticModifier(container, 1024 /* Async */)) inAsyncFunction = true; } let nodeCheckFlag = 0; if (!container || !isLegalUsageOfSuperExpression(container)) { - const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 166 /* ComputedPropertyName */); - if (current && current.kind === 166 /* ComputedPropertyName */) { - error(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); + const current = findAncestor(node, (n) => n === container ? "quit" : n.kind === 167 /* ComputedPropertyName */); + if (current && current.kind === 167 /* ComputedPropertyName */) { + error2(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression2) { - error(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); - } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 209 /* ObjectLiteralExpression */)) { - error(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); + error2(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); + } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 210 /* ObjectLiteralExpression */)) { + error2(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { - error(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); + error2(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); } return errorType; } - if (!isCallExpression2 && immediateContainer.kind === 175 /* Constructor */) { + if (!isCallExpression2 && immediateContainer.kind === 176 /* Constructor */) { checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (isStatic(container) || isCallExpression2) { @@ -338530,7 +341219,7 @@ ${lanes.join("\n")} if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) { forEachEnclosingBlockScopeContainer(node.parent, (current) => { if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) { - getNodeLinks(current).flags |= 8388608 /* ContainsSuperPropertyInStaticInitializer */; + getNodeLinks(current).flags |= 2097152 /* ContainsSuperPropertyInStaticInitializer */; } }); } @@ -338538,7 +341227,7 @@ ${lanes.join("\n")} nodeCheckFlag = 16 /* SuperInstance */; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 173 /* MethodDeclaration */ && inAsyncFunction) { + if (container.kind === 174 /* MethodDeclaration */ && inAsyncFunction) { if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 256 /* MethodWithSuperPropertyAssignmentInAsync */; } else { @@ -338548,9 +341237,9 @@ ${lanes.join("\n")} if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 209 /* ObjectLiteralExpression */) { + if (container.parent.kind === 210 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { - error(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); + error2(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; } else { return anyType; @@ -338558,28 +341247,31 @@ ${lanes.join("\n")} } const classLikeDeclaration = container.parent; if (!getClassExtendsHeritageElement(classLikeDeclaration)) { - error(node, Diagnostics.super_can_only_be_referenced_in_a_derived_class); + error2(node, Diagnostics.super_can_only_be_referenced_in_a_derived_class); return errorType; } + if (classDeclarationExtendsNull(classLikeDeclaration)) { + return isCallExpression2 ? errorType : nullWideningType; + } const classType = getDeclaredTypeOfSymbol(getSymbolOfDeclaration(classLikeDeclaration)); const baseClassType = classType && getBaseTypes(classType)[0]; if (!baseClassType) { return errorType; } - if (container.kind === 175 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { - error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments); + if (container.kind === 176 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + error2(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; } return nodeCheckFlag === 32 /* SuperStatic */ ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType); function isLegalUsageOfSuperExpression(container2) { if (isCallExpression2) { - return container2.kind === 175 /* Constructor */; + return container2.kind === 176 /* Constructor */; } else { - if (isClassLike(container2.parent) || container2.parent.kind === 209 /* ObjectLiteralExpression */) { + if (isClassLike(container2.parent) || container2.parent.kind === 210 /* ObjectLiteralExpression */) { if (isStatic(container2)) { - return container2.kind === 173 /* MethodDeclaration */ || container2.kind === 172 /* MethodSignature */ || container2.kind === 176 /* GetAccessor */ || container2.kind === 177 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 174 /* ClassStaticBlockDeclaration */; + return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 175 /* ClassStaticBlockDeclaration */; } else { - return container2.kind === 173 /* MethodDeclaration */ || container2.kind === 172 /* MethodSignature */ || container2.kind === 176 /* GetAccessor */ || container2.kind === 177 /* SetAccessor */ || container2.kind === 171 /* PropertyDeclaration */ || container2.kind === 170 /* PropertySignature */ || container2.kind === 175 /* Constructor */; + return container2.kind === 174 /* MethodDeclaration */ || container2.kind === 173 /* MethodSignature */ || container2.kind === 177 /* GetAccessor */ || container2.kind === 178 /* SetAccessor */ || container2.kind === 172 /* PropertyDeclaration */ || container2.kind === 171 /* PropertySignature */ || container2.kind === 176 /* Constructor */; } } } @@ -338587,7 +341279,7 @@ ${lanes.join("\n")} } } function getContainingObjectLiteral(func) { - return (func.kind === 173 /* MethodDeclaration */ || func.kind === 176 /* GetAccessor */ || func.kind === 177 /* SetAccessor */) && func.parent.kind === 209 /* ObjectLiteralExpression */ ? func.parent : func.kind === 217 /* FunctionExpression */ && func.parent.kind === 302 /* PropertyAssignment */ ? func.parent.parent : void 0; + return (func.kind === 174 /* MethodDeclaration */ || func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) && func.parent.kind === 210 /* ObjectLiteralExpression */ ? func.parent : func.kind === 218 /* FunctionExpression */ && func.parent.kind === 303 /* PropertyAssignment */ ? func.parent.parent : void 0; } function getThisTypeArgument(type) { return getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : void 0; @@ -338597,8 +341289,27 @@ ${lanes.join("\n")} return t.flags & 2097152 /* Intersection */ ? forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t); }); } + function getThisTypeOfObjectLiteralFromContextualType(containingLiteral, contextualType) { + let literal = containingLiteral; + let type = contextualType; + while (type) { + const thisType = getThisTypeFromContextualType(type); + if (thisType) { + return thisType; + } + if (literal.parent.kind !== 303 /* PropertyAssignment */) { + break; + } + literal = literal.parent.parent; + type = getApparentTypeOfContextualType( + literal, + /*contextFlags*/ + void 0 + ); + } + } function getContextualThisParameterType(func) { - if (func.kind === 218 /* ArrowFunction */) { + if (func.kind === 219 /* ArrowFunction */) { return void 0; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -338619,27 +341330,14 @@ ${lanes.join("\n")} /*contextFlags*/ void 0 ); - let literal = containingLiteral; - let type = contextualType; - while (type) { - const thisType = getThisTypeFromContextualType(type); - if (thisType) { - return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); - } - if (literal.parent.kind !== 302 /* PropertyAssignment */) { - break; - } - literal = literal.parent.parent; - type = getApparentTypeOfContextualType( - literal, - /*contextFlags*/ - void 0 - ); + const thisType = getThisTypeOfObjectLiteralFromContextualType(containingLiteral, contextualType); + if (thisType) { + return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral)); } const parent2 = walkUpParenthesizedExpressions(func.parent); - if (parent2.kind === 225 /* BinaryExpression */ && parent2.operatorToken.kind === 64 /* EqualsToken */) { + if (isAssignmentExpression(parent2)) { const target = parent2.left; if (isAccessExpression(target)) { const { expression } = target; @@ -338694,11 +341392,11 @@ ${lanes.join("\n")} return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 168 /* Parameter */: + case 169 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 207 /* BindingElement */: + case 208 /* BindingElement */: return getContextualTypeForBindingElement(declaration, contextFlags); - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: if (isStatic(declaration)) { return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags); } @@ -338707,10 +341405,10 @@ ${lanes.join("\n")} function getContextualTypeForBindingElement(declaration, contextFlags) { const parent2 = declaration.parent.parent; const name = declaration.propertyName || declaration.name; - const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 207 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */); + const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 208 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */); if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name)) return void 0; - if (parent2.name.kind === 206 /* ArrayBindingPattern */) { + if (parent2.name.kind === 207 /* ArrayBindingPattern */) { const index = indexOfNode(declaration.parent.elements, declaration); if (index < 0) return void 0; @@ -338828,7 +341526,24 @@ ${lanes.join("\n")} } const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); if (signature && !isResolvingReturnTypeOfSignature(signature)) { - return getReturnTypeOfSignature(signature); + const returnType2 = getReturnTypeOfSignature(signature); + const functionFlags = getFunctionFlags(functionDecl); + if (functionFlags & 1 /* Generator */) { + return filterType(returnType2, (t) => { + return !!(t.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */ | 58982400 /* InstantiableNonPrimitive */)) || checkGeneratorInstantiationAssignabilityToReturnType( + t, + functionFlags, + /*errorNode*/ + void 0 + ); + }); + } + if (functionFlags & 2 /* Async */) { + return filterType(returnType2, (t) => { + return !!(t.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */ | 58982400 /* InstantiableNonPrimitive */)) || !!getAwaitedTypeOfPromise(t); + }); + } + return returnType2; } const iife = getImmediatelyInvokedFunctionExpression(functionDecl); if (iife) { @@ -338860,7 +341575,7 @@ ${lanes.join("\n")} return signature ? getOrCreateTypeFromSignature(signature) : void 0; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 214 /* TaggedTemplateExpression */) { + if (template.parent.kind === 215 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return void 0; @@ -339051,7 +341766,7 @@ ${lanes.join("\n")} } else if (t.flags & 3670016 /* StructuredType */) { const prop = getPropertyOfType(t, name); if (prop) { - return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop); + return isCircularMappedProperty(prop) ? void 0 : removeMissingType(getTypeOfSymbol(prop), !!(prop && prop.flags & 16777216 /* Optional */)); } if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) { const restType = getElementTypeOfSliceOfTupleType( @@ -339078,7 +341793,7 @@ ${lanes.join("\n")} } function getContextualTypeForObjectLiteralMethod(node, contextFlags) { Debug.assert(isObjectLiteralMethod(node)); - if (node.flags & 33554432 /* InWithStatement */) { + if (node.flags & 67108864 /* InWithStatement */) { return void 0; } return getContextualTypeForObjectLiteralElement(node, contextFlags); @@ -339136,7 +341851,7 @@ ${lanes.join("\n")} (t) => { if (isTupleType(t)) { if ((firstSpreadIndex === void 0 || index < firstSpreadIndex) && index < t.target.fixedLength) { - return getTypeArguments(t)[index]; + return removeMissingType(getTypeArguments(t)[index], !!(t.target.elementFlags[index] && 2 /* Optional */)); } const offset = length2 !== void 0 && (lastSpreadIndex === void 0 || index > lastSpreadIndex) ? length2 - index : 0; const fixedEndLength = offset > 0 && t.target.hasRestElement ? getEndElementCount(t.target, 3 /* Fixed */) : 0; @@ -339214,16 +341929,17 @@ ${lanes.join("\n")} case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: + case 228 /* TemplateExpression */: case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 80 /* Identifier */: case 157 /* UndefinedKeyword */: return true; - case 210 /* PropertyAccessExpression */: - case 216 /* ParenthesizedExpression */: + case 211 /* PropertyAccessExpression */: + case 217 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 293 /* JsxExpression */: + case 294 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; @@ -339233,8 +341949,19 @@ ${lanes.join("\n")} contextualType, concatenate( map( - filter(node.properties, (p) => !!p.symbol && p.kind === 302 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)), - (prop) => [() => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName] + filter(node.properties, (p) => { + if (!p.symbol) { + return false; + } + if (p.kind === 303 /* PropertyAssignment */) { + return isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); + } + if (p.kind === 304 /* ShorthandPropertyAssignment */) { + return isDiscriminantProperty(contextualType, p.symbol.escapedName); + } + return false; + }), + (prop) => [() => getContextFreeTypeOfExpression(prop.kind === 303 /* PropertyAssignment */ ? prop.initializer : prop.name), prop.symbol.escapedName] ), map( filter(getPropertiesOfType(contextualType), (s) => { @@ -339253,7 +341980,7 @@ ${lanes.join("\n")} contextualType, concatenate( map( - filter(node.properties, (p) => !!p.symbol && p.kind === 290 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))), + filter(node.properties, (p) => !!p.symbol && p.kind === 291 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer))), (prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName] ), map( @@ -339318,7 +342045,7 @@ ${lanes.join("\n")} } function getContextualType2(node, contextFlags) { var _a; - if (node.flags & 33554432 /* InWithStatement */) { + if (node.flags & 67108864 /* InWithStatement */) { return void 0; } const index = findContextualNode( @@ -339331,47 +342058,47 @@ ${lanes.join("\n")} } const { parent: parent2 } = node; switch (parent2.kind) { - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 207 /* BindingElement */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 208 /* BindingElement */: return getContextualTypeForInitializerExpression(node, contextFlags); - case 218 /* ArrowFunction */: - case 252 /* ReturnStatement */: + case 219 /* ArrowFunction */: + case 253 /* ReturnStatement */: return getContextualTypeForReturnExpression(node, contextFlags); - case 228 /* YieldExpression */: + case 229 /* YieldExpression */: return getContextualTypeForYieldOperand(parent2, contextFlags); - case 222 /* AwaitExpression */: + case 223 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent2, contextFlags); - case 212 /* CallExpression */: - case 213 /* NewExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: return getContextualTypeForArgument(parent2, node); - case 169 /* Decorator */: + case 170 /* Decorator */: return getContextualTypeForDecorator(parent2); - case 215 /* TypeAssertionExpression */: - case 233 /* AsExpression */: + case 216 /* TypeAssertionExpression */: + case 234 /* AsExpression */: return isConstTypeReference(parent2.type) ? getContextualType2(parent2, contextFlags) : getTypeFromTypeNode(parent2.type); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent2, contextFlags); - case 304 /* SpreadAssignment */: + case 305 /* SpreadAssignment */: return getContextualType2(parent2.parent, contextFlags); - case 208 /* ArrayLiteralExpression */: { + case 209 /* ArrayLiteralExpression */: { const arrayLiteral = parent2; const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); const elementIndex = indexOfNode(arrayLiteral.elements, node); const spreadIndices = (_a = getNodeLinks(arrayLiteral)).spreadIndices ?? (_a.spreadIndices = getSpreadIndices(arrayLiteral.elements)); return getContextualTypeForElementExpression(type, elementIndex, arrayLiteral.elements.length, spreadIndices.first, spreadIndices.last); } - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 238 /* TemplateSpan */: - Debug.assert(parent2.parent.kind === 227 /* TemplateExpression */); + case 239 /* TemplateSpan */: + Debug.assert(parent2.parent.kind === 228 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent2.parent, node); - case 216 /* ParenthesizedExpression */: { + case 217 /* ParenthesizedExpression */: { if (isInJSFile(parent2)) { if (isJSDocSatisfiesExpression(parent2)) { return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent2)); @@ -339383,20 +342110,22 @@ ${lanes.join("\n")} } return getContextualType2(parent2, contextFlags); } - case 234 /* NonNullExpression */: + case 235 /* NonNullExpression */: return getContextualType2(parent2, contextFlags); - case 237 /* SatisfiesExpression */: + case 238 /* SatisfiesExpression */: return getTypeFromTypeNode(parent2.type); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return tryGetTypeFromEffectiveTypeNode(parent2); - case 293 /* JsxExpression */: + case 294 /* JsxExpression */: return getContextualTypeForJsxExpression(parent2, contextFlags); - case 290 /* JsxAttribute */: - case 292 /* JsxSpreadAttribute */: + case 291 /* JsxAttribute */: + case 293 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent2, contextFlags); - case 285 /* JsxOpeningElement */: - case 284 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 285 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent2, contextFlags); + case 301 /* ImportAttribute */: + return getContextualImportAttributeType(parent2); } return void 0; } @@ -339444,6 +342173,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( @@ -339522,7 +342257,7 @@ ${lanes.join("\n")} let attributesType = forcedLookupLocation === void 0 ? getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType) : forcedLookupLocation === "" ? getReturnTypeOfSignature(sig) : getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation); if (!attributesType) { if (!!forcedLookupLocation && !!length(context.attributes.properties)) { - error(context, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, unescapeLeadingUnderscores(forcedLookupLocation)); + error2(context, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, unescapeLeadingUnderscores(forcedLookupLocation)); } return unknownType; } @@ -339624,7 +342359,7 @@ ${lanes.join("\n")} /*resolvedTypePredicate*/ void 0, minArgCount, - (left.flags | right.flags) & 39 /* PropagatingFlags */ + (left.flags | right.flags) & 167 /* PropagatingFlags */ ); result.compositeKind = 2097152 /* Intersection */; result.compositeSignatures = concatenate(left.compositeKind === 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]); @@ -339655,7 +342390,7 @@ ${lanes.join("\n")} return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0; } function getContextualSignature(node) { - Debug.assert(node.kind !== 173 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); const typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -339706,7 +342441,11 @@ ${lanes.join("\n")} return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; } function hasDefaultValue(node) { - return node.kind === 207 /* BindingElement */ && !!node.initializer || node.kind === 225 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */; + return node.kind === 208 /* BindingElement */ && !!node.initializer || node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */; + } + function isSpreadIntoCallOrNew(node) { + const parent2 = walkUpParenthesizedExpressions(node.parent); + return isSpreadElement(parent2) && isCallOrNewExpression(parent2.parent); } function checkArrayLiteral(node, checkMode, forceTuple) { const elements = node.elements; @@ -339715,18 +342454,17 @@ ${lanes.join("\n")} const elementFlags = []; pushCachedContextualType(node); const inDestructuringPattern = isAssignmentTarget(node); - const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent); - const inConstContext = isSpreadIntoCallOrNew || isConstContext(node); + const inConstContext = isConstContext(node); const contextualType = getApparentTypeOfContextualType( node, /*contextFlags*/ void 0 ); - const inTupleContext = isSpreadIntoCallOrNew || !!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]; - if (e.kind === 229 /* SpreadElement */) { + if (e.kind === 230 /* SpreadElement */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */); } @@ -339750,7 +342488,7 @@ ${lanes.join("\n")} elementTypes.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, e.expression)); elementFlags.push(4 /* Rest */); } - } else if (exactOptionalPropertyTypes && e.kind === 231 /* OmittedExpression */) { + } else if (exactOptionalPropertyTypes && e.kind === 232 /* OmittedExpression */) { hasOmittedExpression = true; elementTypes.push(undefinedOrMissingType); elementFlags.push(2 /* Optional */); @@ -339779,10 +342517,13 @@ ${lanes.join("\n")} elementTypes, elementFlags, /*readonly*/ - inConstContext + inConstContext && !(contextualType && someType(contextualType, isMutableArrayLikeType)) )); } - return createArrayLiteralType(createArrayType(elementTypes.length ? getUnionType(sameMap(elementTypes, (t, i) => elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessTypeOrUndefined(t, numberType) || anyType : t), 2 /* Subtype */) : strictNullChecks ? implicitNeverType : undefinedWideningType, inConstContext)); + return createArrayLiteralType(createArrayType( + elementTypes.length ? getUnionType(sameMap(elementTypes, (t, i) => elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessTypeOrUndefined(t, numberType) || anyType : t), 2 /* Subtype */) : strictNullChecks ? implicitNeverType : undefinedWideningType, + inConstContext + )); } function createArrayLiteralType(type) { if (!(getObjectFlags(type) & 4 /* Reference */)) { @@ -339797,7 +342538,7 @@ ${lanes.join("\n")} } function isNumericName(name) { switch (name.kind) { - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: return isNumericComputedName(name); case 80 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -339814,7 +342555,7 @@ ${lanes.join("\n")} function checkComputedPropertyName(node) { const links = getNodeLinks(node.expression); if (!links.resolvedType) { - if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 103 /* InKeyword */ && node.parent.kind !== 176 /* GetAccessor */ && node.parent.kind !== 177 /* SetAccessor */) { + if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 103 /* InKeyword */ && node.parent.kind !== 177 /* GetAccessor */ && node.parent.kind !== 178 /* SetAccessor */) { return links.resolvedType = errorType; } links.resolvedType = checkExpression(node.expression); @@ -339828,7 +342569,7 @@ ${lanes.join("\n")} } } if (links.resolvedType.flags & 98304 /* Nullable */ || !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { - error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); + error2(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } } return links.resolvedType; @@ -339883,7 +342624,7 @@ ${lanes.join("\n")} /*contextFlags*/ void 0 ); - const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 205 /* ObjectBindingPattern */ || contextualType.pattern.kind === 209 /* ObjectLiteralExpression */); + const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 /* ObjectBindingPattern */ || contextualType.pattern.kind === 210 /* ObjectLiteralExpression */); const inConstContext = isConstContext(node); const checkFlags = inConstContext ? 8 /* Readonly */ : 0; const isInJavascript = isInJSFile(node) && !isInJsonFile(node); @@ -339902,13 +342643,13 @@ ${lanes.join("\n")} let offset = 0; for (const memberDecl of node.properties) { let member = getSymbolOfDeclaration(memberDecl); - const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0; - if (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 303 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) { - let type = memberDecl.kind === 302 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : ( + const computedNameType = memberDecl.name && memberDecl.name.kind === 167 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0; + if (memberDecl.kind === 303 /* PropertyAssignment */ || memberDecl.kind === 304 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) { + let type = memberDecl.kind === 303 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : ( // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. // we don't want to say "could not find 'a'". - memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode) + memberDecl.kind === 304 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode) ); if (isInJavascript) { const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -339926,7 +342667,7 @@ ${lanes.join("\n")} prop.links.nameType = nameType; } if (inDestructuringPattern) { - const isOptional = memberDecl.kind === 302 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 303 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer; + const isOptional = memberDecl.kind === 303 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 304 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer; if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -339935,12 +342676,7 @@ ${lanes.join("\n")} if (impliedProp) { prop.flags |= impliedProp.flags & 16777216 /* Optional */; } else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, stringType)) { - error( - memberDecl.name, - Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, - symbolToString(member), - typeToString(contextualType) - ); + error2(memberDecl.name, Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType)); } } prop.declarations = member.declarations; @@ -339952,13 +342688,13 @@ ${lanes.join("\n")} prop.links.target = member; member = prop; allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop); - if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 173 /* MethodDeclaration */) && isContextSensitive(memberDecl)) { + if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 303 /* PropertyAssignment */ || memberDecl.kind === 174 /* MethodDeclaration */) && isContextSensitive(memberDecl)) { const inferenceContext = getInferenceContext(node); Debug.assert(inferenceContext); - const inferenceNode = memberDecl.kind === 302 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl; + const inferenceNode = memberDecl.kind === 303 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl; addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type); } - } else if (memberDecl.kind === 304 /* SpreadAssignment */) { + } else if (memberDecl.kind === 305 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -339982,12 +342718,12 @@ ${lanes.join("\n")} } spread = getSpreadType(spread, mergedType, node.symbol, objectFlags, inConstContext); } else { - error(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types); + error2(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types); spread = errorType; } continue; } else { - Debug.assert(memberDecl.kind === 176 /* GetAccessor */ || memberDecl.kind === 177 /* SetAccessor */); + Debug.assert(memberDecl.kind === 177 /* GetAccessor */ || memberDecl.kind === 178 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -340010,22 +342746,13 @@ ${lanes.join("\n")} } popContextualType(); if (contextualTypeHasPattern) { - const rootPatternParent = findAncestor( - contextualType.pattern.parent, - (n) => n.kind === 259 /* VariableDeclaration */ || n.kind === 225 /* BinaryExpression */ || n.kind === 168 /* Parameter */ - ); - const spreadOrOutsideRootObject = findAncestor( - node, - (n) => n === rootPatternParent || n.kind === 304 /* SpreadAssignment */ - ); - if (spreadOrOutsideRootObject.kind !== 304 /* SpreadAssignment */) { + const rootPatternParent = findAncestor(contextualType.pattern.parent, (n) => n.kind === 260 /* VariableDeclaration */ || n.kind === 226 /* BinaryExpression */ || n.kind === 169 /* Parameter */); + const spreadOrOutsideRootObject = findAncestor(node, (n) => n === rootPatternParent || n.kind === 305 /* SpreadAssignment */); + if (spreadOrOutsideRootObject.kind !== 305 /* SpreadAssignment */) { for (const prop of getPropertiesOfType(contextualType)) { if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { if (!(prop.flags & 16777216 /* Optional */)) { - error( - prop.valueDeclaration || ((_a = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a.links.bindingElement), - Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value - ); + error2(prop.valueDeclaration || ((_a = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a.links.bindingElement), Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } propertiesTable.set(prop.escapedName, prop); propertiesArray.push(prop); @@ -340097,13 +342824,16 @@ ${lanes.join("\n")} checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); const nodeSourceFile = getSourceFileOfNode(node); if (getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { - error(node, compilerOptions.jsxFactory ? Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option : Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments); + error2( + node, + compilerOptions.jsxFactory ? Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option : Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments + ); } checkJsxChildren(node); return getJsxElementTypeAt(node) || anyType; } function isHyphenatedJsxName(name) { - return stringContains(name, "-"); + return name.includes("-"); } function isJsxIntrinsicTagName(tagName) { return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName); @@ -340153,7 +342883,7 @@ ${lanes.join("\n")} addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType); } } else { - Debug.assert(attributeDecl.kind === 292 /* JsxSpreadAttribute */); + Debug.assert(attributeDecl.kind === 293 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType( spread, @@ -340182,7 +342912,7 @@ ${lanes.join("\n")} checkSpreadPropOverrides(exprType, allAttributesTable, attributeDecl); } } else { - error(attributeDecl.expression, Diagnostics.Spread_types_may_only_be_created_from_object_types); + error2(attributeDecl.expression, Diagnostics.Spread_types_may_only_be_created_from_object_types); typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; } } @@ -340199,12 +342929,12 @@ ${lanes.join("\n")} ); } } - const parent2 = openingLikeElement.parent.kind === 283 /* JsxElement */ ? openingLikeElement.parent : void 0; - if (parent2 && parent2.openingElement === openingLikeElement && parent2.children.length > 0) { + const parent2 = openingLikeElement.parent.kind === 284 /* JsxElement */ ? openingLikeElement.parent : void 0; + if (parent2 && parent2.openingElement === openingLikeElement && getSemanticJsxChildren(parent2.children).length > 0) { const childrenTypes = checkJsxChildren(parent2, checkMode); if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { if (explicitlySpecifyChildrenAttribute) { - error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName)); + error2(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName)); } const contextualType2 = getApparentTypeOfContextualType( openingLikeElement.attributes, @@ -340258,7 +342988,7 @@ ${lanes.join("\n")} if (!child.containsOnlyTriviaWhiteSpaces) { childrenTypes.push(stringType); } - } else if (child.kind === 293 /* JsxExpression */ && !child.expression) { + } else if (child.kind === 294 /* JsxExpression */ && !child.expression) { continue; } else { childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); @@ -340271,7 +343001,7 @@ ${lanes.join("\n")} if (!(right.flags & 16777216 /* Optional */)) { const left = props.get(right.escapedName); if (left) { - const diagnostic = error(left.valueDeclaration, Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, unescapeLeadingUnderscores(left.escapedName)); + const diagnostic = error2(left.valueDeclaration, Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, unescapeLeadingUnderscores(left.escapedName)); addRelatedInfo(diagnostic, createDiagnosticForNode(spread, Diagnostics.This_spread_always_overwrites_this_property)); } } @@ -340293,21 +343023,26 @@ ${lanes.join("\n")} if (!isErrorType(intrinsicElementsType)) { if (!isIdentifier(node.tagName) && !isJsxNamespacedName(node.tagName)) return Debug.fail(); - const intrinsicProp = getPropertyOfType(intrinsicElementsType, isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText); + const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText; + const intrinsicProp = getPropertyOfType(intrinsicElementsType, propName); if (intrinsicProp) { links.jsxFlags |= 1 /* IntrinsicNamedElement */; return links.resolvedSymbol = intrinsicProp; } - const indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType); - if (indexSignatureType) { + const indexSymbol = getApplicableIndexSymbol(intrinsicElementsType, getStringLiteralType(unescapeLeadingUnderscores(propName))); + if (indexSymbol) { + links.jsxFlags |= 2 /* IntrinsicIndexedElement */; + return links.resolvedSymbol = indexSymbol; + } + if (getTypeOfPropertyOrIndexSignatureOfType(intrinsicElementsType, propName)) { links.jsxFlags |= 2 /* IntrinsicIndexedElement */; return links.resolvedSymbol = intrinsicElementsType.symbol; } - error(node, Diagnostics.Property_0_does_not_exist_on_type_1, intrinsicTagNameToString(node.tagName), "JSX." + JsxNames.IntrinsicElements); + error2(node, Diagnostics.Property_0_does_not_exist_on_type_1, intrinsicTagNameToString(node.tagName), "JSX." + JsxNames.IntrinsicElements); return links.resolvedSymbol = unknownSymbol; } else { if (noImplicitAny) { - error(node, Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, unescapeLeadingUnderscores(JsxNames.IntrinsicElements)); + error2(node, Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, unescapeLeadingUnderscores(JsxNames.IntrinsicElements)); } return links.resolvedSymbol = unknownSymbol; } @@ -340329,7 +343064,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; @@ -340390,7 +343130,7 @@ ${lanes.join("\n")} } else if (propertiesOfJsxElementAttribPropInterface.length === 1) { return propertiesOfJsxElementAttribPropInterface[0].escapedName; } else if (propertiesOfJsxElementAttribPropInterface.length > 1 && jsxElementAttribPropInterfaceSym.declarations) { - error(jsxElementAttribPropInterfaceSym.declarations[0], Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property, unescapeLeadingUnderscores(nameOfAttribPropContainer)); + error2(jsxElementAttribPropInterfaceSym.declarations[0], Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property, unescapeLeadingUnderscores(nameOfAttribPropContainer)); } } return void 0; @@ -340413,7 +343153,7 @@ ${lanes.join("\n")} } else if (elementType.flags & 128 /* StringLiteral */) { const intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); if (!intrinsicType) { - error(caller, Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); + error2(caller, Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); return emptyArray; } else { const fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); @@ -340477,6 +343217,7 @@ ${lanes.join("\n")} } } function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { + var _a; Debug.assert(isJsxIntrinsicTagName(node.tagName)); const links = getNodeLinks(node); if (!links.resolvedJsxElementAttributesType) { @@ -340484,7 +343225,8 @@ ${lanes.join("\n")} if (links.jsxFlags & 1 /* IntrinsicNamedElement */) { return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType; } else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) { - return links.resolvedJsxElementAttributesType = getIndexTypeOfType(getJsxType(JsxNames.IntrinsicElements, node), stringType) || errorType; + const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText; + return links.resolvedJsxElementAttributesType = ((_a = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName)) == null ? void 0 : _a.type) || errorType; } else { return links.resolvedJsxElementAttributesType = errorType; } @@ -340539,11 +343281,11 @@ ${lanes.join("\n")} } function checkJsxPreconditions(errorNode) { if ((compilerOptions.jsx || 0 /* None */) === 0 /* None */) { - error(errorNode, Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); + error2(errorNode, Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } if (getJsxElementTypeAt(errorNode) === void 0) { if (noImplicitAny) { - error(errorNode, Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); + error2(errorNode, Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } } } @@ -340570,7 +343312,7 @@ ${lanes.join("\n")} ); } if (jsxFactorySym) { - jsxFactorySym.isReferenced = 67108863 /* All */; + jsxFactorySym.isReferenced = -1 /* All */; if (canCollectSymbolAliasAccessabilityData && jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { markAliasSymbolAsReferenced(jsxFactorySym); } @@ -340635,7 +343377,7 @@ ${lanes.join("\n")} if (node.expression) { const type = checkExpression(node.expression, checkMode); if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) { - error(node, Diagnostics.JSX_spread_child_must_be_an_array_type); + error2(node, Diagnostics.JSX_spread_child_must_be_an_array_type); } return type; } else { @@ -340643,7 +343385,7 @@ ${lanes.join("\n")} } } function getDeclarationNodeFlagsFromSymbol(s) { - return s.valueDeclaration ? getCombinedNodeFlags(s.valueDeclaration) : 0; + return s.valueDeclaration ? getCombinedNodeFlagsCached(s.valueDeclaration) : 0; } function isPrototypeProperty(symbol) { if (symbol.flags & 8192 /* Method */ || getCheckFlags(symbol) & 4 /* SyntheticMethod */) { @@ -340655,59 +343397,51 @@ ${lanes.join("\n")} } } function checkPropertyAccessibility(node, isSuper, writing, type, prop, reportError = true) { - const errorNode = !reportError ? void 0 : node.kind === 165 /* QualifiedName */ ? node.right : node.kind === 204 /* ImportType */ ? node : node.kind === 207 /* BindingElement */ && node.propertyName ? node.propertyName : node.name; + const errorNode = !reportError ? void 0 : node.kind === 166 /* QualifiedName */ ? node.right : node.kind === 205 /* ImportType */ ? node : node.kind === 208 /* BindingElement */ && node.propertyName ? node.propertyName : node.name; return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode); } function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) { + var _a; const flags = getDeclarationModifierFlagsFromSymbol(prop, writing); if (isSuper) { if (languageVersion < 2 /* ES2015 */) { if (symbolHasNonMethodDeclaration(prop)) { if (errorNode) { - error(errorNode, Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); + error2(errorNode, Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } return false; } } - if (flags & 256 /* Abstract */) { + if (flags & 64 /* Abstract */) { if (errorNode) { - error( - errorNode, - Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, - symbolToString(prop), - typeToString(getDeclaringClass(prop)) - ); + error2(errorNode, Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop))); + } + return false; + } + if (!(flags & 256 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassInstanceProperty))) { + if (errorNode) { + error2(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop)); } return false; } } - if (flags & 256 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) { + if (flags & 64 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) { const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(location)) { if (errorNode) { - error( - errorNode, - Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, - symbolToString(prop), - getTextOfIdentifierOrLiteral(declaringClassDeclaration.name) - ); + error2(errorNode, Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString(prop), getTextOfIdentifierOrLiteral(declaringClassDeclaration.name)); } return false; } } - if (!(flags & 24 /* NonPublicAccessibilityModifier */)) { + if (!(flags & 6 /* NonPublicAccessibilityModifier */)) { return true; } - if (flags & 8 /* Private */) { + if (flags & 2 /* Private */) { const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (!isNodeWithinClass(location, declaringClassDeclaration)) { if (errorNode) { - error( - errorNode, - Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, - symbolToString(prop), - typeToString(getDeclaringClass(prop)) - ); + error2(errorNode, Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop))); } return false; } @@ -340723,19 +343457,14 @@ ${lanes.join("\n")} if (!enclosingClass) { enclosingClass = getEnclosingClassFromThisParameter(location); enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing); - if (flags & 32 /* Static */ || !enclosingClass) { + if (flags & 256 /* Static */ || !enclosingClass) { if (errorNode) { - error( - errorNode, - Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, - symbolToString(prop), - typeToString(getDeclaringClass(prop) || containingType) - ); + error2(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType)); } return false; } } - if (flags & 32 /* Static */) { + if (flags & 256 /* Static */) { return true; } if (containingType.flags & 262144 /* TypeParameter */) { @@ -340743,13 +343472,7 @@ ${lanes.join("\n")} } if (!containingType || !hasBaseType(containingType, enclosingClass)) { if (errorNode) { - error( - errorNode, - Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2, - symbolToString(prop), - typeToString(enclosingClass), - typeToString(containingType) - ); + error2(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2, symbolToString(prop), typeToString(enclosingClass), typeToString(containingType)); } return false; } @@ -340783,7 +343506,7 @@ ${lanes.join("\n")} return checkNonNullType(checkExpression(node), node); } function isNullableType(type) { - return !!(getTypeFacts(type) & 50331648 /* IsUndefinedOrNull */); + return hasTypeFacts(type, 50331648 /* IsUndefinedOrNull */); } function getNonNullableTypeIfNeeded(type) { return isNullableType(type) ? getNonNullableType(type) : type; @@ -340791,28 +343514,28 @@ ${lanes.join("\n")} function reportObjectPossiblyNullOrUndefinedError(node, facts) { const nodeText2 = isEntityNameExpression(node) ? entityNameToString(node) : void 0; if (node.kind === 106 /* NullKeyword */) { - error(node, Diagnostics.The_value_0_cannot_be_used_here, "null"); + error2(node, Diagnostics.The_value_0_cannot_be_used_here, "null"); return; } if (nodeText2 !== void 0 && nodeText2.length < 100) { if (isIdentifier(node) && nodeText2 === "undefined") { - error(node, Diagnostics.The_value_0_cannot_be_used_here, "undefined"); + error2(node, Diagnostics.The_value_0_cannot_be_used_here, "undefined"); return; } - error( + error2( node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ? Diagnostics._0_is_possibly_null_or_undefined : Diagnostics._0_is_possibly_undefined : Diagnostics._0_is_possibly_null, nodeText2 ); } else { - error( + error2( node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ? Diagnostics.Object_is_possibly_null_or_undefined : Diagnostics.Object_is_possibly_undefined : Diagnostics.Object_is_possibly_null ); } } function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) { - error( + error2( node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ? Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined : Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined : Diagnostics.Cannot_invoke_an_object_which_is_possibly_null ); @@ -340822,14 +343545,14 @@ ${lanes.join("\n")} if (isEntityNameExpression(node)) { const nodeText2 = entityNameToString(node); if (nodeText2.length < 100) { - error(node, Diagnostics._0_is_of_type_unknown, nodeText2); + error2(node, Diagnostics._0_is_of_type_unknown, nodeText2); return errorType; } } - error(node, Diagnostics.Object_is_of_type_unknown); + error2(node, Diagnostics.Object_is_of_type_unknown); return errorType; } - const facts = getTypeFacts(type); + const facts = getTypeFacts(type, 50331648 /* IsUndefinedOrNull */); if (facts & 50331648 /* IsUndefinedOrNull */) { reportError(node, facts); const t = getNonNullableType(type); @@ -340846,20 +343569,20 @@ ${lanes.join("\n")} if (isEntityNameExpression(node)) { const nodeText2 = entityNameToString(node); if (isIdentifier(node) && nodeText2 === "undefined") { - error(node, Diagnostics.The_value_0_cannot_be_used_here, nodeText2); + error2(node, Diagnostics.The_value_0_cannot_be_used_here, nodeText2); return nonNullType; } if (nodeText2.length < 100) { - error(node, Diagnostics._0_is_possibly_undefined, nodeText2); + error2(node, Diagnostics._0_is_possibly_undefined, nodeText2); return nonNullType; } } - error(node, Diagnostics.Object_is_possibly_undefined); + error2(node, Diagnostics.Object_is_possibly_undefined); } return nonNullType; } function checkPropertyAccessExpression(node, checkMode, writeOnly) { - return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode, writeOnly); + return node.flags & 64 /* OptionalChain */ ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode, writeOnly); } function checkPropertyAccessChain(node, checkMode) { const leftType = checkExpression(node.expression); @@ -340871,13 +343594,13 @@ ${lanes.join("\n")} return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode); } function isMethodAccessForCall(node) { - while (node.parent.kind === 216 /* ParenthesizedExpression */) { + while (node.parent.kind === 217 /* ParenthesizedExpression */) { node = node.parent; } return isCallOrNewExpression(node.parent) && node.parent.expression === node; } function lookupSymbolForPrivateIdentifierDeclaration(propName, location) { - for (let containingClass = getContainingClass(location); !!containingClass; containingClass = getContainingClass(containingClass)) { + for (let containingClass = getContainingClassExcludingClassDecorators(location); !!containingClass; containingClass = getContainingClass(containingClass)) { const { symbol } = containingClass; const name = getSymbolNameForPrivateIdentifier(symbol, propName); const prop = symbol.members && symbol.members.get(name) || symbol.exports && symbol.exports.get(name); @@ -340949,7 +343672,7 @@ ${lanes.join("\n")} const lexicalClass = getContainingClass(lexicalValueDecl); Debug.assert(!!lexicalClass); if (findAncestor(lexicalClass, (n) => typeClass === n)) { - const diagnostic = error( + const diagnostic = error2( right, Diagnostics.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling, diagName, @@ -340971,7 +343694,7 @@ ${lanes.join("\n")} return true; } } - error( + error2( right, Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier, diagName, @@ -341013,18 +343736,24 @@ ${lanes.join("\n")} if (lexicallyScopedSymbol) { return isErrorType(apparentType) ? errorType : apparentType; } - if (!getContainingClass(right)) { + if (getContainingClassExcludingClassDecorators(right) === void 0) { grammarErrorOnNode(right, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); return anyType; } } - prop = lexicallyScopedSymbol ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol) : void 0; - if (!prop && checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) { - return errorType; + prop = lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol); + if (prop === void 0) { + if (checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) { + return errorType; + } + const containingClass = getContainingClassExcludingClassDecorators(right); + if (containingClass && isPlainJsFile(getSourceFileOfNode(containingClass), compilerOptions.checkJs)) { + grammarErrorOnNode(right, Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class, idText(right)); + } } else { - const isSetonlyAccessor = prop && prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */); + const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */); if (isSetonlyAccessor && assignmentKind !== 1 /* Definite */) { - error(node, Diagnostics.Private_accessor_was_defined_without_a_getter); + error2(node, Diagnostics.Private_accessor_was_defined_without_a_getter); } } } else { @@ -341038,12 +343767,12 @@ ${lanes.join("\n")} apparentType, right.escapedText, /*skipObjectFunctionPropertyAugment*/ - false, + isConstEnumObjectType(apparentType), /*includeTypeOnlyMembers*/ - node.kind === 165 /* QualifiedName */ + node.kind === 166 /* QualifiedName */ ); } - if (isIdentifier(left) && parentSymbol && (getIsolatedModules(compilerOptions) || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 305 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { + if (isIdentifier(left) && parentSymbol && (getIsolatedModules(compilerOptions) || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 306 /* EnumMember */)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { markAliasReferenced(parentSymbol, node); } let propType; @@ -341061,9 +343790,9 @@ ${lanes.join("\n")} } if (leftType.symbol === globalThisSymbol) { if (globalThisSymbol.exports.has(right.escapedText) && globalThisSymbol.exports.get(right.escapedText).flags & 418 /* BlockScoped */) { - error(right, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(right.escapedText), typeToString(leftType)); + error2(right, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(right.escapedText), typeToString(leftType)); } else if (noImplicitAny) { - error(right, Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType)); + error2(right, Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType)); } return anyType; } @@ -341073,13 +343802,13 @@ ${lanes.join("\n")} return errorType; } if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) { - error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); + error2(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); } propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, missingType]) : indexInfo.type; if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) { - error(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText)); + error2(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText)); } - if (indexInfo.declaration && getCombinedNodeFlags(indexInfo.declaration) & 268435456 /* Deprecated */) { + if (indexInfo.declaration && isDeprecatedDeclaration2(indexInfo.declaration)) { addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText); } } else { @@ -341092,7 +343821,7 @@ ${lanes.join("\n")} getNodeLinks(node).resolvedSymbol = prop; checkPropertyAccessibility(node, left.kind === 108 /* SuperKeyword */, isWriteAccess(node), apparentType, prop); if (isAssignmentToReadonlyEntity(node, prop, assignmentKind)) { - error(right, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, idText(right)); + error2(right, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, idText(right)); return errorType; } propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writeOnly || isWriteOnlyAccess(node) ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop); @@ -341100,11 +343829,17 @@ ${lanes.join("\n")} return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode); } function isUncheckedJSSuggestion(node, suggestion, excludeClasses) { + var _a; const file = getSourceFileOfNode(node); if (file) { if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */)) { const declarationFile = forEach(suggestion == null ? void 0 : suggestion.declarations, getSourceFileOfNode); - return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) && !(excludeClasses && suggestion && suggestion.flags & 32 /* Class */) && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */); + const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((_a = suggestion.valueDeclaration.heritageClauses) == null ? void 0 : _a.length) || classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + suggestion.valueDeclaration + ); + return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) && !(excludeClasses && suggestion && suggestion.flags & 32 /* Class */ && suggestionHasNoExtendsOrDecorators) && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */ && suggestionHasNoExtendsOrDecorators); } } return false; @@ -341127,7 +343862,7 @@ ${lanes.join("\n")} if (declaration && isPropertyWithoutInitializer(declaration)) { if (!isStatic(declaration)) { const flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 175 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216 /* Ambient */)) { + if (flowContainer.kind === 176 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 33554432 /* Ambient */)) { assumeUninitialized = true; } } @@ -341137,7 +343872,7 @@ ${lanes.join("\n")} } const flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType); if (assumeUninitialized && !containsUndefinedType(propType) && containsUndefinedType(flowType)) { - error(errorNode, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); + error2(errorNode, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); return propType; } return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; @@ -341149,40 +343884,37 @@ ${lanes.join("\n")} } let diagnosticMessage; const declarationName = idText(right); - if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlags(valueDeclaration) & 32 /* Static */) && (compilerOptions.useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) { - diagnosticMessage = error(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName); - } else if (valueDeclaration.kind === 262 /* ClassDeclaration */ && node.parent.kind !== 182 /* TypeReference */ && !(valueDeclaration.flags & 16777216 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { - diagnosticMessage = error(right, Diagnostics.Class_0_used_before_its_declaration, declarationName); + if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 256 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) { + diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName); + } else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { + diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName); } if (diagnosticMessage) { - addRelatedInfo( - diagnosticMessage, - createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here, declarationName) - ); + addRelatedInfo(diagnosticMessage, createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here, declarationName)); } } function isInPropertyInitializerOrClassStaticBlock(node) { return !!findAncestor(node, (node2) => { switch (node2.kind) { - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return true; - case 302 /* PropertyAssignment */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 304 /* SpreadAssignment */: - case 166 /* ComputedPropertyName */: - case 238 /* TemplateSpan */: - case 293 /* JsxExpression */: - case 290 /* JsxAttribute */: - case 291 /* JsxAttributes */: - case 292 /* JsxSpreadAttribute */: - case 285 /* JsxOpeningElement */: - case 232 /* ExpressionWithTypeArguments */: - case 297 /* HeritageClause */: + case 303 /* PropertyAssignment */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 305 /* SpreadAssignment */: + case 167 /* ComputedPropertyName */: + case 239 /* TemplateSpan */: + case 294 /* JsxExpression */: + case 291 /* JsxAttribute */: + case 292 /* JsxAttributes */: + case 293 /* JsxSpreadAttribute */: + case 286 /* JsxOpeningElement */: + case 233 /* ExpressionWithTypeArguments */: + case 298 /* HeritageClause */: return false; - case 218 /* ArrowFunction */: - case 243 /* ExpressionStatement */: + case 219 /* ArrowFunction */: + case 244 /* ExpressionStatement */: return isBlock(node2.parent) && isClassStaticBlockDeclaration(node2.parent.parent) ? true : "quit"; default: return isExpressionNode(node2) ? false : "quit"; @@ -341406,7 +344138,7 @@ ${lanes.join("\n")} if (!valueDeclaration) { return; } - const hasPrivateModifier = hasEffectiveModifier(valueDeclaration, 8 /* Private */); + const hasPrivateModifier = hasEffectiveModifier(valueDeclaration, 2 /* Private */); const hasPrivateIdentifier = prop.valueDeclaration && isNamedDeclaration(prop.valueDeclaration) && isPrivateIdentifier(prop.valueDeclaration.name); if (!hasPrivateModifier && !hasPrivateIdentifier) { return; @@ -341420,16 +344152,16 @@ ${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)); } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 108 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: return isValidPropertyAccessWithType( node, /*isSuper*/ @@ -341437,7 +344169,7 @@ ${lanes.join("\n")} propertyName, getWidenedType(checkExpression(node.left)) ); - case 204 /* ImportType */: + case 205 /* ImportType */: return isValidPropertyAccessWithType( node, /*isSuper*/ @@ -341450,7 +344182,7 @@ ${lanes.join("\n")} function isValidPropertyAccessForCompletions(node, type, property) { return isPropertyAccessible( node, - node.kind === 210 /* PropertyAccessExpression */ && node.expression.kind === 108 /* SuperKeyword */, + node.kind === 211 /* PropertyAccessExpression */ && node.expression.kind === 108 /* SuperKeyword */, /*isWrite*/ false, type, @@ -341483,7 +344215,7 @@ ${lanes.join("\n")} } function getForInVariableSymbol(node) { const initializer = node.initializer; - if (initializer.kind === 260 /* VariableDeclarationList */) { + if (initializer.kind === 261 /* VariableDeclarationList */) { const variable = initializer.declarations[0]; if (variable && !isBindingPattern(variable.name)) { return getSymbolOfDeclaration(variable); @@ -341504,7 +344236,7 @@ ${lanes.join("\n")} let child = expr; let node = expr.parent; while (node) { - if (node.kind === 248 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { + if (node.kind === 249 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { return true; } child = node; @@ -341515,7 +344247,7 @@ ${lanes.join("\n")} return false; } function checkIndexedAccess(node, checkMode) { - return node.flags & 32 /* OptionalChain */ ? checkElementAccessChain(node, checkMode) : checkElementAccessExpression(node, checkNonNullExpression(node.expression), checkMode); + return node.flags & 64 /* OptionalChain */ ? checkElementAccessChain(node, checkMode) : checkElementAccessExpression(node, checkNonNullExpression(node.expression), checkMode); } function checkElementAccessChain(node, checkMode) { const exprType = checkExpression(node.expression); @@ -341530,7 +344262,7 @@ ${lanes.join("\n")} return objectType; } if (isConstEnumObjectType(objectType) && !isStringLiteralLike(indexExpression)) { - error(indexExpression, Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); + error2(indexExpression, Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return errorType; } const effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType; @@ -341545,11 +344277,13 @@ ${lanes.join("\n")} if (callLikeExpressionMayHaveTypeArguments(node)) { forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 214 /* TaggedTemplateExpression */) { + if (node.kind === 215 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); - } else if (node.kind !== 169 /* Decorator */) { + } else if (isBinaryExpression(node)) { + checkExpression(node.left); + } else if (isCallOrNewExpression(node)) { forEach(node.arguments, (argument) => { checkExpression(argument); }); @@ -341594,7 +344328,7 @@ ${lanes.join("\n")} } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 229 /* SpreadElement */ || arg.kind === 236 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 230 /* SpreadElement */ || arg.kind === 237 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return findIndex(args, isSpreadArgument); @@ -341610,9 +344344,9 @@ ${lanes.join("\n")} let callIsIncomplete = false; let effectiveParameterCount = getParameterCount(signature); let effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 214 /* TaggedTemplateExpression */) { + if (node.kind === 215 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 227 /* TemplateExpression */) { + if (node.template.kind === 228 /* TemplateExpression */) { const lastSpan = last(node.template.templateSpans); callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { @@ -341620,8 +344354,10 @@ ${lanes.join("\n")} Debug.assert(templateLiteral.kind === 15 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } - } else if (node.kind === 169 /* Decorator */) { + } else if (node.kind === 170 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); + } else if (node.kind === 226 /* BinaryExpression */) { + argCount = 1; } else if (isJsxOpeningLikeElement(node)) { callIsIncomplete = node.attributes.end === node.end; if (callIsIncomplete) { @@ -341631,7 +344367,7 @@ ${lanes.join("\n")} effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1; effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1); } else if (!node.arguments) { - Debug.assert(node.kind === 213 /* NewExpression */); + Debug.assert(node.kind === 214 /* NewExpression */); return getMinArgumentCount(signature) === 0; } else { argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -341660,6 +344396,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, @@ -341721,13 +344461,13 @@ ${lanes.join("\n")} return voidType; } const thisArgumentType = checkExpression(thisArgumentNode); - return isOptionalChainRoot(thisArgumentNode.parent) ? getNonNullableType(thisArgumentType) : isOptionalChain(thisArgumentNode.parent) ? removeOptionalTypeMarker(thisArgumentType) : thisArgumentType; + return isRightSideOfInstanceofExpression(thisArgumentNode) ? thisArgumentType : isOptionalChainRoot(thisArgumentNode.parent) ? getNonNullableType(thisArgumentType) : isOptionalChain(thisArgumentNode.parent) ? removeOptionalTypeMarker(thisArgumentType) : thisArgumentType; } function inferTypeArguments(node, signature, args, checkMode, context) { if (isJsxOpeningLikeElement(node)) { return inferJsxTypeArguments(node, signature, checkMode, context); } - if (node.kind !== 169 /* Decorator */) { + if (node.kind !== 170 /* Decorator */ && node.kind !== 226 /* BinaryExpression */) { const skipBindingPatterns = every(signature.typeParameters, (p) => !!getDefaultFromTypeParameter(p)); const contextualType = getContextualType2(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */); if (contextualType) { @@ -341764,7 +344504,7 @@ ${lanes.join("\n")} } for (let i = 0; i < argCount; i++) { const arg = args[i]; - if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) { + if (arg.kind !== 232 /* OmittedExpression */) { const paramType = getTypeAtPosition(signature, i); if (couldContainTypeVariables(paramType)) { const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); @@ -341792,11 +344532,11 @@ ${lanes.join("\n")} if (index >= argCount - 1) { const arg = args[argCount - 1]; if (isSpreadArgument(arg)) { - const spreadType = arg.kind === 236 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode); + const spreadType = arg.kind === 237 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode); if (isArrayLikeType(spreadType)) { return getMutableArrayOrTupleType(spreadType); } - return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 229 /* SpreadElement */ ? arg.expression : arg), inConstContext); + return createArrayType(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 230 /* SpreadElement */ ? arg.expression : arg), inConstContext); } } const types = []; @@ -341805,12 +344545,12 @@ ${lanes.join("\n")} for (let i = index; i < argCount; i++) { const arg = args[i]; if (isSpreadArgument(arg)) { - const spreadType = arg.kind === 236 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); + const spreadType = arg.kind === 237 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); if (isArrayLikeType(spreadType)) { types.push(spreadType); flags.push(8 /* Variadic */); } else { - types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 229 /* SpreadElement */ ? arg.expression : arg)); + types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 230 /* SpreadElement */ ? arg.expression : arg)); flags.push(4 /* Rest */); } } else { @@ -341820,11 +344560,13 @@ ${lanes.join("\n")} types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } - if (arg.kind === 236 /* SyntheticExpression */ && arg.tupleNameSource) { + if (arg.kind === 237 /* SyntheticExpression */ && arg.tupleNameSource) { names.push(arg.tupleNameSource); + } else { + names.push(void 0); } } - return createTupleType(types, flags, inConstContext, length(names) === length(types) ? names : void 0); + return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names); } function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) { const isJavascript = isInJSFile(signature.declaration); @@ -341880,8 +344622,9 @@ ${lanes.join("\n")} void 0, checkMode ); + const checkAttributesType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(attributesType) : attributesType; return checkTagNameDoesNotExpectTooManyArguments() && checkTypeRelatedToAndOptionallyElaborate( - attributesType, + checkAttributesType, paramType, relation, reportErrors2 ? node.tagName : void 0, @@ -341972,6 +344715,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)) { @@ -341997,7 +344744,7 @@ ${lanes.join("\n")} const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (let i = 0; i < argCount; i++) { const arg = args[i]; - if (arg.kind !== 231 /* OmittedExpression */) { + if (arg.kind !== 232 /* OmittedExpression */) { const paramType = getTypeAtPosition(signature, i); const argType = checkExpressionWithContextualType( arg, @@ -342007,7 +344754,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; @@ -342025,7 +344773,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, @@ -342055,7 +344803,10 @@ ${lanes.join("\n")} } } function getThisArgumentOfCall(node) { - const expression = node.kind === 212 /* CallExpression */ ? node.expression : node.kind === 214 /* TaggedTemplateExpression */ ? node.tag : void 0; + if (node.kind === 226 /* BinaryExpression */) { + return node.right; + } + const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : node.kind === 170 /* Decorator */ && !legacyDecorators ? node.expression : void 0; if (expression) { const callee = skipOuterExpressions(expression); if (isAccessExpression(callee)) { @@ -342070,19 +344821,22 @@ ${lanes.join("\n")} return result; } function getEffectiveCallArguments(node) { - if (node.kind === 214 /* TaggedTemplateExpression */) { + if (node.kind === 215 /* TaggedTemplateExpression */) { const template = node.template; const args2 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 227 /* TemplateExpression */) { + if (template.kind === 228 /* TemplateExpression */) { forEach(template.templateSpans, (span) => { args2.push(span.expression); }); } return args2; } - if (node.kind === 169 /* Decorator */) { + if (node.kind === 170 /* Decorator */) { return getEffectiveDecoratorArguments(node); } + if (node.kind === 226 /* BinaryExpression */) { + return [node.left]; + } if (isJsxOpeningLikeElement(node)) { return node.attributes.properties.length > 0 || isJsxOpeningElement(node) && node.parent.children.length > 0 ? [node.attributes] : emptyArray; } @@ -342092,17 +344846,12 @@ ${lanes.join("\n")} const effectiveArgs = args.slice(0, spreadIndex); for (let i = spreadIndex; i < args.length; i++) { const arg = args[i]; - const spreadType = arg.kind === 229 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + const spreadType = arg.kind === 230 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); if (spreadType && isTupleType(spreadType)) { forEach(getElementTypes(spreadType), (t, i2) => { var _a; const flags = spreadType.target.elementFlags[i2]; - const syntheticArg = createSyntheticExpression( - arg, - flags & 4 /* Rest */ ? createArrayType(t) : t, - !!(flags & 12 /* Variable */), - (_a = spreadType.target.labeledElementDeclarations) == null ? void 0 : _a[i2] - ); + const syntheticArg = createSyntheticExpression(arg, flags & 4 /* Rest */ ? createArrayType(t) : t, !!(flags & 12 /* Variable */), (_a = spreadType.target.labeledElementDeclarations) == null ? void 0 : _a[i2]); effectiveArgs.push(syntheticArg); }); } else { @@ -342131,34 +344880,24 @@ ${lanes.join("\n")} } function getLegacyDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: return 1; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return hasAccessorModifier(node.parent) ? 3 : 2; - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 168 /* Parameter */: + case 169 /* Parameter */: return 3; default: 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) { @@ -342175,6 +344914,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; @@ -342236,7 +344987,7 @@ ${lanes.join("\n")} if (isVoidPromiseError && isInJSFile(node)) { return getDiagnosticForCallNode(node, Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments); } - const error2 = isDecorator(node) ? hasRestParameter2 ? Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0 : Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0 : hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; + const error3 = isDecorator(node) ? hasRestParameter2 ? Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0 : Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0 : hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; if (min2 < args.length && args.length < max) { if (headMessage) { let chain = chainDiagnosticMessages( @@ -342257,14 +345008,14 @@ ${lanes.join("\n")} let chain = chainDiagnosticMessages( /*details*/ void 0, - error2, + error3, parameterRange, args.length ); chain = chainDiagnosticMessages(chain, headMessage); diagnostic = getDiagnosticForCallNode(node, chain); } else { - diagnostic = getDiagnosticForCallNode(node, error2, parameterRange, args.length); + diagnostic = getDiagnosticForCallNode(node, error3, parameterRange, args.length); } const parameter = (_a = closestSignature == null ? void 0 : closestSignature.declaration) == null ? void 0 : _a.parameters[closestSignature.thisParameter ? args.length + 1 : args.length]; if (parameter) { @@ -342285,14 +345036,14 @@ ${lanes.join("\n")} let chain = chainDiagnosticMessages( /*details*/ void 0, - error2, + error3, parameterRange, args.length ); chain = chainDiagnosticMessages(chain, headMessage); return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), errorSpan, chain); } - return createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error2, parameterRange, args.length); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error3, parameterRange, args.length); } } function getTypeArgumentArityError(node, signatures, typeArguments, headMessage) { @@ -342354,12 +345105,13 @@ ${lanes.join("\n")} return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, headMessage) { - const isTaggedTemplate = node.kind === 214 /* TaggedTemplateExpression */; - const isDecorator2 = node.kind === 169 /* Decorator */; + const isTaggedTemplate = node.kind === 215 /* TaggedTemplateExpression */; + const isDecorator2 = node.kind === 170 /* Decorator */; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); + const isInstanceof = node.kind === 226 /* BinaryExpression */; const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray; let typeArguments; - if (!isDecorator2 && !isSuperCall(node)) { + if (!isDecorator2 && !isInstanceof && !isSuperCall(node)) { typeArguments = node.typeArguments; if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 108 /* SuperKeyword */) { forEach(typeArguments, checkSourceElement); @@ -342367,21 +345119,15 @@ ${lanes.join("\n")} } const candidates = candidatesOutArray || []; reorderCandidates(signatures, candidates, callChainFlags); - if (!candidates.length) { - if (reportErrors2) { - diagnostics.add(getDiagnosticForCallNode(node, Diagnostics.Call_target_does_not_contain_any_signatures)); - } - return resolveErrorCall(node); - } + Debug.assert(candidates.length, "Revert #54442 and add a testcase with whatever triggered this"); const args = getEffectiveCallArguments(node); const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */; - argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */; let candidatesForArgumentError; let candidateForArgumentArityError; let candidateForTypeArgumentError; let result; - const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 212 /* CallExpression */ && node.arguments.hasTrailingComma; + const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 213 /* CallExpression */ && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); } @@ -342394,6 +345140,9 @@ ${lanes.join("\n")} result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode); getNodeLinks(node).resolvedSignature = result; if (reportErrors2) { + if (!headMessage && isInstanceof) { + headMessage = Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method; + } if (candidatesForArgumentError) { if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) { const last2 = candidatesForArgumentError[candidatesForArgumentError.length - 1]; @@ -342478,7 +345227,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); @@ -342509,8 +345258,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; @@ -342600,7 +345349,7 @@ ${lanes.join("\n")} continue; } if (argCheckMode) { - argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */; + argCheckMode = 0 /* Normal */; if (inferenceContext) { const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext); checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters); @@ -342649,7 +345398,7 @@ ${lanes.join("\n")} parameters.push(createCombinedSymbolFromTypes(symbols, mapDefined(candidates, (candidate) => tryGetTypeAtPosition(candidate, i)))); } const restParameterSymbols = mapDefined(candidates, (c) => signatureHasRestParameter(c) ? last(c.parameters) : void 0); - let flags = 0 /* None */; + let flags = 128 /* IsSignatureCandidateForOverloadFailure */; if (restParameterSymbols.length !== 0) { const type = createArrayType(getUnionType(mapDefined(candidates, tryGetRestTypeOfSignature), 2 /* Subtype */)); parameters.push(createCombinedSymbolForOverloadFailure(restParameterSymbols, type)); @@ -342774,13 +345523,13 @@ ${lanes.join("\n")} const numConstructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */).length; if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { if (!isErrorType(funcType) && node.typeArguments) { - error(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + error2(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } return resolveUntypedCall(node); } if (!callSignatures.length) { if (numConstructSignatures) { - error(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); + error2(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); } else { let relatedInformation; if (node.arguments.length === 1) { @@ -342798,18 +345547,22 @@ ${lanes.join("\n")} } return resolveErrorCall(node); } - if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) { + if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunctionOrConstructor)) { skippedGenericFunction(node, checkMode); return resolvingSignature; } if (callSignatures.some((sig) => isInJSFile(sig.declaration) && !!getJSDocClassTag(sig.declaration))) { - error(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); + error2(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags); } - function isGenericFunctionReturningFunction(signature) { - return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature))); + function isGenericFunctionReturningFunctionOrConstructor(signature) { + if (!signature.typeParameters) { + return false; + } + const returnType = getReturnTypeOfSignature(signature); + return isFunctionType(returnType) || isConstructorType(returnType); } function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) { return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576 /* Union */) && !(getReducedType(apparentFuncType).flags & 131072 /* Never */) && isTypeAssignableTo(funcType, globalFunctionType); @@ -342818,7 +345571,7 @@ ${lanes.join("\n")} if (node.arguments && languageVersion < 1 /* ES5 */) { const spreadIndex = getSpreadArgumentIndex(node.arguments); if (spreadIndex >= 0) { - error(node.arguments[spreadIndex], Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher); + error2(node.arguments[spreadIndex], Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher); } } let expressionType = checkNonNullExpression(node.expression); @@ -342831,7 +345584,7 @@ ${lanes.join("\n")} } if (isTypeAny(expressionType)) { if (node.typeArguments) { - error(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + error2(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } return resolveUntypedCall(node); } @@ -342841,12 +345594,12 @@ ${lanes.join("\n")} return resolveErrorCall(node); } if (someSignature(constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */))) { - error(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class); + error2(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class); return resolveErrorCall(node); } const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol); - if (valueDecl && hasSyntacticModifier(valueDecl, 256 /* Abstract */)) { - error(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class); + if (valueDecl && hasSyntacticModifier(valueDecl, 64 /* Abstract */)) { + error2(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class); return resolveErrorCall(node); } return resolveCall(node, constructSignatures, candidatesOutArray, checkMode, 0 /* None */); @@ -342856,10 +345609,10 @@ ${lanes.join("\n")} const signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */); if (!noImplicitAny) { if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) { - error(node, Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); + error2(node, Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); } if (getThisTypeOfSignature(signature) === voidType) { - error(node, Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void); + error2(node, Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void); } } return signature; @@ -342908,25 +345661,25 @@ ${lanes.join("\n")} return true; } const declaration = signature.declaration; - const modifiers = getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); - if (!modifiers || declaration.kind !== 175 /* Constructor */) { + const modifiers = getSelectedEffectiveModifierFlags(declaration, 6 /* NonPublicAccessibilityModifier */); + if (!modifiers || declaration.kind !== 176 /* Constructor */) { return true; } const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); const declaringClass = getDeclaredTypeOfSymbol(declaration.parent.symbol); if (!isNodeWithinClass(node, declaringClassDeclaration)) { const containingClass = getContainingClass(node); - if (containingClass && modifiers & 16 /* Protected */) { + if (containingClass && modifiers & 4 /* Protected */) { const containingType = getTypeOfNode(containingClass); if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType)) { return true; } } - if (modifiers & 8 /* Private */) { - error(node, Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass)); + if (modifiers & 2 /* Private */) { + error2(node, Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass)); } - if (modifiers & 16 /* Protected */) { - error(node, Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass)); + if (modifiers & 4 /* Protected */) { + error2(node, Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass)); } return false; } @@ -343006,11 +345759,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; } @@ -343026,10 +345775,7 @@ ${lanes.join("\n")} const sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind); if (!sigs || !sigs.length) return; - addRelatedInfo( - diagnostic, - createDiagnosticForNode(importNode, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead) - ); + addRelatedInfo(diagnostic, createDiagnosticForNode(importNode, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead)); } } function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) { @@ -343056,16 +345802,16 @@ ${lanes.join("\n")} } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: return Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 168 /* Parameter */: + case 169 /* Parameter */: return Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return Debug.fail(); @@ -343088,7 +345834,7 @@ ${lanes.join("\n")} /*includeTrivia*/ false ); - error(node, Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0, nodeStr); + error2(node, Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0, nodeStr); return resolveErrorCall(node); } const headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); @@ -343178,27 +345924,53 @@ ${lanes.join("\n")} return resolveUntypedCall(node); } if (signatures.length === 0) { - error(node.tagName, Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, getTextOfNode(node.tagName)); + error2(node.tagName, Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, getTextOfNode(node.tagName)); return resolveErrorCall(node); } return resolveCall(node, signatures, candidatesOutArray, checkMode, 0 /* None */); } + function resolveInstanceofExpression(node, candidatesOutArray, checkMode) { + const rightType = checkExpression(node.right); + if (!isTypeAny(rightType)) { + const hasInstanceMethodType = getSymbolHasInstanceMethodOfObjectType(rightType); + if (hasInstanceMethodType) { + const apparentType = getApparentType(hasInstanceMethodType); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + const callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); + const constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */); + if (isUntypedFunctionCall(hasInstanceMethodType, apparentType, callSignatures.length, constructSignatures.length)) { + return resolveUntypedCall(node); + } + if (callSignatures.length) { + return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */); + } + } else if (!(typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + error2(node.right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method); + return resolveErrorCall(node); + } + } + return anySignature; + } function isPotentiallyUncalledDecorator(decorator, signatures) { return signatures.length && every(signatures, (signature) => signature.minArgumentCount === 0 && !signatureHasRestParameter(signature) && signature.parameters.length < getDecoratorArgumentCount(decorator, signature)); } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 212 /* CallExpression */: + case 213 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 213 /* NewExpression */: + case 214 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 169 /* Decorator */: + case 170 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 285 /* JsxOpeningElement */: - case 284 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 285 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); + case 226 /* BinaryExpression */: + return resolveInstanceofExpression(node, candidatesOutArray, checkMode); } Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); } @@ -343273,7 +346045,7 @@ ${lanes.join("\n")} let name; let decl; if (isVariableDeclaration(node.parent) && node.parent.initializer === node) { - if (!isInJSFile(node) && !(isVarConst(node.parent) && isFunctionLikeDeclaration(node))) { + if (!isInJSFile(node) && !(isVarConstLike(node.parent) && isFunctionLikeDeclaration(node))) { return void 0; } name = node.parent.name; @@ -343310,7 +346082,7 @@ ${lanes.join("\n")} return false; } let parent2 = node.parent; - while (parent2 && parent2.kind === 210 /* PropertyAccessExpression */) { + while (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) { parent2 = parent2.parent; } if (parent2 && isBinaryExpression(parent2) && isPrototypeAccess(parent2.left) && parent2.operatorToken.kind === 64 /* EqualsToken */) { @@ -343334,27 +346106,27 @@ ${lanes.join("\n")} if (node.expression.kind === 108 /* SuperKeyword */) { return voidType; } - if (node.kind === 213 /* NewExpression */) { + if (node.kind === 214 /* NewExpression */) { const declaration = signature.declaration; - if (declaration && declaration.kind !== 175 /* Constructor */ && declaration.kind !== 179 /* ConstructSignature */ && declaration.kind !== 184 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a = getJSDocRoot(declaration)) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 175 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { + if (declaration && declaration.kind !== 176 /* Constructor */ && declaration.kind !== 180 /* ConstructSignature */ && declaration.kind !== 185 /* ConstructorType */ && !(isJSDocSignature(declaration) && ((_b = (_a = getJSDocRoot(declaration)) == null ? void 0 : _a.parent) == null ? void 0 : _b.kind) === 176 /* Constructor */) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { - error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); + error2(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } return anyType; } } - if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) { + if (isInJSFile(node) && isCommonJsRequire(node)) { return resolveExternalModuleTypeByLiteral(node.arguments[0]); } const returnType = getReturnTypeOfSignature(signature); if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 212 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 243 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { + if (node.kind === 213 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 244 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!isDottedName(node.expression)) { - error(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); + error2(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); } else if (!getEffectsSignature(node)) { - const diagnostic = error(node.expression, Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation); + const diagnostic = error2(node.expression, Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation); getTypeOfDottedName(node.expression, diagnostic); } } @@ -343373,7 +346145,9 @@ ${lanes.join("\n")} return returnType; } function checkDeprecatedSignature(signature, node) { - if (signature.declaration && signature.declaration.flags & 268435456 /* Deprecated */) { + if (signature.flags & 128 /* IsSignatureCandidateForOverloadFailure */) + return; + if (signature.declaration && signature.declaration.flags & 536870912 /* Deprecated */) { const suggestionNode = getDeprecatedSuggestionNode(node); const name = tryGetPropertyAccessOrIdentifierToString(getInvokedExpression(node)); addDeprecatedSuggestionWithSignature(suggestionNode, signature.declaration, name, signatureToString(signature)); @@ -343382,20 +346156,20 @@ ${lanes.join("\n")} function getDeprecatedSuggestionNode(node) { node = skipParentheses(node); switch (node.kind) { - case 212 /* CallExpression */: - case 169 /* Decorator */: - case 213 /* NewExpression */: + case 213 /* CallExpression */: + case 170 /* Decorator */: + case 214 /* NewExpression */: return getDeprecatedSuggestionNode(node.expression); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return getDeprecatedSuggestionNode(node.tag); - case 285 /* JsxOpeningElement */: - case 284 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 285 /* JsxSelfClosingElement */: return getDeprecatedSuggestionNode(node.tagName); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return node.argumentExpression; - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return node.name; - case 182 /* TypeReference */: + case 183 /* TypeReference */: const typeReference = node; return isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; default: @@ -343443,7 +346217,7 @@ ${lanes.join("\n")} checkExpressionCached(node.arguments[i]); } if (specifierType.flags & 32768 /* Undefined */ || specifierType.flags & 65536 /* Null */ || !isTypeAssignableTo(specifierType, stringType)) { - error(specifier, Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType)); + error2(specifier, Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType)); } if (optionsType) { const importCallOptionsType = getGlobalImportCallOptionsType( @@ -343555,10 +346329,10 @@ ${lanes.join("\n")} if (resolvedRequire.flags & 2097152 /* Alias */) { return false; } - const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 261 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 259 /* VariableDeclaration */ : 0 /* Unknown */; + const targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ ? 262 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ ? 260 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind); - return !!decl && !!(decl.flags & 16777216 /* Ambient */); + return !!decl && !!(decl.flags & 33554432 /* Ambient */); } return false; } @@ -343573,7 +346347,7 @@ ${lanes.join("\n")} return getReturnTypeOfSignature(signature); } function checkAssertion(node, checkMode) { - if (node.kind === 215 /* TypeAssertionExpression */) { + if (node.kind === 216 /* TypeAssertionExpression */) { const file = getSourceFileOfNode(node); if (file && fileExtensionIsOneOf(file.fileName, [".cts" /* Cts */, ".mts" /* Mts */])) { grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead); @@ -343589,18 +346363,18 @@ ${lanes.join("\n")} case 10 /* BigIntLiteral */: case 112 /* TrueKeyword */: case 97 /* FalseKeyword */: - case 208 /* ArrayLiteralExpression */: - case 209 /* ObjectLiteralExpression */: - case 227 /* TemplateExpression */: + case 209 /* ArrayLiteralExpression */: + case 210 /* ObjectLiteralExpression */: + case 228 /* TemplateExpression */: return true; - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: const op = node.operator; const arg = node.operand; return op === 41 /* MinusToken */ && (arg.kind === 9 /* NumericLiteral */ || arg.kind === 10 /* BigIntLiteral */) || op === 40 /* PlusToken */ && arg.kind === 9 /* NumericLiteral */; - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: const expr = skipParentheses(node.expression); const symbol = isEntityNameExpression(expr) ? resolveEntityName( expr, @@ -343617,7 +346391,7 @@ ${lanes.join("\n")} const exprType = checkExpression(expression, checkMode); if (isConstTypeReference(type)) { if (!isValidConstAssertionArgument(expression)) { - error(expression, Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals); + error2(expression, Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals); } return getRegularTypeOfLiteralType(exprType); } @@ -343631,12 +346405,12 @@ ${lanes.join("\n")} let type; let expression; switch (node.kind) { - case 233 /* AsExpression */: - case 215 /* TypeAssertionExpression */: + case 234 /* AsExpression */: + case 216 /* TypeAssertionExpression */: type = node.type; expression = node.expression; break; - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: type = getJSDocTypeAssertionType(node); expression = node.expression; break; @@ -343654,12 +346428,7 @@ ${lanes.join("\n")} addLazyDiagnostic(() => { const widenedType = getWidenedType(exprType); if (!isTypeComparableTo(targetType, widenedType)) { - checkTypeComparableTo( - exprType, - targetType, - errNode, - Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first - ); + checkTypeComparableTo(exprType, targetType, errNode, Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first); } }); } @@ -343670,18 +346439,18 @@ ${lanes.join("\n")} return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); } function checkNonNullAssertion(node) { - return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) : getNonNullableType(checkExpression(node.expression)); + return node.flags & 64 /* OptionalChain */ ? checkNonNullChain(node) : getNonNullableType(checkExpression(node.expression)); } function checkExpressionWithTypeArguments(node) { checkGrammarExpressionWithTypeArguments(node); forEach(node.typeArguments, checkSourceElement); - if (node.kind === 232 /* ExpressionWithTypeArguments */) { + if (node.kind === 233 /* ExpressionWithTypeArguments */) { const parent2 = walkUpParenthesizedExpressions(node.parent); - if (parent2.kind === 225 /* BinaryExpression */ && parent2.operatorToken.kind === 104 /* InstanceOfKeyword */ && isNodeDescendantOf(node, parent2.right)) { - error(node, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression); + if (parent2.kind === 226 /* BinaryExpression */ && parent2.operatorToken.kind === 104 /* InstanceOfKeyword */ && isNodeDescendantOf(node, parent2.right)) { + error2(node, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression); } } - const exprType = node.kind === 232 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); + const exprType = node.kind === 233 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); return getInstantiationExpressionType(exprType, node); } function getInstantiationExpressionType(exprType, node) { @@ -343714,14 +346483,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; @@ -343765,7 +346527,7 @@ ${lanes.join("\n")} if (isErrorType(targetType)) { return targetType; } - const errorNode = findAncestor(target.parent, (n) => n.kind === 237 /* SatisfiesExpression */ || n.kind === 356 /* JSDocSatisfiesTag */); + const errorNode = findAncestor(target.parent, (n) => n.kind === 238 /* SatisfiesExpression */ || n.kind === 357 /* JSDocSatisfiesTag */); checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, errorNode, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); return exprType; } @@ -343793,9 +346555,9 @@ ${lanes.join("\n")} function checkNewTargetMetaProperty(node) { const container = getNewTargetContainer(node); if (!container) { - error(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); + error2(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; - } else if (container.kind === 175 /* Constructor */) { + } else if (container.kind === 176 /* Constructor */) { const symbol = getSymbolOfDeclaration(container.parent); return getTypeOfSymbol(symbol); } else { @@ -343806,26 +346568,29 @@ ${lanes.join("\n")} function checkImportMetaProperty(node) { if (moduleKind === 100 /* Node16 */ || moduleKind === 199 /* NodeNext */) { if (getSourceFileOfNode(node).impliedNodeFormat !== 99 /* ESNext */) { - error(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output); + error2(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output); } } else if (moduleKind < 6 /* ES2020 */ && moduleKind !== 4 /* System */) { - error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext); + error2(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext); } const file = getSourceFileOfNode(node); - Debug.assert(!!(file.flags & 4194304 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag."); + Debug.assert(!!(file.flags & 8388608 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag."); return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType; } function getTypeOfParameter(symbol) { - const type = getTypeOfSymbol(symbol); - if (strictNullChecks) { - const declaration = symbol.valueDeclaration; - if (declaration && hasInitializer(declaration)) { - return getOptionalType(type); - } - } - return type; + const declaration = symbol.valueDeclaration; + return addOptionality( + getTypeOfSymbol(symbol), + /*isProperty*/ + false, + /*isOptional*/ + !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration)) + ); } - function getTupleElementLabel(d) { + function getTupleElementLabel(d, index, restParameterName = "arg") { + if (!d) { + return `${restParameterName}_${index}`; + } Debug.assert(isIdentifier(d.name)); return d.name.escapedText; } @@ -343839,22 +346604,28 @@ ${lanes.join("\n")} if (isTupleType(restType)) { const associatedNames = restType.target.labeledElementDeclarations; const index = pos - paramCount; - return associatedNames && getTupleElementLabel(associatedNames[index]) || restParameter.escapedName + "_" + index; + return getTupleElementLabel(associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName); } return restParameter.escapedName; } - function getParameterIdentifierNameAtPosition(signature, pos) { + function getParameterIdentifierInfoAtPosition(signature, pos) { var _a; - if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 323 /* JSDocFunctionType */) { + if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 324 /* JSDocFunctionType */) { return void 0; } const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); if (pos < paramCount) { const param = signature.parameters[pos]; - return isParameterDeclarationWithIdentifierName(param) ? [param.escapedName, false] : void 0; + const paramIdent = getParameterDeclarationIdentifier(param); + return paramIdent ? { + parameter: paramIdent, + parameterName: param.escapedName, + isRestParameter: false + } : void 0; } const restParameter = signature.parameters[paramCount] || unknownSymbol; - if (!isParameterDeclarationWithIdentifierName(restParameter)) { + const restIdent = getParameterDeclarationIdentifier(restParameter); + if (!restIdent) { return void 0; } const restType = getTypeOfSymbol(restParameter); @@ -343863,21 +346634,22 @@ ${lanes.join("\n")} const index = pos - paramCount; const associatedName = associatedNames == null ? void 0 : associatedNames[index]; const isRestTupleElement = !!(associatedName == null ? void 0 : associatedName.dotDotDotToken); - return associatedName ? [ - getTupleElementLabel(associatedName), - isRestTupleElement - ] : void 0; + if (associatedName) { + Debug.assert(isIdentifier(associatedName.name)); + return { parameter: associatedName.name, parameterName: associatedName.name.escapedText, isRestParameter: isRestTupleElement }; + } + return void 0; } if (pos === paramCount) { - return [restParameter.escapedName, true]; + return { parameter: restIdent, parameterName: restParameter.escapedName, isRestParameter: true }; } return void 0; } - function isParameterDeclarationWithIdentifierName(symbol) { - return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name); + function getParameterDeclarationIdentifier(symbol) { + return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name) && symbol.valueDeclaration.name; } function isValidDeclarationForTupleLabel(d) { - return d.kind === 201 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name); + return d.kind === 202 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name); } function getNameableDeclarationAtPosition(signature, pos) { const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -343911,7 +346683,7 @@ ${lanes.join("\n")} } return void 0; } - function getRestTypeAtPosition(source, pos) { + function getRestTypeAtPosition(source, pos, readonly) { const parameterCount = getParameterCount(source); const minArgumentCount = getMinArgumentCount(source); const restType = getEffectiveRestType(source); @@ -343929,18 +346701,14 @@ ${lanes.join("\n")} types.push(restType); flags.push(8 /* Variadic */); } - const name = getNameableDeclarationAtPosition(source, i); - if (name) { - names.push(name); - } + names.push(getNameableDeclarationAtPosition(source, i)); } - return createTupleType( - types, - flags, - /*readonly*/ - false, - length(names) === length(types) ? names : void 0 - ); + 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; @@ -343998,7 +346766,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); @@ -344020,11 +346788,16 @@ ${lanes.join("\n")} const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); for (let i = 0; i < len; i++) { const declaration = signature.parameters[i].valueDeclaration; - if (declaration.type) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - inferTypes(inferenceContext.inferences, getTypeFromTypeNode(typeNode), getTypeAtPosition(context, i)); - } + const typeNode = getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + const source = addOptionality( + getTypeFromTypeNode(typeNode), + /*isProperty*/ + false, + isOptionalDeclaration(declaration) + ); + const target = getTypeAtPosition(context, i); + inferTypes(inferenceContext.inferences, source, target); } } } @@ -344052,9 +346825,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)) { @@ -344073,29 +346853,40 @@ ${lanes.join("\n")} assignParameterType(parameter); } } - function assignParameterType(parameter, type) { + function assignParameterType(parameter, contextualType) { const links = getSymbolLinks(parameter); if (!links.type) { const declaration = parameter.valueDeclaration; - links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration( - declaration, - /*reportErrors*/ - true - ) : getTypeOfSymbol(parameter)); + links.type = addOptionality( + contextualType || (declaration ? getWidenedTypeForVariableLikeDeclaration( + declaration, + /*reportErrors*/ + true + ) : getTypeOfSymbol(parameter)), + /*isProperty*/ + false, + /*isOptional*/ + !!declaration && !declaration.initializer && isOptionalDeclaration(declaration) + ); if (declaration && declaration.name.kind !== 80 /* Identifier */) { if (links.type === unknownType) { links.type = getTypeFromBindingPattern(declaration.name); } assignBindingElementTypes(declaration.name, links.type); } - } else if (type) { - Debug.assertEqual(links.type, type, "Parameter symbol already has a cached type which differs from newly assigned type"); + } else if (contextualType) { + Debug.assertEqual(links.type, contextualType, "Parameter symbol already has a cached type which differs from newly assigned type"); } } function assignBindingElementTypes(pattern, parentType) { for (const element of pattern.elements) { if (!isOmittedExpression(element)) { - const type = getBindingElementTypeFromParentType(element, parentType); + const type = getBindingElementTypeFromParentType( + element, + parentType, + /*noTupleBoundsCheck*/ + false + ); if (element.name.kind === 80 /* Identifier */) { getSymbolLinks(getSymbolOfDeclaration(element)).type = type; } else { @@ -344181,8 +346972,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, @@ -344195,8 +346986,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*/ @@ -344213,17 +347004,17 @@ ${lanes.join("\n")} if (!links.decoratorSignature) { links.decoratorSignature = anySignature; switch (parent2.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: { + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: { const node = parent2; const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); const contextType = createClassDecoratorContextType(targetType); links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, targetType); break; } - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: { + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: { const node = parent2; if (!isClassLike(node.parent)) break; @@ -344235,7 +347026,7 @@ ${lanes.join("\n")} links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); break; } - case 171 /* PropertyDeclaration */: { + case 172 /* PropertyDeclaration */: { const node = parent2; if (!isClassLike(node.parent)) break; @@ -344257,11 +347048,11 @@ ${lanes.join("\n")} if (!links.decoratorSignature) { links.decoratorSignature = anySignature; switch (parent2.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: { + case 263 /* ClassDeclaration */: + 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, @@ -344272,7 +347063,7 @@ ${lanes.join("\n")} ); break; } - case 168 /* Parameter */: { + case 169 /* Parameter */: { const node = parent2; if (!isConstructorDeclaration(node.parent) && !(isMethodDeclaration(node.parent) || isSetAccessorDeclaration(node.parent) && isClassLike(node.parent.parent))) { break; @@ -344285,9 +347076,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, @@ -344298,22 +347089,22 @@ ${lanes.join("\n")} ); break; } - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 171 /* PropertyDeclaration */: { + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 172 /* PropertyDeclaration */: { const node = parent2; 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, @@ -344366,13 +347157,19 @@ ${lanes.join("\n")} function createPromiseReturnType(func, promisedType) { const promiseType = createPromiseType(promisedType); if (promiseType === unknownType) { - error(func, isImportCall(func) ? Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); + error2( + func, + isImportCall(func) ? Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option + ); return errorType; } else if (!getGlobalPromiseConstructorSymbol( /*reportErrors*/ true )) { - error(func, isImportCall(func) ? Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + error2( + func, + isImportCall(func) ? Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option + ); } return promiseType; } @@ -344396,7 +347193,7 @@ ${lanes.join("\n")} let yieldType; let nextType; let fallbackReturnType = voidType; - if (func.body.kind !== 240 /* Block */) { + if (func.body.kind !== 241 /* Block */) { returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { returnType = unwrapAwaitedType(checkAwaitedType( @@ -344555,7 +347352,11 @@ ${lanes.join("\n")} function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync) { const errorNode = node.expression || node; const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */, expressionType, sentType, errorNode) : expressionType; - return !isAsync ? yieldedType : getAwaitedType(yieldedType, errorNode, node.asteriskToken ? Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + return !isAsync ? yieldedType : getAwaitedType( + yieldedType, + errorNode, + node.asteriskToken ? Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ); } function getNotEqualFactsFromTypeofSwitch(start, end, witnesses) { let facts = 0 /* None */; @@ -344579,7 +347380,7 @@ ${lanes.join("\n")} return links.isExhaustive; } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 220 /* TypeOfExpression */) { + if (node.expression.kind === 221 /* TypeOfExpression */) { const witnesses = getSwitchClauseTypeOfWitnesses(node); if (!witnesses) { return false; @@ -344589,7 +347390,7 @@ ${lanes.join("\n")} if (operandConstraint.flags & 3 /* AnyOrUnknown */) { return (556800 /* AllTypeofNE */ & notEqualFacts) === 556800 /* AllTypeofNE */; } - return !someType(operandConstraint, (t) => (getTypeFacts(t) & notEqualFacts) === notEqualFacts); + return !someType(operandConstraint, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts); } const type = checkExpressionCached(node.expression); if (!isLiteralType(type)) { @@ -344610,9 +347411,21 @@ ${lanes.join("\n")} let hasReturnWithNoExpression = functionHasImplicitReturn(func); let hasReturnOfTypeNever = false; forEachReturnStatement(func.body, (returnStatement) => { - const expr = returnStatement.expression; + let expr = returnStatement.expression; if (expr) { - if (expr.kind === 212 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === func.symbol) { + expr = skipParentheses( + expr, + /*excludeJSDocTypeAssertions*/ + true + ); + if (functionFlags & 2 /* Async */ && expr.kind === 223 /* AwaitExpression */) { + expr = skipParentheses( + expr.expression, + /*excludeJSDocTypeAssertions*/ + true + ); + } + if (expr.kind === 213 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === func.symbol) { hasReturnOfTypeNever = true; return; } @@ -344644,11 +347457,11 @@ ${lanes.join("\n")} } function mayReturnNever(func) { switch (func.kind) { - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return true; - case 173 /* MethodDeclaration */: - return func.parent.kind === 209 /* ObjectLiteralExpression */; + case 174 /* MethodDeclaration */: + return func.parent.kind === 210 /* ObjectLiteralExpression */; default: return false; } @@ -344662,17 +347475,17 @@ ${lanes.join("\n")} if (type && (maybeTypeOfKind(type, 16384 /* Void */) || type.flags & (1 /* Any */ | 32768 /* Undefined */))) { return; } - if (func.kind === 172 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 240 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 173 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 241 /* Block */ || !functionHasImplicitReturn(func)) { return; } - const hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; + const hasExplicitReturn = func.flags & 1024 /* HasExplicitReturn */; const errorNode = getEffectiveReturnTypeNode(func) || func; if (type && type.flags & 131072 /* Never */) { - error(errorNode, Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point); + error2(errorNode, Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point); } else if (type && !hasExplicitReturn) { - error(errorNode, Diagnostics.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value); + error2(errorNode, Diagnostics.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value); } else if (type && strictNullChecks && !isTypeAssignableTo(undefinedType, type)) { - error(errorNode, Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined); + error2(errorNode, Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined); } else if (compilerOptions.noImplicitReturns) { if (!type) { if (!hasExplicitReturn) { @@ -344683,12 +347496,12 @@ ${lanes.join("\n")} return; } } - error(errorNode, Diagnostics.Not_all_code_paths_return_a_value); + error2(errorNode, Diagnostics.Not_all_code_paths_return_a_value); } } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - Debug.assert(node.kind !== 173 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); checkNodeDeferred(node); if (isFunctionExpression(node)) { checkCollisionsForDeclarationName(node, node.name); @@ -344724,7 +347537,7 @@ ${lanes.join("\n")} return anyFunctionType; } const hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 217 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 218 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -344773,7 +347586,7 @@ ${lanes.join("\n")} } } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - Debug.assert(node.kind !== 173 /* MethodDeclaration */ || isObjectLiteralMethod(node)); + Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node)); const functionFlags = getFunctionFlags(node); const returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -344781,23 +347594,24 @@ ${lanes.join("\n")} if (!getEffectiveReturnTypeNode(node)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 240 /* Block */) { + if (node.body.kind === 241 /* Block */) { checkSourceElement(node.body); } else { 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); } } } @@ -344843,7 +347657,7 @@ ${lanes.join("\n")} return !setProp; } function isReadonlySymbol(symbol) { - return !!(getCheckFlags(symbol) & 8 /* Readonly */ || symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) & 64 /* Readonly */ || symbol.flags & 3 /* Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */ || symbol.flags & 98304 /* Accessor */ && !(symbol.flags & 65536 /* SetAccessor */) || symbol.flags & 8 /* EnumMember */ || some(symbol.declarations, isReadonlyAssignmentDeclaration)); + return !!(getCheckFlags(symbol) & 8 /* Readonly */ || symbol.flags & 4 /* Property */ && getDeclarationModifierFlagsFromSymbol(symbol) & 8 /* Readonly */ || symbol.flags & 3 /* Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 6 /* Constant */ || symbol.flags & 98304 /* Accessor */ && !(symbol.flags & 65536 /* SetAccessor */) || symbol.flags & 8 /* EnumMember */ || some(symbol.declarations, isReadonlyAssignmentDeclaration)); } function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) { var _a, _b; @@ -344853,7 +347667,7 @@ ${lanes.join("\n")} if (isReadonlySymbol(symbol)) { if (symbol.flags & 4 /* Property */ && isAccessExpression(expr) && expr.expression.kind === 110 /* ThisKeyword */) { const ctor = getContainingFunction(expr); - if (!(ctor && (ctor.kind === 175 /* Constructor */ || isJSConstructor(ctor)))) { + if (!(ctor && (ctor.kind === 176 /* Constructor */ || isJSConstructor(ctor)))) { return true; } if (symbol.valueDeclaration) { @@ -344874,7 +347688,7 @@ ${lanes.join("\n")} const symbol2 = getNodeLinks(node).resolvedSymbol; if (symbol2.flags & 2097152 /* Alias */) { const declaration = getDeclarationOfAliasSymbol(symbol2); - return !!declaration && declaration.kind === 273 /* NamespaceImport */; + return !!declaration && declaration.kind === 274 /* NamespaceImport */; } } } @@ -344883,11 +347697,11 @@ ${lanes.join("\n")} function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { const node = skipOuterExpressions(expr, 6 /* Assertions */ | 1 /* Parentheses */); if (node.kind !== 80 /* Identifier */ && !isAccessExpression(node)) { - error(expr, invalidReferenceMessage); + error2(expr, invalidReferenceMessage); return false; } - if (node.flags & 32 /* OptionalChain */) { - error(expr, invalidOptionalChainMessage); + if (node.flags & 64 /* OptionalChain */) { + error2(expr, invalidOptionalChainMessage); return false; } return true; @@ -344896,26 +347710,27 @@ ${lanes.join("\n")} checkExpression(node.expression); const expr = skipParentheses(node.expression); if (!isAccessExpression(expr)) { - error(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); + error2(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } if (isPropertyAccessExpression(expr) && isPrivateIdentifier(expr.name)) { - error(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); + error2(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); } const links = getNodeLinks(expr); const symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol); if (symbol) { if (isReadonlySymbol(symbol)) { - error(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + error2(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + } else { + checkDeleteExpressionMustBeOptional(expr, symbol); } - checkDeleteExpressionMustBeOptional(expr, symbol); } return booleanType; } function checkDeleteExpressionMustBeOptional(expr, symbol) { const type = getTypeOfSymbol(symbol); - if (strictNullChecks && !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) && !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getTypeFacts(type) & 16777216 /* IsUndefined */)) { - error(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_optional); + if (strictNullChecks && !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) && !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : hasTypeFacts(type, 16777216 /* IsUndefined */))) { + error2(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_optional); } } function checkTypeOfExpression(node) { @@ -344923,27 +347738,27 @@ ${lanes.join("\n")} return typeofType; } function checkVoidExpression(node) { - checkExpression(node.expression); + checkNodeDeferred(node); return undefinedWideningType; } - function checkAwaitExpressionGrammar(node) { + function checkAwaitGrammar(node) { + let hasError = false; const container = getContainingFunctionOrClassStaticBlock(node); if (container && isClassStaticBlockDeclaration(container)) { - error(node, Diagnostics.Await_expression_cannot_be_used_inside_a_class_static_block); - } else if (!(node.flags & 32768 /* AwaitContext */)) { + const message = isAwaitExpression(node) ? Diagnostics.await_expression_cannot_be_used_inside_a_class_static_block : Diagnostics.await_using_statements_cannot_be_used_inside_a_class_static_block; + error2(node, message); + hasError = true; + } else if (!(node.flags & 65536 /* AwaitContext */)) { if (isInTopLevelContext(node)) { const sourceFile = getSourceFileOfNode(node); if (!hasParseDiagnostics(sourceFile)) { let span; if (!isEffectiveExternalModule(sourceFile, compilerOptions)) { span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); - const diagnostic = createFileDiagnostic( - sourceFile, - span.start, - span.length, - Diagnostics.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 - ); + const message = isAwaitExpression(node) ? Diagnostics.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 : Diagnostics.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; + const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, message); diagnostics.add(diagnostic); + hasError = true; } switch (moduleKind) { case 100 /* Node16 */: @@ -344953,24 +347768,21 @@ ${lanes.join("\n")} diagnostics.add( createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level) ); + hasError = true; break; } case 7 /* ES2022 */: case 99 /* ESNext */: + case 200 /* Preserve */: case 4 /* System */: if (languageVersion >= 4 /* ES2017 */) { break; } default: span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); - diagnostics.add( - createFileDiagnostic( - sourceFile, - span.start, - span.length, - 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 - ) - ); + 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; } } @@ -344978,21 +347790,25 @@ ${lanes.join("\n")} const sourceFile = getSourceFileOfNode(node); if (!hasParseDiagnostics(sourceFile)) { const span = getSpanOfTokenAtPosition(sourceFile, node.pos); - const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); - if (container && container.kind !== 175 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) { + const message = isAwaitExpression(node) ? Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules : Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules; + const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, message); + if (container && container.kind !== 176 /* Constructor */ && (getFunctionFlags(container) & 2 /* Async */) === 0) { const relatedInfo = createDiagnosticForNode(container, Diagnostics.Did_you_mean_to_mark_this_function_as_async); addRelatedInfo(diagnostic, relatedInfo); } diagnostics.add(diagnostic); + hasError = true; } } } - if (isInParameterInitializerBeforeContainingFunction(node)) { - error(node, Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer); + if (isAwaitExpression(node) && isInParameterInitializerBeforeContainingFunction(node)) { + error2(node, Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer); + hasError = true; } + return hasError; } function checkAwaitExpression(node) { - addLazyDiagnostic(() => checkAwaitExpressionGrammar(node)); + addLazyDiagnostic(() => checkAwaitGrammar(node)); const operandType = checkExpression(node.expression); const awaitedType = checkAwaitedType( operandType, @@ -345038,26 +347854,22 @@ ${lanes.join("\n")} case 55 /* TildeToken */: checkNonNullType(operandType, node.operand); if (maybeTypeOfKindConsideringBaseConstraint(operandType, 12288 /* ESSymbolLike */)) { - error(node.operand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(node.operator)); + error2(node.operand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(node.operator)); } if (node.operator === 40 /* PlusToken */) { if (maybeTypeOfKindConsideringBaseConstraint(operandType, 2112 /* BigIntLike */)) { - error(node.operand, Diagnostics.Operator_0_cannot_be_applied_to_type_1, tokenToString(node.operator), typeToString(getBaseTypeOfLiteralType(operandType))); + error2(node.operand, Diagnostics.Operator_0_cannot_be_applied_to_type_1, tokenToString(node.operator), typeToString(getBaseTypeOfLiteralType(operandType))); } return numberType; } return getUnaryResultType(operandType); case 54 /* ExclamationToken */: checkTruthinessOfType(operandType, node.operand); - const facts = getTypeFacts(operandType) & (4194304 /* Truthy */ | 8388608 /* Falsy */); + const facts = getTypeFacts(operandType, 4194304 /* Truthy */ | 8388608 /* Falsy */); return facts === 4194304 /* Truthy */ ? falseType : facts === 8388608 /* Falsy */ ? trueType : booleanType; case 46 /* PlusPlusToken */: case 47 /* MinusMinusToken */: - const ok = checkArithmeticOperandType( - node.operand, - checkNonNullType(operandType, node.operand), - Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type - ); + const ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type); if (ok) { checkReferenceExpression( node.operand, @@ -345133,16 +347945,35 @@ ${lanes.join("\n")} function isConstEnumSymbol(symbol) { return (symbol.flags & 128 /* ConstEnum */) !== 0; } - function checkInstanceOfExpression(left, right, leftType, rightType) { + function getSymbolHasInstanceMethodOfObjectType(type) { + const hasInstancePropertyName = getPropertyNameForKnownSymbolName("hasInstance"); + const hasInstanceProperty = getPropertyOfObjectType(type, hasInstancePropertyName); + if (hasInstanceProperty) { + const hasInstancePropertyType = getTypeOfSymbol(hasInstanceProperty); + if (hasInstancePropertyType && getSignaturesOfType(hasInstancePropertyType, 0 /* Call */).length !== 0) { + return hasInstancePropertyType; + } + } + } + function checkInstanceOfExpression(left, right, leftType, rightType, checkMode) { if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 402784252 /* Primitive */)) { - error(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); + error2(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { - error(right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); + Debug.assert(isInstanceOfExpression(left.parent)); + const signature = getResolvedSignature( + left.parent, + /*candidatesOutArray*/ + void 0, + checkMode + ); + if (signature === resolvingSignature) { + return silentNeverType; } + const returnType = getReturnTypeOfSignature(signature); + checkTypeAssignableTo(returnType, booleanType, right, Diagnostics.An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression); return booleanType; } function hasEmptyObjectIntersection(type) { @@ -345170,7 +348001,7 @@ ${lanes.join("\n")} } if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) { if (hasEmptyObjectIntersection(rightType)) { - error(right, Diagnostics.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator, typeToString(rightType)); + error2(right, Diagnostics.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator, typeToString(rightType)); } } return booleanType; @@ -345188,7 +348019,7 @@ ${lanes.join("\n")} function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) { const properties = node.properties; const property = properties[propertyIndex]; - if (property.kind === 302 /* PropertyAssignment */ || property.kind === 303 /* ShorthandPropertyAssignment */) { + if (property.kind === 303 /* PropertyAssignment */ || property.kind === 304 /* ShorthandPropertyAssignment */) { const name = property.name; const exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -345209,10 +348040,10 @@ ${lanes.join("\n")} } const elementType = getIndexedAccessType(objectLiteralType, exprType, 32 /* ExpressionPosition */, name); const type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 303 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); - } else if (property.kind === 304 /* SpreadAssignment */) { + return checkDestructuringAssignment(property.kind === 304 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + } else if (property.kind === 305 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { - error(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + error2(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } else { if (languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(property, 4 /* Rest */); @@ -345230,7 +348061,7 @@ ${lanes.join("\n")} return checkDestructuringAssignment(property.expression, type); } } else { - error(property, Diagnostics.Property_assignment_expected); + error2(property, Diagnostics.Property_assignment_expected); } } function checkArrayLiteralAssignment(node, sourceType, checkMode) { @@ -345242,7 +348073,7 @@ ${lanes.join("\n")} let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType; for (let i = 0; i < elements.length; i++) { let type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 229 /* SpreadElement */) { + if (node.elements[i].kind === 230 /* SpreadElement */) { type = inBoundsType = inBoundsType ?? (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType); } checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); @@ -345252,8 +348083,8 @@ ${lanes.join("\n")} function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { const elements = node.elements; const element = elements[elementIndex]; - if (element.kind !== 231 /* OmittedExpression */) { - if (element.kind !== 229 /* SpreadElement */) { + if (element.kind !== 232 /* OmittedExpression */) { + if (element.kind !== 230 /* SpreadElement */) { const indexType = getNumberLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(element) ? 16 /* NoTupleBoundsCheck */ : 0); @@ -345265,11 +348096,11 @@ ${lanes.join("\n")} return checkDestructuringAssignment(element, elementType, checkMode); } if (elementIndex < elements.length - 1) { - error(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + error2(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } else { const restExpression = element.expression; - if (restExpression.kind === 225 /* BinaryExpression */ && restExpression.operatorToken.kind === 64 /* EqualsToken */) { - error(restExpression.operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer); + if (restExpression.kind === 226 /* BinaryExpression */ && restExpression.operatorToken.kind === 64 /* EqualsToken */) { + error2(restExpression.operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer); } else { checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); const type = everyType(sourceType, isTupleType) ? mapType(sourceType, (t) => sliceTupleType(t, elementIndex)) : createArrayType(elementType); @@ -345281,10 +348112,10 @@ ${lanes.join("\n")} } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { let target; - if (exprOrAssignment.kind === 303 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 304 /* ShorthandPropertyAssignment */) { const prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { - if (strictNullChecks && !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) { + if (strictNullChecks && !hasTypeFacts(checkExpression(prop.objectAssignmentInitializer), 16777216 /* IsUndefined */)) { sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */); } checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); @@ -345293,26 +348124,26 @@ ${lanes.join("\n")} } else { target = exprOrAssignment; } - if (target.kind === 225 /* BinaryExpression */ && target.operatorToken.kind === 64 /* EqualsToken */) { + if (target.kind === 226 /* BinaryExpression */ && target.operatorToken.kind === 64 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; if (strictNullChecks) { sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */); } } - if (target.kind === 209 /* ObjectLiteralExpression */) { + if (target.kind === 210 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 208 /* ArrayLiteralExpression */) { + if (target.kind === 209 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { const targetType = checkExpression(target, checkMode); - const error2 = target.parent.kind === 304 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - const optionalError = target.parent.kind === 304 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; - if (checkReferenceExpression(target, error2, optionalError)) { + const error3 = target.parent.kind === 305 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; + const optionalError = target.parent.kind === 305 /* SpreadAssignment */ ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; + if (checkReferenceExpression(target, error3, optionalError)) { checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target); } if (isPrivateIdentifierPropertyAccessExpression(target)) { @@ -345326,8 +348157,8 @@ ${lanes.join("\n")} case 80 /* Identifier */: case 11 /* StringLiteral */: case 14 /* RegularExpressionLiteral */: - case 214 /* TaggedTemplateExpression */: - case 227 /* TemplateExpression */: + case 215 /* TaggedTemplateExpression */: + case 228 /* TemplateExpression */: case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: case 10 /* BigIntLiteral */: @@ -345335,25 +348166,25 @@ ${lanes.join("\n")} case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 157 /* UndefinedKeyword */: - case 217 /* FunctionExpression */: - case 230 /* ClassExpression */: - case 218 /* ArrowFunction */: - case 208 /* ArrayLiteralExpression */: - case 209 /* ObjectLiteralExpression */: - case 220 /* TypeOfExpression */: - case 234 /* NonNullExpression */: - case 284 /* JsxSelfClosingElement */: - case 283 /* JsxElement */: + case 218 /* FunctionExpression */: + case 231 /* ClassExpression */: + case 219 /* ArrowFunction */: + case 209 /* ArrayLiteralExpression */: + case 210 /* ObjectLiteralExpression */: + case 221 /* TypeOfExpression */: + case 235 /* NonNullExpression */: + case 285 /* JsxSelfClosingElement */: + case 284 /* JsxElement */: return true; - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: if (isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: switch (node.operator) { case 54 /* ExclamationToken */: case 40 /* PlusToken */: @@ -345362,9 +348193,9 @@ ${lanes.join("\n")} return true; } return false; - case 221 /* VoidExpression */: - case 215 /* TypeAssertionExpression */: - case 233 /* AsExpression */: + case 222 /* VoidExpression */: + case 216 /* TypeAssertionExpression */: + case 234 /* AsExpression */: default: return false; } @@ -345408,7 +348239,7 @@ ${lanes.join("\n")} } checkGrammarNullishCoalesceWithLogicalExpression(node); const operator = node.operatorToken.kind; - if (operator === 64 /* EqualsToken */ && (node.left.kind === 209 /* ObjectLiteralExpression */ || node.left.kind === 208 /* ArrayLiteralExpression */)) { + if (operator === 64 /* EqualsToken */ && (node.left.kind === 210 /* ObjectLiteralExpression */ || node.left.kind === 209 /* ArrayLiteralExpression */)) { state.skip = true; setLastResult(state, checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 110 /* ThisKeyword */)); return state; @@ -345433,7 +348264,7 @@ ${lanes.join("\n")} const operator = operatorToken.kind; if (isLogicalOrCoalescingBinaryOperator(operator)) { let parent2 = node.parent; - while (parent2.kind === 216 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { + while (parent2.kind === 217 /* ParenthesizedExpression */ || isLogicalOrCoalescingBinaryExpression(parent2)) { parent2 = parent2.parent; } if (operator === 56 /* AmpersandAmpersandToken */ || isIfStatement(parent2)) { @@ -345457,7 +348288,7 @@ ${lanes.join("\n")} Debug.assertIsDefined(leftType); const rightType = getLastResult(state); Debug.assertIsDefined(rightType); - result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node); + result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, state.checkMode, node); } state.skip = false; setLeftType( @@ -345509,7 +348340,7 @@ ${lanes.join("\n")} } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { const operator = operatorToken.kind; - if (operator === 64 /* EqualsToken */ && (left.kind === 209 /* ObjectLiteralExpression */ || left.kind === 208 /* ArrayLiteralExpression */)) { + if (operator === 64 /* EqualsToken */ && (left.kind === 210 /* ObjectLiteralExpression */ || left.kind === 209 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 110 /* ThisKeyword */); } let leftType; @@ -345519,9 +348350,9 @@ ${lanes.join("\n")} leftType = checkExpression(left, checkMode); } const rightType = checkExpression(right, checkMode); - return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode); + return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode); } - function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode) { + function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode) { const operator = operatorToken.kind; switch (operator) { case 42 /* AsteriskToken */: @@ -345553,7 +348384,7 @@ ${lanes.join("\n")} rightType = checkNonNullType(rightType, right); let suggestedOperator; if (leftType.flags & 528 /* BooleanLike */ && rightType.flags & 528 /* BooleanLike */ && (suggestedOperator = getSuggestedBooleanOperator(operatorToken.kind)) !== void 0) { - error(errorNode || operatorToken, Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, tokenToString(operatorToken.kind), tokenToString(suggestedOperator)); + error2(errorNode || operatorToken, Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, tokenToString(operatorToken.kind), tokenToString(suggestedOperator)); return numberType; } else { const leftOk = checkArithmeticOperandType( @@ -345583,7 +348414,7 @@ ${lanes.join("\n")} case 43 /* AsteriskAsteriskToken */: case 68 /* AsteriskAsteriskEqualsToken */: if (languageVersion < 3 /* ES2016 */) { - error(errorNode, Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later); + error2(errorNode, Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later); } } resultType2 = bigintType; @@ -345650,7 +348481,9 @@ ${lanes.join("\n")} } if (!resultType) { const closeEnoughKind = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 3 /* AnyOrUnknown */; - reportOperatorError((left2, right2) => isTypeAssignableToKind(left2, closeEnoughKind) && isTypeAssignableToKind(right2, closeEnoughKind)); + reportOperatorError( + (left2, right2) => isTypeAssignableToKind(left2, closeEnoughKind) && isTypeAssignableToKind(right2, closeEnoughKind) + ); return anyType; } if (operator === 65 /* PlusEqualsToken */) { @@ -345678,20 +348511,23 @@ ${lanes.join("\n")} case 36 /* ExclamationEqualsToken */: case 37 /* EqualsEqualsEqualsToken */: case 38 /* ExclamationEqualsEqualsToken */: - if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) { - const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */; - error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true"); + if (!(checkMode && checkMode & 64 /* TypeOnly */)) { + if ((isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) && // only report for === and !== in JS, not == or != + (!isInJSFile(left) || (operator === 37 /* EqualsEqualsEqualsToken */ || operator === 38 /* ExclamationEqualsEqualsToken */))) { + const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */; + error2(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true"); + } + checkNaNEquality(errorNode, operator, left, right); + reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2)); } - checkNaNEquality(errorNode, operator, left, right); - reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2)); return booleanType; case 104 /* InstanceOfKeyword */: - return checkInstanceOfExpression(left, right, leftType, rightType); + return checkInstanceOfExpression(left, right, leftType, rightType, checkMode); case 103 /* InKeyword */: return checkInExpression(left, right, leftType, rightType); case 56 /* AmpersandAmpersandToken */: case 77 /* AmpersandAmpersandEqualsToken */: { - const resultType2 = getTypeFacts(leftType) & 4194304 /* Truthy */ ? getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) : leftType; + const resultType2 = hasTypeFacts(leftType, 4194304 /* Truthy */) ? getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) : leftType; if (operator === 77 /* AmpersandAmpersandEqualsToken */) { checkAssignmentOperator(rightType); } @@ -345699,7 +348535,7 @@ ${lanes.join("\n")} } case 57 /* BarBarToken */: case 76 /* BarBarEqualsToken */: { - const resultType2 = getTypeFacts(leftType) & 8388608 /* Falsy */ ? getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) : leftType; + const resultType2 = hasTypeFacts(leftType, 8388608 /* Falsy */) ? getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) : leftType; if (operator === 76 /* BarBarEqualsToken */) { checkAssignmentOperator(rightType); } @@ -345707,7 +348543,7 @@ ${lanes.join("\n")} } case 61 /* QuestionQuestionToken */: case 78 /* QuestionQuestionEqualsToken */: { - const resultType2 = getTypeFacts(leftType) & 262144 /* EQUndefinedOrNull */ ? getUnionType([getNonNullableType(leftType), rightType], 2 /* Subtype */) : leftType; + const resultType2 = hasTypeFacts(leftType, 262144 /* EQUndefinedOrNull */) ? getUnionType([getNonNullableType(leftType), rightType], 2 /* Subtype */) : leftType; if (operator === 78 /* QuestionQuestionEqualsToken */) { checkAssignmentOperator(rightType); } @@ -345736,7 +348572,7 @@ ${lanes.join("\n")} return textSpanContainsPosition(diag2, start); }); if (!isInDiag2657) - error(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); + error2(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); } return rightType; default: @@ -345770,13 +348606,13 @@ ${lanes.join("\n")} } } function isIndirectCall(node) { - return node.parent.kind === 216 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 214 /* TaggedTemplateExpression */) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior. + return node.parent.kind === 217 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 215 /* TaggedTemplateExpression */) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior. (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval"); } function checkForDisallowedESSymbolOperand(operator2) { const offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint(leftType, 12288 /* ESSymbolLike */) ? left : maybeTypeOfKindConsideringBaseConstraint(rightType, 12288 /* ESSymbolLike */) ? right : void 0; if (offendingSymbolOperand) { - error(offendingSymbolOperand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(operator2)); + error2(offendingSymbolOperand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(operator2)); return false; } return true; @@ -345802,7 +348638,7 @@ ${lanes.join("\n")} } function checkAssignmentOperatorWorker() { let assigneeType = leftType; - if (isCompoundAssignment(operatorToken.kind) && left.kind === 210 /* PropertyAccessExpression */) { + if (isCompoundAssignment(operatorToken.kind) && left.kind === 211 /* PropertyAccessExpression */) { assigneeType = checkPropertyAccessExpression( left, /*checkMode*/ @@ -345811,11 +348647,7 @@ ${lanes.join("\n")} true ); } - if (checkReferenceExpression( - left, - Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, - Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access - )) { + if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)) { let headMessage; if (exactOptionalPropertyTypes && isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768 /* Undefined */)) { const target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText); @@ -345897,21 +348729,13 @@ ${lanes.join("\n")} const isLeftNaN = isGlobalNaN(skipParentheses(left2)); const isRightNaN = isGlobalNaN(skipParentheses(right2)); if (isLeftNaN || isRightNaN) { - const err = error( - errorNode2, - Diagnostics.This_condition_will_always_return_0, - tokenToString(operator2 === 37 /* EqualsEqualsEqualsToken */ || operator2 === 35 /* EqualsEqualsToken */ ? 97 /* FalseKeyword */ : 112 /* TrueKeyword */) - ); + const err = error2(errorNode2, Diagnostics.This_condition_will_always_return_0, tokenToString(operator2 === 37 /* EqualsEqualsEqualsToken */ || operator2 === 35 /* EqualsEqualsToken */ ? 97 /* FalseKeyword */ : 112 /* TrueKeyword */)); if (isLeftNaN && isRightNaN) return; const operatorString = operator2 === 38 /* ExclamationEqualsEqualsToken */ || operator2 === 36 /* ExclamationEqualsToken */ ? tokenToString(54 /* ExclamationToken */) : ""; const location = isLeftNaN ? right2 : left2; const expression = skipParentheses(location); - addRelatedInfo(err, createDiagnosticForNode( - location, - Diagnostics.Did_you_mean_0, - `${operatorString}Number.isNaN(${isEntityNameExpression(expression) ? entityNameToString(expression) : "..."})` - )); + addRelatedInfo(err, createDiagnosticForNode(location, Diagnostics.Did_you_mean_0, `${operatorString}Number.isNaN(${isEntityNameExpression(expression) ? entityNameToString(expression) : "..."})`)); } } function isGlobalNaN(expr) { @@ -345951,7 +348775,15 @@ ${lanes.join("\n")} checkExternalEmitHelpers(node, 256 /* Values */); } } - const returnType = getReturnTypeFromAnnotation(func); + let returnType = getReturnTypeFromAnnotation(func); + if (returnType && returnType.flags & 1048576 /* Union */) { + returnType = filterType(returnType, (t) => checkGeneratorInstantiationAssignabilityToReturnType( + t, + functionFlags, + /*errorNode*/ + void 0 + )); + } const iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync); const signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType; const signatureNextType = iterationTypes && iterationTypes.nextType || anyType; @@ -345978,23 +348810,23 @@ ${lanes.join("\n")} void 0 ); if (!contextualType || isTypeAny(contextualType)) { - error(node, Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation); + error2(node, Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation); } } }); } return type; function checkYieldExpressionGrammar() { - if (!(node.flags & 8192 /* YieldContext */)) { + if (!(node.flags & 16384 /* YieldContext */)) { grammarErrorOnFirstToken(node, Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); } if (isInParameterInitializerBeforeContainingFunction(node)) { - error(node, Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer); + error2(node, Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer); } } } function checkConditionalExpression(node, checkMode) { - const type = checkTruthinessExpression(node.condition); + const type = checkTruthinessExpression(node.condition, checkMode); checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue); const type1 = checkExpression(node.whenTrue, checkMode); const type2 = checkExpression(node.whenFalse, checkMode); @@ -346010,16 +348842,20 @@ ${lanes.join("\n")} for (const span of node.templateSpans) { const type = checkExpression(span.expression); if (maybeTypeOfKindConsideringBaseConstraint(type, 12288 /* ESSymbolLike */)) { - error(span.expression, Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + error2(span.expression, Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); } texts.push(span.literal.text); types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); } - return isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType2( + if (isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType2( node, /*contextFlags*/ void 0 - ) || unknownType, isTemplateLiteralContextualType) ? getTemplateLiteralType(texts, types) : stringType; + ) || unknownType, isTemplateLiteralContextualType)) { + return getTemplateLiteralType(texts, types); + } + const evaluated = node.parent.kind !== 215 /* TaggedTemplateExpression */ && evaluateTemplateExpression(node); + return evaluated ? getFreshTypeOfLiteralType(getStringLiteralType(evaluated)) : stringType; } function isTemplateLiteralContextualType(type) { return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */)); @@ -346075,7 +348911,7 @@ ${lanes.join("\n")} /*excludeJSDocTypeAssertions*/ true ); - return node.kind === 215 /* TypeAssertionExpression */ || node.kind === 233 /* AsExpression */ || isJSDocTypeAssertion(node); + return node.kind === 216 /* TypeAssertionExpression */ || node.kind === 234 /* AsExpression */ || isJSDocTypeAssertion(node); } function checkDeclarationInitializer(declaration, checkMode, contextualType) { const initializer = getEffectiveInitializer(declaration); @@ -346092,7 +348928,7 @@ ${lanes.join("\n")} void 0, checkMode || 0 /* Normal */ ) : checkExpressionCached(initializer, checkMode)); - return isParameter(declaration) && declaration.name.kind === 206 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; + return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } function padTupleType(type, pattern) { const patternElements = pattern.elements; @@ -346100,7 +348936,7 @@ ${lanes.join("\n")} const elementFlags = type.target.elementFlags.slice(); for (let i = getTypeReferenceArity(type); i < patternElements.length; i++) { const e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 207 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 208 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement( e, /*includePatternInType*/ @@ -346117,7 +348953,7 @@ ${lanes.join("\n")} return createTupleType(elementTypes, elementFlags, type.target.readonly); } function widenTypeInferredFromInitializer(declaration, type) { - const widened = getCombinedNodeFlags(declaration) & 2 /* Const */ || isDeclarationReadonly(declaration) ? type : getWidenedLiteralType(type); + const widened = getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || isDeclarationReadonly(declaration) ? type : getWidenedLiteralType(type); if (isInJSFile(declaration)) { if (isEmptyLiteralType(widened)) { reportImplicitAny(declaration, anyType); @@ -346161,14 +348997,14 @@ ${lanes.join("\n")} )); } function checkPropertyAssignment(node, checkMode) { - if (node.name.kind === 166 /* ComputedPropertyName */) { + if (node.name.kind === 167 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); } function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 166 /* ComputedPropertyName */) { + if (node.name.kind === 167 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -346324,18 +349160,18 @@ ${lanes.join("\n")} if (quickType) { return quickType; } - if (node.flags & 134217728 /* TypeCached */ && flowTypeCache) { + if (node.flags & 268435456 /* TypeCached */ && flowTypeCache) { const cachedType = flowTypeCache[getNodeId(node)]; if (cachedType) { return cachedType; } } const startInvocationCount = flowInvocationCount; - const type = checkExpression(node); + const type = checkExpression(node, 64 /* TypeOnly */); if (flowInvocationCount !== startInvocationCount) { const cache = flowTypeCache || (flowTypeCache = []); cache[getNodeId(node)] = type; - setNodeFlags(node, node.flags | 134217728 /* TypeCached */); + setNodeFlags(node, node.flags | 268435456 /* TypeCached */); } return type; } @@ -346400,15 +349236,15 @@ ${lanes.join("\n")} return type; } function checkConstEnumAccess(node, type) { - const ok = node.parent.kind === 210 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 211 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 80 /* Identifier */ || node.kind === 165 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 185 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 280 /* ExportSpecifier */; + const ok = node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.expression === node || node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.expression === node || ((node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 /* TypeQuery */ && node.parent.exprName === node) || node.parent.kind === 281 /* ExportSpecifier */; if (!ok) { - error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); + error2(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } if (getIsolatedModules(compilerOptions)) { Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */)); const constEnumDeclaration = type.symbol.valueDeclaration; - if (constEnumDeclaration.flags & 16777216 /* Ambient */) { - error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); + if (constEnumDeclaration.flags & 33554432 /* Ambient */ && !isValidTypeOnlyAliasUseSite(node)) { + error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); } } } @@ -346427,9 +349263,9 @@ ${lanes.join("\n")} const kind = node.kind; if (cancellationToken) { switch (kind) { - case 230 /* ClassExpression */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 231 /* ClassExpression */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -346446,7 +349282,7 @@ ${lanes.join("\n")} return nullWideningType; case 15 /* NoSubstitutionTemplateLiteral */: case 11 /* StringLiteral */: - return hasSkipDirectInferenceFlag(node) ? anyType : getFreshTypeOfLiteralType(getStringLiteralType(node.text)); + return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text)); case 9 /* NumericLiteral */: checkGrammarNumericLiteral(node); return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text)); @@ -346460,81 +349296,81 @@ ${lanes.join("\n")} return trueType; case 97 /* FalseKeyword */: return falseType; - case 227 /* TemplateExpression */: + case 228 /* TemplateExpression */: return checkTemplateExpression(node); case 14 /* RegularExpressionLiteral */: return globalRegExpType; - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node, checkMode); - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: return checkQualifiedName(node, checkMode); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return checkIndexedAccess(node, checkMode); - case 212 /* CallExpression */: + case 213 /* CallExpression */: if (node.expression.kind === 102 /* ImportKeyword */) { return checkImportCallExpression(node); } - case 213 /* NewExpression */: + case 214 /* NewExpression */: return checkCallExpression(node, checkMode); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: return checkClassExpression(node); - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 220 /* TypeOfExpression */: + case 221 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 215 /* TypeAssertionExpression */: - case 233 /* AsExpression */: + case 216 /* TypeAssertionExpression */: + case 234 /* AsExpression */: return checkAssertion(node, checkMode); - case 234 /* NonNullExpression */: + case 235 /* NonNullExpression */: return checkNonNullAssertion(node); - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return checkExpressionWithTypeArguments(node); - case 237 /* SatisfiesExpression */: + case 238 /* SatisfiesExpression */: return checkSatisfiesExpression(node); - case 235 /* MetaProperty */: + case 236 /* MetaProperty */: return checkMetaProperty(node); - case 219 /* DeleteExpression */: + case 220 /* DeleteExpression */: return checkDeleteExpression(node); - case 221 /* VoidExpression */: + case 222 /* VoidExpression */: return checkVoidExpression(node); - case 222 /* AwaitExpression */: + case 223 /* AwaitExpression */: return checkAwaitExpression(node); - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 224 /* PostfixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 229 /* SpreadElement */: + case 230 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 231 /* OmittedExpression */: + case 232 /* OmittedExpression */: return undefinedWideningType; - case 228 /* YieldExpression */: + case 229 /* YieldExpression */: return checkYieldExpression(node); - case 236 /* SyntheticExpression */: + case 237 /* SyntheticExpression */: return checkSyntheticExpression(node); - case 293 /* JsxExpression */: + case 294 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 283 /* JsxElement */: + case 284 /* JsxElement */: return checkJsxElement(node, checkMode); - case 284 /* JsxSelfClosingElement */: + case 285 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 287 /* JsxFragment */: + case 288 /* JsxFragment */: return checkJsxFragment(node); - case 291 /* JsxAttributes */: + case 292 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 285 /* JsxOpeningElement */: + case 286 /* JsxOpeningElement */: Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -346549,7 +349385,7 @@ ${lanes.join("\n")} const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node)); getBaseConstraintOfType(typeParameter); if (!hasNonCircularTypeParameterDefault(typeParameter)) { - error(node.default, Diagnostics.Type_parameter_0_has_a_circular_default, typeToString(typeParameter)); + error2(node.default, Diagnostics.Type_parameter_0_has_a_circular_default, typeToString(typeParameter)); } const constraintType = getConstraintOfTypeParameter(typeParameter); const defaultType = getDefaultFromTypeParameter(typeParameter); @@ -346563,15 +349399,15 @@ ${lanes.join("\n")} var _a, _b; if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) { const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node)); - const modifiers = getTypeParameterModifiers(typeParameter) & (32768 /* In */ | 65536 /* Out */); + 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 */))) { - error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types); - } else if (modifiers === 32768 /* In */ || modifiers === 65536 /* Out */) { + 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) }); - const source = createMarkerType(symbol, typeParameter, modifiers === 65536 /* Out */ ? markerSubTypeForCheck : markerSuperTypeForCheck); - const target = createMarkerType(symbol, typeParameter, modifiers === 65536 /* Out */ ? markerSuperTypeForCheck : markerSubTypeForCheck); + const source = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSubTypeForCheck : markerSuperTypeForCheck); + const target = createMarkerType(symbol, typeParameter, modifiers === 16384 /* Out */ ? markerSuperTypeForCheck : markerSubTypeForCheck); const saveVarianceTypeParameter = typeParameter; varianceTypeParameter = typeParameter; checkTypeAssignableTo(source, target, node, Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation); @@ -346585,39 +349421,39 @@ ${lanes.join("\n")} checkGrammarModifiers(node); checkVariableLikeDeclaration(node); const func = getContainingFunction(node); - if (hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) { - if (!(func.kind === 175 /* Constructor */ && nodeIsPresent(func.body))) { - error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + if (hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) { + if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) { + error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 175 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") { - error(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); + if (func.kind === 176 /* Constructor */ && isIdentifier(node.name) && node.name.escapedText === "constructor") { + error2(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } if (!node.initializer && isOptionalDeclaration(node) && isBindingPattern(node.name) && func.body) { - error(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); + error2(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { if (func.parameters.indexOf(node) !== 0) { - error(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); + error2(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 175 /* Constructor */ || func.kind === 179 /* ConstructSignature */ || func.kind === 184 /* ConstructorType */) { - error(node, Diagnostics.A_constructor_cannot_have_a_this_parameter); + if (func.kind === 176 /* Constructor */ || func.kind === 180 /* ConstructSignature */ || func.kind === 185 /* ConstructorType */) { + error2(node, Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 218 /* ArrowFunction */) { - error(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter); + if (func.kind === 219 /* ArrowFunction */) { + error2(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 176 /* GetAccessor */ || func.kind === 177 /* SetAccessor */) { - error(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); + if (func.kind === 177 /* GetAccessor */ || func.kind === 178 /* SetAccessor */) { + error2(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } if (node.dotDotDotToken && !isBindingPattern(node.name) && !isTypeAssignableTo(getReducedType(getTypeOfSymbol(node.symbol)), anyReadonlyArrayType)) { - error(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type); + error2(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } function checkTypePredicate(node) { const parent2 = getTypePredicateParent(node); if (!parent2) { - error(node, Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); + error2(node, Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); return; } const signature = getSignatureFromDeclaration(parent2); @@ -346632,7 +349468,7 @@ ${lanes.join("\n")} } else { if (typePredicate.parameterIndex >= 0) { if (signatureHasRestParameter(signature) && typePredicate.parameterIndex === signature.parameters.length - 1) { - error(parameterName, Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); + error2(parameterName, Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); } else { if (typePredicate.type) { const leadingError = () => chainDiagnosticMessages( @@ -346659,20 +349495,20 @@ ${lanes.join("\n")} } } if (!hasReportedError) { - error(node.parameterName, Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); + error2(node.parameterName, Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); } } } } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 218 /* ArrowFunction */: - case 178 /* CallSignature */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 183 /* FunctionType */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 219 /* ArrowFunction */: + case 179 /* CallSignature */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 184 /* FunctionType */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: const parent2 = node.parent; if (node === parent2.type) { return parent2; @@ -346686,13 +349522,9 @@ ${lanes.join("\n")} } const name = element.name; if (name.kind === 80 /* Identifier */ && name.escapedText === predicateVariableName) { - error( - predicateVariableNode, - Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, - predicateVariableName - ); + error2(predicateVariableNode, Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; - } else if (name.kind === 206 /* ArrayBindingPattern */ || name.kind === 205 /* ObjectBindingPattern */) { + } else if (name.kind === 207 /* ArrayBindingPattern */ || name.kind === 206 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern( name, predicateVariableNode, @@ -346704,9 +349536,9 @@ ${lanes.join("\n")} } } function checkSignatureDeclaration(node) { - if (node.kind === 180 /* IndexSignature */) { + if (node.kind === 181 /* IndexSignature */) { checkGrammarIndexSignature(node); - } else if (node.kind === 183 /* FunctionType */ || node.kind === 261 /* FunctionDeclaration */ || node.kind === 184 /* ConstructorType */ || node.kind === 178 /* CallSignature */ || node.kind === 175 /* Constructor */ || node.kind === 179 /* ConstructSignature */) { + } else if (node.kind === 184 /* FunctionType */ || node.kind === 262 /* FunctionDeclaration */ || node.kind === 185 /* ConstructorType */ || node.kind === 179 /* CallSignature */ || node.kind === 176 /* Constructor */ || node.kind === 180 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } const functionFlags = getFunctionFlags(node); @@ -346730,45 +349562,59 @@ ${lanes.join("\n")} addLazyDiagnostic(checkSignatureDeclarationDiagnostics); function checkSignatureDeclarationDiagnostics() { checkCollisionWithArgumentsInGeneratedCode(node); - const returnTypeNode = getEffectiveReturnTypeNode(node); + let returnTypeNode = getEffectiveReturnTypeNode(node); + let returnTypeErrorLocation = returnTypeNode; + if (isInJSFile(node)) { + const typeTag = getJSDocTypeTag(node); + if (typeTag && typeTag.typeExpression && isTypeReferenceNode(typeTag.typeExpression.type)) { + const signature = getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression)); + if (signature && signature.declaration) { + returnTypeNode = getEffectiveReturnTypeNode(signature.declaration); + returnTypeErrorLocation = typeTag.typeExpression.type; + } + } + } if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 179 /* ConstructSignature */: - error(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + case 180 /* ConstructSignature */: + error2(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 178 /* CallSignature */: - error(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + case 179 /* CallSignature */: + error2(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } } - if (returnTypeNode) { + if (returnTypeNode && returnTypeErrorLocation) { const functionFlags2 = getFunctionFlags(node); if ((functionFlags2 & (4 /* Invalid */ | 1 /* Generator */)) === 1 /* Generator */) { const returnType = getTypeFromTypeNode(returnTypeNode); if (returnType === voidType) { - error(returnTypeNode, Diagnostics.A_generator_cannot_have_a_void_type_annotation); + error2(returnTypeErrorLocation, Diagnostics.A_generator_cannot_have_a_void_type_annotation); } else { - const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || anyType; - const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || generatorYieldType; - const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || unknownType; - const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags2 & 2 /* Async */)); - checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeNode); + checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags2, returnTypeErrorLocation); } } else if ((functionFlags2 & 3 /* AsyncGenerator */) === 2 /* Async */) { - checkAsyncFunctionReturnType(node, returnTypeNode); + checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation); } } - if (node.kind !== 180 /* IndexSignature */ && node.kind !== 323 /* JSDocFunctionType */) { + if (node.kind !== 181 /* IndexSignature */ && node.kind !== 324 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } } + function checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags, errorNode) { + const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags & 2 /* Async */) !== 0) || anyType; + const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags & 2 /* Async */) !== 0) || generatorYieldType; + const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags & 2 /* Async */) !== 0) || unknownType; + const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags & 2 /* Async */)); + return checkTypeAssignableTo(generatorInstantiation, returnType, errorNode); + } function checkClassForDuplicateDeclarations(node) { const instanceNames = /* @__PURE__ */ new Map(); const staticNames = /* @__PURE__ */ new Map(); const privateIdentifiers = /* @__PURE__ */ new Map(); for (const member of node.members) { - if (member.kind === 175 /* Constructor */) { + if (member.kind === 176 /* Constructor */) { for (const param of member.parameters) { if (isParameterPropertyDeclaration(param, member) && !isBindingPattern(param.name)) { addName(instanceNames, param.name, param.name.escapedText, 3 /* GetOrSetAccessor */); @@ -346783,19 +349629,19 @@ ${lanes.join("\n")} const isPrivate = isPrivateIdentifier(name); const privateStaticFlags = isPrivate && isStaticMember ? 16 /* PrivateStatic */ : 0; const names = isPrivate ? privateIdentifiers : isStaticMember ? staticNames : instanceNames; - const memberName = name && getPropertyNameForPropertyNameNode(name); + const memberName = name && getEffectivePropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */ | privateStaticFlags); break; - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */ | privateStaticFlags); break; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */ | privateStaticFlags); break; - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */ | privateStaticFlags); break; } @@ -346806,16 +349652,16 @@ ${lanes.join("\n")} const prev = names.get(name); if (prev) { if ((prev & 16 /* PrivateStatic */) !== (meaning & 16 /* PrivateStatic */)) { - error(location, Diagnostics.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name, getTextOfNode(location)); + error2(location, Diagnostics.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name, getTextOfNode(location)); } else { const prevIsMethod = !!(prev & 8 /* Method */); const isMethod = !!(meaning & 8 /* Method */); if (prevIsMethod || isMethod) { if (prevIsMethod !== isMethod) { - error(location, Diagnostics.Duplicate_identifier_0, getTextOfNode(location)); + error2(location, Diagnostics.Duplicate_identifier_0, getTextOfNode(location)); } } else if (prev & meaning & ~16 /* PrivateStatic */) { - error(location, Diagnostics.Duplicate_identifier_0, getTextOfNode(location)); + error2(location, Diagnostics.Duplicate_identifier_0, getTextOfNode(location)); } else { names.set(name, prev | meaning); } @@ -346830,16 +349676,19 @@ ${lanes.join("\n")} const memberNameNode = member.name; const isStaticMember = isStatic(member); if (isStaticMember && memberNameNode) { - const memberName = getPropertyNameForPropertyNameNode(memberNameNode); + const memberName = getEffectivePropertyNameForPropertyNameNode(memberNameNode); switch (memberName) { case "name": case "length": case "caller": case "arguments": + if (useDefineForClassFields) { + break; + } case "prototype": const message = Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; const className = getNameOfSymbolAsWritten(getSymbolOfDeclaration(node)); - error(memberNameNode, message, memberName, className); + error2(memberNameNode, message, memberName, className); break; } } @@ -346848,7 +349697,7 @@ ${lanes.join("\n")} function checkObjectTypeForDuplicateDeclarations(node) { const names = /* @__PURE__ */ new Map(); for (const member of node.members) { - if (member.kind === 170 /* PropertySignature */) { + if (member.kind === 171 /* PropertySignature */) { let memberName; const name = member.name; switch (name.kind) { @@ -346863,8 +349712,8 @@ ${lanes.join("\n")} continue; } if (names.get(memberName)) { - error(getNameOfDeclaration(member.symbol.valueDeclaration), Diagnostics.Duplicate_identifier_0, memberName); - error(member.name, Diagnostics.Duplicate_identifier_0, memberName); + error2(getNameOfDeclaration(member.symbol.valueDeclaration), Diagnostics.Duplicate_identifier_0, memberName); + error2(member.name, Diagnostics.Duplicate_identifier_0, memberName); } else { names.set(memberName, true); } @@ -346872,7 +349721,7 @@ ${lanes.join("\n")} } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 263 /* InterfaceDeclaration */) { + if (node.kind === 264 /* InterfaceDeclaration */) { const nodeSymbol = getSymbolOfDeclaration(node); if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -346896,7 +349745,7 @@ ${lanes.join("\n")} indexSignatureMap.forEach((entry) => { if (entry.declarations.length > 1) { for (const declaration of entry.declarations) { - error(declaration, Diagnostics.Duplicate_index_signature_for_type_0, typeToString(entry.type)); + error2(declaration, Diagnostics.Duplicate_index_signature_for_type_0, typeToString(entry.type)); } } }); @@ -346907,13 +349756,13 @@ ${lanes.join("\n")} checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); setNodeLinksForPrivateIdentifierScope(node); - if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 171 /* PropertyDeclaration */ && node.initializer) { - error(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name)); + if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 172 /* PropertyDeclaration */ && node.initializer) { + error2(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name)); } } function checkPropertySignature(node) { if (isPrivateIdentifier(node.name)) { - error(node, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + error2(node, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); } return checkPropertyDeclaration(node); } @@ -346921,21 +349770,21 @@ ${lanes.join("\n")} if (!checkGrammarMethod(node)) checkGrammarComputedPropertyName(node.name); if (isMethodDeclaration(node) && node.asteriskToken && isIdentifier(node.name) && idText(node.name) === "constructor") { - error(node.name, Diagnostics.Class_constructor_may_not_be_a_generator); + error2(node.name, Diagnostics.Class_constructor_may_not_be_a_generator); } checkFunctionOrMethodDeclaration(node); - if (hasSyntacticModifier(node, 256 /* Abstract */) && node.kind === 173 /* MethodDeclaration */ && node.body) { - error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name)); + if (hasSyntacticModifier(node, 64 /* Abstract */) && node.kind === 174 /* MethodDeclaration */ && node.body) { + error2(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name)); } if (isPrivateIdentifier(node.name) && !getContainingClass(node)) { - error(node, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + error2(node, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); } setNodeLinksForPrivateIdentifierScope(node); } function setNodeLinksForPrivateIdentifierScope(node) { if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) { for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) { - getNodeLinks(lexicalScope).flags |= 4194304 /* ContainsClassWithPrivateIdentifiers */; + getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */; } if (isClassExpression(node.parent)) { const enclosingIterationStatement = getEnclosingIterationStatement(node.parent); @@ -346969,7 +349818,7 @@ ${lanes.join("\n")} if (isPrivateIdentifierClassElementDeclaration(n)) { return true; } - return n.kind === 171 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer; + return n.kind === 172 /* PropertyDeclaration */ && !isStatic(n) && !!n.initializer; } function checkConstructorDeclarationDiagnostics() { const containingClassDecl = node.parent; @@ -346979,12 +349828,12 @@ ${lanes.join("\n")} const superCall = findFirstSuperCall(node.body); if (superCall) { if (classExtendsNull) { - error(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null); + error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null); } - const superCallShouldBeRootLevel = (getEmitScriptTarget(compilerOptions) !== 99 /* ESNext */ || !useDefineForClassFields) && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */))); + const superCallShouldBeRootLevel = !emitStandardClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 31 /* ParameterPropertyModifier */))); if (superCallShouldBeRootLevel) { if (!superCallIsRootLevelInConstructor(superCall, node.body)) { - error(superCall, Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers); + error2(superCall, Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers); } else { let superCallStatement; for (const statement of node.body.statements) { @@ -346997,12 +349846,12 @@ ${lanes.join("\n")} } } if (superCallStatement === void 0) { - error(node, Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers); + error2(node, Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers); } } } } else if (!classExtendsNull) { - error(node, Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); + error2(node, Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); } } } @@ -347022,7 +349871,7 @@ ${lanes.join("\n")} } function checkAccessorDeclaration(node) { if (isIdentifier(node.name) && idText(node.name) === "constructor" && isClassLike(node.parent)) { - error(node.name, Diagnostics.Class_constructor_may_not_be_an_accessor); + error2(node.name, Diagnostics.Class_constructor_may_not_be_an_accessor); } addLazyDiagnostic(checkAccessorDeclarationDiagnostics); checkSourceElement(node.body); @@ -347032,36 +349881,36 @@ ${lanes.join("\n")} checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 176 /* GetAccessor */) { - if (!(node.flags & 16777216 /* Ambient */) && nodeIsPresent(node.body) && node.flags & 256 /* HasImplicitReturn */) { - if (!(node.flags & 512 /* HasExplicitReturn */)) { - error(node.name, Diagnostics.A_get_accessor_must_return_a_value); + if (node.kind === 177 /* GetAccessor */) { + if (!(node.flags & 33554432 /* Ambient */) && nodeIsPresent(node.body) && node.flags & 512 /* HasImplicitReturn */) { + if (!(node.flags & 1024 /* HasExplicitReturn */)) { + error2(node.name, Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 166 /* ComputedPropertyName */) { + if (node.name.kind === 167 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (hasBindableName(node)) { const symbol = getSymbolOfDeclaration(node); - const getter = getDeclarationOfKind(symbol, 176 /* GetAccessor */); - const setter = getDeclarationOfKind(symbol, 177 /* SetAccessor */); + const getter = getDeclarationOfKind(symbol, 177 /* GetAccessor */); + const setter = getDeclarationOfKind(symbol, 178 /* SetAccessor */); if (getter && setter && !(getNodeCheckFlags(getter) & 1 /* TypeChecked */)) { getNodeLinks(getter).flags |= 1 /* TypeChecked */; const getterFlags = getEffectiveModifierFlags(getter); const setterFlags = getEffectiveModifierFlags(setter); - if ((getterFlags & 256 /* Abstract */) !== (setterFlags & 256 /* Abstract */)) { - error(getter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); - error(setter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); + if ((getterFlags & 64 /* Abstract */) !== (setterFlags & 64 /* Abstract */)) { + error2(getter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); + error2(setter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); } - if (getterFlags & 16 /* Protected */ && !(setterFlags & (16 /* Protected */ | 8 /* Private */)) || getterFlags & 8 /* Private */ && !(setterFlags & 8 /* Private */)) { - error(getter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter); - error(setter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter); + if (getterFlags & 4 /* Protected */ && !(setterFlags & (4 /* Protected */ | 2 /* Private */)) || getterFlags & 2 /* Private */ && !(setterFlags & 2 /* Private */)) { + error2(getter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter); + error2(setter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter); } } } const returnType = getTypeOfAccessors(getSymbolOfDeclaration(node)); - if (node.kind === 176 /* GetAccessor */) { + if (node.kind === 177 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -347076,12 +349925,7 @@ ${lanes.join("\n")} return getEffectiveTypeArguments2(node, typeParameters)[index]; } function getEffectiveTypeArguments2(node, typeParameters) { - return fillMissingTypeArguments( - map(node.typeArguments, getTypeFromTypeNode), - typeParameters, - getMinTypeArgumentCount(typeParameters), - isInJSFile(node) - ); + return fillMissingTypeArguments(map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(node)); } function checkTypeArgumentConstraints(node, typeParameters) { let typeArguments; @@ -347122,7 +349966,7 @@ ${lanes.join("\n")} } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 182 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { + if (node.kind === 183 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { const sourceFile = getSourceFileOfNode(node); if (scanTokenAtPosition(sourceFile, node.typeName.end) === 25 /* DotToken */) { grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); @@ -347144,7 +349988,7 @@ ${lanes.join("\n")} } const symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { - if (some(symbol.declarations, (d) => isTypeDeclaration(d) && !!(d.flags & 268435456 /* Deprecated */))) { + if (some(symbol.declarations, (d) => isTypeDeclaration(d) && !!(d.flags & 536870912 /* Deprecated */))) { addDeprecatedSuggestion( getDeprecatedSuggestionNode(node), symbol.declarations, @@ -347181,26 +350025,21 @@ ${lanes.join("\n")} checkSourceElement(node.elementType); } function checkTupleType(node) { - const elementTypes = node.elements; let seenOptionalElement = false; let seenRestElement = false; - const hasNamedElement = some(elementTypes, isNamedTupleMember); - for (const e of elementTypes) { - if (e.kind !== 201 /* NamedTupleMember */ && hasNamedElement) { - grammarErrorOnNode(e, Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names); - break; - } - 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)) { - error(e, Diagnostics.A_rest_element_type_must_be_an_array_type); + error2(e, Diagnostics.A_rest_element_type_must_be_an_array_type); 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; @@ -347212,7 +350051,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; } @@ -347230,27 +350069,25 @@ ${lanes.join("\n")} } const objectType = type.objectType; const indexType = type.indexType; - if (isTypeAssignableTo(indexType, getIndexType(objectType, 0 /* None */))) { - if (accessNode.kind === 211 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { - error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); + 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)); - if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 24 /* NonPublicAccessibilityModifier */) { - error(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(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; } } } - error(accessNode, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); + error2(accessNode, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); return errorType; } function checkIndexedAccessType(node) { @@ -347292,7 +350129,7 @@ ${lanes.join("\n")} forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!findAncestor(node, (n) => n.parent && n.parent.kind === 193 /* ConditionalType */ && n.parent.extendsType === n)) { + if (!findAncestor(node, (n) => n.parent && n.parent.kind === 194 /* ConditionalType */ && n.parent.extendsType === n)) { grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); @@ -347302,11 +350139,11 @@ ${lanes.join("\n")} if (!links.typeParametersChecked) { links.typeParametersChecked = true; const typeParameter = getDeclaredTypeOfTypeParameter(symbol); - const declarations = getDeclarationsOfKind(symbol, 167 /* TypeParameter */); + const declarations = getDeclarationsOfKind(symbol, 168 /* TypeParameter */); if (!areTypeParametersIdentical(declarations, [typeParameter], (decl) => [decl])) { const name = symbolToString(symbol); for (const declaration of declarations) { - error(declaration.name, Diagnostics.All_declarations_of_0_must_have_identical_constraints, name); + error2(declaration.name, Diagnostics.All_declarations_of_0_must_have_identical_constraints, name); } } } @@ -347323,16 +350160,8 @@ ${lanes.join("\n")} } function checkImportType(node) { checkSourceElement(node.argument); - if (node.assertions) { - const override = getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode); - if (override) { - if (!isNightly()) { - grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next); - } - if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) { - grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext); - } - } + if (node.attributes) { + getResolutionModeOverride(node.attributes, grammarErrorOnNode); } checkTypeReferenceOrImport(node); } @@ -347340,25 +350169,26 @@ ${lanes.join("\n")} if (node.dotDotDotToken && node.questionToken) { grammarErrorOnNode(node, Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); } - if (node.type.kind === 189 /* OptionalType */) { + if (node.type.kind === 190 /* OptionalType */) { grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); } - if (node.type.kind === 190 /* RestType */) { + if (node.type.kind === 191 /* RestType */) { grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); } checkSourceElement(node.type); getTypeFromTypeNode(node); } function isPrivateWithinAmbient(node) { - return (hasEffectiveModifier(node, 8 /* Private */) || isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 16777216 /* Ambient */); + return (hasEffectiveModifier(node, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 33554432 /* Ambient */); } function getEffectiveDeclarationFlags(n, flagsToCheck) { - let flags = getCombinedModifierFlags(n); - if (n.parent.kind !== 263 /* InterfaceDeclaration */ && n.parent.kind !== 262 /* ClassDeclaration */ && n.parent.kind !== 230 /* ClassExpression */ && n.flags & 16777216 /* Ambient */) { - if (!(flags & 2 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) { - flags |= 1 /* Export */; + let flags = getCombinedModifierFlagsCached(n); + if (n.parent.kind !== 264 /* InterfaceDeclaration */ && n.parent.kind !== 263 /* ClassDeclaration */ && n.parent.kind !== 231 /* ClassExpression */ && n.flags & 33554432 /* Ambient */) { + const container = getEnclosingContainer(n); + if (container && container.flags & 128 /* ExportContext */ && !(flags & 128 /* Ambient */) && !(isModuleBlock(n.parent) && isModuleDeclaration(n.parent.parent) && isGlobalScopeAugmentation(n.parent.parent))) { + flags |= 32 /* Export */; } - flags |= 2 /* Ambient */; + flags |= 128 /* Ambient */; } return flags & flagsToCheck; } @@ -347376,14 +350206,14 @@ ${lanes.join("\n")} const canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck2); forEach(overloads, (o) => { const deviation = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlags; - if (deviation & 1 /* Export */) { - error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported); - } else if (deviation & 2 /* Ambient */) { - error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); - } else if (deviation & (8 /* Private */ | 16 /* Protected */)) { - error(getNameOfDeclaration(o) || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); - } else if (deviation & 256 /* Abstract */) { - error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract); + if (deviation & 32 /* Export */) { + error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported); + } else if (deviation & 128 /* Ambient */) { + error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); + } else if (deviation & (2 /* Private */ | 4 /* Protected */)) { + error2(getNameOfDeclaration(o) || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); + } else if (deviation & 64 /* Abstract */) { + error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract); } }); } @@ -347394,12 +350224,12 @@ ${lanes.join("\n")} forEach(overloads, (o) => { const deviation = hasQuestionToken(o) !== canonicalHasQuestionToken; if (deviation) { - error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_optional_or_required); + error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_optional_or_required); } }); } } - const flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 8 /* Private */ | 16 /* Protected */ | 256 /* Abstract */; + const flagsToCheck = 32 /* Export */ | 128 /* Ambient */ | 2 /* Private */ | 4 /* Protected */ | 64 /* Abstract */; let someNodeFlags = 0 /* None */; let allNodeFlags = flagsToCheck; let someHaveQuestionToken = false; @@ -347430,27 +350260,27 @@ ${lanes.join("\n")} (isPrivateIdentifier(node.name) && isPrivateIdentifier(subsequentName) && node.name.escapedText === subsequentName.escapedText || // Both are computed property names isComputedPropertyName(node.name) && isComputedPropertyName(subsequentName) && isTypeIdenticalTo(checkComputedPropertyName(node.name), checkComputedPropertyName(subsequentName)) || // Both are literal property names that are the same. isPropertyNameLiteral(node.name) && isPropertyNameLiteral(subsequentName) && getEscapedTextOfIdentifierOrLiteral(node.name) === getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - const reportError = (node.kind === 173 /* MethodDeclaration */ || node.kind === 172 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode); + const reportError = (node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */) && isStatic(node) !== isStatic(subsequentNode); if (reportError) { const diagnostic = isStatic(node) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; - error(errorNode2, diagnostic); + error2(errorNode2, diagnostic); } return; } if (nodeIsPresent(subsequentNode.body)) { - error(errorNode2, Diagnostics.Function_implementation_name_must_be_0, declarationNameToString(node.name)); + error2(errorNode2, Diagnostics.Function_implementation_name_must_be_0, declarationNameToString(node.name)); return; } } } const errorNode = node.name || node; if (isConstructor) { - error(errorNode, Diagnostics.Constructor_implementation_is_missing); + error2(errorNode, Diagnostics.Constructor_implementation_is_missing); } else { - if (hasSyntacticModifier(node, 256 /* Abstract */)) { - error(errorNode, Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); + if (hasSyntacticModifier(node, 64 /* Abstract */)) { + error2(errorNode, Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); } else { - error(errorNode, Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); + error2(errorNode, Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); } } } @@ -347461,15 +350291,15 @@ ${lanes.join("\n")} if (declarations) { for (const current of declarations) { const node = current; - const inAmbientContext = node.flags & 16777216 /* Ambient */; - const inAmbientContextOrInterface = node.parent && (node.parent.kind === 263 /* InterfaceDeclaration */ || node.parent.kind === 186 /* TypeLiteral */) || inAmbientContext; + const inAmbientContext = node.flags & 33554432 /* Ambient */; + const inAmbientContextOrInterface = node.parent && (node.parent.kind === 264 /* InterfaceDeclaration */ || node.parent.kind === 187 /* TypeLiteral */) || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = void 0; } - if ((node.kind === 262 /* ClassDeclaration */ || node.kind === 230 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 263 /* ClassDeclaration */ || node.kind === 231 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 261 /* FunctionDeclaration */ || node.kind === 173 /* MethodDeclaration */ || node.kind === 172 /* MethodSignature */ || node.kind === 175 /* Constructor */) { + if (node.kind === 262 /* FunctionDeclaration */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 176 /* Constructor */) { functionDeclarations.push(node); const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; @@ -347499,41 +350329,33 @@ ${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; } } } if (multipleConstructorImplementation) { forEach(functionDeclarations, (declaration) => { - error(declaration, Diagnostics.Multiple_constructor_implementations_are_not_allowed); + error2(declaration, Diagnostics.Multiple_constructor_implementations_are_not_allowed); }); } if (duplicateFunctionDeclaration) { forEach(functionDeclarations, (declaration) => { - error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Duplicate_function_implementation); + error2(getNameOfDeclaration(declaration) || declaration, Diagnostics.Duplicate_function_implementation); }); } if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */ && declarations) { - const relatedDiagnostics = filter(declarations, (d) => d.kind === 262 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class)); + const relatedDiagnostics = filter(declarations, (d) => d.kind === 263 /* ClassDeclaration */).map((d) => createDiagnosticForNode(d, Diagnostics.Consider_adding_a_declare_modifier_to_this_class)); forEach(declarations, (declaration) => { - const diagnostic = declaration.kind === 262 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 261 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0; + const diagnostic = declaration.kind === 263 /* ClassDeclaration */ ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 262 /* FunctionDeclaration */ ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0; if (diagnostic) { addRelatedInfo( - error(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)), + error2(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)), ...relatedDiagnostics ); } }); } - if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration, 256 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) { + if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier(lastSeenNonAmbientDeclaration, 64 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) { reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } if (hasOverloads) { @@ -347548,7 +350370,7 @@ ${lanes.join("\n")} if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration; addRelatedInfo( - error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), + error2(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here) ); break; @@ -347576,9 +350398,9 @@ ${lanes.join("\n")} let defaultExportedDeclarationSpaces = 0 /* None */; for (const d of symbol.declarations) { const declarationSpaces = getDeclarationSpaces(d); - const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d, 1 /* Export */ | 1024 /* Default */); - if (effectiveDeclarationFlags & 1 /* Export */) { - if (effectiveDeclarationFlags & 1024 /* Default */) { + const effectiveDeclarationFlags = getEffectiveDeclarationFlags(d, 32 /* Export */ | 2048 /* Default */); + if (effectiveDeclarationFlags & 32 /* Export */) { + if (effectiveDeclarationFlags & 2048 /* Default */) { defaultExportedDeclarationSpaces |= declarationSpaces; } else { exportedDeclarationSpaces |= declarationSpaces; @@ -347595,54 +350417,54 @@ ${lanes.join("\n")} const declarationSpaces = getDeclarationSpaces(d); const name = getNameOfDeclaration(d); if (declarationSpaces & commonDeclarationSpacesForDefaultAndNonDefault) { - error(name, Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, declarationNameToString(name)); + error2(name, Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, declarationNameToString(name)); } else if (declarationSpaces & commonDeclarationSpacesForExportsAndLocals) { - error(name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, declarationNameToString(name)); + error2(name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, declarationNameToString(name)); } } } function getDeclarationSpaces(decl) { let d = decl; switch (d.kind) { - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 352 /* JSDocTypedefTag */: - case 344 /* JSDocCallbackTag */: - case 346 /* JSDocEnumTag */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 353 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: + case 347 /* JSDocEnumTag */: return 2 /* ExportType */; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return isAmbientModule(d) || getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 262 /* ClassDeclaration */: - case 265 /* EnumDeclaration */: - case 305 /* EnumMember */: + case 263 /* ClassDeclaration */: + case 266 /* EnumDeclaration */: + case 306 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 311 /* SourceFile */: + case 312 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 276 /* ExportAssignment */: - case 225 /* BinaryExpression */: + case 277 /* ExportAssignment */: + case 226 /* BinaryExpression */: const node2 = d; const expression = isExportAssignment(node2) ? node2.expression : node2.right; if (!isEntityNameExpression(expression)) { return 1 /* ExportValue */; } d = expression; - case 270 /* ImportEqualsDeclaration */: - case 273 /* NamespaceImport */: - case 272 /* ImportClause */: + case 271 /* ImportEqualsDeclaration */: + case 274 /* NamespaceImport */: + case 273 /* ImportClause */: let result = 0 /* None */; const target = resolveAlias(getSymbolOfDeclaration(d)); forEach(target.declarations, (d2) => { result |= getDeclarationSpaces(d2); }); return result; - case 259 /* VariableDeclaration */: - case 207 /* BindingElement */: - case 261 /* FunctionDeclaration */: - case 275 /* ImportSpecifier */: + case 260 /* VariableDeclaration */: + case 208 /* BindingElement */: + case 262 /* FunctionDeclaration */: + case 276 /* ImportSpecifier */: case 80 /* Identifier */: return 1 /* ExportValue */; - case 172 /* MethodSignature */: - case 170 /* PropertySignature */: + case 173 /* MethodSignature */: + case 171 /* PropertySignature */: return 2 /* ExportType */; default: return Debug.failBadSyntaxKind(d); @@ -347677,7 +350499,7 @@ ${lanes.join("\n")} const thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0 /* Call */) : emptyArray; if (thenSignatures.length === 0) { if (errorNode) { - error(errorNode, Diagnostics.A_promise_must_have_a_then_method); + error2(errorNode, Diagnostics.A_promise_must_have_a_then_method); } return void 0; } @@ -347697,7 +350519,7 @@ ${lanes.join("\n")} thisTypeForErrorOut.value = thisTypeForError; } if (errorNode) { - error(errorNode, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForError)); + error2(errorNode, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForError)); } return void 0; } @@ -347708,7 +350530,7 @@ ${lanes.join("\n")} const onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0 /* Call */); if (onfulfilledParameterSignatures.length === 0) { if (errorNode) { - error(errorNode, Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); + error2(errorNode, Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); } return void 0; } @@ -347789,7 +350611,7 @@ ${lanes.join("\n")} if (type.flags & 1048576 /* Union */) { if (awaitedTypeStack.lastIndexOf(type.id) >= 0) { if (errorNode) { - error(errorNode, Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + error2(errorNode, Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); } return void 0; } @@ -347812,7 +350634,7 @@ ${lanes.join("\n")} if (promisedType) { if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { if (errorNode) { - error(errorNode, Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + error2(errorNode, Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); } return void 0; } @@ -347838,7 +350660,7 @@ ${lanes.join("\n")} } return typeAsAwaitable.awaitedTypeOfType = type; } - function checkAsyncFunctionReturnType(node, returnTypeNode) { + function checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation) { const returnType = getTypeFromTypeNode(returnTypeNode); if (languageVersion >= 2 /* ES2015 */) { if (isErrorType(returnType)) { @@ -347849,7 +350671,7 @@ ${lanes.join("\n")} true ); if (globalPromiseType !== emptyGenericType && !isReferenceToType2(returnType, globalPromiseType)) { - error(returnTypeNode, Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, typeToString(getAwaitedTypeNoAlias(returnType) || voidType)); + reportErrorForInvalidReturnType(Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, returnTypeNode, returnTypeErrorLocation, typeToString(getAwaitedTypeNoAlias(returnType) || voidType)); return; } } else { @@ -347859,7 +350681,7 @@ ${lanes.join("\n")} } const promiseConstructorName = getEntityNameFromTypeNode(returnTypeNode); if (promiseConstructorName === void 0) { - error(returnTypeNode, Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, typeToString(returnType)); + reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, typeToString(returnType)); return; } const promiseConstructorSymbol = resolveEntityName( @@ -347874,9 +350696,9 @@ ${lanes.join("\n")} /*reportErrors*/ false )) { - error(returnTypeNode, Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + error2(returnTypeErrorLocation, Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); } else { - error(returnTypeNode, Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, entityNameToString(promiseConstructorName)); + reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName)); } return; } @@ -347885,26 +350707,22 @@ ${lanes.join("\n")} true ); if (globalPromiseConstructorLikeType === emptyObjectType) { - error(returnTypeNode, Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, entityNameToString(promiseConstructorName)); + reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName)); return; } - if (!checkTypeAssignableTo( - promiseConstructorType, - globalPromiseConstructorLikeType, - returnTypeNode, - Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value - )) { + const headMessage = Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value; + const errorInfo = () => returnTypeNode === returnTypeErrorLocation ? void 0 : chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type + ); + if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, returnTypeErrorLocation, headMessage, errorInfo)) { return; } const rootName = promiseConstructorName && getFirstIdentifier(promiseConstructorName); const collidingSymbol = getSymbol2(node.locals, rootName.escapedText, 111551 /* Value */); if (collidingSymbol) { - error( - collidingSymbol.valueDeclaration, - Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, - idText(rootName), - entityNameToString(promiseConstructorName) - ); + error2(collidingSymbol.valueDeclaration, Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, idText(rootName), entityNameToString(promiseConstructorName)); return; } } @@ -347915,6 +350733,14 @@ ${lanes.join("\n")} node, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member ); + function reportErrorForInvalidReturnType(message, returnTypeNode2, returnTypeErrorLocation2, typeName) { + if (returnTypeNode2 === returnTypeErrorLocation2) { + error2(returnTypeErrorLocation2, message, typeName); + } else { + const diag2 = error2(returnTypeErrorLocation2, Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type); + addRelatedInfo(diag2, createDiagnosticForNode(returnTypeNode2, message, typeName)); + } + } } function checkDecorator(node) { const signature = getResolvedSignature(node); @@ -347929,21 +350755,21 @@ ${lanes.join("\n")} let headMessage; const expectedReturnType = decoratorSignature.resolvedReturnType; switch (node.parent.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; break; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: if (!legacyDecorators) { headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; break; } - case 168 /* Parameter */: + case 169 /* Parameter */: headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; break; - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; break; default: @@ -347975,7 +350801,7 @@ ${lanes.join("\n")} ); } function createSetterFunctionType(type) { - const valueParam = createParameter("value", type); + const valueParam = createParameter2("value", type); return createFunctionType( /*typeParameters*/ void 0, @@ -348012,7 +350838,7 @@ ${lanes.join("\n")} if (canCollectSymbolAliasAccessabilityData && symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { markAliasSymbolAsReferenced(rootSymbol); } else if (forDecoratorMetadata && getIsolatedModules(compilerOptions) && getEmitModuleKind(compilerOptions) >= 5 /* ES2015 */ && !symbolIsValue(rootSymbol) && !some(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { - const diag2 = error(typeName, Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled); + const diag2 = error2(typeName, Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled); const aliasDeclaration = find(rootSymbol.declarations || emptyArray, isAliasSymbolDeclaration2); if (aliasDeclaration) { addRelatedInfo(diag2, createDiagnosticForNode(aliasDeclaration, Diagnostics._0_was_imported_here, idText(rootName))); @@ -348033,15 +350859,15 @@ ${lanes.join("\n")} function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 192 /* IntersectionType */: - case 191 /* UnionType */: + case 193 /* IntersectionType */: + case 192 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 193 /* ConditionalType */: + case 194 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 195 /* ParenthesizedType */: - case 201 /* NamedTupleMember */: + case 196 /* ParenthesizedType */: + case 202 /* NamedTupleMember */: return getEntityNameForDecoratorMetadata(node.type); - case 182 /* TypeReference */: + case 183 /* TypeReference */: return node.typeName; } } @@ -348049,13 +350875,13 @@ ${lanes.join("\n")} function getEntityNameForDecoratorMetadataFromTypeList(types) { let commonEntityName; for (let typeNode of types) { - while (typeNode.kind === 195 /* ParenthesizedType */ || typeNode.kind === 201 /* NamedTupleMember */) { + while (typeNode.kind === 196 /* ParenthesizedType */ || typeNode.kind === 202 /* NamedTupleMember */) { typeNode = typeNode.type; } if (typeNode.kind === 146 /* NeverKeyword */) { continue; } - if (!strictNullChecks && (typeNode.kind === 200 /* LiteralType */ && typeNode.literal.kind === 106 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 201 /* LiteralType */ && typeNode.literal.kind === 106 /* NullKeyword */ || typeNode.kind === 157 /* UndefinedKeyword */)) { continue; } const individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -348086,7 +350912,7 @@ ${lanes.join("\n")} } if (legacyDecorators) { checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 168 /* Parameter */) { + if (node.kind === 169 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } } else if (languageVersion < 99 /* ESNext */) { @@ -348112,7 +350938,7 @@ ${lanes.join("\n")} if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); switch (node.kind) { - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: const constructor = getFirstConstructorWithBody(node); if (constructor) { for (const parameter of constructor.parameters) { @@ -348120,27 +350946,28 @@ ${lanes.join("\n")} } } break; - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - const otherKind = node.kind === 176 /* GetAccessor */ ? 177 /* SetAccessor */ : 176 /* GetAccessor */; + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + const otherKind = node.kind === 177 /* GetAccessor */ ? 178 /* SetAccessor */ : 177 /* GetAccessor */; const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: for (const parameter of node.parameters) { markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(node)); break; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(node)); break; - case 168 /* Parameter */: + case 169 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); const containingSignature = node.parent; for (const parameter of containingSignature.parameters) { markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } + markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(containingSignature)); break; } } @@ -348160,7 +350987,7 @@ ${lanes.join("\n")} } function checkJSDocTypeAliasTag(node) { if (!node.typeExpression) { - error(node.name, Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags); + error2(node.name, Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags); } if (node.name) { checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); @@ -348185,7 +351012,7 @@ ${lanes.join("\n")} if (length(tags) > 1) { for (let i = 1; i < length(tags); i++) { const tagName = tags[i].tagName; - error(tagName, Diagnostics._0_tag_already_specified, idText(tagName)); + error2(tagName, Diagnostics._0_tag_already_specified, idText(tagName)); } } } @@ -348214,43 +351041,49 @@ ${lanes.join("\n")} } } } + function checkJSDocThisTag(node) { + const host2 = getEffectiveJSDocHost(node); + if (host2 && isArrowFunction(host2)) { + error2(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter); + } + } function checkJSDocImplementsTag(node) { const classLike = getEffectiveJSDocHost(node); if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) { - error(classLike, Diagnostics.JSDoc_0_is_not_attached_to_a_class, idText(node.tagName)); + error2(classLike, Diagnostics.JSDoc_0_is_not_attached_to_a_class, idText(node.tagName)); } } function checkJSDocAugmentsTag(node) { const classLike = getEffectiveJSDocHost(node); if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) { - error(classLike, Diagnostics.JSDoc_0_is_not_attached_to_a_class, idText(node.tagName)); + error2(classLike, Diagnostics.JSDoc_0_is_not_attached_to_a_class, idText(node.tagName)); return; } const augmentsTags = getJSDocTags(classLike).filter(isJSDocAugmentsTag); Debug.assert(augmentsTags.length > 0); if (augmentsTags.length > 1) { - error(augmentsTags[1], Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); + error2(augmentsTags[1], Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); } const name = getIdentifierFromEntityNameExpression(node.class.expression); const extend2 = getClassExtendsHeritageElement(classLike); if (extend2) { const className = getIdentifierFromEntityNameExpression(extend2.expression); if (className && name.escapedText !== className.escapedText) { - error(name, Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause, idText(node.tagName), idText(name), idText(className)); + error2(name, Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause, idText(node.tagName), idText(name), idText(className)); } } } function checkJSDocAccessibilityModifiers(node) { const host2 = getJSDocHost(node); if (host2 && isPrivateIdentifierClassElementDeclaration(host2)) { - error(node, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); + error2(node, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); } } function getIdentifierFromEntityNameExpression(node) { switch (node.kind) { case 80 /* Identifier */: return node; - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return node.name; default: return void 0; @@ -348261,7 +351094,7 @@ ${lanes.join("\n")} checkDecorators(node); checkSignatureDeclaration(node); const functionFlags = getFunctionFlags(node); - if (node.name && node.name.kind === 166 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 167 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (hasBindableName(node)) { @@ -348269,7 +351102,7 @@ ${lanes.join("\n")} const localSymbol = node.localSymbol || symbol; const firstDeclaration = (_a = localSymbol.declarations) == null ? void 0 : _a.find( // Get first non javascript function declaration - (declaration) => declaration.kind === node.kind && !(declaration.flags & 262144 /* JavaScriptFile */) + (declaration) => declaration.kind === node.kind && !(declaration.flags & 524288 /* JavaScriptFile */) ); if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); @@ -348278,14 +351111,14 @@ ${lanes.join("\n")} checkFunctionOrConstructorSymbol(symbol); } } - const body = node.kind === 172 /* MethodSignature */ ? void 0 : node.body; + const body = node.kind === 173 /* MethodSignature */ ? void 0 : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics); if (isInJSFile(node)) { const typeTag = getJSDocTypeTag(node); if (typeTag && typeTag.typeExpression && !getContextualCallSignature(getTypeFromTypeNode(typeTag.typeExpression), node)) { - error(typeTag.typeExpression.type, Diagnostics.The_type_of_a_function_declaration_must_match_the_function_s_signature); + error2(typeTag.typeExpression.type, Diagnostics.The_type_of_a_function_declaration_must_match_the_function_s_signature); } } function checkFunctionOrMethodDeclarationDiagnostics() { @@ -348314,42 +351147,42 @@ ${lanes.join("\n")} function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) { for (const node of potentiallyUnusedIdentifiers) { switch (node.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 311 /* SourceFile */: - case 266 /* ModuleDeclaration */: - case 240 /* Block */: - case 268 /* CaseBlock */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: + case 312 /* SourceFile */: + case 267 /* ModuleDeclaration */: + case 241 /* Block */: + case 269 /* CaseBlock */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 175 /* Constructor */: - case 217 /* FunctionExpression */: - case 261 /* FunctionDeclaration */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 176 /* Constructor */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 172 /* MethodSignature */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 264 /* TypeAliasDeclaration */: - case 263 /* InterfaceDeclaration */: + case 173 /* MethodSignature */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 265 /* TypeAliasDeclaration */: + case 264 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 194 /* InferType */: + case 195 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -348368,28 +351201,28 @@ ${lanes.join("\n")} function checkUnusedClassMembers(node, addDiagnostic) { for (const member of node.members) { switch (member.kind) { - case 173 /* MethodDeclaration */: - case 171 /* PropertyDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - if (member.kind === 177 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 174 /* MethodDeclaration */: + case 172 /* PropertyDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + if (member.kind === 178 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { break; } const symbol = getSymbolOfDeclaration(member); - if (!symbol.isReferenced && (hasEffectiveModifier(member, 8 /* Private */) || isNamedDeclaration(member) && isPrivateIdentifier(member.name)) && !(member.flags & 16777216 /* Ambient */)) { + if (!symbol.isReferenced && (hasEffectiveModifier(member, 2 /* Private */) || isNamedDeclaration(member) && isPrivateIdentifier(member.name)) && !(member.flags & 33554432 /* Ambient */)) { addDiagnostic(member, 0 /* Local */, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 175 /* Constructor */: + case 176 /* Constructor */: for (const parameter of member.parameters) { - if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 8 /* Private */)) { + if (!parameter.symbol.isReferenced && hasSyntacticModifier(parameter, 2 /* Private */)) { addDiagnostic(parameter, 0 /* Local */, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol))); } } break; - case 180 /* IndexSignature */: - case 239 /* SemicolonClassElement */: - case 174 /* ClassStaticBlockDeclaration */: + case 181 /* IndexSignature */: + case 240 /* SemicolonClassElement */: + case 175 /* ClassStaticBlockDeclaration */: break; default: Debug.fail("Unexpected class member"); @@ -348413,7 +351246,7 @@ ${lanes.join("\n")} continue; const name = idText(typeParameter.name); const { parent: parent2 } = typeParameter; - if (parent2.kind !== 194 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) { + if (parent2.kind !== 195 /* InferType */ && parent2.typeParameters.every(isTypeParameterUnused)) { if (tryAddToSet(seenParentsWithEveryUnused, parent2)) { const sourceFile = getSourceFileOfNode(parent2); const range = isJSDocTemplateTag(parent2) ? rangeOfNode(parent2) : rangeOfTypeParameters(sourceFile, parent2.typeParameters); @@ -348471,7 +351304,11 @@ ${lanes.join("\n")} addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId); } } else if (isVariableDeclaration(declaration)) { - addToGroup(unusedVariables, declaration.parent, declaration, getNodeId); + const blockScopeKind = getCombinedNodeFlagsCached(declaration) & 7 /* BlockScoped */; + const name = getNameOfDeclaration(declaration); + if (blockScopeKind !== 4 /* Using */ && blockScopeKind !== 6 /* AwaitUsing */ || !name || !isIdentifierThatStartsWithUnderscore(name)) { + addToGroup(unusedVariables, declaration.parent, declaration, getNodeId); + } } else { const parameter = local.valueDeclaration && tryGetRootParameterDeclaration(local.valueDeclaration); const name = local.valueDeclaration && getNameOfDeclaration(local.valueDeclaration); @@ -348492,9 +351329,13 @@ ${lanes.join("\n")} }); unusedImports.forEach(([importClause, unuseds]) => { const importDecl = importClause.parent; - const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 273 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0); + const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 274 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length : 0); if (nDeclarations === unuseds.length) { - addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 ? createDiagnosticForNode(importDecl, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(first(unuseds).name)) : createDiagnosticForNode(importDecl, Diagnostics.All_imports_in_import_declaration_are_unused)); + addDiagnostic( + importDecl, + 0 /* Local */, + unuseds.length === 1 ? createDiagnosticForNode(importDecl, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(first(unuseds).name)) : createDiagnosticForNode(importDecl, Diagnostics.All_imports_in_import_declaration_are_unused) + ); } else { for (const unused of unuseds) errorUnusedLocal(unused, idText(unused.name), addDiagnostic); @@ -348503,10 +351344,14 @@ ${lanes.join("\n")} unusedDestructures.forEach(([bindingPattern, bindingElements]) => { const kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 259 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 260 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 260 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 261 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { - addDiagnostic(bindingPattern, kind, bindingElements.length === 1 ? createDiagnosticForNode(bindingPattern, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(bindingElements).name)) : createDiagnosticForNode(bindingPattern, Diagnostics.All_destructured_elements_are_unused)); + addDiagnostic( + bindingPattern, + kind, + bindingElements.length === 1 ? createDiagnosticForNode(bindingPattern, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(bindingElements).name)) : createDiagnosticForNode(bindingPattern, Diagnostics.All_destructured_elements_are_unused) + ); } } else { for (const e of bindingElements) { @@ -348516,7 +351361,11 @@ ${lanes.join("\n")} }); unusedVariables.forEach(([declarationList, declarations]) => { if (declarationList.declarations.length === declarations.length) { - addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 242 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused)); + addDiagnostic( + declarationList, + 0 /* Local */, + declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 243 /* VariableStatement */ ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused) + ); } else { for (const decl of declarations) { addDiagnostic(decl, 0 /* Local */, createDiagnosticForNode(decl, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name))); @@ -348545,21 +351394,21 @@ ${lanes.join("\n")} switch (name.kind) { case 80 /* Identifier */: return idText(name); - case 206 /* ArrayBindingPattern */: - case 205 /* ObjectBindingPattern */: + case 207 /* ArrayBindingPattern */: + case 206 /* ObjectBindingPattern */: return bindingNameText(cast(first(name.elements), isBindingElement).name); default: return Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 272 /* ImportClause */ || node.kind === 275 /* ImportSpecifier */ || node.kind === 273 /* NamespaceImport */; + return node.kind === 273 /* ImportClause */ || node.kind === 276 /* ImportSpecifier */ || node.kind === 274 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 272 /* ImportClause */ ? decl : decl.kind === 273 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 273 /* ImportClause */ ? decl : decl.kind === 274 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { - if (node.kind === 240 /* Block */) { + if (node.kind === 241 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (isFunctionOrModuleBlock(node)) { @@ -348574,7 +351423,7 @@ ${lanes.join("\n")} } } function checkCollisionWithArgumentsInGeneratedCode(node) { - if (languageVersion >= 2 /* ES2015 */ || !hasRestParameter(node) || node.flags & 16777216 /* Ambient */ || nodeIsMissing(node.body)) { + if (languageVersion >= 2 /* ES2015 */ || !hasRestParameter(node) || node.flags & 33554432 /* Ambient */ || nodeIsMissing(node.body)) { return; } forEach(node.parameters, (p) => { @@ -348587,10 +351436,10 @@ ${lanes.join("\n")} if ((identifier == null ? void 0 : identifier.escapedText) !== name) { return false; } - if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 173 /* MethodDeclaration */ || node.kind === 172 /* MethodSignature */ || node.kind === 176 /* GetAccessor */ || node.kind === 177 /* SetAccessor */ || node.kind === 302 /* PropertyAssignment */) { + if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 174 /* MethodDeclaration */ || node.kind === 173 /* MethodSignature */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */ || node.kind === 303 /* PropertyAssignment */) { return false; } - if (node.flags & 16777216 /* Ambient */) { + if (node.flags & 33554432 /* Ambient */) { return false; } if (isImportClause(node) || isImportEqualsDeclaration(node) || isImportSpecifier(node)) { @@ -348609,9 +351458,9 @@ ${lanes.join("\n")} if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { const isDeclaration2 = node.kind !== 80 /* Identifier */; if (isDeclaration2) { - error(getNameOfDeclaration(node), Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); + error2(getNameOfDeclaration(node), Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { - error(node, Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); + error2(node, Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); } return true; } @@ -348623,9 +351472,9 @@ ${lanes.join("\n")} if (getNodeCheckFlags(current) & 8 /* CaptureNewTarget */) { const isDeclaration2 = node.kind !== 80 /* Identifier */; if (isDeclaration2) { - error(getNameOfDeclaration(node), Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); + error2(getNameOfDeclaration(node), Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); } else { - error(node, Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); + error2(node, Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); } return true; } @@ -348643,14 +351492,8 @@ ${lanes.join("\n")} return; } const parent2 = getDeclarationContainer(node); - if (parent2.kind === 311 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) { - errorSkippedOn( - "noEmit", - name, - Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, - declarationNameToString(name), - declarationNameToString(name) - ); + if (parent2.kind === 312 /* SourceFile */ && isExternalOrCommonJsModule(parent2)) { + errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, declarationNameToString(name), declarationNameToString(name)); } } function checkCollisionWithGlobalPromiseInGeneratedCode(node, name) { @@ -348661,14 +351504,8 @@ ${lanes.join("\n")} return; } const parent2 = getDeclarationContainer(node); - if (parent2.kind === 311 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 2048 /* HasAsyncFunctions */) { - errorSkippedOn( - "noEmit", - name, - Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, - declarationNameToString(name), - declarationNameToString(name) - ); + if (parent2.kind === 312 /* SourceFile */ && isExternalOrCommonJsModule(parent2) && parent2.flags & 4096 /* HasAsyncFunctions */) { + errorSkippedOn("noEmit", name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, declarationNameToString(name), declarationNameToString(name)); } } function recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name) { @@ -348678,7 +351515,7 @@ ${lanes.join("\n")} } function checkWeakMapSetCollision(node) { const enclosingBlockScope = getEnclosingBlockScopeContainer(node); - if (getNodeCheckFlags(enclosingBlockScope) & 4194304 /* ContainsClassWithPrivateIdentifiers */) { + if (getNodeCheckFlags(enclosingBlockScope) & 1048576 /* ContainsClassWithPrivateIdentifiers */) { Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier"); errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText); } @@ -348692,30 +351529,24 @@ ${lanes.join("\n")} let hasCollision = false; if (isClassExpression(node)) { for (const member of node.members) { - if (getNodeCheckFlags(member) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) { + if (getNodeCheckFlags(member) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) { hasCollision = true; break; } } } else if (isFunctionExpression(node)) { - if (getNodeCheckFlags(node) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) { + if (getNodeCheckFlags(node) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) { hasCollision = true; } } else { const container = getEnclosingBlockScopeContainer(node); - if (container && getNodeCheckFlags(container) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) { + if (container && getNodeCheckFlags(container) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) { hasCollision = true; } } if (hasCollision) { Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name), "The target of a Reflect collision check should be an identifier"); - errorSkippedOn( - "noEmit", - node, - Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers, - declarationNameToString(node.name), - "Reflect" - ); + errorSkippedOn("noEmit", node, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers, declarationNameToString(node.name), "Reflect"); } } function checkCollisionsForDeclarationName(node, name) { @@ -348727,7 +351558,7 @@ ${lanes.join("\n")} recordPotentialCollisionWithReflectInGeneratedCode(node, name); if (isClassLike(node)) { checkTypeNameIsReserved(name, Diagnostics.Class_name_cannot_be_0); - if (!(node.flags & 16777216 /* Ambient */)) { + if (!(node.flags & 33554432 /* Ambient */)) { checkClassNameCollisionWithObject(name); } } else if (isEnumDeclaration(node)) { @@ -348735,10 +351566,7 @@ ${lanes.join("\n")} } } function checkVarDeclaredNamesNotShadowed(node) { - if ((getCombinedNodeFlags(node) & 3 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) { - return; - } - if (node.kind === 259 /* VariableDeclaration */ && !node.initializer) { + if ((getCombinedNodeFlagsCached(node) & 7 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) { return; } const symbol = getSymbolOfDeclaration(node); @@ -348757,13 +351585,13 @@ ${lanes.join("\n")} false ); if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { - if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 260 /* VariableDeclarationList */); - const container = varDeclList.parent.kind === 242 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0; - const namesShareScope = container && (container.kind === 240 /* Block */ && isFunctionLike(container.parent) || container.kind === 267 /* ModuleBlock */ || container.kind === 266 /* ModuleDeclaration */ || container.kind === 311 /* SourceFile */); + if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 7 /* BlockScoped */) { + const varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, 261 /* VariableDeclarationList */); + const container = varDeclList.parent.kind === 243 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : void 0; + const namesShareScope = container && (container.kind === 241 /* Block */ && isFunctionLike(container.parent) || container.kind === 268 /* ModuleBlock */ || container.kind === 267 /* ModuleDeclaration */ || container.kind === 312 /* SourceFile */); if (!namesShareScope) { const name = symbolToString(localDeclarationSymbol); - error(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); + error2(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); } } } @@ -348781,7 +351609,7 @@ ${lanes.join("\n")} if (!node.name) { return; } - if (node.name.kind === 166 /* ComputedPropertyName */) { + if (node.name.kind === 167 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (hasOnlyExpressionInitializer(node) && node.initializer) { checkExpressionCached(node.initializer); @@ -348795,11 +351623,11 @@ ${lanes.join("\n")} if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ES2018 */) { checkExternalEmitHelpers(node, 4 /* Rest */); } - if (node.propertyName && node.propertyName.kind === 166 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } const parent2 = node.parent.parent; - const parentCheckMode = node.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */; + const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */; const parentType = getTypeForBindingElementParent(parent2, parentCheckMode); const name = node.propertyName || node.name; if (parentType && !isBindingPattern(name)) { @@ -348828,20 +351656,20 @@ ${lanes.join("\n")} } } if (isBindingPattern(node.name)) { - if (node.name.kind === 206 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } forEach(node.name.elements, checkSourceElement); } - if (isParameter(node) && node.initializer && nodeIsMissing(getContainingFunction(node).body)) { - error(node, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + if (node.initializer && isParameterDeclaration(node) && nodeIsMissing(getContainingFunction(node).body)) { + error2(node, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (isBindingPattern(node.name)) { if (isInAmbientOrTypeNode(node)) { return; } - const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 248 /* ForInStatement */; + const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 249 /* ForInStatement */; const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression)); if (needCheckInitializer || needCheckWidenedType) { const widenedType = getWidenedTypeForVariableLikeDeclaration(node); @@ -348873,20 +351701,45 @@ ${lanes.join("\n")} const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node); if (initializer) { const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a = symbol.exports) == null ? void 0 : _a.size); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 248 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 249 /* ForInStatement */) { + const initializerType = checkExpressionCached(initializer); checkTypeAssignableToAndOptionallyElaborate( - checkExpressionCached(initializer), + initializerType, type, node, initializer, /*headMessage*/ void 0 ); + const blockScopeKind = getCombinedNodeFlagsCached(node) & 7 /* BlockScoped */; + if (blockScopeKind === 6 /* AwaitUsing */) { + const globalAsyncDisposableType = getGlobalAsyncDisposableType( + /*reportErrors*/ + true + ); + const globalDisposableType = getGlobalDisposableType( + /*reportErrors*/ + true + ); + if (globalAsyncDisposableType !== emptyObjectType && globalDisposableType !== emptyObjectType) { + const optionalDisposableType = getUnionType([globalAsyncDisposableType, globalDisposableType, nullType, undefinedType]); + checkTypeAssignableTo(initializerType, optionalDisposableType, initializer, Diagnostics.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); + } + } else if (blockScopeKind === 4 /* Using */) { + const globalDisposableType = getGlobalDisposableType( + /*reportErrors*/ + true + ); + if (globalDisposableType !== emptyObjectType) { + const optionalDisposableType = getUnionType([globalDisposableType, nullType, undefinedType]); + checkTypeAssignableTo(initializerType, optionalDisposableType, initializer, Diagnostics.The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined); + } + } } } if (symbol.declarations && symbol.declarations.length > 1) { if (some(symbol.declarations, (d) => d !== node && isVariableLike(d) && !areDeclarationFlagsIdentical(d, node))) { - error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); + error2(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); } } } else { @@ -348905,12 +351758,12 @@ ${lanes.join("\n")} ); } if (symbol.valueDeclaration && !areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) { - error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); + error2(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); } } - if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */) { + if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */) { checkExportsOnMergedDeclarations(node); - if (node.kind === 259 /* VariableDeclaration */ || node.kind === 207 /* BindingElement */) { + if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionsForDeclarationName(node, node.name); @@ -348918,9 +351771,9 @@ ${lanes.join("\n")} } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { const nextDeclarationName = getNameOfDeclaration(nextDeclaration); - const message = nextDeclaration.kind === 171 /* PropertyDeclaration */ || nextDeclaration.kind === 170 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; + const message = nextDeclaration.kind === 172 /* PropertyDeclaration */ || nextDeclaration.kind === 171 /* PropertySignature */ ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; const declName = declarationNameToString(nextDeclarationName); - const err = error( + const err = error2( nextDeclarationName, message, declName, @@ -348928,20 +351781,17 @@ ${lanes.join("\n")} typeToString(nextType) ); if (firstDeclaration) { - addRelatedInfo( - err, - createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here, declName) - ); + addRelatedInfo(err, createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here, declName)); } } function areDeclarationFlagsIdentical(left, right) { - if (left.kind === 168 /* Parameter */ && right.kind === 259 /* VariableDeclaration */ || left.kind === 259 /* VariableDeclaration */ && right.kind === 168 /* Parameter */) { + if (left.kind === 169 /* Parameter */ && right.kind === 260 /* VariableDeclaration */ || left.kind === 260 /* VariableDeclaration */ && right.kind === 169 /* Parameter */) { return true; } if (hasQuestionToken(left) !== hasQuestionToken(right)) { return false; } - const interestingFlags = 8 /* Private */ | 16 /* Protected */ | 512 /* Async */ | 256 /* Abstract */ | 64 /* Readonly */ | 32 /* Static */; + const interestingFlags = 2 /* Private */ | 4 /* Protected */ | 1024 /* Async */ | 64 /* Abstract */ | 8 /* Readonly */ | 256 /* Static */; return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { @@ -348955,10 +351805,17 @@ ${lanes.join("\n")} checkGrammarBindingElement(node); return checkVariableLikeDeclaration(node); } + function checkVariableDeclarationList(node) { + const blockScopeKind = getCombinedNodeFlags(node) & 7 /* BlockScoped */; + if (blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) { + checkExternalEmitHelpers(node, 33554432 /* AddDisposableResourceAndDisposeResources */); + } + forEach(node.declarations, checkSourceElement); + } function checkVariableStatement(node) { if (!checkGrammarModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) - checkGrammarForDisallowedLetOrConstStatement(node); - forEach(node.declarationList.declarations, checkSourceElement); + checkGrammarForDisallowedBlockScopedVariableStatement(node); + checkVariableDeclarationList(node.declarationList); } function checkExpressionStatement(node) { checkGrammarStatementInAmbientContext(node); @@ -348969,8 +351826,8 @@ ${lanes.join("\n")} const type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type, node.thenStatement); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 241 /* EmptyStatement */) { - error(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); + if (node.thenStatement.kind === 242 /* EmptyStatement */) { + error2(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); } @@ -348997,7 +351854,7 @@ ${lanes.join("\n")} } const type = location === condExpr2 ? condType : checkTruthinessExpression(location); const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression); - if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast) + if (!hasTypeFacts(type, 4194304 /* Truthy */) || isPropertyExpressionCast) return; const callSignatures = getSignaturesOfType(type, 0 /* Call */); const isPromise = !!getAwaitedTypeOfPromise(type); @@ -349020,7 +351877,7 @@ ${lanes.join("\n")} getTypeNameForErrorDisplay(type) ); } else { - error(location, Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead); + error2(location, Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead); } } } @@ -349086,7 +351943,7 @@ ${lanes.join("\n")} } function checkTruthinessOfType(type, node) { if (type.flags & 16384 /* Void */) { - error(node, Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness); + error2(node, Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness); } return type; } @@ -349095,13 +351952,13 @@ ${lanes.join("\n")} } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 260 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 261 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 260 /* VariableDeclarationList */) { - forEach(node.initializer.declarations, checkVariableDeclaration); + if (node.initializer.kind === 261 /* VariableDeclarationList */) { + checkVariableDeclarationList(node.initializer); } else { checkExpression(node.initializer); } @@ -349120,7 +351977,7 @@ ${lanes.join("\n")} const container = getContainingFunctionOrClassStaticBlock(node); if (node.awaitModifier) { if (container && isClassStaticBlockDeclaration(container)) { - grammarErrorOnNode(node.awaitModifier, Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block); + grammarErrorOnNode(node.awaitModifier, Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block); } else { const functionFlags = getFunctionFlags(container); if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 99 /* ESNext */) { @@ -349130,12 +351987,12 @@ ${lanes.join("\n")} } else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(node, 256 /* ForOfIncludes */); } - if (node.initializer.kind === 260 /* VariableDeclarationList */) { - checkForInOrForOfVariableDeclaration(node); + if (node.initializer.kind === 261 /* VariableDeclarationList */) { + checkVariableDeclarationList(node.initializer); } else { const varExpr = node.initializer; const iteratedType = checkRightHandSideOfForOf(node); - if (varExpr.kind === 208 /* ArrayLiteralExpression */ || varExpr.kind === 209 /* ObjectLiteralExpression */) { + if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) { checkDestructuringAssignment(varExpr, iteratedType || errorType); } else { const leftType = checkExpression(varExpr); @@ -349157,19 +352014,19 @@ ${lanes.join("\n")} function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); const rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression)); - if (node.initializer.kind === 260 /* VariableDeclarationList */) { + if (node.initializer.kind === 261 /* VariableDeclarationList */) { const variable = node.initializer.declarations[0]; if (variable && isBindingPattern(variable.name)) { - error(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); + error2(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } - checkForInOrForOfVariableDeclaration(node); + checkVariableDeclarationList(node.initializer); } else { const varExpr = node.initializer; const leftType = checkExpression(varExpr); - if (varExpr.kind === 208 /* ArrayLiteralExpression */ || varExpr.kind === 209 /* ObjectLiteralExpression */) { - error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); + if (varExpr.kind === 209 /* ArrayLiteralExpression */ || varExpr.kind === 210 /* ObjectLiteralExpression */) { + error2(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { - error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); + error2(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { checkReferenceExpression( varExpr, @@ -349179,20 +352036,13 @@ ${lanes.join("\n")} } } if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { - error(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); + error2(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); } checkSourceElement(node.statement); if (node.locals) { registerForUnusedIdentifiersCheck(node); } } - function checkForInOrForOfVariableDeclaration(iterationStatement) { - const variableDeclarationList = iterationStatement.initializer; - if (variableDeclarationList.declarations.length >= 1) { - const decl = variableDeclarationList.declarations[0]; - checkVariableDeclaration(decl); - } - } function checkRightHandSideOfForOf(statement) { const use = statement.awaitModifier ? 15 /* ForAwaitOf */ : 13 /* ForOf */; return checkIteratedTypeOrElementType(use, checkNonNullExpression(statement.expression), undefinedType, statement.expression); @@ -349250,7 +352100,7 @@ ${lanes.join("\n")} if (hasStringConstituent) { if (languageVersion < 1 /* ES5 */) { if (errorNode) { - error(errorNode, Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + error2(errorNode, Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); reportedError = true; } } @@ -349568,13 +352418,10 @@ ${lanes.join("\n")} !!getAwaitedTypeOfPromise(type) || !allowAsyncIterables && isForOfStatement(errorNode.parent) && errorNode.parent.expression === errorNode && getGlobalAsyncIterableType( /*reportErrors*/ false - ) !== emptyGenericType && isTypeAssignableTo( - type, - getGlobalAsyncIterableType( - /*reportErrors*/ - false - ) - ) + ) !== emptyGenericType && isTypeAssignableTo(type, getGlobalAsyncIterableType( + /*reportErrors*/ + false + )) ); return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type)); } @@ -349710,7 +352557,7 @@ ${lanes.join("\n")} errorOutputContainer.errors ?? (errorOutputContainer.errors = []); errorOutputContainer.errors.push(createDiagnosticForNode(errorNode, diagnostic, methodName)); } else { - error(errorNode, diagnostic, methodName); + error2(errorNode, diagnostic, methodName); } } return methodName === "next" ? noIterationTypes : void 0; @@ -349765,7 +352612,7 @@ ${lanes.join("\n")} errorOutputContainer.errors ?? (errorOutputContainer.errors = []); errorOutputContainer.errors.push(createDiagnosticForNode(errorNode, resolver.mustHaveAValueDiagnostic, methodName)); } else { - error(errorNode, resolver.mustHaveAValueDiagnostic, methodName); + error2(errorNode, resolver.mustHaveAValueDiagnostic, methodName); } } yieldType = anyType; @@ -349849,13 +352696,13 @@ ${lanes.join("\n")} const functionFlags = getFunctionFlags(container); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (container.kind === 177 /* SetAccessor */) { + if (container.kind === 178 /* SetAccessor */) { if (node.expression) { - error(node, Diagnostics.Setters_cannot_return_a_value); + error2(node, Diagnostics.Setters_cannot_return_a_value); } - } else if (container.kind === 175 /* Constructor */) { + } else if (container.kind === 176 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { - error(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + error2(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } else if (getReturnTypeFromAnnotation(container)) { const unwrappedReturnType = unwrapReturnType(returnType, functionFlags) ?? returnType; @@ -349870,13 +352717,13 @@ ${lanes.join("\n")} checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression); } } - } else if (container.kind !== 175 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) { - error(node, Diagnostics.Not_all_code_paths_return_a_value); + } else if (container.kind !== 176 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) { + error2(node, Diagnostics.Not_all_code_paths_return_a_value); } } function checkWithStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.flags & 32768 /* AwaitContext */) { + if (node.flags & 65536 /* AwaitContext */) { grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_an_async_function_block); } } @@ -349894,7 +352741,7 @@ ${lanes.join("\n")} let hasDuplicateDefaultClause = false; const expressionType = checkExpression(node.expression); forEach(node.caseBlock.clauses, (clause) => { - if (clause.kind === 296 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 297 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === void 0) { firstDefaultClause = clause; } else { @@ -349902,12 +352749,12 @@ ${lanes.join("\n")} hasDuplicateDefaultClause = true; } } - if (clause.kind === 295 /* CaseClause */) { + if (clause.kind === 296 /* CaseClause */) { addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause)); } forEach(clause.statements, checkSourceElement); if (compilerOptions.noFallthroughCasesInSwitch && clause.fallthroughFlowNode && isReachableFlowNode(clause.fallthroughFlowNode)) { - error(clause, Diagnostics.Fallthrough_case_in_switch); + error2(clause, Diagnostics.Fallthrough_case_in_switch); } function createLazyCaseClauseDiagnostics(clause2) { return () => { @@ -349934,7 +352781,7 @@ ${lanes.join("\n")} if (isFunctionLike(current)) { return "quit"; } - if (current.kind === 255 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 256 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNode(node.label)); return true; } @@ -350024,21 +352871,14 @@ ${lanes.join("\n")} return; } const indexInfos = getApplicableIndexInfos(type, propNameType); - const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 263 /* InterfaceDeclaration */) : void 0; - const propDeclaration = declaration && declaration.kind === 225 /* BinaryExpression */ || name && name.kind === 166 /* ComputedPropertyName */ ? declaration : void 0; + const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 264 /* InterfaceDeclaration */) : void 0; + const propDeclaration = declaration && declaration.kind === 226 /* BinaryExpression */ || name && name.kind === 167 /* ComputedPropertyName */ ? declaration : void 0; const localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : void 0; for (const info of indexInfos) { const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfDeclaration(info.declaration)) === type.symbol ? info.declaration : void 0; const errorNode = localPropDeclaration || localIndexDeclaration || (interfaceDeclaration && !some(getBaseTypes(type), (base) => !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType)) ? interfaceDeclaration : void 0); if (errorNode && !isTypeAssignableTo(propType, info.type)) { - const diagnostic = createError( - errorNode, - Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, - symbolToString(prop), - typeToString(propType), - typeToString(info.keyType), - typeToString(info.type) - ); + const diagnostic = createError(errorNode, Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, symbolToString(prop), typeToString(propType), typeToString(info.keyType), typeToString(info.type)); if (propDeclaration && errorNode !== propDeclaration) { addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics._0_is_declared_here, symbolToString(prop))); } @@ -350049,7 +352889,7 @@ ${lanes.join("\n")} function checkIndexConstraintForIndexSignature(type, checkInfo) { const declaration = checkInfo.declaration; const indexInfos = getApplicableIndexInfos(type, checkInfo.keyType); - const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 263 /* InterfaceDeclaration */) : void 0; + const interfaceDeclaration = getObjectFlags(type) & 2 /* Interface */ ? getDeclarationOfKind(type.symbol, 264 /* InterfaceDeclaration */) : void 0; const localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfDeclaration(declaration)) === type.symbol ? declaration : void 0; for (const info of indexInfos) { if (info === checkInfo) @@ -350057,14 +352897,7 @@ ${lanes.join("\n")} const localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfDeclaration(info.declaration)) === type.symbol ? info.declaration : void 0; const errorNode = localCheckDeclaration || localIndexDeclaration || (interfaceDeclaration && !some(getBaseTypes(type), (base) => !!getIndexInfoOfType(base, checkInfo.keyType) && !!getIndexTypeOfType(base, info.keyType)) ? interfaceDeclaration : void 0); if (errorNode && !isTypeAssignableTo(checkInfo.type, info.type)) { - error( - errorNode, - Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, - typeToString(checkInfo.keyType), - typeToString(checkInfo.type), - typeToString(info.keyType), - typeToString(info.type) - ); + error2(errorNode, Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, typeToString(checkInfo.keyType), typeToString(checkInfo.type), typeToString(info.keyType), typeToString(info.type)); } } } @@ -350080,12 +352913,12 @@ ${lanes.join("\n")} case "symbol": case "void": case "object": - error(name, message, name.escapedText); + error2(name, message, name.escapedText); } } function checkClassNameCollisionWithObject(name) { if (languageVersion >= 1 /* ES5 */ && name.escapedText === "Object" && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(name).impliedNodeFormat === 1 /* CommonJS */)) { - error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); + error2(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); } } function checkUnmatchedJSDocParameters(node) { @@ -350108,7 +352941,7 @@ ${lanes.join("\n")} const lastJSDocParamIndex = jsdocParameters.length - 1; const lastJSDocParam = jsdocParameters[lastJSDocParamIndex]; if (isJs && lastJSDocParam && isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression && lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !excludedParameters.has(lastJSDocParamIndex) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) { - error(lastJSDocParam.name, Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, idText(lastJSDocParam.name)); + error2(lastJSDocParam.name, Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, idText(lastJSDocParam.name)); } } else { forEach(jsdocParameters, ({ name, isNameFirst }, index) => { @@ -350117,7 +352950,7 @@ ${lanes.join("\n")} } if (isQualifiedName(name)) { if (isJs) { - error(name, Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, entityNameToString(name), entityNameToString(name.left)); + error2(name, Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, entityNameToString(name), entityNameToString(name.left)); } } else { if (!isNameFirst) { @@ -350142,11 +352975,11 @@ ${lanes.join("\n")} seenDefault = true; checkTypeParametersNotReferenced(node.default, typeParameterDeclarations, i); } else if (seenDefault) { - error(node, Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); + error2(node, Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); } for (let j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, Diagnostics.Duplicate_identifier_0, declarationNameToString(node.name)); + error2(node.name, Diagnostics.Duplicate_identifier_0, declarationNameToString(node.name)); } } }; @@ -350155,12 +352988,12 @@ ${lanes.join("\n")} function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 182 /* TypeReference */) { + if (node.kind === 183 /* TypeReference */) { const type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (let i = index; i < typeParameters.length; i++) { if (type.symbol === getSymbolOfDeclaration(typeParameters[i])) { - error(node, Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters); + error2(node, Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters); } } } @@ -350183,7 +353016,7 @@ ${lanes.join("\n")} if (!areTypeParametersIdentical(declarations, type.localTypeParameters, getEffectiveTypeParameterDeclarations)) { const name = symbolToString(symbol); for (const declaration of declarations) { - error(declaration.name, Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); + error2(declaration.name, Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name); } } } @@ -350225,7 +353058,7 @@ ${lanes.join("\n")} node ); const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */; - const willTransformInitializers = !useDefineForClassFields || languageVersion < 9 /* ES2022 */; + const willTransformInitializers = !emitStandardClassFields; if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) { for (const member of node.members) { if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated( @@ -350286,7 +353119,7 @@ ${lanes.join("\n")} if (legacyDecorators && firstDecorator && some(node.members, (p) => hasStaticModifier(p) && isPrivateIdentifierClassElementDeclaration(p))) { grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator); } - if (!node.name && !hasSyntacticModifier(node, 1024 /* Default */)) { + if (!node.name && !hasSyntacticModifier(node, 2048 /* Default */)) { grammarErrorOnFirstToken(node, Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); } checkClassLikeDeclaration(node); @@ -350306,7 +353139,7 @@ ${lanes.join("\n")} checkTypeParameterListsIdentical(symbol); checkFunctionOrConstructorSymbol(symbol); checkClassForDuplicateDeclarations(node); - const nodeInAmbientContext = !!(node.flags & 16777216 /* Ambient */); + const nodeInAmbientContext = !!(node.flags & 33554432 /* Ambient */); if (!nodeInAmbientContext) { checkClassForStaticPropertyNameConflicts(node); } @@ -350345,27 +353178,22 @@ ${lanes.join("\n")} )) { issueMemberSpecificError(node, typeWithThis, baseWithThis, Diagnostics.Class_0_incorrectly_extends_base_class_1); } else { - checkTypeAssignableTo( - staticType, - getTypeWithoutSignatures(staticBaseType), - node.name || node, - Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1 - ); + checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); } if (baseConstructorType.flags & 8650752 /* TypeVariable */) { if (!isMixinConstructorType(staticType)) { - error(node.name || node, Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); + error2(node.name || node, Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); } else { const constructSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */); - if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node, 256 /* Abstract */)) { - error(node.name || node, Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract); + if (constructSignatures.some((signature) => signature.flags & 4 /* Abstract */) && !hasSyntacticModifier(node, 64 /* Abstract */)) { + error2(node.name || node, Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract); } } } if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32 /* Class */) && !(baseConstructorType.flags & 8650752 /* TypeVariable */)) { const constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); if (forEach(constructors, (sig) => !isJSConstructor(sig.declaration) && !isTypeIdenticalTo(getReturnTypeOfSignature(sig), baseType))) { - error(baseTypeNode.expression, Diagnostics.Base_constructors_must_all_have_the_same_return_type); + error2(baseTypeNode.expression, Diagnostics.Base_constructors_must_all_have_the_same_return_type); } } checkKindsOfPropertyMemberOverrides(type, baseType); @@ -350377,7 +353205,7 @@ ${lanes.join("\n")} if (implementedTypeNodes) { for (const typeRefNode of implementedTypeNodes) { if (!isEntityNameExpression(typeRefNode.expression) || isOptionalChain(typeRefNode.expression)) { - error(typeRefNode.expression, Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); + error2(typeRefNode.expression, Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); } checkTypeReferenceNode(typeRefNode); addLazyDiagnostic(createImplementsDiagnostics(typeRefNode)); @@ -350410,7 +353238,7 @@ ${lanes.join("\n")} issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag); } } else { - error(typeRefNode, Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); + error2(typeRefNode, Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } }; @@ -350477,7 +353305,7 @@ ${lanes.join("\n")} } function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) { const isJs = isInJSFile(node); - const nodeInAmbientContext = !!(node.flags & 16777216 /* Ambient */); + const nodeInAmbientContext = !!(node.flags & 33554432 /* Ambient */); if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) { const memberEscapedName = escapeLeadingUnderscores(memberName); const thisType = memberIsStatic ? staticType : typeWithThis; @@ -350488,12 +353316,12 @@ ${lanes.join("\n")} if (prop && !baseProp && memberHasOverrideModifier) { if (errorNode) { const suggestion = getSuggestedSymbolForNonexistentClassMember(memberName, baseType); - suggestion ? error( + suggestion ? error2( errorNode, isJs ? Diagnostics.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 : Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1, baseClassName, symbolToString(suggestion) - ) : error( + ) : error2( errorNode, isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 : Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName @@ -350508,12 +353336,12 @@ ${lanes.join("\n")} if (!baseHasAbstract) { if (errorNode) { const diag2 = memberIsParameterProperty ? isJs ? Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 : Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0 : isJs ? Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 : Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0; - error(errorNode, diag2, baseClassName); + error2(errorNode, diag2, baseClassName); } return 1 /* NeedsOverride */; } else if (memberHasAbstractModifier && baseHasAbstract) { if (errorNode) { - error(errorNode, Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0, baseClassName); + error2(errorNode, Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0, baseClassName); } return 1 /* NeedsOverride */; } @@ -350521,7 +353349,7 @@ ${lanes.join("\n")} } else if (memberHasOverrideModifier) { if (errorNode) { const className = typeToString(type); - error( + error2( errorNode, isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class : Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, className @@ -350571,10 +353399,10 @@ ${lanes.join("\n")} const signatures = getSignaturesOfType(type, 1 /* Construct */); if (signatures.length) { const declaration = signatures[0].declaration; - if (declaration && hasEffectiveModifier(declaration, 8 /* Private */)) { + if (declaration && hasEffectiveModifier(declaration, 2 /* Private */)) { const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); if (!isNodeWithinClass(node, typeClassDeclaration)) { - error(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); + error2(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); } } } @@ -350591,7 +353419,7 @@ ${lanes.join("\n")} const baseTypes = baseTypeNode && getBaseTypes(type); const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0; const baseStaticType = getBaseConstructorTypeOfClass(type); - const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */); + const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16 /* Override */); return checkMemberForOverrideModifier( node, staticType, @@ -350611,7 +353439,7 @@ ${lanes.join("\n")} return getCheckFlags(s) & 1 /* Instantiated */ ? s.links.target : s; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { - return filter(symbol.declarations, (d) => d.kind === 262 /* ClassDeclaration */ || d.kind === 263 /* InterfaceDeclaration */); + return filter(symbol.declarations, (d) => d.kind === 263 /* ClassDeclaration */ || d.kind === 264 /* InterfaceDeclaration */); } function checkKindsOfPropertyMemberOverrides(type, baseType) { var _a, _b, _c, _d; @@ -350632,7 +353460,7 @@ ${lanes.join("\n")} Debug.assert(!!derived, "derived should point to something, even if it is the base class' declaration."); if (derived === base) { const derivedClassDecl = getClassLikeDeclarationOfSymbol(type.symbol); - if (baseDeclarationFlags & 256 /* Abstract */ && (!derivedClassDecl || !hasSyntacticModifier(derivedClassDecl, 256 /* Abstract */))) { + if (baseDeclarationFlags & 64 /* Abstract */ && (!derivedClassDecl || !hasSyntacticModifier(derivedClassDecl, 64 /* Abstract */))) { for (const otherBaseType of getBaseTypes(type)) { if (otherBaseType === baseType) continue; @@ -350643,14 +353471,14 @@ ${lanes.join("\n")} } } if (!inheritedAbstractMemberNotImplementedError) { - inheritedAbstractMemberNotImplementedError = error( + inheritedAbstractMemberNotImplementedError = error2( derivedClassDecl, Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1, typeToString(type), typeToString(baseType) ); } - if (derivedClassDecl.kind === 230 /* ClassExpression */) { + if (derivedClassDecl.kind === 231 /* ClassExpression */) { addRelatedInfo( inheritedAbstractMemberNotImplementedError, createDiagnosticForNode( @@ -350675,7 +353503,7 @@ ${lanes.join("\n")} } } else { const derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived); - if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) { + if (baseDeclarationFlags & 2 /* Private */ || derivedDeclarationFlags & 2 /* Private */) { continue; } let errorMessage; @@ -350689,15 +353517,15 @@ ${lanes.join("\n")} const overriddenInstanceAccessor = basePropertyFlags === 4 /* Property */ && derivedPropertyFlags !== 4 /* Property */; if (overriddenInstanceProperty || overriddenInstanceAccessor) { const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor; - error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type)); + error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type)); } else if (useDefineForClassFields) { - const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 171 /* PropertyDeclaration */ && !d.initializer); - if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_d = derived.declarations) == null ? void 0 : _d.some((d) => !!(d.flags & 16777216 /* Ambient */)))) { + const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer); + if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 64 /* Abstract */) && !(derivedDeclarationFlags & 64 /* Abstract */) && !((_d = derived.declarations) == null ? void 0 : _d.some((d) => !!(d.flags & 33554432 /* Ambient */)))) { const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol)); const propName = uninitialized.name; if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) { const errorMessage2 = Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration; - error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType)); + error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType)); } } } @@ -350714,12 +353542,12 @@ ${lanes.join("\n")} } else { errorMessage = Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } - error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); + error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); } } } function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) { - return baseDeclarationFlags & 256 /* Abstract */ && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent); + return baseDeclarationFlags & 64 /* Abstract */ && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent); } function getNonInheritedProperties(type, baseTypes, properties) { if (!length(baseTypes)) { @@ -350779,12 +353607,12 @@ ${lanes.join("\n")} return ok; } function checkPropertyInitialization(node) { - if (!strictNullChecks || !strictPropertyInitialization || node.flags & 16777216 /* Ambient */) { + if (!strictNullChecks || !strictPropertyInitialization || node.flags & 33554432 /* Ambient */) { return; } const constructor = findConstructorDeclaration(node); for (const member of node.members) { - if (getEffectiveModifierFlags(member) & 2 /* Ambient */) { + if (getEffectiveModifierFlags(member) & 128 /* Ambient */) { continue; } if (!isStatic(member) && isPropertyWithoutInitializer(member)) { @@ -350793,7 +353621,7 @@ ${lanes.join("\n")} const type = getTypeOfSymbol(getSymbolOfDeclaration(member)); if (!(type.flags & 3 /* AnyOrUnknown */ || containsUndefinedType(type))) { if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) { - error(member.name, Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, declarationNameToString(propName)); + error2(member.name, Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, declarationNameToString(propName)); } } } @@ -350801,7 +353629,7 @@ ${lanes.join("\n")} } } function isPropertyWithoutInitializer(node) { - return node.kind === 171 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer; + return node.kind === 172 /* PropertyDeclaration */ && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer; } function isPropertyInitializedInStaticBlocks(propName, propType, staticBlocks, startPos, endPos) { for (const staticBlock of staticBlocks) { @@ -350835,7 +353663,7 @@ ${lanes.join("\n")} checkExportsOnMergedDeclarations(node); const symbol = getSymbolOfDeclaration(node); checkTypeParameterListsIdentical(symbol); - const firstInterfaceDecl = getDeclarationOfKind(symbol, 263 /* InterfaceDeclaration */); + const firstInterfaceDecl = getDeclarationOfKind(symbol, 264 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { const type = getDeclaredTypeOfSymbol(symbol); const typeWithThis = getTypeWithThisArgument(type); @@ -350850,7 +353678,7 @@ ${lanes.join("\n")} }); forEach(getInterfaceBaseTypeNodes(node), (heritageElement) => { if (!isEntityNameExpression(heritageElement.expression) || isOptionalChain(heritageElement.expression)) { - error(heritageElement.expression, Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); + error2(heritageElement.expression, Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); } checkTypeReferenceNode(heritageElement); }); @@ -350867,7 +353695,7 @@ ${lanes.join("\n")} checkTypeParameters(node.typeParameters); if (node.type.kind === 141 /* IntrinsicKeyword */) { if (!intrinsicTypeKinds.has(node.name.escapedText) || length(node.typeParameters) !== 1) { - error(node.type, Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); + error2(node.type, Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); } } else { checkSourceElement(node.type); @@ -350888,23 +353716,23 @@ ${lanes.join("\n")} } function computeMemberValue(member, autoValue) { if (isComputedNonLiteralName(member.name)) { - error(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); + error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else { const text = getTextOfPropertyName(member.name); - if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) { - error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); + if (isNumericLiteralName(text)) { + error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); } } if (member.initializer) { return computeConstantValue(member); } - if (member.parent.flags & 16777216 /* Ambient */ && !isEnumConst(member.parent)) { + if (member.parent.flags & 33554432 /* Ambient */ && !isEnumConst(member.parent)) { return void 0; } if (autoValue !== void 0) { return autoValue; } - error(member.name, Diagnostics.Enum_member_must_have_initializer); + error2(member.name, Diagnostics.Enum_member_must_have_initializer); return void 0; } function computeConstantValue(member) { @@ -350913,12 +353741,15 @@ ${lanes.join("\n")} const value = evaluate(initializer, member); if (value !== void 0) { if (isConstEnum && typeof value === "number" && !isFinite(value)) { - error(initializer, isNaN(value) ? Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + error2( + initializer, + isNaN(value) ? Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value + ); } } else if (isConstEnum) { - error(initializer, Diagnostics.const_enum_member_initializers_must_be_constant_expressions); - } else if (member.parent.flags & 16777216 /* Ambient */) { - error(initializer, Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression); + error2(initializer, Diagnostics.const_enum_member_initializers_must_be_constant_expressions); + } else if (member.parent.flags & 33554432 /* Ambient */) { + error2(initializer, Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression); } else { checkTypeAssignableTo(checkExpression(initializer), numberType, initializer, Diagnostics.Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values); } @@ -350926,7 +353757,7 @@ ${lanes.join("\n")} } function evaluate(expr, location) { switch (expr.kind) { - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: const value = evaluate(expr.operand, location); if (typeof value === "number") { switch (expr.operator) { @@ -350939,7 +353770,7 @@ ${lanes.join("\n")} } } break; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: const left = evaluate(expr.left, location); const right = evaluate(expr.right, location); if (typeof left === "number" && typeof right === "number") { @@ -350976,18 +353807,30 @@ ${lanes.join("\n")} case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: return expr.text; - case 227 /* TemplateExpression */: + case 228 /* TemplateExpression */: return evaluateTemplateExpression(expr, location); case 9 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return evaluate(expr.expression, location); - case 80 /* Identifier */: - if (isInfinityOrNaNString(expr.escapedText)) { - return +expr.escapedText; + case 80 /* Identifier */: { + const identifier = expr; + if (isInfinityOrNaNString(identifier.escapedText) && resolveEntityName( + identifier, + 111551 /* Value */, + /*ignoreErrors*/ + true + ) === getGlobalSymbol( + identifier.escapedText, + 111551 /* Value */, + /*diagnostic*/ + void 0 + )) { + return +identifier.escapedText; } - case 210 /* PropertyAccessExpression */: + } + case 211 /* PropertyAccessExpression */: if (isEntityNameExpression(expr)) { const symbol = resolveEntityName( expr, @@ -350997,18 +353840,18 @@ ${lanes.join("\n")} ); if (symbol) { if (symbol.flags & 8 /* EnumMember */) { - return evaluateEnumMember(expr, symbol, location); + return location ? evaluateEnumMember(expr, symbol, location) : getEnumMemberValue(symbol.valueDeclaration); } - if (isConstVariable(symbol)) { + if (isConstantVariable(symbol)) { const declaration = symbol.valueDeclaration; - if (declaration && !declaration.type && declaration.initializer && declaration !== location && isBlockScopedNameDeclaredBeforeUse(declaration, location)) { + if (declaration && isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && (!location || declaration !== location && isBlockScopedNameDeclaredBeforeUse(declaration, location))) { return evaluate(declaration.initializer, declaration); } } } } break; - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: const root = expr.expression; if (isEntityNameExpression(root) && isStringLiteralLike(expr.argumentExpression)) { const rootSymbol = resolveEntityName( @@ -351021,7 +353864,7 @@ ${lanes.join("\n")} const name = escapeLeadingUnderscores(expr.argumentExpression.text); const member = rootSymbol.exports.get(name); if (member) { - return evaluateEnumMember(expr, member, location); + return location ? evaluateEnumMember(expr, member, location) : getEnumMemberValue(member.valueDeclaration); } } } @@ -351032,11 +353875,11 @@ ${lanes.join("\n")} function evaluateEnumMember(expr, symbol, location) { const declaration = symbol.valueDeclaration; if (!declaration || declaration === location) { - error(expr, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(symbol)); + error2(expr, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(symbol)); return void 0; } if (!isBlockScopedNameDeclaredBeforeUse(declaration, location)) { - error(expr, Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums); + error2(expr, Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums); return 0; } return getEnumMemberValue(declaration); @@ -351069,13 +353912,13 @@ ${lanes.join("\n")} const enumIsConst = isEnumConst(node); forEach(enumSymbol.declarations, (decl) => { if (isEnumDeclaration(decl) && isEnumConst(decl) !== enumIsConst) { - error(getNameOfDeclaration(decl), Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + error2(getNameOfDeclaration(decl), Diagnostics.Enum_declarations_must_all_be_const_or_non_const); } }); } let seenEnumMissingInitialInitializer = false; forEach(enumSymbol.declarations, (declaration) => { - if (declaration.kind !== 265 /* EnumDeclaration */) { + if (declaration.kind !== 266 /* EnumDeclaration */) { return false; } const enumDeclaration = declaration; @@ -351085,7 +353928,7 @@ ${lanes.join("\n")} const firstEnumMember = enumDeclaration.members[0]; if (!firstEnumMember.initializer) { if (seenEnumMissingInitialInitializer) { - error(firstEnumMember.name, Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element); + error2(firstEnumMember.name, Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element); } else { seenEnumMissingInitialInitializer = true; } @@ -351095,7 +353938,7 @@ ${lanes.join("\n")} } function checkEnumMember(node) { if (isPrivateIdentifier(node.name)) { - error(node, Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier); + error2(node, Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier); } if (node.initializer) { checkExpression(node.initializer); @@ -351105,7 +353948,7 @@ ${lanes.join("\n")} const declarations = symbol.declarations; if (declarations) { for (const declaration of declarations) { - if ((declaration.kind === 262 /* ClassDeclaration */ || declaration.kind === 261 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216 /* Ambient */)) { + if ((declaration.kind === 263 /* ClassDeclaration */ || declaration.kind === 262 /* FunctionDeclaration */ && nodeIsPresent(declaration.body)) && !(declaration.flags & 33554432 /* Ambient */)) { return declaration; } } @@ -351134,9 +353977,9 @@ ${lanes.join("\n")} function checkModuleDeclarationDiagnostics() { var _a, _b; const isGlobalAugmentation = isGlobalScopeAugmentation(node); - const inAmbientContext = node.flags & 16777216 /* Ambient */; + const inAmbientContext = node.flags & 33554432 /* Ambient */; if (isGlobalAugmentation && !inAmbientContext) { - error(node.name, Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); + error2(node.name, Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); } const isAmbientExternalModule = isAmbientModule(node); const contextErrorMessage = isAmbientExternalModule ? Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file : Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module; @@ -351155,26 +353998,26 @@ ${lanes.join("\n")} const symbol = getSymbolOfDeclaration(node); if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) { - error(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName); + error2(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName); } if (((_a = symbol.declarations) == null ? void 0 : _a.length) > 1) { const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (firstNonAmbientClassOrFunc) { if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + error2(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + error2(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - const mergedClass = getDeclarationOfKind(symbol, 262 /* ClassDeclaration */); + const mergedClass = getDeclarationOfKind(symbol, 263 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; } } - if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 311 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || node.parent.impliedNodeFormat === 1 /* CommonJS */)) { + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 312 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || node.parent.impliedNodeFormat === 1 /* CommonJS */)) { const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 95 /* ExportKeyword */); if (exportModifier) { - error(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + error2(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); } } } @@ -351188,15 +354031,15 @@ ${lanes.join("\n")} } } else if (isGlobalSourceFile(node.parent)) { if (isGlobalAugmentation) { - error(node.name, Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + error2(node.name, Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); } else if (isExternalModuleNameRelative(getTextOfIdentifierOrLiteral(node.name))) { - error(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + error2(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); } } else { if (isGlobalAugmentation) { - error(node.name, Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + error2(node.name, Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); } else { - error(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + error2(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); } } } @@ -351204,21 +354047,21 @@ ${lanes.join("\n")} } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: for (const decl of node.declarationList.declarations) { checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 276 /* ExportAssignment */: - case 277 /* ExportDeclaration */: + case 277 /* ExportAssignment */: + case 278 /* ExportDeclaration */: grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 270 /* ImportEqualsDeclaration */: - case 271 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportDeclaration */: grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 207 /* BindingElement */: - case 259 /* VariableDeclaration */: + case 208 /* BindingElement */: + case 260 /* VariableDeclaration */: const name = node.name; if (isBindingPattern(name)) { for (const el of name.elements) { @@ -351226,12 +354069,12 @@ ${lanes.join("\n")} } break; } - case 262 /* ClassDeclaration */: - case 265 /* EnumDeclaration */: - case 261 /* FunctionDeclaration */: - case 263 /* InterfaceDeclaration */: - case 266 /* ModuleDeclaration */: - case 264 /* TypeAliasDeclaration */: + case 263 /* ClassDeclaration */: + case 266 /* EnumDeclaration */: + case 262 /* FunctionDeclaration */: + case 264 /* InterfaceDeclaration */: + case 267 /* ModuleDeclaration */: + case 265 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -351242,12 +354085,12 @@ ${lanes.join("\n")} switch (node.kind) { case 80 /* Identifier */: return node; - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: do { node = node.left; } while (node.kind !== 80 /* Identifier */); return node; - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: do { if (isModuleExportsAccessExpression(node.expression) && !isPrivateIdentifier(node.name)) { return node.name; @@ -351263,26 +354106,30 @@ ${lanes.join("\n")} return false; } if (!isStringLiteral(moduleName)) { - error(moduleName, Diagnostics.String_literal_expected); + error2(moduleName, Diagnostics.String_literal_expected); return false; } - const inAmbientExternalModule = node.parent.kind === 267 /* ModuleBlock */ && isAmbientModule(node.parent.parent); - if (node.parent.kind !== 311 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 277 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); + const inAmbientExternalModule = node.parent.kind === 268 /* ModuleBlock */ && isAmbientModule(node.parent.parent); + if (node.parent.kind !== 312 /* SourceFile */ && !inAmbientExternalModule) { + error2( + moduleName, + node.kind === 278 /* ExportDeclaration */ ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module + ); return false; } if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) { if (!isTopLevelInExternalModuleAugmentation(node)) { - error(node, Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); + error2(node, Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); return false; } } - if (!isImportEqualsDeclaration(node) && node.assertClause) { + if (!isImportEqualsDeclaration(node) && node.attributes) { + const diagnostic = node.attributes.token === 118 /* WithKeyword */ ? Diagnostics.Import_attribute_values_must_be_string_literal_expressions : Diagnostics.Import_assertion_values_must_be_string_literal_expressions; let hasError = false; - for (const clause of node.assertClause.elements) { - if (!isStringLiteral(clause.value)) { + for (const attr of node.attributes.elements) { + if (!isStringLiteral(attr.value)) { hasError = true; - error(clause.value, Diagnostics.Import_assertion_values_must_be_string_literal_expressions); + error2(attr.value, diagnostic); } } return !hasError; @@ -351297,26 +354144,29 @@ ${lanes.join("\n")} symbol = getMergedSymbol(symbol.exportSymbol || symbol); if (isInJSFile(node) && !(target.flags & 111551 /* Value */) && !isTypeOnlyImportOrExportDeclaration(node)) { const errorNode = isImportOrExportSpecifier(node) ? node.propertyName || node.name : isNamedDeclaration(node) ? node.name : node; - Debug.assert(node.kind !== 279 /* NamespaceExport */); - if (node.kind === 280 /* ExportSpecifier */) { - const diag2 = error(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files); + Debug.assert(node.kind !== 280 /* NamespaceExport */); + if (node.kind === 281 /* ExportSpecifier */) { + const diag2 = error2(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files); const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText); if (alreadyExportedSymbol === target) { const exportingDeclaration = (_c = alreadyExportedSymbol.declarations) == null ? void 0 : _c.find(isJSDocNode); if (exportingDeclaration) { - addRelatedInfo(diag2, createDiagnosticForNode( - exportingDeclaration, - Diagnostics._0_is_automatically_exported_here, - unescapeLeadingUnderscores(alreadyExportedSymbol.escapedName) - )); + addRelatedInfo( + diag2, + createDiagnosticForNode( + exportingDeclaration, + Diagnostics._0_is_automatically_exported_here, + unescapeLeadingUnderscores(alreadyExportedSymbol.escapedName) + ) + ); } } } else { - Debug.assert(node.kind !== 259 /* VariableDeclaration */); + Debug.assert(node.kind !== 260 /* VariableDeclaration */); const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration)); const moduleSpecifier = (importDeclaration && ((_d = tryGetModuleSpecifierFromDeclaration(importDeclaration)) == null ? void 0 : _d.text)) ?? "..."; const importedIdentifier = unescapeLeadingUnderscores(isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName); - error( + error2( errorNode, Diagnostics._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation, importedIdentifier, @@ -351325,47 +354175,57 @@ ${lanes.join("\n")} } return; } - const targetFlags = getAllSymbolFlags(target); + const targetFlags = getSymbolFlags(target); const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (targetFlags & excludedMeanings) { - const message = node.kind === 280 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; - error(node, message, symbolToString(symbol)); + 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 & 16777216 /* Ambient */)) { + if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) { const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol); const isType = !(targetFlags & 111551 /* Value */); if (isType || typeOnlyAlias) { switch (node.kind) { - case 272 /* ImportClause */: - case 275 /* ImportSpecifier */: - case 270 /* ImportEqualsDeclaration */: { + case 273 /* ImportClause */: + case 276 /* ImportSpecifier */: + case 271 /* ImportEqualsDeclaration */: { if (compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) { Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name"); const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? compilerOptions.verbatimModuleSyntax ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : compilerOptions.verbatimModuleSyntax ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; - const name = idText(node.kind === 275 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); + const name = idText(node.kind === 276 /* ImportSpecifier */ ? node.propertyName || node.name : node.name); addTypeOnlyDeclarationRelatedInfo( - error(node, message, name), + error2(node, message, name), isType ? void 0 : typeOnlyAlias, name ); } - if (isType && node.kind === 270 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 1 /* Export */)) { - error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName); + if (isType && node.kind === 271 /* ImportEqualsDeclaration */ && hasEffectiveModifier(node, 32 /* Export */)) { + error2(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName); } break; } - case 280 /* ExportSpecifier */: { + case 281 /* ExportSpecifier */: { if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { const name = idText(node.propertyName || node.name); - const diagnostic = isType ? error(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName); + const diagnostic = isType ? error2(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error2(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName); addTypeOnlyDeclarationRelatedInfo(diagnostic, isType ? void 0 : typeOnlyAlias, name); break; } } } } - if (compilerOptions.verbatimModuleSyntax && node.kind !== 270 /* ImportEqualsDeclaration */ && !isInJSFile(node) && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { - error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + if (compilerOptions.verbatimModuleSyntax && node.kind !== 271 /* ImportEqualsDeclaration */ && !isInJSFile(node) && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); } } if (isImportSpecifier(node)) { @@ -351407,39 +354267,43 @@ ${lanes.join("\n")} function checkImportBinding(node) { checkCollisionsForDeclarationName(node, node.name); checkAliasSymbol(node); - if (node.kind === 275 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + if (node.kind === 276 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { checkExternalEmitHelpers(node, 131072 /* ImportDefault */); } } - function checkAssertClause(declaration) { + function checkImportAttributes(declaration) { var _a; - if (declaration.assertClause) { - const validForTypeAssertions = isExclusivelyTypeOnlyImportOrExport(declaration); - const override = getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : void 0); - if (validForTypeAssertions && override) { - if (!isNightly()) { - grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next); - } - if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) { - return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext); - } + 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 */; + if (validForTypeAttributes && override) { return; } const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier); - if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) { - return grammarErrorOnNode( - declaration.assertClause, - moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_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) { - return grammarErrorOnNode(declaration.assertClause, Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports); + return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports); } if (override) { - return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports); + return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports); } } } + 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; @@ -351454,7 +354318,7 @@ ${lanes.join("\n")} checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 273 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 274 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); if (moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && getESModuleInterop(compilerOptions)) { checkExternalEmitHelpers(node, 65536 /* ImportStar */); @@ -351468,7 +354332,7 @@ ${lanes.join("\n")} } } } - checkAssertClause(node); + checkImportAttributes(node); } function checkImportEqualsDeclaration(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)) { @@ -351477,17 +354341,17 @@ ${lanes.join("\n")} checkGrammarModifiers(node); if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); - if (hasSyntacticModifier(node, 1 /* Export */)) { + if (hasSyntacticModifier(node, 32 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 282 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) { const target = resolveAlias(getSymbolOfDeclaration(node)); if (target !== unknownSymbol) { - const targetFlags = getAllSymbolFlags(target); + const targetFlags = getSymbolFlags(target); if (targetFlags & 111551 /* Value */) { const moduleName = getFirstIdentifier(node.moduleReference); if (!(resolveEntityName(moduleName, 111551 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) { - error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName)); + error2(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName)); } } if (targetFlags & 788968 /* Type */) { @@ -351498,7 +354362,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 & 16777216 /* 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); } } @@ -351518,15 +354382,15 @@ ${lanes.join("\n")} if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause && !isNamespaceExport(node.exportClause)) { forEach(node.exportClause.elements, checkExportSpecifier); - const inAmbientExternalModule = node.parent.kind === 267 /* ModuleBlock */ && isAmbientModule(node.parent.parent); - const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 267 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 16777216 /* Ambient */; - if (node.parent.kind !== 311 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { - error(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); + const inAmbientExternalModule = node.parent.kind === 268 /* ModuleBlock */ && isAmbientModule(node.parent.parent); + const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 268 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 33554432 /* Ambient */; + if (node.parent.kind !== 312 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + error2(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } else { const moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol && hasExportAssignmentSymbol(moduleSymbol)) { - error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); + error2(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); } else if (node.exportClause) { checkAliasSymbol(node.exportClause); } @@ -351541,17 +354405,17 @@ ${lanes.join("\n")} } } } - checkAssertClause(node); + checkImportAttributes(node); } function checkGrammarExportDeclaration(node) { var _a; - if (node.isTypeOnly && ((_a = node.exportClause) == null ? void 0 : _a.kind) === 278 /* NamedExports */) { + if (node.isTypeOnly && ((_a = node.exportClause) == null ? void 0 : _a.kind) === 279 /* NamedExports */) { return checkGrammarNamedImportsOrExports(node.exportClause); } return false; } function checkGrammarModuleElementContext(node, errorMessage) { - const isInAppropriateContext = node.parent.kind === 311 /* SourceFile */ || node.parent.kind === 267 /* ModuleBlock */ || node.parent.kind === 266 /* ModuleDeclaration */; + const isInAppropriateContext = node.parent.kind === 312 /* SourceFile */ || node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 267 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -351587,7 +354451,7 @@ ${lanes.join("\n")} } for (const statement of sourceFile.statements) { if (canConvertImportDeclarationToTypeOnly(statement) || canConvertImportEqualsDeclarationToTypeOnly(statement)) { - error( + error2( statement, Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error ); @@ -351617,13 +354481,13 @@ ${lanes.join("\n")} true ); if (symbol && (symbol === undefinedSymbol || symbol === globalThisSymbol || symbol.declarations && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) { - error(exportedName, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, idText(exportedName)); + error2(exportedName, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, idText(exportedName)); } else { if (!node.isTypeOnly && !node.parent.parent.isTypeOnly) { markExportAsReferenced(node); } const target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol); - if (!target || getAllSymbolFlags(target) & 111551 /* Value */) { + if (!target || getSymbolFlags(target) & 111551 /* Value */) { checkExpressionCached(node.propertyName || node.name); } } @@ -351638,12 +354502,12 @@ ${lanes.join("\n")} if (checkGrammarModuleElementContext(node, illegalContextMessage)) { return; } - const container = node.parent.kind === 311 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 266 /* ModuleDeclaration */ && !isAmbientModule(container)) { + const container = node.parent.kind === 312 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) { if (node.isExportEquals) { - error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + error2(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } else { - error(node, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + error2(node, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } return; } @@ -351654,12 +354518,12 @@ ${lanes.join("\n")} if (typeAnnotationNode) { checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); } - const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); + const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */); if (node.expression.kind === 80 /* Identifier */) { const id = node.expression; const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName( id, - 67108863 /* All */, + -1 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ @@ -351667,23 +354531,52 @@ ${lanes.join("\n")} node )); if (sym) { + const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(sym, 111551 /* Value */); markAliasReferenced(sym, id); - if (getAllSymbolFlags(sym) & 111551 /* Value */) { + if (getSymbolFlags(sym) & 111551 /* Value */) { checkExpressionCached(id); - if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) { - error( + 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, idText(id) ); } - } else if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax) { - error( + } else if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax) { + error2( id, node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, 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); } @@ -351698,16 +354591,16 @@ ${lanes.join("\n")} checkExpressionCached(node.expression); } if (isIllegalExportDefaultInCJS) { - error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); } checkExternalModuleExports(container); - if (node.flags & 16777216 /* Ambient */ && !isEntityNameExpression(node.expression)) { + if (node.flags & 33554432 /* Ambient */ && !isEntityNameExpression(node.expression)) { 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 & 16777216 /* Ambient */ && getSourceFileOfNode(node).impliedNodeFormat === 99 /* ESNext */ || !(node.flags & 16777216 /* 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 & 16777216 /* Ambient */)) { + } else if (moduleKind === 4 /* System */ && !(node.flags & 33554432 /* Ambient */)) { grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); } } @@ -351723,7 +354616,7 @@ ${lanes.join("\n")} if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { const declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; if (declaration && !isTopLevelInExternalModuleAugmentation(declaration) && !isInJSFile(declaration)) { - error(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + error2(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } } const exports = getExportsOfModule(moduleSymbol); @@ -351780,182 +354673,184 @@ ${lanes.join("\n")} const kind = node.kind; if (cancellationToken) { switch (kind) { - case 266 /* ModuleDeclaration */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 261 /* FunctionDeclaration */: + case 267 /* ModuleDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 262 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 242 /* FirstStatement */ && kind <= 258 /* LastStatement */ && canHaveFlowNode(node) && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 243 /* FirstStatement */ && kind <= 259 /* LastStatement */ && canHaveFlowNode(node) && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected); } switch (kind) { - case 167 /* TypeParameter */: + case 168 /* TypeParameter */: return checkTypeParameter(node); - case 168 /* Parameter */: + case 169 /* Parameter */: return checkParameter(node); - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 170 /* PropertySignature */: + case 171 /* PropertySignature */: return checkPropertySignature(node); - case 184 /* ConstructorType */: - case 183 /* FunctionType */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 180 /* IndexSignature */: + case 185 /* ConstructorType */: + case 184 /* FunctionType */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 181 /* IndexSignature */: return checkSignatureDeclaration(node); - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: return checkMethodDeclaration(node); - case 174 /* ClassStaticBlockDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: return checkClassStaticBlockDeclaration(node); - case 175 /* Constructor */: + case 176 /* Constructor */: return checkConstructorDeclaration(node); - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return checkAccessorDeclaration(node); - case 182 /* TypeReference */: + case 183 /* TypeReference */: return checkTypeReferenceNode(node); - case 181 /* TypePredicate */: + case 182 /* TypePredicate */: return checkTypePredicate(node); - case 185 /* TypeQuery */: + case 186 /* TypeQuery */: return checkTypeQuery(node); - case 186 /* TypeLiteral */: + case 187 /* TypeLiteral */: return checkTypeLiteral(node); - case 187 /* ArrayType */: + case 188 /* ArrayType */: return checkArrayType(node); - case 188 /* TupleType */: + case 189 /* TupleType */: return checkTupleType(node); - case 191 /* UnionType */: - case 192 /* IntersectionType */: + case 192 /* UnionType */: + case 193 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 195 /* ParenthesizedType */: - case 189 /* OptionalType */: - case 190 /* RestType */: + case 196 /* ParenthesizedType */: + case 190 /* OptionalType */: + case 191 /* RestType */: return checkSourceElement(node.type); - case 196 /* ThisType */: + case 197 /* ThisType */: return checkThisType(node); - case 197 /* TypeOperator */: + case 198 /* TypeOperator */: return checkTypeOperator(node); - case 193 /* ConditionalType */: + case 194 /* ConditionalType */: return checkConditionalType(node); - case 194 /* InferType */: + case 195 /* InferType */: return checkInferType(node); - case 202 /* TemplateLiteralType */: + case 203 /* TemplateLiteralType */: return checkTemplateLiteralType(node); - case 204 /* ImportType */: + case 205 /* ImportType */: return checkImportType(node); - case 201 /* NamedTupleMember */: + case 202 /* NamedTupleMember */: return checkNamedTupleMember(node); - case 334 /* JSDocAugmentsTag */: + case 335 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 335 /* JSDocImplementsTag */: + case 336 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 352 /* JSDocTypedefTag */: - case 344 /* JSDocCallbackTag */: - case 346 /* JSDocEnumTag */: + case 353 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: + case 347 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 351 /* JSDocTemplateTag */: + case 352 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 350 /* JSDocTypeTag */: + case 351 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 330 /* JSDocLink */: - case 331 /* JSDocLinkCode */: - case 332 /* JSDocLinkPlain */: + case 331 /* JSDocLink */: + case 332 /* JSDocLinkCode */: + case 333 /* JSDocLinkPlain */: return checkJSDocLinkLikeTag(node); - case 347 /* JSDocParameterTag */: + case 348 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 354 /* JSDocPropertyTag */: + case 355 /* JSDocPropertyTag */: return checkJSDocPropertyTag(node); - case 323 /* JSDocFunctionType */: + case 324 /* JSDocFunctionType */: checkJSDocFunctionType(node); - case 321 /* JSDocNonNullableType */: - case 320 /* JSDocNullableType */: - case 318 /* JSDocAllType */: - case 319 /* JSDocUnknownType */: - case 328 /* JSDocTypeLiteral */: + case 322 /* JSDocNonNullableType */: + case 321 /* JSDocNullableType */: + case 319 /* JSDocAllType */: + case 320 /* JSDocUnknownType */: + case 329 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); forEachChild(node, checkSourceElement); return; - case 324 /* JSDocVariadicType */: + case 325 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 315 /* JSDocTypeExpression */: + case 316 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 339 /* JSDocPublicTag */: - case 341 /* JSDocProtectedTag */: - case 340 /* JSDocPrivateTag */: + case 340 /* JSDocPublicTag */: + case 342 /* JSDocProtectedTag */: + case 341 /* JSDocPrivateTag */: return checkJSDocAccessibilityModifiers(node); - case 356 /* JSDocSatisfiesTag */: + case 357 /* JSDocSatisfiesTag */: return checkJSDocSatisfiesTag(node); - case 198 /* IndexedAccessType */: + case 350 /* JSDocThisTag */: + return checkJSDocThisTag(node); + case 199 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 199 /* MappedType */: + case 200 /* MappedType */: return checkMappedType(node); - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 240 /* Block */: - case 267 /* ModuleBlock */: + case 241 /* Block */: + case 268 /* ModuleBlock */: return checkBlock(node); - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return checkVariableStatement(node); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return checkExpressionStatement(node); - case 244 /* IfStatement */: + case 245 /* IfStatement */: return checkIfStatement(node); - case 245 /* DoStatement */: + case 246 /* DoStatement */: return checkDoStatement(node); - case 246 /* WhileStatement */: + case 247 /* WhileStatement */: return checkWhileStatement(node); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return checkForStatement(node); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return checkForInStatement(node); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return checkForOfStatement(node); - case 250 /* ContinueStatement */: - case 251 /* BreakStatement */: + case 251 /* ContinueStatement */: + case 252 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 252 /* ReturnStatement */: + case 253 /* ReturnStatement */: return checkReturnStatement(node); - case 253 /* WithStatement */: + case 254 /* WithStatement */: return checkWithStatement(node); - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: return checkSwitchStatement(node); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return checkLabeledStatement(node); - case 256 /* ThrowStatement */: + case 257 /* ThrowStatement */: return checkThrowStatement(node); - case 257 /* TryStatement */: + case 258 /* TryStatement */: return checkTryStatement(node); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 207 /* BindingElement */: + case 208 /* BindingElement */: return checkBindingElement(node); - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return checkClassDeclaration(node); - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 264 /* TypeAliasDeclaration */: + case 265 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return checkImportDeclaration(node); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: return checkExportDeclaration(node); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return checkExportAssignment(node); - case 241 /* EmptyStatement */: - case 258 /* DebuggerStatement */: + case 242 /* EmptyStatement */: + case 259 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 281 /* MissingDeclaration */: + case 282 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -351975,9 +354870,14 @@ ${lanes.join("\n")} const diagnostic = node.postfix ? Diagnostics._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1 : Diagnostics._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1; const typeNode = node.type; const type = getTypeFromTypeNode(typeNode); - grammarErrorOnNode(node, diagnostic, token, typeToString( - isJSDocNullableType(node) && !(type === neverType || type === voidType) ? getUnionType(append([type, undefinedType], node.postfix ? void 0 : nullType)) : type - )); + grammarErrorOnNode( + node, + diagnostic, + token, + typeToString( + isJSDocNullableType(node) && !(type === neverType || type === voidType) ? getUnionType(append([type, undefinedType], node.postfix ? void 0 : nullType)) : type + ) + ); } else { grammarErrorOnNode(node, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } @@ -351989,16 +354889,16 @@ ${lanes.join("\n")} const { parent: parent2 } = node; if (isParameter(parent2) && isJSDocFunctionType(parent2.parent)) { if (last(parent2.parent.parameters) !== parent2) { - error(node, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + error2(node, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); } return; } if (!isJSDocTypeExpression(parent2)) { - error(node, Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); + error2(node, Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); } const paramTag = node.parent.parent; if (!isJSDocParameterTag(paramTag)) { - error(node, Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); + error2(node, Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); return; } const param = getParameterSymbolFromJSDoc(paramTag); @@ -352007,7 +354907,7 @@ ${lanes.join("\n")} } const host2 = getHostSignatureFromJSDoc(paramTag); if (!host2 || last(host2.parameters).symbol !== param) { - error(node, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + error2(node, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); } } function getTypeFromJSDocVariadicType(node) { @@ -352054,39 +354954,48 @@ ${lanes.join("\n")} currentNode = node; instantiationCount = 0; switch (node.kind) { - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 214 /* TaggedTemplateExpression */: - case 169 /* Decorator */: - case 285 /* JsxOpeningElement */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 215 /* TaggedTemplateExpression */: + case 170 /* Decorator */: + case 286 /* JsxOpeningElement */: resolveUntypedCall(node); break; - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 167 /* TypeParameter */: + case 168 /* TypeParameter */: checkTypeParameterDeferred(node); break; - case 284 /* JsxSelfClosingElement */: + case 285 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 283 /* JsxElement */: + case 284 /* JsxElement */: checkJsxElementDeferred(node); break; - case 215 /* TypeAssertionExpression */: - case 233 /* AsExpression */: - case 216 /* ParenthesizedExpression */: + case 216 /* TypeAssertionExpression */: + case 234 /* AsExpression */: + case 217 /* ParenthesizedExpression */: checkAssertionDeferred(node); + break; + case 222 /* VoidExpression */: + checkExpression(node.expression); + break; + case 226 /* BinaryExpression */: + if (isInstanceOfExpression(node)) { + resolveUntypedCall(node); + } + break; } currentNode = saveCurrentNode; (_b = tracing) == null ? void 0 : _b.pop(); @@ -352143,7 +355052,7 @@ ${lanes.join("\n")} addLazyDiagnostic(() => { if (!node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters)) { checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), (containingNode, kind, diag2) => { - if (!containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 16777216 /* Ambient */))) { + if (!containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 33554432 /* Ambient */))) { diagnostics.add(diag2); } }); @@ -352222,7 +355131,7 @@ ${lanes.join("\n")} return diagnostics.getGlobalDiagnostics(); } function getSymbolsInScope(location, meaning) { - if (location.flags & 33554432 /* InWithStatement */) { + if (location.flags & 67108864 /* InWithStatement */) { return []; } const symbols = createSymbolTable(); @@ -352236,27 +355145,27 @@ ${lanes.join("\n")} copySymbols(location.locals, meaning); } switch (location.kind) { - case 311 /* SourceFile */: + case 312 /* SourceFile */: if (!isExternalModule(location)) break; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: copyLocallyVisibleExportSymbols(getSymbolOfDeclaration(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: copySymbols(getSymbolOfDeclaration(location).exports, meaning & 8 /* EnumMember */); break; - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: const className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: if (!isStaticSymbol) { copySymbols(getMembersOfSymbol(getSymbolOfDeclaration(location)), meaning & 788968 /* Type */); } break; - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: const funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -352289,7 +355198,7 @@ ${lanes.join("\n")} function copyLocallyVisibleExportSymbols(source, meaning2) { if (meaning2) { source.forEach((symbol) => { - if (!getDeclarationOfKind(symbol, 280 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 279 /* NamespaceExport */)) { + if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) { copySymbol(symbol, meaning2); } }); @@ -352300,16 +355209,16 @@ ${lanes.join("\n")} return name.kind === 80 /* Identifier */ && isTypeDeclaration(name.parent) && getNameOfDeclaration(name.parent) === name; } function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 165 /* QualifiedName */) { + while (node.parent.kind === 166 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 182 /* TypeReference */; + return node.parent.kind === 183 /* TypeReference */; } function isInNameOfExpressionWithTypeArguments(node) { - while (node.parent.kind === 210 /* PropertyAccessExpression */) { + while (node.parent.kind === 211 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 232 /* ExpressionWithTypeArguments */; + return node.parent.kind === 233 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { let result; @@ -352335,13 +355244,13 @@ ${lanes.join("\n")} return !!forEachEnclosingClass(node, (n) => n === classDeclaration); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 165 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 166 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 270 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 271 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0; } - if (nodeOnRightSide.parent.kind === 276 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 277 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0; } return void 0; @@ -352355,9 +355264,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); } } @@ -352367,7 +355279,7 @@ ${lanes.join("\n")} node = parent2; parent2 = parent2.parent; } - if (parent2 && parent2.kind === 204 /* ImportType */ && parent2.qualifier === node) { + if (parent2 && parent2.kind === 205 /* ImportType */ && parent2.qualifier === node) { return parent2; } return void 0; @@ -352389,7 +355301,7 @@ ${lanes.join("\n")} /*contextFlags*/ void 0 ); - const type = contextualType && getThisTypeFromContextualType(contextualType); + const type = getThisTypeOfObjectLiteralFromContextualType(containingLiteral, contextualType); return type && !isTypeAny(type); } } @@ -352399,7 +355311,7 @@ ${lanes.join("\n")} if (isDeclarationName(name)) { return getSymbolOfNode(name.parent); } - if (isInJSFile(name) && name.parent.kind === 210 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { + if (isInJSFile(name) && name.parent.kind === 211 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { if (!isPrivateIdentifier(name) && !isJSDocMemberName(name) && !isThisPropertyAndThisTyped(name.parent)) { const specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name); if (specialPropertyAssignmentSymbol) { @@ -352407,7 +355319,7 @@ ${lanes.join("\n")} } } } - if (name.parent.kind === 276 /* ExportAssignment */ && isEntityNameExpression(name)) { + if (name.parent.kind === 277 /* ExportAssignment */ && isEntityNameExpression(name)) { const success = resolveEntityName( name, /*all meanings*/ @@ -352419,7 +355331,7 @@ ${lanes.join("\n")} return success; } } else if (isEntityName(name) && isInRightSideOfImportOrExportAssignment(name)) { - const importEqualsDeclaration = getAncestor(name, 270 /* ImportEqualsDeclaration */); + const importEqualsDeclaration = getAncestor(name, 271 /* ImportEqualsDeclaration */); Debug.assert(importEqualsDeclaration !== void 0); return getSymbolOfPartOfRightHandSideOfImportEquals( name, @@ -352440,7 +355352,7 @@ ${lanes.join("\n")} } if (isInNameOfExpressionWithTypeArguments(name)) { let meaning = 0 /* None */; - if (name.parent.kind === 232 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 233 /* ExpressionWithTypeArguments */) { meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */; if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551 /* Value */; @@ -352459,10 +355371,10 @@ ${lanes.join("\n")} return entityNameSymbol; } } - if (name.parent.kind === 347 /* JSDocParameterTag */) { + if (name.parent.kind === 348 /* JSDocParameterTag */) { return getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 167 /* TypeParameter */ && name.parent.parent.kind === 351 /* JSDocTemplateTag */) { + if (name.parent.kind === 168 /* TypeParameter */ && name.parent.parent.kind === 352 /* JSDocTemplateTag */) { Debug.assert(!isInJSFile(name)); const typeParameter = getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -352515,39 +355427,15 @@ ${lanes.join("\n")} return result; } else if (isPrivateIdentifier(name)) { return getSymbolForPrivateIdentifierExpression(name); - } else if (name.kind === 210 /* PropertyAccessExpression */ || name.kind === 165 /* QualifiedName */) { + } else if (name.kind === 211 /* PropertyAccessExpression */ || name.kind === 166 /* QualifiedName */) { const links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 210 /* PropertyAccessExpression */) { + if (name.kind === 211 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name, 0 /* Normal */); if (!links.resolvedSymbol) { - const expressionType = checkExpressionCached(name.expression); - const infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name.name)); - if (infos.length && expressionType.members) { - const resolved = resolveStructuredTypeMembers(expressionType); - const symbol = resolved.members.get("__index" /* Index */); - if (infos === getIndexInfosOfType(expressionType)) { - links.resolvedSymbol = symbol; - } else if (symbol) { - const symbolLinks2 = getSymbolLinks(symbol); - const declarationList = mapDefined(infos, (i) => i.declaration); - const nodeListId = map(declarationList, getNodeId).join(","); - if (!symbolLinks2.filteredIndexSymbolCache) { - symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map(); - } - if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) { - links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId); - } else { - const copy = createSymbol(131072 /* Signature */, "__index" /* Index */); - copy.declarations = mapDefined(infos, (i) => i.declaration); - copy.parent = expressionType.aliasSymbol ? expressionType.aliasSymbol : expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy.declarations[0].parent); - symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy); - links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId); - } - } - } + links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name)); } } else { checkQualifiedName(name, 0 /* Normal */); @@ -352560,7 +355448,7 @@ ${lanes.join("\n")} return resolveJSDocMemberName(name); } } else if (isTypeReferenceIdentifier(name)) { - const meaning = name.parent.kind === 182 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + const meaning = name.parent.kind === 183 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; const symbol = resolveEntityName( name, meaning, @@ -352571,7 +355459,7 @@ ${lanes.join("\n")} ); return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name); } - if (name.parent.kind === 181 /* TypePredicate */) { + if (name.parent.kind === 182 /* TypePredicate */) { return resolveEntityName( name, /*meaning*/ @@ -352580,6 +355468,31 @@ ${lanes.join("\n")} } return void 0; } + function getApplicableIndexSymbol(type, keyType) { + const infos = getApplicableIndexInfos(type, keyType); + if (infos.length && type.members) { + const symbol = getIndexSymbolFromSymbolTable(resolveStructuredTypeMembers(type).members); + if (infos === getIndexInfosOfType(type)) { + return symbol; + } else if (symbol) { + const symbolLinks2 = getSymbolLinks(symbol); + const declarationList = mapDefined(infos, (i) => i.declaration); + const nodeListId = map(declarationList, getNodeId).join(","); + if (!symbolLinks2.filteredIndexSymbolCache) { + symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map(); + } + if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) { + return symbolLinks2.filteredIndexSymbolCache.get(nodeListId); + } else { + const copy = createSymbol(131072 /* Signature */, "__index" /* Index */); + copy.declarations = mapDefined(infos, (i) => i.declaration); + copy.parent = type.aliasSymbol ? type.aliasSymbol : type.symbol ? type.symbol : getSymbolAtLocation(copy.declarations[0].parent); + symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy); + return copy; + } + } + } + } function resolveJSDocMemberName(name, ignoreErrors, container) { if (isEntityName(name)) { const meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */; @@ -352612,7 +355525,7 @@ ${lanes.join("\n")} } const { parent: parent2 } = node; const grandParent = parent2.parent; - if (node.flags & 33554432 /* InWithStatement */) { + if (node.flags & 67108864 /* InWithStatement */) { return void 0; } if (isDeclarationNameOrImportPropertyName(node)) { @@ -352624,7 +355537,7 @@ ${lanes.join("\n")} if (node.kind === 80 /* Identifier */) { if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); - } else if (parent2.kind === 207 /* BindingElement */ && grandParent.kind === 205 /* ObjectBindingPattern */ && node === parent2.propertyName) { + } else if (parent2.kind === 208 /* BindingElement */ && grandParent.kind === 206 /* ObjectBindingPattern */ && node === parent2.propertyName) { const typeOfPattern = getTypeOfNode(grandParent); const propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); if (propertyDeclaration) { @@ -352643,8 +355556,8 @@ ${lanes.join("\n")} switch (node.kind) { case 80 /* Identifier */: case 81 /* PrivateIdentifier */: - case 210 /* PropertyAccessExpression */: - case 165 /* QualifiedName */: + case 211 /* PropertyAccessExpression */: + case 166 /* QualifiedName */: if (!isThisInTypeQuery(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } @@ -352665,19 +355578,19 @@ ${lanes.join("\n")} if (isInExpressionContext(node)) { return checkExpression(node).symbol; } - case 196 /* ThisType */: + case 197 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 108 /* SuperKeyword */: return checkExpression(node).symbol; case 137 /* ConstructorKeyword */: const constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 175 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 176 /* Constructor */) { return constructorDeclaration.parent.symbol; } return void 0; case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 271 /* ImportDeclaration */ || node.parent.kind === 277 /* 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 @@ -352695,16 +355608,23 @@ ${lanes.join("\n")} case 39 /* EqualsGreaterThanToken */: case 86 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 204 /* ImportType */: + case 205 /* ImportType */: return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : void 0; case 95 /* ExportKeyword */: return isExportAssignment(node.parent) ? Debug.checkDefined(node.parent.symbol) : void 0; case 102 /* ImportKeyword */: case 105 /* NewKeyword */: return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0; - case 235 /* MetaProperty */: + case 104 /* InstanceOfKeyword */: + if (isBinaryExpression(node.parent)) { + const type = getTypeOfExpression(node.parent.right); + const hasInstanceMethodType = getSymbolHasInstanceMethodOfObjectType(type); + return (hasInstanceMethodType == null ? void 0 : hasInstanceMethodType.symbol) ?? type.symbol; + } + return void 0; + case 236 /* MetaProperty */: return checkExpression(node).symbol; - case 294 /* JsxNamespacedName */: + case 295 /* JsxNamespacedName */: if (isJSXTagName(node) && isJsxIntrinsicTagName(node)) { const symbol = getIntrinsicTagSymbol(node.parent); return symbol === unknownSymbol ? void 0 : symbol; @@ -352723,7 +355643,7 @@ ${lanes.join("\n")} return void 0; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 303 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 304 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return void 0; @@ -352739,7 +355659,7 @@ ${lanes.join("\n")} if (isSourceFile(node) && !isExternalModule(node)) { return errorType; } - if (node.flags & 33554432 /* InWithStatement */) { + if (node.flags & 67108864 /* InWithStatement */) { return errorType; } const classDecl = tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node); @@ -352800,19 +355720,25 @@ ${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) { - Debug.assert(expr.kind === 209 /* ObjectLiteralExpression */ || expr.kind === 208 /* ArrayLiteralExpression */); - if (expr.parent.kind === 249 /* ForOfStatement */) { + Debug.assert(expr.kind === 210 /* ObjectLiteralExpression */ || expr.kind === 209 /* ArrayLiteralExpression */); + if (expr.parent.kind === 250 /* ForOfStatement */) { const iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 225 /* BinaryExpression */) { + if (expr.parent.kind === 226 /* BinaryExpression */) { const iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 302 /* PropertyAssignment */) { + if (expr.parent.kind === 303 /* PropertyAssignment */) { const node2 = cast(expr.parent.parent, isObjectLiteralExpression); const typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node2) || errorType; const propertyIndex = indexOfNode(node2.properties, expr.parent); @@ -352845,7 +355771,7 @@ ${lanes.join("\n")} case 9 /* NumericLiteral */: case 11 /* StringLiteral */: return getStringLiteralType(name.text); - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: const nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -352915,7 +355841,7 @@ ${lanes.join("\n")} return symbolLinks2.exportsSomeValue; function isValue(s) { s = resolveSymbol(s); - return s && !!(getAllSymbolFlags(s) & 111551 /* Value */); + return s && !!(getSymbolFlags(s) & 111551 /* Value */); } } function isNameOfModuleOrEnumDeclaration(node) { @@ -352940,7 +355866,7 @@ ${lanes.join("\n")} } const parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && ((_a = parentSymbol.valueDeclaration) == null ? void 0 : _a.kind) === 311 /* SourceFile */) { + if (parentSymbol.flags & 512 /* ValueModule */ && ((_a = parentSymbol.valueDeclaration) == null ? void 0 : _a.kind) === 312 /* SourceFile */) { const symbolFile = parentSymbol.valueDeclaration; const referenceFile = getSourceFileOfNode(node); const symbolIsUmdExport = symbolFile !== referenceFile; @@ -352970,7 +355896,7 @@ ${lanes.join("\n")} return void 0; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { - return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 298 /* CatchClause */; + return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 299 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && symbol.valueDeclaration && !isSourceFile(symbol.valueDeclaration)) { @@ -352998,7 +355924,7 @@ ${lanes.join("\n")} /*lookInLabeledStatements*/ false ); - const inLoopBodyBlock = container.kind === 240 /* Block */ && isIterationStatement( + const inLoopBodyBlock = container.kind === 241 /* Block */ && isIterationStatement( container.parent, /*lookInLabeledStatements*/ false @@ -353038,39 +355964,52 @@ ${lanes.join("\n")} function isValueAliasDeclaration(node) { Debug.assert(canCollectSymbolAliasAccessabilityData); switch (node.kind) { - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfDeclaration(node)); - case 272 /* ImportClause */: - case 273 /* NamespaceImport */: - case 275 /* ImportSpecifier */: - case 280 /* ExportSpecifier */: + case 273 /* ImportClause */: + case 274 /* NamespaceImport */: + case 276 /* ImportSpecifier */: + case 281 /* ExportSpecifier */: const symbol = getSymbolOfDeclaration(node); - return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */); - case 277 /* ExportDeclaration */: + return !!symbol && isAliasResolvedToValue( + symbol, + /*excludeTypeOnlyValues*/ + true + ); + case 278 /* ExportDeclaration */: const exportClause = node.exportClause; return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration)); - case 276 /* ExportAssignment */: - return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfDeclaration(node)) : true; + case 277 /* ExportAssignment */: + return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue( + getSymbolOfDeclaration(node), + /*excludeTypeOnlyValues*/ + true + ) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { const node = getParseTreeNode(nodeIn, isImportEqualsDeclaration); - if (node === void 0 || node.parent.kind !== 311 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) { + if (node === void 0 || node.parent.kind !== 312 /* SourceFile */ || !isInternalModuleImportEqualsDeclaration(node)) { return false; } const isValue = isAliasResolvedToValue(getSymbolOfDeclaration(node)); return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference); } - function isAliasResolvedToValue(symbol) { + function isAliasResolvedToValue(symbol, excludeTypeOnlyValues) { if (!symbol) { return false; } const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol)); if (target === unknownSymbol) { - return true; + return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol); } - return !!((getAllSymbolFlags(target) ?? -1) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target)); + return !!(getSymbolFlags( + symbol, + excludeTypeOnlyValues, + /*excludeLocalMeanings*/ + true + ) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target)); } function isConstEnumOrConstEnumOnlyModule(s) { return isConstEnumSymbol(s) || !!s.constEnumOnlyModule; @@ -353084,7 +356023,7 @@ ${lanes.join("\n")} return true; } const target = getSymbolLinks(symbol).aliasTarget; - if (target && getEffectiveModifierFlags(node) & 1 /* Export */ && getAllSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) { + if (target && getEffectiveModifierFlags(node) & 32 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) { return true; } } @@ -353109,10 +356048,10 @@ ${lanes.join("\n")} return false; } function isRequiredInitializedParameter(parameter) { - return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter, 16476 /* ParameterPropertyModifier */); + return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */); } function isOptionalUninitializedParameterProperty(parameter) { - return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter, 16476 /* ParameterPropertyModifier */); + return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */); } function isExpandoFunctionDeclaration(node) { const declaration = getParseTreeNode(node, isFunctionDeclaration); @@ -353123,7 +356062,7 @@ ${lanes.join("\n")} if (!symbol || !(symbol.flags & 16 /* Function */)) { return false; } - return !!forEachEntry(getExportsOfSymbol(symbol), (p) => p.flags & 111551 /* Value */ && p.valueDeclaration && isPropertyAccessExpression(p.valueDeclaration)); + return !!forEachEntry(getExportsOfSymbol(symbol), (p) => p.flags & 111551 /* Value */ && isExpandoPropertyDeclaration(p.valueDeclaration)); } function getPropertiesOfContainerFunction(node) { const declaration = getParseTreeNode(node, isFunctionDeclaration); @@ -353146,15 +356085,15 @@ ${lanes.join("\n")} } function canHaveConstantValue(node) { switch (node.kind) { - case 305 /* EnumMember */: - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 306 /* EnumMember */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: return true; } return false; } function getConstantValue2(node) { - if (node.kind === 305 /* EnumMember */) { + if (node.kind === 306 /* EnumMember */) { return getEnumMemberValue(node); } const symbol = getNodeLinks(node).resolvedSymbol; @@ -353201,7 +356140,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, @@ -353209,26 +356148,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 */) { @@ -353354,24 +356297,24 @@ ${lanes.join("\n")} if (symbol) { return filter(getExportSymbolOfValueSymbolIfExported(symbol).declarations, (declaration) => { switch (declaration.kind) { - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: - case 207 /* BindingElement */: - case 171 /* PropertyDeclaration */: - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: - case 305 /* EnumMember */: - case 209 /* ObjectLiteralExpression */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 265 /* EnumDeclaration */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 266 /* ModuleDeclaration */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: + case 208 /* BindingElement */: + case 172 /* PropertyDeclaration */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: + case 306 /* EnumMember */: + case 210 /* ObjectLiteralExpression */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 266 /* EnumDeclaration */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 267 /* ModuleDeclaration */: return true; } return false; @@ -353382,7 +356325,7 @@ ${lanes.join("\n")} return void 0; } function isLiteralConstDeclaration(node) { - if (isDeclarationReadonly(node) || isVariableDeclaration(node) && isVarConst(node)) { + if (isDeclarationReadonly(node) || isVariableDeclaration(node) && isVarConstLike(node)) { return isFreshLiteralType(getTypeOfSymbol(getSymbolOfDeclaration(node))); } return false; @@ -353399,7 +356342,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)); @@ -353500,12 +356443,12 @@ ${lanes.join("\n")} getJsxFragmentFactoryEntity, getAllAccessorDeclarations(accessor) { accessor = getParseTreeNode(accessor, isGetOrSetAccessorDeclaration); - const otherKind = accessor.kind === 177 /* SetAccessor */ ? 176 /* GetAccessor */ : 177 /* SetAccessor */; + const otherKind = accessor.kind === 178 /* SetAccessor */ ? 177 /* GetAccessor */ : 178 /* SetAccessor */; const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(accessor), otherKind); const firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor; const secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor; - const setAccessor = accessor.kind === 177 /* SetAccessor */ ? accessor : otherAccessor; - const getAccessor = accessor.kind === 176 /* GetAccessor */ ? accessor : otherAccessor; + const setAccessor = accessor.kind === 178 /* SetAccessor */ ? accessor : otherAccessor; + const getAccessor = accessor.kind === 177 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor, secondAccessor, @@ -353526,14 +356469,23 @@ ${lanes.join("\n")} }, getDeclarationStatementsForSourceFile: (node, flags, tracker, bundled) => { const n = getParseTreeNode(node); - Debug.assert(n && n.kind === 311 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + Debug.assert(n && n.kind === 312 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); const sym = getSymbolOfDeclaration(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); } return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker, bundled); }, - isImportRequiredByAugmentation + isImportRequiredByAugmentation, + tryFindAmbientModule: (moduleReferenceExpression) => { + const node = getParseTreeNode(moduleReferenceExpression); + const moduleSpecifier = node && isStringLiteralLike(node) ? node.text : void 0; + return moduleSpecifier !== void 0 ? tryFindAmbientModule( + moduleSpecifier, + /*withAugmentations*/ + true + ) : void 0; + } }; function isImportRequiredByAugmentation(node) { const file = getSourceFileOfNode(node); @@ -353561,18 +356513,18 @@ ${lanes.join("\n")} return false; } function isInHeritageClause(node) { - return node.parent && node.parent.kind === 232 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 297 /* HeritageClause */; + return node.parent && node.parent.kind === 233 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 298 /* HeritageClause */; } function getTypeReferenceDirectivesForEntityName(node) { if (!fileToDirective) { return void 0; } let meaning; - if (node.parent.kind === 166 /* ComputedPropertyName */) { + if (node.parent.kind === 167 /* ComputedPropertyName */) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } else { meaning = 788968 /* Type */ | 1920 /* Namespace */; - if (node.kind === 80 /* Identifier */ && isInTypeQuery(node) || node.kind === 210 /* PropertyAccessExpression */ && !isInHeritageClause(node)) { + if (node.kind === 80 /* Identifier */ && isInTypeQuery(node) || node.kind === 211 /* PropertyAccessExpression */ && !isInHeritageClause(node)) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } } @@ -353615,7 +356567,7 @@ ${lanes.join("\n")} break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 311 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 312 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } for (const decl of symbol.declarations) { @@ -353630,17 +356582,17 @@ ${lanes.join("\n")} if (fileToDirective.has(file.path)) return; fileToDirective.set(file.path, [key, mode]); - for (const { fileName, resolutionMode } of file.referencedFiles) { + for (const { fileName } of file.referencedFiles) { const resolvedFile = resolveTripleslashReference(fileName, file.fileName); const referencedFile = host.getSourceFile(resolvedFile); if (referencedFile) { - addReferencedFilesToTypeDirective(referencedFile, key, resolutionMode || file.impliedNodeFormat); + addReferencedFilesToTypeDirective(referencedFile, key, mode || file.impliedNodeFormat); } } } } function getExternalModuleFileFromDeclaration(declaration) { - const specifier = declaration.kind === 266 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration); + const specifier = declaration.kind === 267 /* ModuleDeclaration */ ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration); const moduleSymbol = resolveExternalModuleNameWorker( specifier, specifier, @@ -353650,7 +356602,7 @@ ${lanes.join("\n")} if (!moduleSymbol) { return void 0; } - return getDeclarationOfKind(moduleSymbol, 311 /* SourceFile */); + return getDeclarationOfKind(moduleSymbol, 312 /* SourceFile */); } function initializeTypeChecker() { for (const file of host.getSourceFiles()) { @@ -353832,11 +356784,11 @@ ${lanes.join("\n")} function checkExternalEmitHelpers(location, helpers) { if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { const sourceFile = getSourceFileOfNode(location); - if (isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 16777216 /* Ambient */)) { + if (isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 33554432 /* Ambient */)) { const helpersModule = resolveHelpersModule(sourceFile, location); if (helpersModule !== unknownSymbol) { const uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; - for (let helper = 1 /* FirstEmitHelper */; helper <= 16777216 /* LastEmitHelper */; helper <<= 1) { + for (let helper = 1 /* FirstEmitHelper */; helper <= 33554432 /* LastEmitHelper */; helper <<= 1) { if (uncheckedHelpers & helper) { for (const name of getHelperNames(helper)) { if (requestedExternalEmitHelperNames.has(name)) @@ -353844,18 +356796,18 @@ ${lanes.join("\n")} requestedExternalEmitHelperNames.add(name); const symbol = resolveSymbol(getSymbol2(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */)); if (!symbol) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); + error2(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name); } else if (helper & 524288 /* ClassPrivateFieldGet */) { if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); + error2(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 4); } } else if (helper & 1048576 /* ClassPrivateFieldSet */) { if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); + error2(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 5); } } else if (helper & 1024 /* SpreadArray */) { if (!some(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { - error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); + error2(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name, 3); } } } @@ -353918,6 +356870,8 @@ ${lanes.join("\n")} return ["__setFunctionName"]; case 16777216 /* PropKey */: return ["__propKey"]; + case 33554432 /* AddDisposableResourceAndDisposeResources */: + return ["__addDisposableResource", "__disposeResources"]; default: return Debug.fail("Unrecognized helper"); } @@ -353929,6 +356883,7 @@ ${lanes.join("\n")} return externalHelpersModule; } function checkGrammarModifiers(node) { + var _a; const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node); if (quickResult !== void 0) { return quickResult; @@ -353936,6 +356891,7 @@ ${lanes.join("\n")} if (isParameter(node) && parameterIsThisKeyword(node)) { return grammarErrorOnFirstToken(node, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); } + const blockScopeKind = isVariableStatement(node) ? node.declarationList.flags & 7 /* BlockScoped */ : 0 /* None */; let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; let flags = 0 /* None */; let sawExportBeforeDecorators = false; @@ -353943,97 +356899,98 @@ ${lanes.join("\n")} for (const modifier of node.modifiers) { if (isDecorator(modifier)) { if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { - if (node.kind === 173 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { + if (node.kind === 174 /* MethodDeclaration */ && !nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); } - } else if (legacyDecorators && (node.kind === 176 /* GetAccessor */ || node.kind === 177 /* SetAccessor */)) { + } else if (legacyDecorators && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */)) { const accessors = getAllAccessorDeclarations(node.parent.members, node); if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); } } - if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) { + if (flags & ~(2080 /* ExportDefault */ | 32768 /* Decorator */)) { return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); } - if (hasLeadingDecorators && flags & 126975 /* Modifier */) { + if (hasLeadingDecorators && flags & 98303 /* Modifier */) { Debug.assertIsDefined(firstDecorator); const sourceFile = getSourceFileOfNode(modifier); if (!hasParseDiagnostics(sourceFile)) { addRelatedInfo( - error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + error2(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here) ); return true; } return false; } - flags |= 131072 /* Decorator */; - if (!(flags & 126975 /* Modifier */)) { + flags |= 32768 /* Decorator */; + if (!(flags & 98303 /* Modifier */)) { hasLeadingDecorators = true; - } else if (flags & 1 /* Export */) { + } else if (flags & 32 /* Export */) { sawExportBeforeDecorators = true; } firstDecorator ?? (firstDecorator = modifier); } else { if (modifier.kind !== 148 /* ReadonlyKeyword */) { - if (node.kind === 170 /* PropertySignature */ || node.kind === 172 /* MethodSignature */) { + if (node.kind === 171 /* PropertySignature */ || node.kind === 173 /* MethodSignature */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); } - if (node.kind === 180 /* IndexSignature */ && (modifier.kind !== 126 /* StaticKeyword */ || !isClassLike(node.parent))) { + if (node.kind === 181 /* IndexSignature */ && (modifier.kind !== 126 /* StaticKeyword */ || !isClassLike(node.parent))) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); } } if (modifier.kind !== 103 /* InKeyword */ && modifier.kind !== 147 /* OutKeyword */ && modifier.kind !== 87 /* ConstKeyword */) { - if (node.kind === 167 /* TypeParameter */) { + if (node.kind === 168 /* TypeParameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); } } switch (modifier.kind) { - case 87 /* ConstKeyword */: - if (node.kind !== 265 /* EnumDeclaration */ && node.kind !== 167 /* TypeParameter */) { + 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; - if (node.kind === 167 /* TypeParameter */ && !(isFunctionLikeDeclaration(parent2) || isClassLike(parent2) || isFunctionTypeNode(parent2) || isConstructorTypeNode(parent2) || isCallSignatureDeclaration(parent2) || isConstructSignatureDeclaration(parent2) || isMethodSignature(parent2))) { + 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 163 /* OverrideKeyword */: - if (flags & 16384 /* Override */) { + } + case 164 /* OverrideKeyword */: + if (flags & 16 /* Override */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); - } else if (flags & 2 /* Ambient */) { + } else if (flags & 128 /* Ambient */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); - } else if (flags & 64 /* Readonly */) { + } else if (flags & 8 /* Readonly */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); - } else if (flags & 128 /* Accessor */) { + } else if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); - } else if (flags & 512 /* Async */) { + } else if (flags & 1024 /* Async */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); } - flags |= 16384 /* Override */; + flags |= 16 /* Override */; lastOverride = modifier; break; case 125 /* PublicKeyword */: case 124 /* ProtectedKeyword */: case 123 /* PrivateKeyword */: const text = visibilityToString(modifierToFlag(modifier.kind)); - if (flags & 28 /* AccessibilityModifier */) { + if (flags & 7 /* AccessibilityModifier */) { return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); - } else if (flags & 16384 /* Override */) { + } else if (flags & 16 /* Override */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); - } else if (flags & 32 /* Static */) { + } else if (flags & 256 /* Static */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); - } else if (flags & 128 /* Accessor */) { + } else if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); - } else if (flags & 64 /* Readonly */) { + } else if (flags & 8 /* Readonly */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); - } else if (flags & 512 /* Async */) { + } else if (flags & 1024 /* Async */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); - } else if (node.parent.kind === 267 /* ModuleBlock */ || node.parent.kind === 311 /* SourceFile */) { + } else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); - } else if (flags & 256 /* Abstract */) { + } else if (flags & 64 /* Abstract */) { if (modifier.kind === 123 /* PrivateKeyword */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); } else { @@ -354045,184 +357002,198 @@ ${lanes.join("\n")} flags |= modifierToFlag(modifier.kind); break; case 126 /* StaticKeyword */: - if (flags & 32 /* Static */) { + if (flags & 256 /* Static */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); - } else if (flags & 64 /* Readonly */) { + } else if (flags & 8 /* Readonly */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); - } else if (flags & 512 /* Async */) { + } else if (flags & 1024 /* Async */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); - } else if (flags & 128 /* Accessor */) { + } else if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); - } else if (node.parent.kind === 267 /* ModuleBlock */ || node.parent.kind === 311 /* SourceFile */) { + } else if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); - } else if (node.kind === 168 /* Parameter */) { + } else if (node.kind === 169 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } else if (flags & 256 /* Abstract */) { + } else if (flags & 64 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); - } else if (flags & 16384 /* Override */) { + } else if (flags & 16 /* Override */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); } - flags |= 32 /* Static */; + flags |= 256 /* Static */; lastStatic = modifier; break; case 129 /* AccessorKeyword */: - if (flags & 128 /* Accessor */) { + if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); - } else if (flags & 64 /* Readonly */) { + } else if (flags & 8 /* Readonly */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); - } else if (flags & 2 /* Ambient */) { + } else if (flags & 128 /* Ambient */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); - } else if (node.kind !== 171 /* PropertyDeclaration */) { + } else if (node.kind !== 172 /* PropertyDeclaration */) { return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); } - flags |= 128 /* Accessor */; + flags |= 512 /* Accessor */; break; case 148 /* ReadonlyKeyword */: - if (flags & 64 /* Readonly */) { + if (flags & 8 /* Readonly */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); - } else if (node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 170 /* PropertySignature */ && node.kind !== 180 /* IndexSignature */ && node.kind !== 168 /* Parameter */) { + } else if (node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 171 /* PropertySignature */ && node.kind !== 181 /* IndexSignature */ && node.kind !== 169 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); - } else if (flags & 128 /* Accessor */) { + } else if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); } - flags |= 64 /* Readonly */; + flags |= 8 /* Readonly */; break; case 95 /* ExportKeyword */: - if (compilerOptions.verbatimModuleSyntax && !(node.flags & 16777216 /* Ambient */) && node.kind !== 264 /* TypeAliasDeclaration */ && node.kind !== 263 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later - node.kind !== 266 /* ModuleDeclaration */ && node.parent.kind === 311 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { + if (compilerOptions.verbatimModuleSyntax && !(node.flags & 33554432 /* Ambient */) && node.kind !== 265 /* TypeAliasDeclaration */ && node.kind !== 264 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later + node.kind !== 267 /* ModuleDeclaration */ && node.parent.kind === 312 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) { return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); } - if (flags & 1 /* Export */) { + if (flags & 32 /* Export */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); - } else if (flags & 2 /* Ambient */) { + } else if (flags & 128 /* Ambient */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } else if (flags & 256 /* Abstract */) { + } else if (flags & 64 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); - } else if (flags & 512 /* Async */) { + } else if (flags & 1024 /* Async */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } else if (isClassLike(node.parent)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); - } else if (node.kind === 168 /* Parameter */) { + } else if (node.kind === 169 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } else if (blockScopeKind === 4 /* Using */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "export"); + } else if (blockScopeKind === 6 /* AwaitUsing */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "export"); } - flags |= 1 /* Export */; + flags |= 32 /* Export */; break; case 90 /* DefaultKeyword */: - const container = node.parent.kind === 311 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 266 /* ModuleDeclaration */ && !isAmbientModule(container)) { + const container = node.parent.kind === 312 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) { return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); - } else if (!(flags & 1 /* Export */)) { + } else if (blockScopeKind === 4 /* Using */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "default"); + } else if (blockScopeKind === 6 /* AwaitUsing */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "default"); + } else if (!(flags & 32 /* Export */)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); } else if (sawExportBeforeDecorators) { return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here); } - flags |= 1024 /* Default */; + flags |= 2048 /* Default */; break; case 138 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { + if (flags & 128 /* Ambient */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); - } else if (flags & 512 /* Async */) { + } else if (flags & 1024 /* Async */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (flags & 16384 /* Override */) { + } else if (flags & 16 /* Override */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); - } else if (node.kind === 168 /* Parameter */) { + } else if (node.kind === 169 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } else if (node.parent.flags & 16777216 /* Ambient */ && node.parent.kind === 267 /* ModuleBlock */) { + } else if (blockScopeKind === 4 /* Using */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "declare"); + } else if (blockScopeKind === 6 /* AwaitUsing */) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "declare"); + } else if (node.parent.flags & 33554432 /* Ambient */ && node.parent.kind === 268 /* ModuleBlock */) { return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (isPrivateIdentifierClassElementDeclaration(node)) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); - } else if (flags & 128 /* Accessor */) { + } else if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); } - flags |= 2 /* Ambient */; + flags |= 128 /* Ambient */; lastDeclare = modifier; break; case 128 /* AbstractKeyword */: - if (flags & 256 /* Abstract */) { + if (flags & 64 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 262 /* ClassDeclaration */ && node.kind !== 184 /* ConstructorType */) { - if (node.kind !== 173 /* MethodDeclaration */ && node.kind !== 171 /* PropertyDeclaration */ && node.kind !== 176 /* GetAccessor */ && node.kind !== 177 /* SetAccessor */) { + if (node.kind !== 263 /* ClassDeclaration */ && node.kind !== 185 /* ConstructorType */) { + if (node.kind !== 174 /* MethodDeclaration */ && node.kind !== 172 /* PropertyDeclaration */ && node.kind !== 177 /* GetAccessor */ && node.kind !== 178 /* SetAccessor */) { return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 262 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) { - const message = node.kind === 171 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class; + if (!(node.parent.kind === 263 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 64 /* Abstract */))) { + const message = node.kind === 172 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class; return grammarErrorOnNode(modifier, message); } - if (flags & 32 /* Static */) { + if (flags & 256 /* Static */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); } - if (flags & 8 /* Private */) { + if (flags & 2 /* Private */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); } - if (flags & 512 /* Async */ && lastAsync) { + if (flags & 1024 /* Async */ && lastAsync) { return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); } - if (flags & 16384 /* Override */) { + if (flags & 16 /* Override */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); } - if (flags & 128 /* Accessor */) { + if (flags & 512 /* Accessor */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); } } if (isNamedDeclaration(node) && node.name.kind === 81 /* PrivateIdentifier */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); } - flags |= 256 /* Abstract */; + flags |= 64 /* Abstract */; break; case 134 /* AsyncKeyword */: - if (flags & 512 /* Async */) { + if (flags & 1024 /* Async */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); - } else if (flags & 2 /* Ambient */ || node.parent.flags & 16777216 /* Ambient */) { + } else if (flags & 128 /* Ambient */ || node.parent.flags & 33554432 /* Ambient */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); - } else if (node.kind === 168 /* Parameter */) { + } else if (node.kind === 169 /* Parameter */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } - if (flags & 256 /* Abstract */) { + if (flags & 64 /* Abstract */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); } - flags |= 512 /* Async */; + flags |= 1024 /* Async */; lastAsync = modifier; break; case 103 /* InKeyword */: - case 147 /* OutKeyword */: - const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 32768 /* In */ : 65536 /* Out */; + case 147 /* OutKeyword */: { + const inOutFlag = modifier.kind === 103 /* InKeyword */ ? 8192 /* In */ : 16384 /* Out */; const inOutText = modifier.kind === 103 /* InKeyword */ ? "in" : "out"; - if (node.kind !== 167 /* 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) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); } - if (inOutFlag & 32768 /* In */ && flags & 65536 /* Out */) { + if (inOutFlag & 8192 /* In */ && flags & 16384 /* Out */) { return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); } flags |= inOutFlag; break; + } } } } - if (node.kind === 175 /* Constructor */) { - if (flags & 32 /* Static */) { + if (node.kind === 176 /* Constructor */) { + if (flags & 256 /* Static */) { return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } - if (flags & 16384 /* Override */) { + if (flags & 16 /* Override */) { return grammarErrorOnNode(lastOverride, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override"); } - if (flags & 512 /* Async */) { + if (flags & 1024 /* Async */) { return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async"); } return false; - } else if ((node.kind === 271 /* ImportDeclaration */ || node.kind === 270 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + } else if ((node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */) && flags & 128 /* Ambient */) { return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) { + } else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && isBindingPattern(node.name)) { return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); - } else if (node.kind === 168 /* Parameter */ && flags & 16476 /* ParameterPropertyModifier */ && node.dotDotDotToken) { + } else if (node.kind === 169 /* Parameter */ && flags & 31 /* ParameterPropertyModifier */ && node.dotDotDotToken) { return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } - if (flags & 512 /* Async */) { + if (flags & 1024 /* Async */) { return checkGrammarAsyncModifier(node, lastAsync); } return false; @@ -354239,46 +357210,47 @@ ${lanes.join("\n")} } function findFirstIllegalModifier(node) { switch (node.kind) { - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 175 /* Constructor */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 180 /* IndexSignature */: - case 266 /* ModuleDeclaration */: - case 271 /* ImportDeclaration */: - case 270 /* ImportEqualsDeclaration */: - case 277 /* ExportDeclaration */: - case 276 /* ExportAssignment */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 168 /* Parameter */: - case 167 /* TypeParameter */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 176 /* Constructor */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 181 /* IndexSignature */: + case 267 /* ModuleDeclaration */: + case 272 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 278 /* ExportDeclaration */: + case 277 /* ExportAssignment */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 169 /* Parameter */: + case 168 /* TypeParameter */: return void 0; - case 174 /* ClassStaticBlockDeclaration */: - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: - case 269 /* NamespaceExportDeclaration */: - case 281 /* MissingDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: + case 270 /* NamespaceExportDeclaration */: + case 282 /* MissingDeclaration */: return find(node.modifiers, isModifier); default: - if (node.parent.kind === 267 /* ModuleBlock */ || node.parent.kind === 311 /* SourceFile */) { + if (node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) { return void 0; } switch (node.kind) { - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return findFirstModifierExcept(node, 134 /* AsyncKeyword */); - case 262 /* ClassDeclaration */: - case 184 /* ConstructorType */: + case 263 /* ClassDeclaration */: + case 185 /* ConstructorType */: return findFirstModifierExcept(node, 128 /* AbstractKeyword */); - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 242 /* VariableStatement */: - case 264 /* TypeAliasDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: return find(node.modifiers, isModifier); - case 265 /* EnumDeclaration */: + case 243 /* VariableStatement */: + return node.declarationList.flags & 4 /* Using */ ? findFirstModifierExcept(node, 135 /* AwaitKeyword */) : find(node.modifiers, isModifier); + case 266 /* EnumDeclaration */: return findFirstModifierExcept(node, 87 /* ConstKeyword */); default: Debug.assertNever(node); @@ -354294,10 +357266,10 @@ ${lanes.join("\n")} } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 173 /* MethodDeclaration */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -354325,7 +357297,7 @@ ${lanes.join("\n")} if (i !== parameterCount - 1) { return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); } - if (!(parameter.flags & 16777216 /* Ambient */)) { + if (!(parameter.flags & 33554432 /* Ambient */)) { checkGrammarForDisallowedTrailingComma(parameters, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); } if (parameter.questionToken) { @@ -354355,12 +357327,12 @@ ${lanes.join("\n")} if (length(nonSimpleParameters)) { forEach(nonSimpleParameters, (parameter) => { addRelatedInfo( - error(parameter, Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), + error2(parameter, Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), createDiagnosticForNode(useStrictDirective, Diagnostics.use_strict_directive_used_here) ); }); const diagnostics2 = nonSimpleParameters.map((parameter, index) => index === 0 ? createDiagnosticForNode(parameter, Diagnostics.Non_simple_parameter_declared_here) : createDiagnosticForNode(parameter, Diagnostics.and_here)); - addRelatedInfo(error(useStrictDirective, Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list), ...diagnostics2); + addRelatedInfo(error2(useStrictDirective, Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list), ...diagnostics2); return true; } } @@ -354442,7 +357414,7 @@ ${lanes.join("\n")} return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } function checkGrammarTaggedTemplateChain(node) { - if (node.questionDotToken || node.flags & 32 /* OptionalChain */) { + if (node.questionDotToken || node.flags & 64 /* OptionalChain */) { return grammarErrorOnNode(node.template, Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain); } return false; @@ -354510,11 +357482,11 @@ ${lanes.join("\n")} return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 166 /* ComputedPropertyName */) { + if (node.kind !== 167 /* ComputedPropertyName */) { return false; } const computedPropertyName = node; - if (computedPropertyName.expression.kind === 225 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 28 /* CommaToken */) { + if (computedPropertyName.expression.kind === 226 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 28 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; @@ -354522,9 +357494,9 @@ ${lanes.join("\n")} function checkGrammarForGenerator(node) { if (node.asteriskToken) { Debug.assert( - node.kind === 261 /* FunctionDeclaration */ || node.kind === 217 /* FunctionExpression */ || node.kind === 173 /* MethodDeclaration */ + node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */ || node.kind === 174 /* MethodDeclaration */ ); - if (node.flags & 16777216 /* Ambient */) { + if (node.flags & 33554432 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } if (!node.body) { @@ -354541,7 +357513,7 @@ ${lanes.join("\n")} function checkGrammarObjectLiteralExpression(node, inDestructuring) { const seen = /* @__PURE__ */ new Map(); for (const prop of node.properties) { - if (prop.kind === 304 /* SpreadAssignment */) { + if (prop.kind === 305 /* SpreadAssignment */) { if (inDestructuring) { const expression = skipParentheses(prop.expression); if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) { @@ -354551,10 +357523,10 @@ ${lanes.join("\n")} continue; } const name = prop.name; - if (name.kind === 166 /* ComputedPropertyName */) { + if (name.kind === 167 /* ComputedPropertyName */) { checkGrammarComputedPropertyName(name); } - if (prop.kind === 303 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 304 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { grammarErrorOnNode(prop.equalsToken, 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); } if (name.kind === 81 /* PrivateIdentifier */) { @@ -354562,7 +357534,7 @@ ${lanes.join("\n")} } if (canHaveModifiers(prop) && prop.modifiers) { for (const mod of prop.modifiers) { - if (isModifier(mod) && (mod.kind !== 134 /* AsyncKeyword */ || prop.kind !== 173 /* MethodDeclaration */)) { + if (isModifier(mod) && (mod.kind !== 134 /* AsyncKeyword */ || prop.kind !== 174 /* MethodDeclaration */)) { grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); } } @@ -354575,8 +357547,8 @@ ${lanes.join("\n")} } let currentKind; switch (prop.kind) { - case 303 /* ShorthandPropertyAssignment */: - case 302 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: + case 303 /* PropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); checkGrammarForInvalidQuestionMark(prop.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 9 /* NumericLiteral */) { @@ -354584,13 +357556,13 @@ ${lanes.join("\n")} } currentKind = 4 /* PropertyAssignment */; break; - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -354627,7 +357599,7 @@ ${lanes.join("\n")} checkGrammarTypeArguments(node, node.typeArguments); const seen = /* @__PURE__ */ new Map(); for (const attr of node.attributes.properties) { - if (attr.kind === 292 /* JsxSpreadAttribute */) { + if (attr.kind === 293 /* JsxSpreadAttribute */) { continue; } const { name, initializer } = attr; @@ -354637,7 +357609,7 @@ ${lanes.join("\n")} } else { return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 293 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 294 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -354659,16 +357631,13 @@ ${lanes.join("\n")} if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 249 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { - if (!(forInOrOfStatement.flags & 32768 /* AwaitContext */)) { + if (forInOrOfStatement.kind === 250 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (!(forInOrOfStatement.flags & 65536 /* AwaitContext */)) { const sourceFile = getSourceFileOfNode(forInOrOfStatement); if (isInTopLevelContext(forInOrOfStatement)) { if (!hasParseDiagnostics(sourceFile)) { if (!isEffectiveExternalModule(sourceFile, compilerOptions)) { - diagnostics.add(createDiagnosticForNode( - forInOrOfStatement.awaitModifier, - Diagnostics.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 - )); + diagnostics.add(createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.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)); } switch (moduleKind) { case 100 /* Node16 */: @@ -354687,10 +357656,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; } @@ -354699,7 +357665,7 @@ ${lanes.join("\n")} if (!hasParseDiagnostics(sourceFile)) { const diagnostic = createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); const func = getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 175 /* Constructor */) { + if (func && func.kind !== 176 /* Constructor */) { Debug.assert((getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async); addRelatedInfo(diagnostic, relatedInfo); @@ -354711,11 +357677,11 @@ ${lanes.join("\n")} return false; } } - if (isForOfStatement(forInOrOfStatement) && !(forInOrOfStatement.flags & 32768 /* AwaitContext */) && isIdentifier(forInOrOfStatement.initializer) && forInOrOfStatement.initializer.escapedText === "async") { + if (isForOfStatement(forInOrOfStatement) && !(forInOrOfStatement.flags & 65536 /* AwaitContext */) && isIdentifier(forInOrOfStatement.initializer) && forInOrOfStatement.initializer.escapedText === "async") { grammarErrorOnNode(forInOrOfStatement.initializer, Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async); return false; } - if (forInOrOfStatement.initializer.kind === 260 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 261 /* VariableDeclarationList */) { const variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { const declarations = variableList.declarations; @@ -354723,16 +357689,16 @@ ${lanes.join("\n")} return false; } if (declarations.length > 1) { - const diagnostic = forInOrOfStatement.kind === 248 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; + const diagnostic = forInOrOfStatement.kind === 249 /* ForInStatement */ ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } const firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - const diagnostic = forInOrOfStatement.kind === 248 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; + const diagnostic = forInOrOfStatement.kind === 249 /* ForInStatement */ ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - const diagnostic = forInOrOfStatement.kind === 248 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; + const diagnostic = forInOrOfStatement.kind === 249 /* ForInStatement */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); } } @@ -354740,22 +357706,22 @@ ${lanes.join("\n")} return false; } function checkGrammarAccessor(accessor) { - if (!(accessor.flags & 16777216 /* Ambient */) && accessor.parent.kind !== 186 /* TypeLiteral */ && accessor.parent.kind !== 263 /* InterfaceDeclaration */) { + if (!(accessor.flags & 33554432 /* Ambient */) && accessor.parent.kind !== 187 /* TypeLiteral */ && accessor.parent.kind !== 264 /* InterfaceDeclaration */) { if (languageVersion < 1 /* ES5 */) { return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); } if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(accessor.name)) { return grammarErrorOnNode(accessor.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } - if (accessor.body === void 0 && !hasSyntacticModifier(accessor, 256 /* Abstract */)) { + if (accessor.body === void 0 && !hasSyntacticModifier(accessor, 64 /* Abstract */)) { return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); } } if (accessor.body) { - if (hasSyntacticModifier(accessor, 256 /* Abstract */)) { + if (hasSyntacticModifier(accessor, 64 /* Abstract */)) { return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation); } - if (accessor.parent.kind === 186 /* TypeLiteral */ || accessor.parent.kind === 263 /* InterfaceDeclaration */) { + if (accessor.parent.kind === 187 /* TypeLiteral */ || accessor.parent.kind === 264 /* InterfaceDeclaration */) { return grammarErrorOnNode(accessor.body, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } } @@ -354765,10 +357731,10 @@ ${lanes.join("\n")} if (!doesAccessorHaveCorrectParameterCount(accessor)) { return grammarErrorOnNode( accessor.name, - accessor.kind === 176 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter + accessor.kind === 177 /* GetAccessor */ ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter ); } - if (accessor.kind === 177 /* SetAccessor */) { + if (accessor.kind === 178 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -354786,10 +357752,10 @@ ${lanes.join("\n")} return false; } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 176 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 176 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 177 /* GetAccessor */ ? 1 : 2)) { return getThisParameter(accessor); } } @@ -354806,7 +357772,7 @@ ${lanes.join("\n")} } } switch (parent2.kind) { - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: const decl = parent2; if (decl.name.kind !== 80 /* Identifier */) { return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -354818,13 +357784,13 @@ ${lanes.join("\n")} return grammarErrorOnNode(parent2.name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: if (!isStatic(parent2) || !hasEffectiveReadonlyModifier(parent2)) { return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 170 /* PropertySignature */: - if (!hasSyntacticModifier(parent2, 64 /* Readonly */)) { + case 171 /* PropertySignature */: + if (!hasSyntacticModifier(parent2, 8 /* Readonly */)) { return grammarErrorOnNode(parent2.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } break; @@ -354832,7 +357798,7 @@ ${lanes.join("\n")} return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here); } } else if (node.operator === 148 /* ReadonlyKeyword */) { - if (node.type.kind !== 187 /* ArrayType */ && node.type.kind !== 188 /* TupleType */) { + if (node.type.kind !== 188 /* ArrayType */ && node.type.kind !== 189 /* TupleType */) { return grammarErrorOnFirstToken(node, Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, tokenToString(155 /* SymbolKeyword */)); } } @@ -354846,8 +357812,8 @@ ${lanes.join("\n")} if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 173 /* MethodDeclaration */) { - if (node.parent.kind === 209 /* ObjectLiteralExpression */) { + if (node.kind === 174 /* MethodDeclaration */) { + if (node.parent.kind === 210 /* ObjectLiteralExpression */) { if (node.modifiers && !(node.modifiers.length === 1 && first(node.modifiers).kind === 134 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here); } else if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) { @@ -354866,14 +357832,14 @@ ${lanes.join("\n")} if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(node.name)) { return grammarErrorOnNode(node.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } - if (node.flags & 16777216 /* Ambient */) { + if (node.flags & 33554432 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); - } else if (node.kind === 173 /* MethodDeclaration */ && !node.body) { + } else if (node.kind === 174 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - } else if (node.parent.kind === 263 /* InterfaceDeclaration */) { + } else if (node.parent.kind === 264 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); - } else if (node.parent.kind === 186 /* TypeLiteral */) { + } else if (node.parent.kind === 187 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -354884,9 +357850,9 @@ ${lanes.join("\n")} return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { - const isMisplacedContinueLabel = node.kind === 250 /* ContinueStatement */ && !isIterationStatement( + const isMisplacedContinueLabel = node.kind === 251 /* ContinueStatement */ && !isIterationStatement( current.statement, /*lookInLabeledStatements*/ true @@ -354897,8 +357863,8 @@ ${lanes.join("\n")} return false; } break; - case 254 /* SwitchStatement */: - if (node.kind === 251 /* BreakStatement */ && !node.label) { + case 255 /* SwitchStatement */: + if (node.kind === 252 /* BreakStatement */ && !node.label) { return false; } break; @@ -354915,10 +357881,10 @@ ${lanes.join("\n")} current = current.parent; } if (node.label) { - const message = node.kind === 251 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + const message = node.kind === 252 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - const message = node.kind === 251 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + const message = node.kind === 252 /* BreakStatement */ ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } } @@ -354938,10 +357904,10 @@ ${lanes.join("\n")} } } function isStringOrNumberLiteralExpression(expr) { - return isStringOrNumericLiteralLike(expr) || expr.kind === 223 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 9 /* NumericLiteral */; + return isStringOrNumericLiteralLike(expr) || expr.kind === 224 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 9 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { - return expr.kind === 10 /* BigIntLiteral */ || expr.kind === 223 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 10 /* BigIntLiteral */; + return expr.kind === 10 /* BigIntLiteral */ || expr.kind === 224 /* PrefixUnaryExpression */ && expr.operator === 41 /* MinusToken */ && expr.operand.kind === 10 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) { @@ -354952,7 +357918,7 @@ ${lanes.join("\n")} const initializer = node.initializer; if (initializer) { const isInvalidInitializer = !(isStringOrNumberLiteralExpression(initializer) || isSimpleLiteralEnumReference(initializer) || initializer.kind === 112 /* TrueKeyword */ || initializer.kind === 97 /* FalseKeyword */ || isBigIntLiteralExpression(initializer)); - const isConstOrReadonly = isDeclarationReadonly(node) || isVariableDeclaration(node) && isVarConst(node); + const isConstOrReadonly = isDeclarationReadonly(node) || isVariableDeclaration(node) && isVarConstLike(node); if (isConstOrReadonly && !node.type) { if (isInvalidInitializer) { return grammarErrorOnNode(initializer, Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference); @@ -354963,27 +357929,41 @@ ${lanes.join("\n")} } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 248 /* ForInStatement */ && node.parent.parent.kind !== 249 /* ForOfStatement */) { - if (node.flags & 16777216 /* Ambient */) { + const nodeFlags = getCombinedNodeFlagsCached(node); + const blockScopeKind = nodeFlags & 7 /* BlockScoped */; + if (isBindingPattern(node.name)) { + switch (blockScopeKind) { + case 6 /* AwaitUsing */: + return grammarErrorOnNode(node, Diagnostics._0_declarations_may_not_have_binding_patterns, "await using"); + case 4 /* Using */: + return grammarErrorOnNode(node, Diagnostics._0_declarations_may_not_have_binding_patterns, "using"); + } + } + if (node.parent.parent.kind !== 249 /* ForInStatement */ && node.parent.parent.kind !== 250 /* ForOfStatement */) { + if (nodeFlags & 33554432 /* Ambient */) { checkAmbientInitializer(node); } else if (!node.initializer) { if (isBindingPattern(node.name) && !isBindingPattern(node.parent)) { return grammarErrorOnNode(node, Diagnostics.A_destructuring_declaration_must_have_an_initializer); } - if (isVarConst(node)) { - return grammarErrorOnNode(node, Diagnostics.const_declarations_must_be_initialized); + switch (blockScopeKind) { + case 6 /* AwaitUsing */: + return grammarErrorOnNode(node, Diagnostics._0_declarations_must_be_initialized, "await using"); + case 4 /* Using */: + return grammarErrorOnNode(node, Diagnostics._0_declarations_must_be_initialized, "using"); + case 2 /* Const */: + return grammarErrorOnNode(node, Diagnostics._0_declarations_must_be_initialized, "const"); } } } - if (node.exclamationToken && (node.parent.parent.kind !== 242 /* VariableStatement */ || !node.type || node.initializer || node.flags & 16777216 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 243 /* VariableStatement */ || !node.type || node.initializer || nodeFlags & 33554432 /* Ambient */)) { const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; return grammarErrorOnNode(node.exclamationToken, message); } - if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 16777216 /* Ambient */) && hasSyntacticModifier(node.parent.parent, 1 /* Export */)) { + if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent, 32 /* Export */)) { checkESModuleMarker(node.name); } - const checkLetConstNames = isLet(node) || isVarConst(node); - return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); + return !!blockScopeKind && checkGrammarNameInLetOrConstDeclarations(node.name); } function checkESModuleMarker(name) { if (name.kind === 80 /* Identifier */) { @@ -355023,29 +358003,39 @@ ${lanes.join("\n")} if (!declarationList.declarations.length) { return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); } + const blockScopeFlags = declarationList.flags & 7 /* BlockScoped */; + if ((blockScopeFlags === 4 /* Using */ || blockScopeFlags === 6 /* AwaitUsing */) && isForInStatement(declarationList.parent)) { + return grammarErrorOnNode( + declarationList, + blockScopeFlags === 4 /* Using */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration : Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration + ); + } + if (blockScopeFlags === 6 /* AwaitUsing */) { + return checkAwaitGrammar(declarationList); + } return false; } function allowLetAndConstDeclarations(parent2) { switch (parent2.kind) { - case 244 /* IfStatement */: - case 245 /* DoStatement */: - case 246 /* WhileStatement */: - case 253 /* WithStatement */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: + case 245 /* IfStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: + case 254 /* WithStatement */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: return false; - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return allowLetAndConstDeclarations(parent2.parent); } return true; } - function checkGrammarForDisallowedLetOrConstStatement(node) { + function checkGrammarForDisallowedBlockScopedVariableStatement(node) { if (!allowLetAndConstDeclarations(node.parent)) { - if (isLet(node.declarationList)) { - return grammarErrorOnNode(node, Diagnostics.let_declarations_can_only_be_declared_inside_a_block); - } else if (isVarConst(node.declarationList)) { - return grammarErrorOnNode(node, Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + const blockScopeKind = getCombinedNodeFlagsCached(node.declarationList) & 7 /* BlockScoped */; + if (blockScopeKind) { + const keyword = blockScopeKind === 1 /* Let */ ? "let" : blockScopeKind === 2 /* Const */ ? "const" : blockScopeKind === 4 /* Using */ ? "using" : blockScopeKind === 6 /* AwaitUsing */ ? "await using" : Debug.fail("Unknown BlockScope flag"); + return grammarErrorOnNode(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, keyword); } } } @@ -355134,7 +358124,7 @@ ${lanes.join("\n")} if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) { return true; } - } else if (node.parent.kind === 263 /* InterfaceDeclaration */) { + } else if (node.parent.kind === 264 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -355151,23 +358141,23 @@ ${lanes.join("\n")} return grammarErrorOnNode(node.initializer, Diagnostics.A_type_literal_property_cannot_have_an_initializer); } } - if (node.flags & 16777216 /* Ambient */) { + if (node.flags & 33554432 /* Ambient */) { checkAmbientInitializer(node); } - if (isPropertyDeclaration(node) && node.exclamationToken && (!isClassLike(node.parent) || !node.type || node.initializer || node.flags & 16777216 /* Ambient */ || isStatic(node) || hasAbstractModifier(node))) { + if (isPropertyDeclaration(node) && node.exclamationToken && (!isClassLike(node.parent) || !node.type || node.initializer || node.flags & 33554432 /* Ambient */ || isStatic(node) || hasAbstractModifier(node))) { const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; return grammarErrorOnNode(node.exclamationToken, message); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 263 /* InterfaceDeclaration */ || node.kind === 264 /* TypeAliasDeclaration */ || node.kind === 271 /* ImportDeclaration */ || node.kind === 270 /* ImportEqualsDeclaration */ || node.kind === 277 /* ExportDeclaration */ || node.kind === 276 /* ExportAssignment */ || node.kind === 269 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 1024 /* Default */)) { + if (node.kind === 264 /* InterfaceDeclaration */ || node.kind === 265 /* TypeAliasDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 271 /* ImportEqualsDeclaration */ || node.kind === 278 /* ExportDeclaration */ || node.kind === 277 /* ExportAssignment */ || node.kind === 270 /* NamespaceExportDeclaration */ || hasSyntacticModifier(node, 128 /* Ambient */ | 32 /* Export */ | 2048 /* Default */)) { return false; } return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (const decl of file.statements) { - if (isDeclaration(decl) || decl.kind === 242 /* VariableStatement */) { + if (isDeclaration(decl) || decl.kind === 243 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -355176,15 +358166,15 @@ ${lanes.join("\n")} return false; } function checkGrammarSourceFile(node) { - return !!(node.flags & 16777216 /* Ambient */) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node); + return !!(node.flags & 33554432 /* Ambient */) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node); } function checkGrammarStatementInAmbientContext(node) { - if (node.flags & 16777216 /* Ambient */) { + if (node.flags & 33554432 /* Ambient */) { const links = getNodeLinks(node); if (!links.hasReportedStatementInAmbientContext && (isFunctionLike(node.parent) || isAccessor(node.parent))) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 240 /* Block */ || node.parent.kind === 267 /* ModuleBlock */ || node.parent.kind === 311 /* SourceFile */) { + if (node.parent.kind === 241 /* Block */ || node.parent.kind === 268 /* ModuleBlock */ || node.parent.kind === 312 /* SourceFile */) { const links2 = getNodeLinks(node.parent); if (!links2.hasReportedStatementInAmbientContext) { return links2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -355195,7 +358185,7 @@ ${lanes.join("\n")} return false; } function checkGrammarNumericLiteral(node) { - const isFractional = getTextOfNode(node).indexOf(".") !== -1; + const isFractional = getTextOfNode(node).includes("."); const isScientific = node.numericLiteralFlags & 16 /* Scientific */; if (isFractional || isScientific) { return; @@ -355253,7 +358243,7 @@ ${lanes.join("\n")} if (node.isTypeOnly && node.name && node.namedBindings) { return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both); } - if (node.isTypeOnly && ((_a = node.namedBindings) == null ? void 0 : _a.kind) === 274 /* NamedImports */) { + if (node.isTypeOnly && ((_a = node.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamedImports */) { return checkGrammarNamedImportsOrExports(node.namedBindings); } return false; @@ -355263,7 +358253,7 @@ ${lanes.join("\n")} if (specifier.isTypeOnly) { return grammarErrorOnFirstToken( specifier, - specifier.kind === 275 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement + specifier.kind === 276 /* ImportSpecifier */ ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement ); } }); @@ -355282,12 +358272,12 @@ ${lanes.join("\n")} if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) { checkGrammarForDisallowedTrailingComma(nodeArguments); if (nodeArguments.length > 1) { - const assertionArgument = nodeArguments[1]; - return grammarErrorOnNode(assertionArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext); + const importAttributesArgument = nodeArguments[1]; + return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext); } } if (nodeArguments.length === 0 || nodeArguments.length > 2) { - return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments); + return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments); } const spreadElement = find(nodeArguments, isSpreadElement); if (spreadElement) { @@ -355375,19 +358365,39 @@ ${lanes.join("\n")} } function getEffectivePropertyNameForPropertyNameNode(node) { const name = getPropertyNameForPropertyNameNode(node); - return name ? name : isComputedPropertyName(node) && isEntityNameExpression(node.expression) ? tryGetNameFromEntityNameExpression(node.expression) : void 0; + return name ? name : isComputedPropertyName(node) ? tryGetNameFromType(getTypeOfExpression(node.expression)) : void 0; + } + function getCombinedModifierFlagsCached(node) { + if (lastGetCombinedModifierFlagsNode === node) { + return lastGetCombinedModifierFlagsResult; + } + lastGetCombinedModifierFlagsNode = node; + lastGetCombinedModifierFlagsResult = getCombinedModifierFlags(node); + return lastGetCombinedModifierFlagsResult; + } + function getCombinedNodeFlagsCached(node) { + if (lastGetCombinedNodeFlagsNode === node) { + return lastGetCombinedNodeFlagsResult; + } + lastGetCombinedNodeFlagsNode = node; + lastGetCombinedNodeFlagsResult = getCombinedNodeFlags(node); + return lastGetCombinedNodeFlagsResult; + } + function isVarConstLike(node) { + const blockScopeKind = getCombinedNodeFlagsCached(node) & 7 /* BlockScoped */; + return blockScopeKind === 2 /* Const */ || blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */; } } function isNotAccessor(declaration) { return !isAccessor(declaration); } function isNotOverload(declaration) { - return declaration.kind !== 261 /* FunctionDeclaration */ && declaration.kind !== 173 /* MethodDeclaration */ || !!declaration.body; + return declaration.kind !== 262 /* FunctionDeclaration */ && declaration.kind !== 174 /* MethodDeclaration */ || !!declaration.body; } function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 275 /* ImportSpecifier */: - case 280 /* ExportSpecifier */: + case 276 /* ImportSpecifier */: + case 281 /* ExportSpecifier */: return isIdentifier(name); default: return isDeclarationName(name); @@ -355536,8 +358546,8 @@ ${lanes.join("\n")} CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive"; CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions"; CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp"; - CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions"; - CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement"; + CheckMode3[CheckMode3["RestBindingElement"] = 32] = "RestBindingElement"; + CheckMode3[CheckMode3["TypeOnly"] = 64] = "TypeOnly"; return CheckMode3; })(CheckMode || {}); SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => { @@ -355555,7 +358565,8 @@ ${lanes.join("\n")} Uppercase: 0 /* Uppercase */, Lowercase: 1 /* Lowercase */, Capitalize: 2 /* Capitalize */, - Uncapitalize: 3 /* Uncapitalize */ + Uncapitalize: 3 /* Uncapitalize */, + NoInfer: 4 /* NoInfer */ })); SymbolLinks = class { }; @@ -355571,13 +358582,13 @@ ${lanes.join("\n")} JsxNames2.IntrinsicClassAttributes = "IntrinsicClassAttributes"; JsxNames2.LibraryManagedAttributes = "LibraryManagedAttributes"; })(JsxNames || (JsxNames = {})); - SymbolTrackerImpl = class { + SymbolTrackerImpl = class _SymbolTrackerImpl { constructor(context, tracker, moduleResolverHost) { this.moduleResolverHost = void 0; this.inner = void 0; this.disableTrackSymbol = false; var _a; - while (tracker instanceof SymbolTrackerImpl) { + while (tracker instanceof _SymbolTrackerImpl) { tracker = tracker.inner; } this.inner = tracker; @@ -355586,12 +358597,14 @@ ${lanes.join("\n")} this.canTrackSymbol = !!((_a = this.inner) == null ? void 0 : _a.trackSymbol); } trackSymbol(symbol, enclosingDeclaration, meaning) { - var _a; + var _a, _b; if (((_a = this.inner) == null ? void 0 : _a.trackSymbol) && !this.disableTrackSymbol) { if (this.inner.trackSymbol(symbol, enclosingDeclaration, meaning)) { this.onDiagnosticReported(); return true; } + if (!(symbol.flags & 262144 /* TypeParameter */)) + ((_b = this.context).trackedSymbols ?? (_b.trackedSymbols = [])).push([symbol, enclosingDeclaration, meaning]); } return false; } @@ -355665,13 +358678,6 @@ ${lanes.join("\n")} this.inner.reportNonSerializableProperty(propertyName); } } - reportImportTypeNodeResolutionModeOverride() { - var _a; - if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) { - this.onDiagnosticReported(); - this.inner.reportImportTypeNodeResolutionModeOverride(); - } - } onDiagnosticReported() { this.context.reportedDiagnostic = true; } @@ -355929,7 +358935,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; } @@ -355946,21 +358952,21 @@ ${lanes.join("\n")} "use strict"; init_ts2(); visitEachChildTable = { - [165 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [166 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateQualifiedName( node, Debug.checkDefined(nodeVisitor(node.left, visitor, isEntityName)), Debug.checkDefined(nodeVisitor(node.right, visitor, isIdentifier)) ); }, - [166 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [167 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateComputedPropertyName( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Signature elements - [167 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [168 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -355969,7 +358975,7 @@ ${lanes.join("\n")} nodeVisitor(node.default, visitor, isTypeNode) ); }, - [168 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [169 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateParameterDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -355980,14 +358986,14 @@ ${lanes.join("\n")} nodeVisitor(node.initializer, visitor, isExpression) ); }, - [169 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [170 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDecorator( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Type elements - [170 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [171 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updatePropertySignature( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -355996,7 +359002,7 @@ ${lanes.join("\n")} nodeVisitor(node.type, visitor, isTypeNode) ); }, - [171 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [172 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updatePropertyDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356007,7 +359013,7 @@ ${lanes.join("\n")} nodeVisitor(node.initializer, visitor, isExpression) ); }, - [172 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [173 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMethodSignature( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -356018,7 +359024,7 @@ ${lanes.join("\n")} nodeVisitor(node.type, visitor, isTypeNode) ); }, - [173 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [174 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMethodDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356031,7 +359037,7 @@ ${lanes.join("\n")} visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [175 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [176 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356039,7 +359045,7 @@ ${lanes.join("\n")} visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [176 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [177 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateGetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356049,7 +359055,7 @@ ${lanes.join("\n")} visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [177 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [178 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSetAccessorDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356058,7 +359064,7 @@ ${lanes.join("\n")} visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [174 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [175 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { context.startLexicalEnvironment(); context.suspendLexicalEnvironment(); return context.factory.updateClassStaticBlockDeclaration( @@ -356066,7 +359072,7 @@ ${lanes.join("\n")} visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [178 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [179 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCallSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), @@ -356074,7 +359080,7 @@ ${lanes.join("\n")} nodeVisitor(node.type, visitor, isTypeNode) ); }, - [179 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [180 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructSignature( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), @@ -356082,7 +359088,7 @@ ${lanes.join("\n")} nodeVisitor(node.type, visitor, isTypeNode) ); }, - [180 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [181 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexSignature( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356091,7 +359097,7 @@ ${lanes.join("\n")} ); }, // Types - [181 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [182 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypePredicateNode( node, nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), @@ -356099,14 +359105,14 @@ ${lanes.join("\n")} nodeVisitor(node.type, visitor, isTypeNode) ); }, - [182 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [183 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeReferenceNode( node, Debug.checkDefined(nodeVisitor(node.typeName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, - [183 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [184 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateFunctionTypeNode( node, nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), @@ -356114,7 +359120,7 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [184 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [185 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConstructorTypeNode( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -356123,56 +359129,56 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [185 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [186 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeQueryNode( node, Debug.checkDefined(nodeVisitor(node.exprName, visitor, isEntityName)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, - [186 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [187 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateTypeLiteralNode( node, nodesVisitor(node.members, visitor, isTypeElement) ); }, - [187 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [188 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateArrayTypeNode( node, Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) ); }, - [188 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [189 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateTupleTypeNode( node, nodesVisitor(node.elements, visitor, isTypeNode) ); }, - [189 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [190 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateOptionalTypeNode( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [190 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [191 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateRestTypeNode( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [191 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [192 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateUnionTypeNode( node, nodesVisitor(node.types, visitor, isTypeNode) ); }, - [192 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [193 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateIntersectionTypeNode( node, nodesVisitor(node.types, visitor, isTypeNode) ); }, - [193 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [194 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateConditionalTypeNode( node, Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), @@ -356181,30 +359187,30 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) ); }, - [194 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [195 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInferTypeNode( node, Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) ); }, - [204 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [205 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeNode( node, Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), - nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer), + nodeVisitor(node.attributes, visitor, isImportAttributes), nodeVisitor(node.qualifier, visitor, isEntityName), nodesVisitor(node.typeArguments, visitor, isTypeNode), node.isTypeOf ); }, - [301 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [302 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportTypeAssertionContainer( node, Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), node.multiLine ); }, - [201 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [202 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateNamedTupleMember( node, tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, @@ -356213,26 +359219,26 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [195 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [196 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedType( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [197 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [198 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOperatorNode( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [198 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [199 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIndexedAccessTypeNode( node, Debug.checkDefined(nodeVisitor(node.objectType, visitor, isTypeNode)), Debug.checkDefined(nodeVisitor(node.indexType, visitor, isTypeNode)) ); }, - [199 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [200 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateMappedTypeNode( node, tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, @@ -356243,20 +359249,20 @@ ${lanes.join("\n")} nodesVisitor(node.members, visitor, isTypeElement) ); }, - [200 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [201 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLiteralTypeNode( node, Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) ); }, - [202 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [203 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralType( node, Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) ); }, - [203 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [204 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateLiteralTypeSpan( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), @@ -356264,19 +359270,19 @@ ${lanes.join("\n")} ); }, // Binding patterns - [205 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [206 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateObjectBindingPattern( node, nodesVisitor(node.elements, visitor, isBindingElement) ); }, - [206 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [207 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateArrayBindingPattern( node, nodesVisitor(node.elements, visitor, isArrayBindingElement) ); }, - [207 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [208 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBindingElement( node, tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, @@ -356286,19 +359292,19 @@ ${lanes.join("\n")} ); }, // Expression - [208 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [209 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateArrayLiteralExpression( node, nodesVisitor(node.elements, visitor, isExpression) ); }, - [209 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [210 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateObjectLiteralExpression( node, nodesVisitor(node.properties, visitor, isObjectLiteralElementLike) ); }, - [210 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [211 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -356310,7 +359316,7 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) ); }, - [211 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [212 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return isElementAccessChain(node) ? context.factory.updateElementAccessChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -356322,7 +359328,7 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) ); }, - [212 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [213 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return isCallChain(node) ? context.factory.updateCallChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -356336,7 +359342,7 @@ ${lanes.join("\n")} nodesVisitor(node.arguments, visitor, isExpression) ); }, - [213 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [214 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNewExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -356344,7 +359350,7 @@ ${lanes.join("\n")} nodesVisitor(node.arguments, visitor, isExpression) ); }, - [214 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [215 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTaggedTemplateExpression( node, Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), @@ -356352,20 +359358,20 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) ); }, - [215 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [216 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAssertion( node, Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [216 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [217 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateParenthesizedExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [217 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [218 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionExpression( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -356377,7 +359383,7 @@ ${lanes.join("\n")} visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [218 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [219 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateArrowFunction( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -356388,43 +359394,43 @@ ${lanes.join("\n")} visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [219 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [220 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDeleteExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [220 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [221 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeOfExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [221 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [222 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVoidExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [222 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [223 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAwaitExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [223 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [224 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePrefixUnaryExpression( node, Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, - [224 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [225 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePostfixUnaryExpression( node, Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) ); }, - [225 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [226 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateBinaryExpression( node, Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), @@ -356432,7 +359438,7 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) ); }, - [226 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [227 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateConditionalExpression( node, Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), @@ -356442,27 +359448,27 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) ); }, - [227 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [228 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateExpression( node, Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), nodesVisitor(node.templateSpans, visitor, isTemplateSpan) ); }, - [228 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [229 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateYieldExpression( node, tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, nodeVisitor(node.expression, visitor, isExpression) ); }, - [229 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [230 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadElement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [230 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [231 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateClassExpression( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356472,28 +359478,28 @@ ${lanes.join("\n")} nodesVisitor(node.members, visitor, isClassElement) ); }, - [232 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [233 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionWithTypeArguments( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.typeArguments, visitor, isTypeNode) ); }, - [233 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [234 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateAsExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [237 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [238 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSatisfiesExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [234 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [235 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return isOptionalChain(node) ? context.factory.updateNonNullChain( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) @@ -356502,14 +359508,14 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [235 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [236 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateMetaProperty( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, // Misc - [238 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [239 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTemplateSpan( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -356517,26 +359523,26 @@ ${lanes.join("\n")} ); }, // Element - [240 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [241 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateBlock( node, nodesVisitor(node.statements, visitor, isStatement) ); }, - [242 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [243 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateVariableStatement( node, nodesVisitor(node.modifiers, visitor, isModifierLike), Debug.checkDefined(nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)) ); }, - [243 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [244 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExpressionStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [244 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [245 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateIfStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), @@ -356544,21 +359550,21 @@ ${lanes.join("\n")} nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) ); }, - [245 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [246 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateDoStatement( node, visitIterationBody(node.statement, visitor, context, nodeVisitor), Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [246 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [247 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWhileStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [247 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [248 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForStatement( node, nodeVisitor(node.initializer, visitor, isForInitializer), @@ -356567,7 +359573,7 @@ ${lanes.join("\n")} visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [248 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [249 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateForInStatement( node, Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), @@ -356575,7 +359581,7 @@ ${lanes.join("\n")} visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [249 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [250 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateForOfStatement( node, tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, @@ -356584,52 +359590,52 @@ ${lanes.join("\n")} visitIterationBody(node.statement, visitor, context, nodeVisitor) ); }, - [250 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [251 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateContinueStatement( node, nodeVisitor(node.label, visitor, isIdentifier) ); }, - [251 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [252 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateBreakStatement( node, nodeVisitor(node.label, visitor, isIdentifier) ); }, - [252 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [253 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateReturnStatement( node, nodeVisitor(node.expression, visitor, isExpression) ); }, - [253 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [254 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateWithStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, - [254 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [255 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSwitchStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), Debug.checkDefined(nodeVisitor(node.caseBlock, visitor, isCaseBlock)) ); }, - [255 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [256 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateLabeledStatement( node, Debug.checkDefined(nodeVisitor(node.label, visitor, isIdentifier)), Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock)) ); }, - [256 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [257 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateThrowStatement( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [257 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [258 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTryStatement( node, Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock)), @@ -356637,7 +359643,7 @@ ${lanes.join("\n")} nodeVisitor(node.finallyBlock, visitor, isBlock) ); }, - [259 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { + [260 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateVariableDeclaration( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), @@ -356646,13 +359652,13 @@ ${lanes.join("\n")} nodeVisitor(node.initializer, visitor, isExpression) ); }, - [260 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [261 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateVariableDeclarationList( node, nodesVisitor(node.declarations, visitor, isVariableDeclaration) ); }, - [261 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { + [262 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { return context.factory.updateFunctionDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifier), @@ -356664,7 +359670,7 @@ ${lanes.join("\n")} visitFunctionBody(node.body, visitor, context, nodeVisitor) ); }, - [262 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [263 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateClassDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356674,7 +359680,7 @@ ${lanes.join("\n")} nodesVisitor(node.members, visitor, isClassElement) ); }, - [263 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [264 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateInterfaceDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356684,7 +359690,7 @@ ${lanes.join("\n")} nodesVisitor(node.members, visitor, isTypeElement) ); }, - [264 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [265 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateTypeAliasDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356693,7 +359699,7 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) ); }, - [265 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [266 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356701,7 +359707,7 @@ ${lanes.join("\n")} nodesVisitor(node.members, visitor, isEnumMember) ); }, - [266 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [267 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateModuleDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356709,25 +359715,25 @@ ${lanes.join("\n")} nodeVisitor(node.body, visitor, isModuleBody) ); }, - [267 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [268 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateModuleBlock( node, nodesVisitor(node.statements, visitor, isStatement) ); }, - [268 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [269 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCaseBlock( node, nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause) ); }, - [269 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [270 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExportDeclaration( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [270 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [271 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportEqualsDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), @@ -356736,30 +359742,30 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) ); }, - [271 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [272 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), nodeVisitor(node.importClause, visitor, isImportClause), Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)), - nodeVisitor(node.assertClause, visitor, isAssertClause) + nodeVisitor(node.attributes, visitor, isImportAttributes) ); }, - [299 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateAssertClause( + [300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context.factory.updateImportAttributes( node, - nodesVisitor(node.elements, visitor, isAssertEntry), + nodesVisitor(node.elements, visitor, isImportAttribute), node.multiLine ); }, - [300 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateAssertEntry( + [301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context.factory.updateImportAttribute( node, - Debug.checkDefined(nodeVisitor(node.name, visitor, isAssertionKey)), + Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)), Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) ); }, - [272 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [273 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportClause( node, node.isTypeOnly, @@ -356767,25 +359773,25 @@ ${lanes.join("\n")} nodeVisitor(node.namedBindings, visitor, isNamedImportBindings) ); }, - [273 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [274 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceImport( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [279 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [280 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateNamespaceExport( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [274 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [275 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateNamedImports( node, nodesVisitor(node.elements, visitor, isImportSpecifier) ); }, - [275 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [276 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateImportSpecifier( node, node.isTypeOnly, @@ -356793,30 +359799,30 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [276 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [277 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportAssignment( node, nodesVisitor(node.modifiers, visitor, isModifierLike), Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [277 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [278 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportDeclaration( node, nodesVisitor(node.modifiers, visitor, isModifierLike), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, isExpression), - nodeVisitor(node.assertClause, visitor, isAssertClause) + nodeVisitor(node.attributes, visitor, isImportAttributes) ); }, - [278 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateNamedExports( node, nodesVisitor(node.elements, visitor, isExportSpecifier) ); }, - [280 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [281 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExportSpecifier( node, node.isTypeOnly, @@ -356825,14 +359831,14 @@ ${lanes.join("\n")} ); }, // Module references - [282 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [283 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateExternalModuleReference( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // JSX - [283 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [284 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxElement( node, Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), @@ -356840,7 +359846,7 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) ); }, - [284 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [285 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSelfClosingElement( node, Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), @@ -356848,7 +359854,7 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, - [285 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [286 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxOpeningElement( node, Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), @@ -356856,20 +359862,20 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) ); }, - [286 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [287 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxClosingElement( node, Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) ); }, - [294 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName2(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [295 /* JsxNamespacedName */]: function forEachChildInJsxNamespacedName2(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxNamespacedName( node, Debug.checkDefined(nodeVisitor(node.namespace, visitor, isIdentifier)), Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) ); }, - [287 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [288 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxFragment( node, Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), @@ -356877,52 +359883,52 @@ ${lanes.join("\n")} Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) ); }, - [290 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [291 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttribute( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isJsxAttributeName)), nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) ); }, - [291 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [292 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateJsxAttributes( node, nodesVisitor(node.properties, visitor, isJsxAttributeLike) ); }, - [292 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [293 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxSpreadAttribute( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [293 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [294 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateJsxExpression( node, nodeVisitor(node.expression, visitor, isExpression) ); }, // Clauses - [295 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { + [296 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCaseClause( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), nodesVisitor(node.statements, visitor, isStatement) ); }, - [296 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [297 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateDefaultClause( node, nodesVisitor(node.statements, visitor, isStatement) ); }, - [297 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [298 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateHeritageClause( node, nodesVisitor(node.types, visitor, isExpressionWithTypeArguments) ); }, - [298 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [299 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateCatchClause( node, nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), @@ -356930,28 +359936,28 @@ ${lanes.join("\n")} ); }, // Property assignments - [302 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [303 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePropertyAssignment( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), Debug.checkDefined(nodeVisitor(node.initializer, visitor, isExpression)) ); }, - [303 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [304 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateShorthandPropertyAssignment( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) ); }, - [304 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [305 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateSpreadAssignment( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, // Enum - [305 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [306 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updateEnumMember( node, Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), @@ -356959,20 +359965,20 @@ ${lanes.join("\n")} ); }, // Top-level nodes - [311 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) { + [312 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateSourceFile( node, visitLexicalEnvironment(node.statements, visitor, context) ); }, // Transformation nodes - [359 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + [360 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { return context.factory.updatePartiallyEmittedExpression( node, Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) ); }, - [360 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + [361 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { return context.factory.updateCommaListExpression( node, nodesVisitor(node.elements, visitor, isExpression) @@ -357234,7 +360240,7 @@ ${lanes.join("\n")} const line = lineInfo.getLineText(index); const comment = sourceMapCommentRegExp.exec(line); if (comment) { - return trimStringEnd(comment[1]); + return comment[1].trimEnd(); } else if (!line.match(whitespaceOrMapCommentRegExp)) { break; } @@ -357265,13 +360271,13 @@ ${lanes.join("\n")} let sourceLine = 0; let sourceCharacter = 0; let nameIndex = 0; - let error; + let error2; return { get pos() { return pos; }, get error() { - return error; + return error2; }, get state() { return captureMapping( @@ -357356,8 +360362,8 @@ ${lanes.join("\n")} return { value: void 0, done: true }; } function setError(message) { - if (error === void 0) { - error = message; + if (error2 === void 0) { + error2 = message; } } function setErrorAndStopIterating(message) { @@ -357365,7 +360371,7 @@ ${lanes.join("\n")} return stopIterating(); } function hasReportedError() { - return error !== void 0; + return error2 !== void 0; } function isSourceMappingSegmentEnd() { return pos === mappings.length || mappings.charCodeAt(pos) === 44 /* comma */ || mappings.charCodeAt(pos) === 59 /* semicolon */; @@ -357573,7 +360579,7 @@ ${lanes.join("\n")} function chainBundle(context, transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 311 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 312 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends); @@ -357603,9 +360609,11 @@ ${lanes.join("\n")} function getImportNeedsImportDefaultHelper(node) { return !getImportNeedsImportStarHelper(node) && (isDefaultImport(node) || !!node.importClause && isNamedImports(node.importClause.namedBindings) && containsDefaultReference(node.importClause.namedBindings)); } - function collectExternalModuleInfo(context, sourceFile, resolver, compilerOptions) { + function collectExternalModuleInfo(context, sourceFile) { + const resolver = context.getEmitResolver(); + const compilerOptions = context.getCompilerOptions(); const externalImports = []; - const exportSpecifiers = createMultiMap(); + const exportSpecifiers = new IdentifierNameMultiMap(); const exportedBindings = []; const uniqueExports = /* @__PURE__ */ new Map(); let exportedNames; @@ -357616,7 +360624,7 @@ ${lanes.join("\n")} let hasImportDefault = false; for (const node of sourceFile.statements) { switch (node.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: externalImports.push(node); if (!hasImportStar && getImportNeedsImportStarHelper(node)) { hasImportStar = true; @@ -357625,12 +360633,12 @@ ${lanes.join("\n")} hasImportDefault = true; } break; - case 270 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 282 /* ExternalModuleReference */) { + case 271 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 283 /* ExternalModuleReference */) { externalImports.push(node); } break; - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -357653,21 +360661,21 @@ ${lanes.join("\n")} addExportedNamesForExportDeclaration(node); } break; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 242 /* VariableStatement */: - if (hasSyntacticModifier(node, 1 /* Export */)) { + case 243 /* VariableStatement */: + if (hasSyntacticModifier(node, 32 /* Export */)) { for (const decl of node.declarationList.declarations) { exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings); } } break; - case 261 /* FunctionDeclaration */: - if (hasSyntacticModifier(node, 1 /* Export */)) { - if (hasSyntacticModifier(node, 1024 /* Default */)) { + case 262 /* FunctionDeclaration */: + if (hasSyntacticModifier(node, 32 /* Export */)) { + if (hasSyntacticModifier(node, 2048 /* Default */)) { if (!hasExportDefault) { multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node)); hasExportDefault = true; @@ -357682,9 +360690,9 @@ ${lanes.join("\n")} } } break; - case 262 /* ClassDeclaration */: - if (hasSyntacticModifier(node, 1 /* Export */)) { - if (hasSyntacticModifier(node, 1024 /* Default */)) { + case 263 /* ClassDeclaration */: + if (hasSyntacticModifier(node, 32 /* Export */)) { + if (hasSyntacticModifier(node, 2048 /* Default */)) { if (!hasExportDefault) { multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node)); hasExportDefault = true; @@ -357711,7 +360719,7 @@ ${lanes.join("\n")} if (!uniqueExports.get(idText(specifier.name))) { const name = specifier.propertyName || specifier.name; if (!node.moduleSpecifier) { - exportSpecifiers.add(idText(name), specifier); + exportSpecifiers.add(name, specifier); } const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name); if (decl) { @@ -357801,14 +360809,23 @@ ${lanes.join("\n")} const expression = skipParentheses(statement.expression); return isSuperCall(expression) ? expression : void 0; } - function findSuperStatementIndex(statements, indexAfterLastPrologueStatement) { - for (let i = indexAfterLastPrologueStatement; i < statements.length; i += 1) { + function findSuperStatementIndexPathWorker(statements, start, indices) { + for (let i = start; i < statements.length; i += 1) { const statement = statements[i]; if (getSuperCallFromStatement(statement)) { - return i; + indices.unshift(i); + return true; + } else if (isTryStatement(statement) && findSuperStatementIndexPathWorker(statement.tryBlock.statements, 0, indices)) { + indices.unshift(i); + return true; } } - return -1; + return false; + } + function findSuperStatementIndexPath(statements, start) { + const indices = []; + findSuperStatementIndexPathWorker(statements, start, indices); + return indices; } function getProperties(node, requireInitializer, isStatic2) { return filter(node.members, (m) => isInitializedOrStaticProperty(m, requireInitializer, isStatic2)); @@ -357826,7 +360843,7 @@ ${lanes.join("\n")} return isPropertyDeclaration(member) && hasStaticModifier(member); } function isInitializedProperty(member) { - return member.kind === 171 /* PropertyDeclaration */ && member.initializer !== void 0; + return member.kind === 172 /* PropertyDeclaration */ && member.initializer !== void 0; } function isNonStaticMethodOrAccessorWithPrivateName(member) { return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name); @@ -357863,15 +360880,15 @@ ${lanes.join("\n")} } function getAllDecoratorsOfClassElement(member, parent2, useLegacyDecorators) { switch (member.kind) { - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: if (!useLegacyDecorators) { return getAllDecoratorsOfMethod(member); } return getAllDecoratorsOfAccessors(member, parent2); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return void 0; @@ -357943,10 +360960,96 @@ ${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"() { "use strict"; init_ts2(); + IdentifierNameMap = class _IdentifierNameMap { + constructor() { + this._map = /* @__PURE__ */ new Map(); + } + get size() { + return this._map.size; + } + has(key) { + return this._map.has(_IdentifierNameMap.toKey(key)); + } + get(key) { + return this._map.get(_IdentifierNameMap.toKey(key)); + } + set(key, value) { + this._map.set(_IdentifierNameMap.toKey(key), value); + return this; + } + delete(key) { + var _a; + return ((_a = this._map) == null ? void 0 : _a.delete(_IdentifierNameMap.toKey(key))) ?? false; + } + clear() { + this._map.clear(); + } + values() { + return this._map.values(); + } + static toKey(name) { + if (isGeneratedPrivateIdentifier(name) || isGeneratedIdentifier(name)) { + const autoGenerate = name.emitNode.autoGenerate; + if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) { + const node = getNodeForGeneratedName(name); + const baseName = isMemberName(node) && node !== name ? _IdentifierNameMap.toKey(node) : `(generated@${getNodeId(node)})`; + return formatGeneratedName( + /*privateName*/ + false, + autoGenerate.prefix, + baseName, + autoGenerate.suffix, + _IdentifierNameMap.toKey + ); + } else { + const baseName = `(auto@${autoGenerate.id})`; + return formatGeneratedName( + /*privateName*/ + false, + autoGenerate.prefix, + baseName, + autoGenerate.suffix, + _IdentifierNameMap.toKey + ); + } + } + if (isPrivateIdentifier(name)) { + return idText(name).slice(1); + } + return idText(name); + } + }; + IdentifierNameMultiMap = class extends IdentifierNameMap { + add(key, value) { + let values = this.get(key); + if (values) { + values.push(value); + } else { + this.set(key, values = [value]); + } + return values; + } + remove(key, value) { + const values = this.get(key); + if (values) { + unorderedRemoveItem(values, value); + if (!values.length) { + this.delete(key); + } + } + } + }; } }); @@ -358418,6 +361521,287 @@ ${lanes.join("\n")} } }); + // src/compiler/transformers/classThis.ts + function createClassThisAssignmentBlock(factory2, classThis, thisExpression = factory2.createThis()) { + const expression = factory2.createAssignment(classThis, thisExpression); + const statement = factory2.createExpressionStatement(expression); + const body = factory2.createBlock( + [statement], + /*multiLine*/ + false + ); + const block = factory2.createClassStaticBlockDeclaration(body); + getOrCreateEmitNode(block).classThis = classThis; + return block; + } + function isClassThisAssignmentBlock(node) { + var _a; + if (!isClassStaticBlockDeclaration(node) || node.body.statements.length !== 1) { + return false; + } + const statement = node.body.statements[0]; + return isExpressionStatement(statement) && isAssignmentExpression( + statement.expression, + /*excludeCompoundAssignment*/ + true + ) && isIdentifier(statement.expression.left) && ((_a = node.emitNode) == null ? void 0 : _a.classThis) === statement.expression.left && statement.expression.right.kind === 110 /* ThisKeyword */; + } + function classHasClassThisAssignment(node) { + var _a; + return !!((_a = node.emitNode) == null ? void 0 : _a.classThis) && some(node.members, isClassThisAssignmentBlock); + } + function injectClassThisAssignmentIfMissing(factory2, node, classThis, thisExpression) { + if (classHasClassThisAssignment(node)) { + return node; + } + const staticBlock = createClassThisAssignmentBlock(factory2, classThis, thisExpression); + if (node.name) { + setSourceMapRange(staticBlock.body.statements[0], node.name); + } + const members = factory2.createNodeArray([staticBlock, ...node.members]); + setTextRange(members, node.members); + const updatedNode = isClassDeclaration(node) ? factory2.updateClassDeclaration( + node, + node.modifiers, + node.name, + node.typeParameters, + node.heritageClauses, + members + ) : factory2.updateClassExpression( + node, + node.modifiers, + node.name, + node.typeParameters, + node.heritageClauses, + members + ); + getOrCreateEmitNode(updatedNode).classThis = classThis; + return updatedNode; + } + var init_classThis = __esm({ + "src/compiler/transformers/classThis.ts"() { + "use strict"; + init_ts2(); + } + }); + + // src/compiler/transformers/namedEvaluation.ts + function getAssignedNameOfIdentifier(factory2, name, expression) { + const original = getOriginalNode(skipOuterExpressions(expression)); + if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier(original, 2048 /* Default */)) { + return factory2.createStringLiteral("default"); + } + return factory2.createStringLiteralFromNode(name); + } + function getAssignedNameOfPropertyName(context, name, assignedNameText) { + const { factory: factory2 } = context; + if (assignedNameText !== void 0) { + const assignedName2 = factory2.createStringLiteral(assignedNameText); + return { assignedName: assignedName2, name }; + } + if (isPropertyNameLiteral(name) || isPrivateIdentifier(name)) { + const assignedName2 = factory2.createStringLiteralFromNode(name); + return { assignedName: assignedName2, name }; + } + if (isPropertyNameLiteral(name.expression) && !isIdentifier(name.expression)) { + const assignedName2 = factory2.createStringLiteralFromNode(name.expression); + return { assignedName: assignedName2, name }; + } + const assignedName = factory2.getGeneratedNameForNode(name); + context.hoistVariableDeclaration(assignedName); + const key = context.getEmitHelperFactory().createPropKeyHelper(name.expression); + const assignment = factory2.createAssignment(assignedName, key); + const updatedName = factory2.updateComputedPropertyName(name, assignment); + return { assignedName, name: updatedName }; + } + function createClassNamedEvaluationHelperBlock(context, assignedName, thisExpression = context.factory.createThis()) { + const { factory: factory2 } = context; + const expression = context.getEmitHelperFactory().createSetFunctionNameHelper(thisExpression, assignedName); + const statement = factory2.createExpressionStatement(expression); + const body = factory2.createBlock( + [statement], + /*multiLine*/ + false + ); + const block = factory2.createClassStaticBlockDeclaration(body); + getOrCreateEmitNode(block).assignedName = assignedName; + return block; + } + function isClassNamedEvaluationHelperBlock(node) { + var _a; + if (!isClassStaticBlockDeclaration(node) || node.body.statements.length !== 1) { + return false; + } + const statement = node.body.statements[0]; + return isExpressionStatement(statement) && isCallToHelper(statement.expression, "___setFunctionName") && statement.expression.arguments.length >= 2 && statement.expression.arguments[1] === ((_a = node.emitNode) == null ? void 0 : _a.assignedName); + } + function classHasExplicitlyAssignedName(node) { + var _a; + return !!((_a = node.emitNode) == null ? void 0 : _a.assignedName) && some(node.members, isClassNamedEvaluationHelperBlock); + } + function classHasDeclaredOrExplicitlyAssignedName(node) { + return !!node.name || classHasExplicitlyAssignedName(node); + } + function injectClassNamedEvaluationHelperBlockIfMissing(context, node, assignedName, thisExpression) { + if (classHasExplicitlyAssignedName(node)) { + return node; + } + const { factory: factory2 } = context; + const namedEvaluationBlock = createClassNamedEvaluationHelperBlock(context, assignedName, thisExpression); + if (node.name) { + setSourceMapRange(namedEvaluationBlock.body.statements[0], node.name); + } + const insertionIndex = findIndex(node.members, isClassThisAssignmentBlock) + 1; + const leading = node.members.slice(0, insertionIndex); + const trailing = node.members.slice(insertionIndex); + const members = factory2.createNodeArray([...leading, namedEvaluationBlock, ...trailing]); + setTextRange(members, node.members); + node = isClassDeclaration(node) ? factory2.updateClassDeclaration( + node, + node.modifiers, + node.name, + node.typeParameters, + node.heritageClauses, + members + ) : factory2.updateClassExpression( + node, + node.modifiers, + node.name, + node.typeParameters, + node.heritageClauses, + members + ); + getOrCreateEmitNode(node).assignedName = assignedName; + return node; + } + function finishTransformNamedEvaluation(context, expression, assignedName, ignoreEmptyStringLiteral) { + if (ignoreEmptyStringLiteral && isStringLiteral(assignedName) && isEmptyStringLiteral(assignedName)) { + return expression; + } + const { factory: factory2 } = context; + const innerExpression = skipOuterExpressions(expression); + const updatedExpression = isClassExpression(innerExpression) ? cast(injectClassNamedEvaluationHelperBlockIfMissing(context, innerExpression, assignedName), isClassExpression) : context.getEmitHelperFactory().createSetFunctionNameHelper(innerExpression, assignedName); + return factory2.restoreOuterExpressions(expression, updatedExpression); + } + function transformNamedEvaluationOfPropertyAssignment(context, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context; + const { assignedName, name } = getAssignedNameOfPropertyName(context, node.name, assignedNameText); + const initializer = finishTransformNamedEvaluation(context, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updatePropertyAssignment( + node, + name, + initializer + ); + } + function transformNamedEvaluationOfShorthandAssignmentProperty(context, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.name, node.objectAssignmentInitializer); + const objectAssignmentInitializer = finishTransformNamedEvaluation(context, node.objectAssignmentInitializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updateShorthandPropertyAssignment( + node, + node.name, + objectAssignmentInitializer + ); + } + function transformNamedEvaluationOfVariableDeclaration(context, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.name, node.initializer); + const initializer = finishTransformNamedEvaluation(context, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updateVariableDeclaration( + node, + node.name, + node.exclamationToken, + node.type, + initializer + ); + } + function transformNamedEvaluationOfParameterDeclaration(context, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.name, node.initializer); + const initializer = finishTransformNamedEvaluation(context, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updateParameterDeclaration( + node, + node.modifiers, + node.dotDotDotToken, + node.name, + node.questionToken, + node.type, + initializer + ); + } + function transformNamedEvaluationOfBindingElement(context, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.name, node.initializer); + const initializer = finishTransformNamedEvaluation(context, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updateBindingElement( + node, + node.dotDotDotToken, + node.propertyName, + node.name, + initializer + ); + } + function transformNamedEvaluationOfPropertyDeclaration(context, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context; + const { assignedName, name } = getAssignedNameOfPropertyName(context, node.name, assignedNameText); + const initializer = finishTransformNamedEvaluation(context, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updatePropertyDeclaration( + node, + node.modifiers, + name, + node.questionToken ?? node.exclamationToken, + node.type, + initializer + ); + } + function transformNamedEvaluationOfAssignmentExpression(context, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.left, node.right); + const right = finishTransformNamedEvaluation(context, node.right, assignedName, ignoreEmptyStringLiteral); + return factory2.updateBinaryExpression( + node, + node.left, + node.operatorToken, + right + ); + } + function transformNamedEvaluationOfExportAssignment(context, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const expression = finishTransformNamedEvaluation(context, node.expression, assignedName, ignoreEmptyStringLiteral); + return factory2.updateExportAssignment( + node, + node.modifiers, + expression + ); + } + function transformNamedEvaluation(context, node, ignoreEmptyStringLiteral, assignedName) { + switch (node.kind) { + case 303 /* PropertyAssignment */: + return transformNamedEvaluationOfPropertyAssignment(context, node, ignoreEmptyStringLiteral, assignedName); + case 304 /* ShorthandPropertyAssignment */: + return transformNamedEvaluationOfShorthandAssignmentProperty(context, node, ignoreEmptyStringLiteral, assignedName); + case 260 /* VariableDeclaration */: + return transformNamedEvaluationOfVariableDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); + case 169 /* Parameter */: + return transformNamedEvaluationOfParameterDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); + case 208 /* BindingElement */: + return transformNamedEvaluationOfBindingElement(context, node, ignoreEmptyStringLiteral, assignedName); + case 172 /* PropertyDeclaration */: + return transformNamedEvaluationOfPropertyDeclaration(context, node, ignoreEmptyStringLiteral, assignedName); + case 226 /* BinaryExpression */: + return transformNamedEvaluationOfAssignmentExpression(context, node, ignoreEmptyStringLiteral, assignedName); + case 277 /* ExportAssignment */: + return transformNamedEvaluationOfExportAssignment(context, node, ignoreEmptyStringLiteral, assignedName); + } + } + var init_namedEvaluation = __esm({ + "src/compiler/transformers/namedEvaluation.ts"() { + "use strict"; + init_ts2(); + } + }); + // src/compiler/transformers/taggedTemplate.ts function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) { const tag = visitNode(node.tag, visitor, isExpression); @@ -358472,10 +361856,7 @@ ${lanes.join("\n")} function getRawLiteral(factory2, node, currentSourceFile) { let text = node.rawText; if (text === void 0) { - Debug.assertIsDefined( - currentSourceFile, - "Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform." - ); + Debug.assertIsDefined(currentSourceFile, "Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."); text = getSourceTextOfNodeFromSourceFile(currentSourceFile, node); const isLast = node.kind === 15 /* NoSubstitutionTemplateLiteral */ || node.kind === 18 /* TemplateTail */; text = text.substring(1, text.length - (isLast ? 1 : 2)); @@ -358516,8 +361897,8 @@ ${lanes.join("\n")} const previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(210 /* PropertyAccessExpression */); - context.enableSubstitution(211 /* ElementAccessExpression */); + context.enableSubstitution(211 /* PropertyAccessExpression */); + context.enableSubstitution(212 /* ElementAccessExpression */); let currentSourceFile; let currentNamespace; let currentNamespaceContainerName; @@ -358528,18 +361909,21 @@ ${lanes.join("\n")} let applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 312 /* Bundle */) { + if (node.kind === 313 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { - return factory2.createBundle(node.sourceFiles.map(transformSourceFile), mapDefined(node.prepends, (prepend) => { - if (prepend.kind === 314 /* InputFiles */) { - return createUnparsedSourceFile(prepend, "js"); - } - return prepend; - })); + return factory2.createBundle( + node.sourceFiles.map(transformSourceFile), + mapDefined(node.prepends, (prepend) => { + if (prepend.kind === 315 /* InputFiles */) { + return createUnparsedSourceFile(prepend, "js"); + } + return prepend; + }) + ); } function transformSourceFile(node) { if (node.isDeclarationFile) { @@ -358566,22 +361950,22 @@ ${lanes.join("\n")} } function onBeforeVisitNode(node) { switch (node.kind) { - case 311 /* SourceFile */: - case 268 /* CaseBlock */: - case 267 /* ModuleBlock */: - case 240 /* Block */: + case 312 /* SourceFile */: + case 269 /* CaseBlock */: + case 268 /* ModuleBlock */: + case 241 /* Block */: currentLexicalScope = node; currentScopeFirstDeclarationsOfName = void 0; break; - case 262 /* ClassDeclaration */: - case 261 /* FunctionDeclaration */: - if (hasSyntacticModifier(node, 2 /* Ambient */)) { + case 263 /* ClassDeclaration */: + case 262 /* FunctionDeclaration */: + if (hasSyntacticModifier(node, 128 /* Ambient */)) { break; } if (node.name) { recordEmittedDeclarationInScope(node); } else { - Debug.assert(node.kind === 262 /* ClassDeclaration */ || hasSyntacticModifier(node, 1024 /* Default */)); + Debug.assert(node.kind === 263 /* ClassDeclaration */ || hasSyntacticModifier(node, 2048 /* Default */)); } break; } @@ -358600,31 +361984,72 @@ ${lanes.join("\n")} } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: - case 270 /* ImportEqualsDeclaration */: - case 276 /* ExportAssignment */: - case 277 /* ExportDeclaration */: + case 272 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 277 /* ExportAssignment */: + case 278 /* ExportDeclaration */: return visitElidableStatement(node); default: 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); } return node; } switch (node.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return visitImportDeclaration(node); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return visitExportAssignment(node); - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: return visitExportDeclaration(node); default: Debug.fail("Unhandled ellided statement"); @@ -358634,9 +362059,9 @@ ${lanes.join("\n")} return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 277 /* ExportDeclaration */ || node.kind === 271 /* ImportDeclaration */ || node.kind === 272 /* ImportClause */ || node.kind === 270 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 282 /* ExternalModuleReference */) { + if (node.kind === 278 /* ExportDeclaration */ || node.kind === 272 /* ImportDeclaration */ || node.kind === 273 /* ImportClause */ || node.kind === 271 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 283 /* ExternalModuleReference */) { return void 0; - } else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 1 /* Export */)) { + } else if (node.transformFlags & 1 /* ContainsTypeScript */ || hasSyntacticModifier(node, 32 /* Export */)) { return visitTypeScript(node); } return node; @@ -358646,21 +362071,21 @@ ${lanes.join("\n")} } function classElementVisitorWorker(node, parent2) { switch (node.kind) { - case 175 /* Constructor */: + case 176 /* Constructor */: return visitConstructor(node); - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return visitPropertyDeclaration(node, parent2); - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return visitGetAccessor(node, parent2); - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return visitSetAccessor(node, parent2); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return visitMethodDeclaration(node, parent2); - case 174 /* ClassStaticBlockDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: return visitEachChild(node, visitor, context); - case 239 /* SemicolonClassElement */: + case 240 /* SemicolonClassElement */: return node; - case 180 /* IndexSignature */: + case 181 /* IndexSignature */: return; default: return Debug.failBadSyntaxKind(node); @@ -358671,15 +362096,15 @@ ${lanes.join("\n")} } function objectLiteralElementVisitorWorker(node, parent2) { switch (node.kind) { - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: - case 304 /* SpreadAssignment */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: + case 305 /* SpreadAssignment */: return visitor(node); - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return visitGetAccessor(node, parent2); - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return visitSetAccessor(node, parent2); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return visitMethodDeclaration(node, parent2); default: return Debug.failBadSyntaxKind(node); @@ -358694,7 +362119,7 @@ ${lanes.join("\n")} function modifierVisitor(node) { if (isDecorator(node)) return void 0; - if (modifierToFlag(node.kind) & 117086 /* TypeScriptModifier */) { + if (modifierToFlag(node.kind) & 28895 /* TypeScriptModifier */) { return void 0; } else if (currentNamespace && node.kind === 95 /* ExportKeyword */) { return void 0; @@ -358702,7 +362127,7 @@ ${lanes.join("\n")} return node; } function visitTypeScript(node) { - if (isStatement(node) && hasSyntacticModifier(node, 2 /* Ambient */)) { + if (isStatement(node) && hasSyntacticModifier(node, 128 /* Ambient */)) { return factory2.createNotEmittedStatement(node); } switch (node.kind) { @@ -358713,19 +362138,19 @@ ${lanes.join("\n")} case 123 /* PrivateKeyword */: case 124 /* ProtectedKeyword */: case 128 /* AbstractKeyword */: - case 163 /* OverrideKeyword */: + case 164 /* OverrideKeyword */: case 87 /* ConstKeyword */: case 138 /* DeclareKeyword */: case 148 /* ReadonlyKeyword */: case 103 /* InKeyword */: case 147 /* OutKeyword */: - case 187 /* ArrayType */: - case 188 /* TupleType */: - case 189 /* OptionalType */: - case 190 /* RestType */: - case 186 /* TypeLiteral */: - case 181 /* TypePredicate */: - case 167 /* TypeParameter */: + case 188 /* ArrayType */: + case 189 /* TupleType */: + case 190 /* OptionalType */: + case 191 /* RestType */: + case 187 /* TypeLiteral */: + case 182 /* TypePredicate */: + case 168 /* TypeParameter */: case 133 /* AnyKeyword */: case 159 /* UnknownKeyword */: case 136 /* BooleanKeyword */: @@ -358734,80 +362159,80 @@ ${lanes.join("\n")} case 146 /* NeverKeyword */: case 116 /* VoidKeyword */: case 155 /* SymbolKeyword */: - case 184 /* ConstructorType */: - case 183 /* FunctionType */: - case 185 /* TypeQuery */: - case 182 /* TypeReference */: - case 191 /* UnionType */: - case 192 /* IntersectionType */: - case 193 /* ConditionalType */: - case 195 /* ParenthesizedType */: - case 196 /* ThisType */: - case 197 /* TypeOperator */: - case 198 /* IndexedAccessType */: - case 199 /* MappedType */: - case 200 /* LiteralType */: - case 180 /* IndexSignature */: + case 185 /* ConstructorType */: + case 184 /* FunctionType */: + case 186 /* TypeQuery */: + case 183 /* TypeReference */: + case 192 /* UnionType */: + case 193 /* IntersectionType */: + case 194 /* ConditionalType */: + case 196 /* ParenthesizedType */: + case 197 /* ThisType */: + case 198 /* TypeOperator */: + case 199 /* IndexedAccessType */: + case 200 /* MappedType */: + case 201 /* LiteralType */: + case 181 /* IndexSignature */: return void 0; - case 264 /* TypeAliasDeclaration */: + case 265 /* TypeAliasDeclaration */: return factory2.createNotEmittedStatement(node); - case 269 /* NamespaceExportDeclaration */: + case 270 /* NamespaceExportDeclaration */: return void 0; - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: return factory2.createNotEmittedStatement(node); - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: return visitClassExpression(node); - case 297 /* HeritageClause */: + case 298 /* HeritageClause */: return visitHeritageClause(node); - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return visitExpressionWithTypeArguments(node); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 175 /* Constructor */: - case 171 /* PropertyDeclaration */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 174 /* ClassStaticBlockDeclaration */: + case 176 /* Constructor */: + case 172 /* PropertyDeclaration */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 175 /* ClassStaticBlockDeclaration */: return Debug.fail("Class and object literal elements must be visited with their respective visitors"); - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: return visitFunctionExpression(node); - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return visitArrowFunction(node); - case 168 /* Parameter */: + case 169 /* Parameter */: return visitParameter(node); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitParenthesizedExpression(node); - case 215 /* TypeAssertionExpression */: - case 233 /* AsExpression */: + case 216 /* TypeAssertionExpression */: + case 234 /* AsExpression */: return visitAssertionExpression(node); - case 237 /* SatisfiesExpression */: + case 238 /* SatisfiesExpression */: return visitSatisfiesExpression(node); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return visitCallExpression(node); - case 213 /* NewExpression */: + case 214 /* NewExpression */: return visitNewExpression(node); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 234 /* NonNullExpression */: + case 235 /* NonNullExpression */: return visitNonNullExpression(node); - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: return visitEnumDeclaration(node); - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return visitVariableStatement(node); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return visitModuleDeclaration(node); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 284 /* JsxSelfClosingElement */: + case 285 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node); - case 285 /* JsxOpeningElement */: + case 286 /* JsxOpeningElement */: return visitJsxJsxOpeningElement(node); default: return visitEachChild(node, visitor, context); @@ -358917,25 +362342,25 @@ ${lanes.join("\n")} insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment()); const iife = factory2.createImmediatelyInvokedArrowFunction(statements); setInternalEmitFlags(iife, 1 /* TypeScriptClassWrapper */); - const modifiers2 = facts & 16 /* IsNamedExternalExport */ ? factory2.createModifiersFromModifierFlags(1 /* Export */) : void 0; + const varDecl = factory2.createVariableDeclaration( + factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + false + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ); + setOriginalNode(varDecl, node); const varStatement = factory2.createVariableStatement( - modifiers2, - factory2.createVariableDeclarationList([ - factory2.createVariableDeclaration( - factory2.getLocalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - false - ), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - iife - ) - ], 1 /* Let */) + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([varDecl], 1 /* Let */) ); setOriginalNode(varStatement, node); setCommentRange(varStatement, node); @@ -358964,10 +362389,10 @@ ${lanes.join("\n")} )) ]; } - if (facts & 16 /* IsNamedExternalExport */ && !promoteToIIFE) { + if (facts & 16 /* IsNamedExternalExport */) { return [ statement, - factory2.createExternalModuleExport(factory2.getLocalName( + factory2.createExternalModuleExport(factory2.getDeclarationName( node, /*allowComments*/ false, @@ -359131,19 +362556,19 @@ ${lanes.join("\n")} } function shouldAddTypeMetadata(node) { const kind = node.kind; - return kind === 173 /* MethodDeclaration */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */ || kind === 171 /* PropertyDeclaration */; + return kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 172 /* PropertyDeclaration */; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 173 /* MethodDeclaration */; + return node.kind === 174 /* MethodDeclaration */; } function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: return getFirstConstructorWithBody(node) !== void 0; - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return true; } return false; @@ -359192,7 +362617,7 @@ ${lanes.join("\n")} return !nodeIsMissing(node.body); } function visitPropertyDeclaration(node, parent2) { - const isAmbient = node.flags & 16777216 /* Ambient */ || hasSyntacticModifier(node, 256 /* Abstract */); + const isAmbient = node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 64 /* Abstract */); if (isAmbient && !(legacyDecorators && hasDecorators(node))) { return void 0; } @@ -359201,7 +362626,7 @@ ${lanes.join("\n")} if (isAmbient) { return factory2.updatePropertyDeclaration( node, - concatenate(modifiers, factory2.createModifiersFromModifierFlags(2 /* Ambient */)), + concatenate(modifiers, factory2.createModifiersFromModifierFlags(128 /* Ambient */)), Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), /*questionOrExclamationToken*/ void 0, @@ -359234,6 +362659,35 @@ ${lanes.join("\n")} transformConstructorBody(node.body, node) ); } + function transformConstructorBodyWorker(statementsOut, statementsIn, statementOffset, superPath, superPathDepth, initializerStatements) { + const superStatementIndex = superPath[superPathDepth]; + const superStatement = statementsIn[superStatementIndex]; + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset, superStatementIndex - statementOffset)); + if (isTryStatement(superStatement)) { + const tryBlockStatements = []; + transformConstructorBodyWorker( + tryBlockStatements, + superStatement.tryBlock.statements, + /*statementOffset*/ + 0, + superPath, + superPathDepth + 1, + initializerStatements + ); + const tryBlockStatementsArray = factory2.createNodeArray(tryBlockStatements); + setTextRange(tryBlockStatementsArray, superStatement.tryBlock.statements); + statementsOut.push(factory2.updateTryStatement( + superStatement, + factory2.updateBlock(superStatement.tryBlock, tryBlockStatements), + visitNode(superStatement.catchClause, visitor, isCatchClause), + visitNode(superStatement.finallyBlock, visitor, isBlock) + )); + } else { + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex, 1)); + addRange(statementsOut, initializerStatements); + } + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex + 1)); + } function transformConstructorBody(body, constructor) { const parametersWithPropertyAssignments = constructor && filter(constructor.parameters, (p) => isParameterPropertyDeclaration(p, constructor)); if (!some(parametersWithPropertyAssignments)) { @@ -359248,25 +362702,22 @@ ${lanes.join("\n")} false, visitor ); - const superStatementIndex = findSuperStatementIndex(body.statements, prologueStatementCount); - if (superStatementIndex >= 0) { - addRange( + const superPath = findSuperStatementIndexPath(body.statements, prologueStatementCount); + const parameterPropertyAssignments = mapDefined(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment); + if (superPath.length) { + transformConstructorBodyWorker( statements, - visitNodes2(body.statements, visitor, isStatement, prologueStatementCount, superStatementIndex + 1 - prologueStatementCount) + body.statements, + prologueStatementCount, + superPath, + /*superPathDepth*/ + 0, + parameterPropertyAssignments ); - } - const parameterPropertyAssignments = mapDefined(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment); - if (superStatementIndex >= 0) { - addRange(statements, parameterPropertyAssignments); } else { - statements = [ - ...statements.slice(0, prologueStatementCount), - ...parameterPropertyAssignments, - ...statements.slice(prologueStatementCount) - ]; + addRange(statements, parameterPropertyAssignments); + addRange(statements, visitNodes2(body.statements, visitor, isStatement, prologueStatementCount)); } - const start = superStatementIndex >= 0 ? superStatementIndex + 1 : prologueStatementCount; - addRange(statements, visitNodes2(body.statements, visitor, isStatement, start)); statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); const block = factory2.createBlock( setTextRange(factory2.createNodeArray(statements), body.statements), @@ -359338,7 +362789,7 @@ ${lanes.join("\n")} ); } function shouldEmitAccessorDeclaration(node) { - return !(nodeIsMissing(node.body) && hasSyntacticModifier(node, 256 /* Abstract */)); + return !(nodeIsMissing(node.body) && hasSyntacticModifier(node, 64 /* Abstract */)); } function visitGetAccessor(node, parent2) { if (!(node.transformFlags & 1 /* ContainsTypeScript */)) { @@ -359717,7 +363168,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) { @@ -359762,7 +363213,7 @@ ${lanes.join("\n")} /*allowSourceMaps*/ true )); - const varFlags = currentLexicalScope.kind === 311 /* SourceFile */ ? 0 /* None */ : 1 /* Let */; + const varFlags = currentLexicalScope.kind === 312 /* SourceFile */ ? 0 /* None */ : 1 /* Let */; const statement = factory2.createVariableStatement( visitNodes2(node.modifiers, modifierVisitor, isModifier), factory2.createVariableDeclarationList([varDecl], varFlags) @@ -359773,7 +363224,7 @@ ${lanes.join("\n")} setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 265 /* EnumDeclaration */) { + if (node.kind === 266 /* EnumDeclaration */) { setSourceMapRange(statement.declarationList, node); } else { setSourceMapRange(statement, node); @@ -359881,7 +363332,7 @@ ${lanes.join("\n")} let statementsLocation; let blockLocation; if (node.body) { - if (node.body.kind === 267 /* ModuleBlock */) { + if (node.body.kind === 268 /* ModuleBlock */) { saveStateAndInvoke(node.body, (body) => addRange(statements, visitNodes2(body.statements, namespaceElementVisitor, isStatement))); statementsLocation = node.body.statements; blockLocation = node.body; @@ -359912,13 +363363,13 @@ ${lanes.join("\n")} true ); setTextRange(block, blockLocation); - if (!node.body || node.body.kind !== 267 /* ModuleBlock */) { + if (!node.body || node.body.kind !== 268 /* ModuleBlock */) { setEmitFlags(block, getEmitFlags(block) | 3072 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 266 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 267 /* ModuleDeclaration */) { const recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -359937,7 +363388,7 @@ ${lanes.join("\n")} void 0, importClause, node.moduleSpecifier, - node.assertClause + node.attributes ) : void 0; } function visitImportClause(node) { @@ -359953,7 +363404,7 @@ ${lanes.join("\n")} ) : void 0; } function visitNamedImportBindings(node) { - if (node.kind === 273 /* NamespaceImport */) { + if (node.kind === 274 /* NamespaceImport */) { return shouldEmitAliasDeclaration(node) ? node : void 0; } else { const allowEmpty = compilerOptions.verbatimModuleSyntax || compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ || compilerOptions.importsNotUsedAsValues === 2 /* Error */); @@ -359987,7 +363438,7 @@ ${lanes.join("\n")} node.isTypeOnly, exportClause, node.moduleSpecifier, - node.assertClause + node.attributes ) : void 0; } function visitNamedExports(node, allowEmpty) { @@ -360021,7 +363472,7 @@ ${lanes.join("\n")} /*importClause*/ void 0, node.moduleReference.expression, - /*assertClause*/ + /*attributes*/ void 0 ), node @@ -360071,16 +363522,16 @@ ${lanes.join("\n")} } } function isExportOfNamespace(node) { - return currentNamespace !== void 0 && hasSyntacticModifier(node, 1 /* Export */); + return currentNamespace !== void 0 && hasSyntacticModifier(node, 32 /* Export */); } function isExternalModuleExport(node) { - return currentNamespace === void 0 && hasSyntacticModifier(node, 1 /* Export */); + return currentNamespace === void 0 && hasSyntacticModifier(node, 32 /* Export */); } function isNamedExternalModuleExport(node) { - return isExternalModuleExport(node) && !hasSyntacticModifier(node, 1024 /* Default */); + return isExternalModuleExport(node) && !hasSyntacticModifier(node, 2048 /* Default */); } function isDefaultExternalModuleExport(node) { - return isExternalModuleExport(node) && hasSyntacticModifier(node, 1024 /* Default */); + return isExternalModuleExport(node) && hasSyntacticModifier(node, 2048 /* Default */); } function createExportMemberAssignmentStatement(node) { const expression = factory2.createAssignment( @@ -360151,15 +363602,15 @@ ${lanes.join("\n")} if ((enabledSubstitutions & 2 /* NamespaceExports */) === 0) { enabledSubstitutions |= 2 /* NamespaceExports */; context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(303 /* ShorthandPropertyAssignment */); - context.enableEmitNotification(266 /* ModuleDeclaration */); + context.enableSubstitution(304 /* ShorthandPropertyAssignment */); + context.enableEmitNotification(267 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return getOriginalNode(node).kind === 266 /* ModuleDeclaration */; + return getOriginalNode(node).kind === 267 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return getOriginalNode(node).kind === 265 /* EnumDeclaration */; + return getOriginalNode(node).kind === 266 /* EnumDeclaration */; } function onEmitNode(hint, node, emitCallback) { const savedApplicableSubstitutions = applicableSubstitutions; @@ -360204,9 +363655,9 @@ ${lanes.join("\n")} switch (node.kind) { case 80 /* Identifier */: return substituteExpressionIdentifier(node); - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -360221,8 +363672,8 @@ ${lanes.join("\n")} /*prefixLocals*/ false ); - if (container && container.kind !== 311 /* SourceFile */) { - const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 266 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 265 /* EnumDeclaration */; + if (container && container.kind !== 312 /* SourceFile */) { + const substitute = applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 267 /* ModuleDeclaration */ || applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 266 /* EnumDeclaration */; if (substitute) { return setTextRange( factory2.createPropertyAccessExpression(factory2.getGeneratedNameForNode(container), node), @@ -360247,7 +363698,7 @@ ${lanes.join("\n")} const constantValue = tryGetConstEnumValue(node); if (constantValue !== void 0) { setConstantValue(node, constantValue); - const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(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))} `); @@ -360310,8 +363761,9 @@ ${lanes.join("\n")} let pendingStatements; let lexicalEnvironment; const lexicalEnvironmentMap = /* @__PURE__ */ new Map(); + const noSubstitution = /* @__PURE__ */ new Set(); let currentClassContainer; - let currentStaticPropertyDeclarationOrStaticBlock; + let currentClassElement; let shouldSubstituteThisWithClassThis = false; let previousShouldSubstituteThisWithClassThis = false; return chainBundle(context, transformSourceFile); @@ -360343,76 +363795,77 @@ ${lanes.join("\n")} switch (node.kind) { case 129 /* AccessorKeyword */: return Debug.fail("Use `modifierVisitor` instead."); - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ClassExpression */: - return visitClassExpression( - node, - /*referencedName*/ - void 0 - ); - case 174 /* ClassStaticBlockDeclaration */: - case 171 /* PropertyDeclaration */: + case 231 /* ClassExpression */: + return visitClassExpression(node); + case 175 /* ClassStaticBlockDeclaration */: + case 172 /* PropertyDeclaration */: return Debug.fail("Use `classElementVisitor` instead."); - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return visitPropertyAssignment(node); - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return visitVariableStatement(node); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 168 /* Parameter */: + case 169 /* Parameter */: return visitParameterDeclaration(node); - case 207 /* BindingElement */: + case 208 /* BindingElement */: return visitBindingElement(node); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return visitExportAssignment(node); case 81 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ false ); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ false ); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ - false, - /*referencedName*/ - void 0 + false ); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return visitCallExpression(node); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return visitExpressionStatement(node); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatement(node); - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 175 /* Constructor */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: { - return setCurrentStaticPropertyDeclarationOrStaticBlockAnd( - /*current*/ + case 110 /* ThisKeyword */: + return visitThisExpression(node); + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + return setCurrentClassElementAnd( + /*classElement*/ void 0, fallbackVisitor, node ); + case 176 /* Constructor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: { + return setCurrentClassElementAnd( + node, + fallbackVisitor, + node + ); } default: return fallbackVisitor(node); @@ -360421,56 +363874,32 @@ ${lanes.join("\n")} function fallbackVisitor(node) { return visitEachChild(node, visitor, context); } - function namedEvaluationVisitor(node, referencedName) { - switch (node.kind) { - case 359 /* PartiallyEmittedExpression */: - return visitPartiallyEmittedExpression( - node, - /*discarded*/ - false, - referencedName - ); - case 216 /* ParenthesizedExpression */: - return visitParenthesizedExpression( - node, - /*discarded*/ - false, - referencedName - ); - case 230 /* ClassExpression */: - return visitClassExpression(node, referencedName); - default: - return visitor(node); - } - } function discardedValueVisitor(node) { switch (node.kind) { - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ true ); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ true ); - case 360 /* CommaListExpression */: + case 361 /* CommaListExpression */: return visitCommaListExpression( node, /*discarded*/ true ); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ - true, - /*referencedName*/ - void 0 + true ); default: return visitor(node); @@ -360478,9 +363907,9 @@ ${lanes.join("\n")} } function heritageClauseVisitor(node) { switch (node.kind) { - case 297 /* HeritageClause */: + case 298 /* HeritageClause */: return visitEachChild(node, heritageClauseVisitor, context); - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return visitExpressionWithTypeArgumentsInHeritageClause(node); default: return visitor(node); @@ -360488,8 +363917,8 @@ ${lanes.join("\n")} } function assignmentTargetVisitor(node) { switch (node.kind) { - case 209 /* ObjectLiteralExpression */: - case 208 /* ArrayLiteralExpression */: + case 210 /* ObjectLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -360497,29 +363926,35 @@ ${lanes.join("\n")} } function classElementVisitor(node) { switch (node.kind) { - case 175 /* Constructor */: - return visitConstructorDeclaration(node); - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 173 /* MethodDeclaration */: - return setCurrentStaticPropertyDeclarationOrStaticBlockAnd( - /*current*/ - void 0, + case 176 /* Constructor */: + return setCurrentClassElementAnd( + node, + visitConstructorDeclaration, + node + ); + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: + return setCurrentClassElementAnd( + node, visitMethodOrAccessorDeclaration, node ); - case 171 /* PropertyDeclaration */: - return setCurrentStaticPropertyDeclarationOrStaticBlockAnd( - /*current*/ - void 0, + case 172 /* PropertyDeclaration */: + return setCurrentClassElementAnd( + node, visitPropertyDeclaration, node ); - case 174 /* ClassStaticBlockDeclaration */: - return visitClassStaticBlockDeclaration(node); - case 166 /* ComputedPropertyName */: + case 175 /* ClassStaticBlockDeclaration */: + return setCurrentClassElementAnd( + node, + visitClassStaticBlockDeclaration, + node + ); + case 167 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 239 /* SemicolonClassElement */: + case 240 /* SemicolonClassElement */: return node; default: return isModifierLike(node) ? modifierVisitor(node) : visitor(node); @@ -360527,7 +363962,7 @@ ${lanes.join("\n")} } function propertyNameVisitor(node) { switch (node.kind) { - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: return visitComputedPropertyName(node); default: return visitor(node); @@ -360535,10 +363970,10 @@ ${lanes.join("\n")} } function accessorFieldResultVisitor(node) { switch (node.kind) { - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return transformFieldInitializer(node); - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return classElementVisitor(node); default: Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration"); @@ -360567,9 +364002,7 @@ ${lanes.join("\n")} } function visitPropertyAssignment(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const { referencedName, name } = visitReferencedPropertyName(node.name); - const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); - return factory2.updatePropertyAssignment(node, name, initializer); + node = transformNamedEvaluation(context, node); } return visitEachChild(node, visitor, context); } @@ -360581,71 +364014,33 @@ ${lanes.join("\n")} pendingStatements = savedPendingStatements; return statement; } - function getAssignedNameOfIdentifier(name, initializer) { - const originalClass = getOriginalNode(initializer, isClassLike); - return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); - } function visitVariableDeclaration(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); - const name = visitNode(node.name, visitor, isBindingName); - const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateVariableDeclaration( - node, - name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ); + node = transformNamedEvaluation(context, node); } return visitEachChild(node, visitor, context); } function visitParameterDeclaration(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); - const name = visitNode(node.name, visitor, isBindingName); - const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateParameterDeclaration( - node, - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - name, - /*questionToken*/ - void 0, - /*type*/ - void 0, - initializer - ); + node = transformNamedEvaluation(context, node); } return visitEachChild(node, visitor, context); } function visitBindingElement(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); - const propertyName = visitNode(node.propertyName, visitor, isPropertyName); - const name = visitNode(node.name, visitor, isBindingName); - const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateBindingElement( - node, - /*dotDotDotToken*/ - void 0, - propertyName, - name, - initializer - ); + node = transformNamedEvaluation(context, node); } return visitEachChild(node, visitor, context); } function visitExportAssignment(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); - const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); - const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateExportAssignment(node, modifiers, expression); + node = transformNamedEvaluation( + context, + node, + /*ignoreEmptyStringLiteral*/ + true, + node.isExportEquals ? "" : "default" + ); } return visitEachChild(node, visitor, context); } @@ -360710,12 +364105,15 @@ ${lanes.join("\n")} } return void 0; } - function setCurrentStaticPropertyDeclarationOrStaticBlockAnd(current, visitor2, arg) { - const savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock; - currentStaticPropertyDeclarationOrStaticBlock = current; - const result = visitor2(arg); - currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock; - return result; + function setCurrentClassElementAnd(classElement, visitor2, arg) { + if (classElement !== currentClassElement) { + const savedCurrentClassElement = currentClassElement; + currentClassElement = classElement; + const result = visitor2(arg); + currentClassElement = savedCurrentClassElement; + return result; + } + return visitor2(arg); } function getHoistedFunctionName(node) { Debug.assert(isPrivateIdentifier(node.name)); @@ -360733,6 +364131,11 @@ ${lanes.join("\n")} } } } + function getClassThis() { + const lex = getClassLexicalEnvironment(); + const classThis = lex.classThis ?? lex.classConstructor ?? (currentClassContainer == null ? void 0 : currentClassContainer.name); + return Debug.checkDefined(classThis); + } function transformAutoAccessor(node) { const commentRange = getCommentRange(node); const sourceMapRange = getSourceMapRange(node); @@ -360759,11 +364162,13 @@ ${lanes.join("\n")} setOriginalNode(backingField, node); setEmitFlags(backingField, 3072 /* NoComments */); setSourceMapRange(backingField, sourceMapRange); - const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName); + const receiver = isStatic(node) ? getClassThis() : factory2.createThis(); + const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName, receiver); setOriginalNode(getter, node); setCommentRange(getter, commentRange); setSourceMapRange(getter, sourceMapRange); - const setter = createAccessorPropertySetRedirector(factory2, node, modifiers, setterName); + const setterModifiers = factory2.createModifiersFromModifierFlags(modifiersToFlags(modifiers)); + const setter = createAccessorPropertySetRedirector(factory2, node, setterModifiers, setterName, receiver); setOriginalNode(setter, node); setEmitFlags(setter, 3072 /* NoComments */); setSourceMapRange(setter, sourceMapRange); @@ -360802,17 +364207,7 @@ ${lanes.join("\n")} ); } if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const { referencedName, name } = visitReferencedPropertyName(node.name); - return factory2.updatePropertyDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - name, - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression) - ); + node = transformNamedEvaluation(context, node); } return factory2.updatePropertyDeclaration( node, @@ -360830,9 +364225,7 @@ ${lanes.join("\n")} const expr = getPropertyNameExpressionIfNeeded( node.name, /*shouldHoist*/ - !!node.initializer || useDefineForClassFields, - /*captureReferencedName*/ - isNamedEvaluation(node, isAnonymousClassNeedingAssignedName) + !!node.initializer || useDefineForClassFields ); if (expr) { getPendingExpressions().push(...flattenCommaList(expr)); @@ -360877,8 +364270,21 @@ ${lanes.join("\n")} } return transformFieldInitializer(node); } + function shouldForceDynamicThis() { + return !!currentClassElement && hasStaticModifier(currentClassElement) && isAccessor(currentClassElement) && isAutoAccessorPropertyDeclaration(getOriginalNode(currentClassElement)); + } + function ensureDynamicThisIfNeeded(node) { + if (shouldForceDynamicThis()) { + const innerExpression = skipOuterExpressions(node); + if (innerExpression.kind === 110 /* ThisKeyword */) { + noSubstitution.add(innerExpression); + } + } + } function createPrivateIdentifierAccess(info, receiver) { - return createPrivateIdentifierAccessHelper(info, visitNode(receiver, visitor, isExpression)); + receiver = visitNode(receiver, visitor, isExpression); + ensureDynamicThisIfNeeded(receiver); + return createPrivateIdentifierAccessHelper(info, receiver); } function createPrivateIdentifierAccessHelper(info, receiver) { setCommentRange(receiver, moveRangePos(receiver, -1)); @@ -360923,7 +364329,7 @@ ${lanes.join("\n")} ); } } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node) && isIdentifier(node.name) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); @@ -360942,7 +364348,7 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitElementAccessExpression(node) { - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); @@ -360967,6 +364373,7 @@ ${lanes.join("\n")} let info; if (info = accessPrivateIdentifier2(operand.name)) { const receiver = visitNode(operand.expression, visitor, isExpression); + ensureDynamicThisIfNeeded(receiver); const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver); let expression = createPrivateIdentifierAccess(info, readExpression); const temp = isPrefixUnaryExpression(node) || discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); @@ -360985,7 +364392,7 @@ ${lanes.join("\n")} } return expression; } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + } else if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(operand) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { const expression = visitInvalidSuperProperty(operand); @@ -361042,6 +364449,9 @@ ${lanes.join("\n")} } function createCopiableReceiverExpr(receiver) { const clone2 = nodeIsSynthesized(receiver) ? receiver : factory2.cloneNode(receiver); + if (receiver.kind === 110 /* ThisKeyword */ && noSubstitution.has(receiver)) { + noSubstitution.add(clone2); + } if (isSimpleInlineableExpression(receiver)) { return { readExpression: clone2, initializeExpression: void 0 }; } @@ -361072,7 +364482,7 @@ ${lanes.join("\n")} [visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)] ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && ((_a = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node.expression) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && ((_a = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a.classConstructor)) { const invocation = factory2.createFunctionCallCall( visitNode(node.expression, visitor, isExpression), lexicalEnvironment.data.classConstructor, @@ -361101,7 +364511,7 @@ ${lanes.join("\n")} visitNode(node.template, visitor, isTemplateLiteral) ); } - if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && ((_a = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a.classConstructor)) { + if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node.tag) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && ((_a = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a.classConstructor)) { const invocation = factory2.createFunctionBindCall( visitNode(node.tag, visitor, isExpression), lexicalEnvironment.data.classConstructor, @@ -361124,30 +364534,40 @@ ${lanes.join("\n")} lexicalEnvironmentMap.set(getOriginalNode(node), lexicalEnvironment); } if (shouldTransformPrivateElementsOrClassStaticBlocks) { + if (isClassThisAssignmentBlock(node)) { + const result = visitNode(node.body.statements[0].expression, visitor, isExpression); + if (isAssignmentExpression( + result, + /*excludeCompoundAssignment*/ + true + ) && result.left === result.right) { + return void 0; + } + return result; + } + if (isClassNamedEvaluationHelperBlock(node)) { + return visitNode(node.body.statements[0].expression, visitor, isExpression); + } startLexicalEnvironment(); - let statements = setCurrentStaticPropertyDeclarationOrStaticBlockAnd( + let statements = setCurrentClassElementAnd( node, (statements2) => visitNodes2(statements2, visitor, isStatement), node.body.statements ); statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); const iife = factory2.createImmediatelyInvokedArrowFunction(statements); + setOriginalNode(skipParentheses(iife.expression), node); + addEmitFlags(skipParentheses(iife.expression), 4 /* AdviseOnEmitNode */); setOriginalNode(iife, node); setTextRange(iife, node); - addEmitFlags(iife, 4 /* AdviseOnEmitNode */); return iife; } } function isAnonymousClassNeedingAssignedName(node) { if (isClassExpression(node) && !node.name) { const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); - const classStaticBlock = find(staticPropertiesOrClassStaticBlocks, isClassStaticBlockDeclaration); - if (classStaticBlock) { - for (const statement of classStaticBlock.body.statements) { - if (isExpressionStatement(statement) && isCallToHelper(statement.expression, "___setFunctionName")) { - return false; - } - } + if (some(staticPropertiesOrClassStaticBlocks, isClassNamedEvaluationHelperBlock)) { + return false; } const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || !!(getInternalEmitFlags(node) && 32 /* TransformPrivateStaticElements */)) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); return hasTransformableStatics; @@ -361170,10 +364590,8 @@ ${lanes.join("\n")} } if (isAssignmentExpression(node)) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.left, node.right); - const left2 = visitNode(node.left, visitor, isExpression); - const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateBinaryExpression(node, left2, node.operatorToken, right); + node = transformNamedEvaluation(context, node); + Debug.assertNode(node, isAssignmentExpression); } const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */); if (isPrivateIdentifierPropertyAccessExpression(left)) { @@ -361187,7 +364605,7 @@ ${lanes.join("\n")} node ); } - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + } else if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node.left) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return factory2.updateBinaryExpression( @@ -361252,36 +364670,15 @@ ${lanes.join("\n")} const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); return factory2.updateCommaListExpression(node, elements); } - function visitParenthesizedExpression(node, discarded, referencedName) { - const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + function visitParenthesizedExpression(node, discarded) { + const visitorFunc = discarded ? discardedValueVisitor : visitor; const expression = visitNode(node.expression, visitorFunc, isExpression); return factory2.updateParenthesizedExpression(node, expression); } - function visitPartiallyEmittedExpression(node, discarded, referencedName) { - const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; - const expression = visitNode(node.expression, visitorFunc, isExpression); - return factory2.updatePartiallyEmittedExpression(node, expression); - } - function visitReferencedPropertyName(node) { - if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { - const referencedName2 = factory2.createStringLiteralFromNode(node); - const name2 = visitNode(node, visitor, isPropertyName); - return { referencedName: referencedName2, name: name2 }; - } - if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { - const referencedName2 = factory2.createStringLiteralFromNode(node.expression); - const name2 = visitNode(node, visitor, isPropertyName); - return { referencedName: referencedName2, name: name2 }; - } - const referencedName = factory2.createTempVariable(hoistVariableDeclaration); - const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); - const assignment = factory2.createAssignment(referencedName, key); - const name = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); - return { referencedName, name }; - } function createPrivateIdentifierAssignment(info, receiver, right, operator) { receiver = visitNode(receiver, visitor, isExpression); right = visitNode(right, visitor, isExpression); + ensureDynamicThisIfNeeded(receiver); if (isCompoundAssignment(operator)) { const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver); receiver = initializeExpression || readExpression; @@ -361328,11 +364725,15 @@ ${lanes.join("\n")} return filter(node.members, isNonStaticMethodOrAccessorWithPrivateName); } function getClassFacts(node) { + var _a; let facts = 0 /* None */; const original = getOriginalNode(node); if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) { facts |= 1 /* ClassWasDecorated */; } + if (shouldTransformPrivateElementsOrClassStaticBlocks && (classHasClassThisAssignment(node) || classHasExplicitlyAssignedName(node))) { + facts |= 2 /* NeedsClassConstructorReference */; + } let containsPublicInstanceFields = false; let containsInitializedPublicInstanceFields = false; let containsInstancePrivateElements = false; @@ -361341,6 +364742,8 @@ ${lanes.join("\n")} if (isStatic(member)) { if (member.name && (isPrivateIdentifier(member.name) || isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) { facts |= 2 /* NeedsClassConstructorReference */; + } else if (isAutoAccessorPropertyDeclaration(member) && shouldTransformAutoAccessors === -1 /* True */ && !node.name && !((_a = node.emitNode) == null ? void 0 : _a.classThis)) { + facts |= 2 /* NeedsClassConstructorReference */; } if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) { if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384 /* ContainsLexicalThis */) { @@ -361361,6 +364764,9 @@ ${lanes.join("\n")} containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member)); } else if (isPrivateIdentifierClassElementDeclaration(member)) { containsInstancePrivateElements = true; + if (resolver.getNodeCheckFlags(member) & 262144 /* ContainsConstructorReference */) { + facts |= 2 /* NeedsClassConstructorReference */; + } } else if (isPropertyDeclaration(member)) { containsPublicInstanceFields = true; containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer); @@ -361395,7 +364801,8 @@ ${lanes.join("\n")} } return visitEachChild(node, visitor, context); } - function visitInNewClassLexicalEnvironment(node, referencedName, visitor2) { + function visitInNewClassLexicalEnvironment(node, visitor2) { + var _a; const savedCurrentClassContainer = currentClassContainer; const savedPendingExpressions = pendingExpressions; const savedLexicalEnvironment = lexicalEnvironment; @@ -361407,6 +364814,15 @@ ${lanes.join("\n")} const name = getNameOfDeclaration(node); if (name && isIdentifier(name)) { getPrivateIdentifierEnvironment().data.className = name; + } else if ((_a = node.emitNode) == null ? void 0 : _a.assignedName) { + if (isStringLiteral(node.emitNode.assignedName)) { + if (node.emitNode.assignedName.textSourceNode && isIdentifier(node.emitNode.assignedName.textSourceNode)) { + getPrivateIdentifierEnvironment().data.className = node.emitNode.assignedName.textSourceNode; + } else if (isIdentifierText(node.emitNode.assignedName.text, languageVersion)) { + const prefixName = factory2.createIdentifier(node.emitNode.assignedName.text); + getPrivateIdentifierEnvironment().data.className = prefixName; + } + } } } if (shouldTransformPrivateElementsOrClassStaticBlocks) { @@ -361425,7 +364841,7 @@ ${lanes.join("\n")} if (facts & 8 /* NeedsSubstitutionForThisInClassStaticField */) { enableSubstitutionForClassStaticThisOrSuperReference(); } - const result = visitor2(node, facts, referencedName); + const result = visitor2(node, facts); endClassLexicalEnvironment(); Debug.assert(lexicalEnvironment === savedLexicalEnvironment); currentClassContainer = savedCurrentClassContainer; @@ -361433,12 +364849,7 @@ ${lanes.join("\n")} return result; } function visitClassDeclaration(node) { - return visitInNewClassLexicalEnvironment( - node, - /*referencedName*/ - void 0, - visitClassDeclarationInNewClassLexicalEnvironment - ); + return visitInNewClassLexicalEnvironment(node, visitClassDeclarationInNewClassLexicalEnvironment); } function visitClassDeclarationInNewClassLexicalEnvironment(node, facts) { var _a, _b; @@ -361456,12 +364867,13 @@ ${lanes.join("\n")} getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); } - if ((_b = node.emitNode) == null ? void 0 : _b.classThis) { - getClassLexicalEnvironment().classThis = node.emitNode.classThis; - } } - const isExport = hasSyntacticModifier(node, 1 /* Export */); - const isDefault = hasSyntacticModifier(node, 1024 /* Default */); + if ((_b = node.emitNode) == null ? void 0 : _b.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; + } + const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */; + const isExport = hasSyntacticModifier(node, 32 /* Export */); + const isDefault = hasSyntacticModifier(node, 2048 /* Default */); let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); @@ -361494,6 +364906,11 @@ ${lanes.join("\n")} ) )); } + const alias = getClassLexicalEnvironment().classConstructor; + if (isClassWithConstructorReference && alias) { + enableSubstitutionForClassAliases(); + classAliases[getOriginalNodeId(node)] = alias; + } const classDecl = factory2.updateClassDeclaration( node, modifiers, @@ -361509,24 +364926,27 @@ ${lanes.join("\n")} } return statements; } - function visitClassExpression(node, referencedName) { - return visitInNewClassLexicalEnvironment(node, referencedName, visitClassExpressionInNewClassLexicalEnvironment); + function visitClassExpression(node) { + return visitInNewClassLexicalEnvironment(node, visitClassExpressionInNewClassLexicalEnvironment); } - function visitClassExpressionInNewClassLexicalEnvironment(node, facts, referencedName) { - var _a, _b, _c, _d; + function visitClassExpressionInNewClassLexicalEnvironment(node, facts) { + var _a, _b, _c; const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */); const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); - const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */; + const classCheckFlags = resolver.getNodeCheckFlags(node); + const isClassWithConstructorReference = classCheckFlags & 262144 /* ContainsConstructorReference */; let temp; function createClassTempVar() { var _a2; if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) { return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; } - const classCheckFlags = resolver.getNodeCheckFlags(node); - const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */; const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */; - const temp2 = factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + const temp2 = factory2.createTempVariable( + requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2); return temp2; } @@ -361539,7 +364959,7 @@ ${lanes.join("\n")} const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); const { members, prologue } = transformClassMembers(node); - let classExpression = factory2.updateClassExpression( + const classExpression = factory2.updateClassExpression( node, modifiers, node.name, @@ -361553,41 +364973,18 @@ ${lanes.join("\n")} expressions.push(prologue); } const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */) && some(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); - if (hasTransformableStatics || some(pendingExpressions) || referencedName) { + if (hasTransformableStatics || some(pendingExpressions)) { if (isDecoratedClassDeclaration) { Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration."); if (some(pendingExpressions)) { addRange(pendingStatements, map(pendingExpressions, factory2.createExpressionStatement)); } - if (referencedName) { - if (shouldTransformPrivateElementsOrClassStaticBlocks) { - const setNameExpression = emitHelpers().createSetFunctionNameHelper(temp ?? ((_b = node.emitNode) == null ? void 0 : _b.classThis) ?? factory2.getInternalName(node), referencedName); - pendingStatements.push(factory2.createExpressionStatement(setNameExpression)); - } else { - const setNameExpression = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), referencedName); - classExpression = factory2.updateClassExpression( - classExpression, - classExpression.modifiers, - classExpression.name, - classExpression.typeParameters, - classExpression.heritageClauses, - [ - factory2.createClassStaticBlockDeclaration( - factory2.createBlock([ - factory2.createExpressionStatement(setNameExpression) - ]) - ), - ...classExpression.members - ] - ); - } - } if (some(staticPropertiesOrClassStaticBlocks)) { - addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, ((_c = node.emitNode) == null ? void 0 : _c.classThis) ?? factory2.getInternalName(node)); + addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, ((_b = node.emitNode) == null ? void 0 : _b.classThis) ?? factory2.getInternalName(node)); } if (temp) { expressions.push(factory2.createAssignment(temp, classExpression)); - } else if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_d = node.emitNode) == null ? void 0 : _d.classThis)) { + } else if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_c = node.emitNode) == null ? void 0 : _c.classThis)) { expressions.push(factory2.createAssignment(node.emitNode.classThis, classExpression)); } else { expressions.push(classExpression); @@ -361602,9 +364999,6 @@ ${lanes.join("\n")} } expressions.push(factory2.createAssignment(temp, classExpression)); addRange(expressions, pendingExpressions); - if (referencedName) { - expressions.push(emitHelpers().createSetFunctionNameHelper(temp, referencedName)); - } addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp)); expressions.push(factory2.cloneNode(temp)); } @@ -361623,6 +365017,13 @@ ${lanes.join("\n")} } return void 0; } + function visitThisExpression(node) { + if (shouldTransformThisInStaticInitializers && currentClassElement && isClassStaticBlockDeclaration(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classThis, classConstructor } = lexicalEnvironment.data; + return classThis ?? classConstructor ?? node; + } + return node; + } function transformClassMembers(node) { const shouldTransformPrivateStaticElementsInClass = !!(getInternalEmitFlags(node) & 32 /* TransformPrivateStaticElements */); if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInFile) { @@ -361702,9 +365103,14 @@ ${lanes.join("\n")} } if (syntheticConstructor || syntheticStaticBlock) { let membersArray; + const classThisAssignmentBlock = find(members, isClassThisAssignmentBlock); + const classNamedEvaluationHelperBlock = find(members, isClassNamedEvaluationHelperBlock); + membersArray = append(membersArray, classThisAssignmentBlock); + membersArray = append(membersArray, classNamedEvaluationHelperBlock); membersArray = append(membersArray, syntheticConstructor); membersArray = append(membersArray, syntheticStaticBlock); - membersArray = addRange(membersArray, members); + const remainingMembers = classThisAssignmentBlock || classNamedEvaluationHelperBlock ? filter(members, (member) => member !== classThisAssignmentBlock && member !== classNamedEvaluationHelperBlock) : members; + membersArray = addRange(membersArray, remainingMembers); members = setTextRange( factory2.createNodeArray(membersArray), /*location*/ @@ -361765,8 +365171,46 @@ ${lanes.join("\n")} ) ); } + function transformConstructorBodyWorker(statementsOut, statementsIn, statementOffset, superPath, superPathDepth, initializerStatements, constructor) { + const superStatementIndex = superPath[superPathDepth]; + const superStatement = statementsIn[superStatementIndex]; + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset, superStatementIndex - statementOffset)); + statementOffset = superStatementIndex + 1; + if (isTryStatement(superStatement)) { + const tryBlockStatements = []; + transformConstructorBodyWorker( + tryBlockStatements, + superStatement.tryBlock.statements, + /*statementOffset*/ + 0, + superPath, + superPathDepth + 1, + initializerStatements, + constructor + ); + const tryBlockStatementsArray = factory2.createNodeArray(tryBlockStatements); + setTextRange(tryBlockStatementsArray, superStatement.tryBlock.statements); + statementsOut.push(factory2.updateTryStatement( + superStatement, + factory2.updateBlock(superStatement.tryBlock, tryBlockStatements), + visitNode(superStatement.catchClause, visitor, isCatchClause), + visitNode(superStatement.finallyBlock, visitor, isBlock) + )); + } else { + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex, 1)); + while (statementOffset < statementsIn.length) { + const statement = statementsIn[statementOffset]; + if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { + statementOffset++; + } else { + break; + } + } + addRange(statementsOut, initializerStatements); + } + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset)); + } function transformConstructorBody(node, constructor, isDerivedClass) { - var _a; const instanceProperties = getProperties( node, /*requireInitializer*/ @@ -361790,68 +365234,65 @@ ${lanes.join("\n")} } resumeLexicalEnvironment(); const needsSyntheticConstructor = !constructor && isDerivedClass; - let indexOfFirstStatementAfterSuperAndPrologue = 0; - let prologueStatementCount = 0; - let superStatementIndex = -1; + let statementOffset = 0; let statements = []; - if ((_a = constructor == null ? void 0 : constructor.body) == null ? void 0 : _a.statements) { - prologueStatementCount = factory2.copyPrologue( + const initializerStatements = []; + const receiver = factory2.createThis(); + addInstanceMethodStatements(initializerStatements, privateMethodsAndAccessors, receiver); + if (constructor) { + const parameterProperties = filter(instanceProperties, (prop) => isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + const nonParameterProperties = filter(properties, (prop) => !isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + addPropertyOrClassStaticBlockStatements(initializerStatements, parameterProperties, receiver); + addPropertyOrClassStaticBlockStatements(initializerStatements, nonParameterProperties, receiver); + } else { + addPropertyOrClassStaticBlockStatements(initializerStatements, properties, receiver); + } + if (constructor == null ? void 0 : constructor.body) { + statementOffset = factory2.copyPrologue( constructor.body.statements, statements, /*ensureUseStrict*/ false, visitor ); - superStatementIndex = findSuperStatementIndex(constructor.body.statements, prologueStatementCount); - if (superStatementIndex >= 0) { - indexOfFirstStatementAfterSuperAndPrologue = superStatementIndex + 1; - statements = [ - ...statements.slice(0, prologueStatementCount), - ...visitNodes2(constructor.body.statements, visitor, isStatement, prologueStatementCount, indexOfFirstStatementAfterSuperAndPrologue - prologueStatementCount), - ...statements.slice(prologueStatementCount) - ]; - } else if (prologueStatementCount >= 0) { - indexOfFirstStatementAfterSuperAndPrologue = prologueStatementCount; - } - } - if (needsSyntheticConstructor) { - statements.push( - factory2.createExpressionStatement( - factory2.createCallExpression( - factory2.createSuper(), - /*typeArguments*/ - void 0, - [factory2.createSpreadElement(factory2.createIdentifier("arguments"))] - ) - ) - ); - } - let parameterPropertyDeclarationCount = 0; - if (constructor == null ? void 0 : constructor.body) { - for (let i = indexOfFirstStatementAfterSuperAndPrologue; i < constructor.body.statements.length; i++) { - const statement = constructor.body.statements[i]; - if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { - parameterPropertyDeclarationCount++; - } else { - break; + const superStatementIndices = findSuperStatementIndexPath(constructor.body.statements, statementOffset); + if (superStatementIndices.length) { + transformConstructorBodyWorker( + statements, + constructor.body.statements, + statementOffset, + superStatementIndices, + /*superPathDepth*/ + 0, + initializerStatements, + constructor + ); + } else { + while (statementOffset < constructor.body.statements.length) { + const statement = constructor.body.statements[statementOffset]; + if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { + statementOffset++; + } else { + break; + } } + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(constructor.body.statements, visitor, isStatement, statementOffset)); } - if (parameterPropertyDeclarationCount > 0) { - indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; - } - } - const receiver = factory2.createThis(); - addInstanceMethodStatements(statements, privateMethodsAndAccessors, receiver); - if (constructor) { - const parameterProperties = filter(instanceProperties, (prop) => isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); - const nonParameterProperties = filter(properties, (prop) => !isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); - addPropertyOrClassStaticBlockStatements(statements, parameterProperties, receiver); - addPropertyOrClassStaticBlockStatements(statements, nonParameterProperties, receiver); } else { - addPropertyOrClassStaticBlockStatements(statements, properties, receiver); - } - if (constructor) { - addRange(statements, visitNodes2(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); + if (needsSyntheticConstructor) { + statements.push( + factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createSuper(), + /*typeArguments*/ + void 0, + [factory2.createSpreadElement(factory2.createIdentifier("arguments"))] + ) + ) + ); + } + addRange(statements, initializerStatements); } statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); if (statements.length === 0 && !constructor) { @@ -361884,7 +365325,7 @@ ${lanes.join("\n")} } } function transformPropertyOrClassStaticBlock(property, receiver) { - const expression = isClassStaticBlockDeclaration(property) ? transformClassStaticBlockDeclaration(property) : transformProperty(property, receiver); + const expression = isClassStaticBlockDeclaration(property) ? setCurrentClassElementAnd(property, transformClassStaticBlockDeclaration, property) : transformProperty(property, receiver); if (!expression) { return void 0; } @@ -361909,7 +365350,12 @@ ${lanes.join("\n")} function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) { const expressions = []; for (const property of propertiesOrClassStaticBlocks) { - const expression = isClassStaticBlockDeclaration(property) ? transformClassStaticBlockDeclaration(property) : transformProperty(property, receiver); + const expression = isClassStaticBlockDeclaration(property) ? setCurrentClassElementAnd(property, transformClassStaticBlockDeclaration, property) : setCurrentClassElementAnd( + property, + () => transformProperty(property, receiver), + /*arg*/ + void 0 + ); if (!expression) { continue; } @@ -361924,7 +365370,7 @@ ${lanes.join("\n")} } function transformProperty(property, receiver) { var _a; - const savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock; + const savedCurrentClassElement = currentClassElement; const transformed = transformPropertyWorker(property, receiver); if (transformed && hasStaticModifier(property) && ((_a = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a.facts)) { setOriginalNode(transformed, property); @@ -361932,26 +365378,18 @@ ${lanes.join("\n")} setSourceMapRange(transformed, getSourceMapRange(property.name)); lexicalEnvironmentMap.set(getOriginalNode(property), lexicalEnvironment); } - currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock; + currentClassElement = savedCurrentClassElement; return transformed; } function transformPropertyWorker(property, receiver) { const emitAssignment = !useDefineForClassFields; - let referencedName; if (isNamedEvaluation(property, isAnonymousClassNeedingAssignedName)) { - if (isPropertyNameLiteral(property.name) || isPrivateIdentifier(property.name)) { - referencedName = factory2.createStringLiteralFromNode(property.name); - } else if (isPropertyNameLiteral(property.name.expression) && !isIdentifier(property.name.expression)) { - referencedName = factory2.createStringLiteralFromNode(property.name.expression); - } else { - referencedName = factory2.getGeneratedNameForNode(property.name); - } + property = transformNamedEvaluation(context, property); } const propertyName = hasAccessorModifier(property) ? factory2.getGeneratedPrivateNameForNode(property.name) : isComputedPropertyName(property.name) && !isSimpleInlineableExpression(property.name.expression) ? factory2.updateComputedPropertyName(property.name, factory2.getGeneratedNameForNode(property.name)) : property.name; if (hasStaticModifier(property)) { - currentStaticPropertyDeclarationOrStaticBlock = property; + currentClassElement = property; } - const initializerVisitor = referencedName ? (child) => namedEvaluationVisitor(child, referencedName) : visitor; if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(property)) { const privateIdentifierInfo = accessPrivateIdentifier2(propertyName); if (privateIdentifierInfo) { @@ -361960,14 +365398,14 @@ ${lanes.join("\n")} return createPrivateInstanceFieldInitializer( factory2, receiver, - visitNode(property.initializer, initializerVisitor, isExpression), + visitNode(property.initializer, visitor, isExpression), privateIdentifierInfo.brandCheckIdentifier ); } else { return createPrivateStaticFieldInitializer( factory2, privateIdentifierInfo.variableName, - visitNode(property.initializer, initializerVisitor, isExpression) + visitNode(property.initializer, visitor, isExpression) ); } } else { @@ -361981,10 +365419,10 @@ ${lanes.join("\n")} return void 0; } const propertyOriginalNode = getOriginalNode(property); - if (hasSyntacticModifier(propertyOriginalNode, 256 /* Abstract */)) { + if (hasSyntacticModifier(propertyOriginalNode, 64 /* Abstract */)) { return void 0; } - let initializer = visitNode(property.initializer, initializerVisitor, isExpression); + let initializer = visitNode(property.initializer, visitor, isExpression); if (isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName)) { const localName = factory2.cloneNode(propertyName); if (initializer) { @@ -362029,14 +365467,14 @@ ${lanes.join("\n")} if ((enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */) === 0) { enabledSubstitutions |= 2 /* ClassStaticThisOrSuperReference */; context.enableSubstitution(110 /* ThisKeyword */); - context.enableEmitNotification(261 /* FunctionDeclaration */); - context.enableEmitNotification(217 /* FunctionExpression */); - context.enableEmitNotification(175 /* Constructor */); - context.enableEmitNotification(176 /* GetAccessor */); - context.enableEmitNotification(177 /* SetAccessor */); - context.enableEmitNotification(173 /* MethodDeclaration */); - context.enableEmitNotification(171 /* PropertyDeclaration */); - context.enableEmitNotification(166 /* ComputedPropertyName */); + context.enableEmitNotification(262 /* FunctionDeclaration */); + context.enableEmitNotification(218 /* FunctionExpression */); + context.enableEmitNotification(176 /* Constructor */); + context.enableEmitNotification(177 /* GetAccessor */); + context.enableEmitNotification(178 /* SetAccessor */); + context.enableEmitNotification(174 /* MethodDeclaration */); + context.enableEmitNotification(172 /* PropertyDeclaration */); + context.enableEmitNotification(167 /* ComputedPropertyName */); } } function addInstanceMethodStatements(statements, methods, receiver) { @@ -362062,10 +365500,10 @@ ${lanes.join("\n")} visitNode(node.argumentExpression, visitor, isExpression) ); } - function getPropertyNameExpressionIfNeeded(name, shouldHoist, captureReferencedName) { + function getPropertyNameExpressionIfNeeded(name, shouldHoist) { if (isComputedPropertyName(name)) { const cacheAssignment = findComputedPropertyNameCacheAssignment(name); - let expression = visitNode(name.expression, visitor, isExpression); + const expression = visitNode(name.expression, visitor, isExpression); const innerExpression = skipPartiallyEmittedExpressions(expression); const inlinable = isSimpleInlineableExpression(innerExpression); const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); @@ -362076,9 +365514,6 @@ ${lanes.join("\n")} } else { hoistVariableDeclaration(generatedName); } - if (captureReferencedName) { - expression = emitHelpers().createPropKeyHelper(expression); - } return factory2.createAssignment(generatedName, expression); } return inlinable || isIdentifier(innerExpression) ? void 0 : expression; @@ -362274,7 +365709,7 @@ ${lanes.join("\n")} } if (isPrivateIdentifierPropertyAccessExpression(node)) { return wrapPrivateIdentifierForDestructuringTarget(node); - } else if (shouldTransformSuperInStaticInitializers && isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + } else if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; if (facts & 1 /* ClassWasDecorated */) { return visitInvalidSuperProperty(node); @@ -362301,10 +365736,7 @@ ${lanes.join("\n")} } function visitAssignmentElement(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const left = visitDestructuringAssignmentTarget(node.left); - const assignedName = getAssignedNameOfIdentifier(node.left, node.right); - const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + node = transformNamedEvaluation(context, node); } if (isAssignmentExpression( node, @@ -362351,9 +365783,7 @@ ${lanes.join("\n")} } function visitShorthandAssignmentProperty(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); - const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateShorthandPropertyAssignment(node, node.name, objectAssignmentInitializer); + node = transformNamedEvaluation(context, node); } return visitEachChild(node, visitor, context); } @@ -362403,16 +365833,16 @@ ${lanes.join("\n")} return; } switch (node.kind) { - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: if (isArrowFunction(original) || getEmitFlags(node) & 524288 /* AsyncFunctionBody */) { break; } - case 261 /* FunctionDeclaration */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 173 /* MethodDeclaration */: - case 171 /* PropertyDeclaration */: { + case 262 /* FunctionDeclaration */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 172 /* PropertyDeclaration */: { const savedLexicalEnvironment = lexicalEnvironment; const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; lexicalEnvironment = void 0; @@ -362424,7 +365854,7 @@ ${lanes.join("\n")} lexicalEnvironment = savedLexicalEnvironment; return; } - case 166 /* ComputedPropertyName */: { + case 167 /* ComputedPropertyName */: { const savedLexicalEnvironment = lexicalEnvironment; const savedShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; @@ -362454,11 +365884,8 @@ ${lanes.join("\n")} return node; } function substituteThisExpression(node) { - if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + if (enabledSubstitutions & 2 /* ClassStaticThisOrSuperReference */ && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !noSubstitution.has(node)) { const { facts, classConstructor, classThis } = lexicalEnvironment.data; - if (facts & 1 /* ClassWasDecorated */ && legacyDecorators) { - return factory2.createParenthesizedExpression(factory2.createVoidZero()); - } const substituteThis = shouldSubstituteThisWithClassThis ? classThis ?? classConstructor : classConstructor; if (substituteThis) { return setTextRange( @@ -362469,6 +365896,9 @@ ${lanes.join("\n")} node ); } + if (facts & 1 /* ClassWasDecorated */ && legacyDecorators) { + return factory2.createParenthesizedExpression(factory2.createVoidZero()); + } } return node; } @@ -362477,7 +365907,7 @@ ${lanes.join("\n")} } function trySubstituteClassAlias(node) { if (enabledSubstitutions & 1 /* ClassAliases */) { - if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) { + if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) { const declaration = resolver.getReferencedValueDeclaration(node); if (declaration) { const classAlias = classAliases[declaration.id]; @@ -362523,6 +365953,12 @@ ${lanes.join("\n")} function isPrivateIdentifierInExpression(node) { return isPrivateIdentifier(node.left) && node.operatorToken.kind === 103 /* InKeyword */; } + function isStaticPropertyDeclaration2(node) { + return isPropertyDeclaration(node) && hasStaticModifier(node); + } + function isStaticPropertyDeclarationOrClassStaticBlock(node) { + return isClassStaticBlockDeclaration(node) || isStaticPropertyDeclaration2(node); + } var init_classFields = __esm({ "src/compiler/transformers/classFields.ts"() { "use strict"; @@ -362564,15 +366000,15 @@ ${lanes.join("\n")} } function serializeTypeOfNode(node) { switch (node.kind) { - case 171 /* PropertyDeclaration */: - case 168 /* Parameter */: + case 172 /* PropertyDeclaration */: + case 169 /* Parameter */: return serializeTypeNode(node.type); - case 177 /* SetAccessor */: - case 176 /* GetAccessor */: + case 178 /* SetAccessor */: + case 177 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 173 /* MethodDeclaration */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 174 /* MethodDeclaration */: return factory2.createIdentifier("Function"); default: return factory2.createVoidZero(); @@ -362599,7 +366035,7 @@ ${lanes.join("\n")} return factory2.createArrayLiteralExpression(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 176 /* GetAccessor */) { + if (container && node.kind === 177 /* GetAccessor */) { const { setAccessor } = getAllAccessorDeclarations(container.members, node); if (setAccessor) { return setAccessor.parameters; @@ -362625,72 +366061,72 @@ ${lanes.join("\n")} case 157 /* UndefinedKeyword */: case 146 /* NeverKeyword */: return factory2.createVoidZero(); - case 183 /* FunctionType */: - case 184 /* ConstructorType */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: return factory2.createIdentifier("Function"); - case 187 /* ArrayType */: - case 188 /* TupleType */: + case 188 /* ArrayType */: + case 189 /* TupleType */: return factory2.createIdentifier("Array"); - case 181 /* TypePredicate */: + case 182 /* TypePredicate */: return node.assertsModifier ? factory2.createVoidZero() : factory2.createIdentifier("Boolean"); case 136 /* BooleanKeyword */: return factory2.createIdentifier("Boolean"); - case 202 /* TemplateLiteralType */: + case 203 /* TemplateLiteralType */: case 154 /* StringKeyword */: return factory2.createIdentifier("String"); case 151 /* ObjectKeyword */: return factory2.createIdentifier("Object"); - case 200 /* LiteralType */: + case 201 /* LiteralType */: return serializeLiteralOfLiteralTypeNode(node.literal); case 150 /* NumberKeyword */: return factory2.createIdentifier("Number"); - case 162 /* BigIntKeyword */: + case 163 /* BigIntKeyword */: return getGlobalConstructor("BigInt", 7 /* ES2020 */); case 155 /* SymbolKeyword */: return getGlobalConstructor("Symbol", 2 /* ES2015 */); - case 182 /* TypeReference */: + case 183 /* TypeReference */: return serializeTypeReferenceNode(node); - case 192 /* IntersectionType */: + case 193 /* IntersectionType */: return serializeUnionOrIntersectionConstituents( node.types, /*isIntersection*/ true ); - case 191 /* UnionType */: + case 192 /* UnionType */: return serializeUnionOrIntersectionConstituents( node.types, /*isIntersection*/ false ); - case 193 /* ConditionalType */: + case 194 /* ConditionalType */: return serializeUnionOrIntersectionConstituents( [node.trueType, node.falseType], /*isIntersection*/ false ); - case 197 /* TypeOperator */: + case 198 /* TypeOperator */: if (node.operator === 148 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 185 /* TypeQuery */: - case 198 /* IndexedAccessType */: - case 199 /* MappedType */: - case 186 /* TypeLiteral */: + case 186 /* TypeQuery */: + case 199 /* IndexedAccessType */: + case 200 /* MappedType */: + case 187 /* TypeLiteral */: case 133 /* AnyKeyword */: case 159 /* UnknownKeyword */: - case 196 /* ThisType */: - case 204 /* ImportType */: + case 197 /* ThisType */: + case 205 /* ImportType */: break; - case 318 /* JSDocAllType */: - case 319 /* JSDocUnknownType */: - case 323 /* JSDocFunctionType */: - case 324 /* JSDocVariadicType */: - case 325 /* JSDocNamepathType */: + case 319 /* JSDocAllType */: + case 320 /* JSDocUnknownType */: + case 324 /* JSDocFunctionType */: + case 325 /* JSDocVariadicType */: + case 326 /* JSDocNamepathType */: break; - case 320 /* JSDocNullableType */: - case 321 /* JSDocNonNullableType */: - case 322 /* JSDocOptionalType */: + case 321 /* JSDocNullableType */: + case 322 /* JSDocNonNullableType */: + case 323 /* JSDocOptionalType */: return serializeTypeNode(node.type); default: return Debug.failBadSyntaxKind(node); @@ -362702,7 +366138,7 @@ ${lanes.join("\n")} case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: return factory2.createIdentifier("String"); - case 223 /* PrefixUnaryExpression */: { + case 224 /* PrefixUnaryExpression */: { const operand = node.operand; switch (operand.kind) { case 9 /* NumericLiteral */: @@ -362861,7 +366297,7 @@ ${lanes.join("\n")} name.original = void 0; setParent(name, getParseTreeNode(currentLexicalScope)); return name; - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -362917,23 +366353,23 @@ ${lanes.join("\n")} return node; } switch (node.kind) { - case 169 /* Decorator */: + case 170 /* Decorator */: return void 0; - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: return visitClassExpression(node); - case 175 /* Constructor */: + case 176 /* Constructor */: return visitConstructorDeclaration(node); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 168 /* Parameter */: + case 169 /* Parameter */: return visitParameterDeclaration(node); default: return visitEachChild(node, visitor, context); @@ -362996,16 +366432,19 @@ ${lanes.join("\n")} true ); if (hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node)) { - members = setTextRange(factory2.createNodeArray([ - ...members, - factory2.createClassStaticBlockDeclaration( - factory2.createBlock( - decorationStatements, - /*multiLine*/ - true + members = setTextRange( + factory2.createNodeArray([ + ...members, + factory2.createClassStaticBlockDeclaration( + factory2.createBlock( + decorationStatements, + /*multiLine*/ + true + ) ) - ) - ]), members); + ]), + members + ); decorationStatements = void 0; } return { decorationStatements, members }; @@ -363028,8 +366467,8 @@ ${lanes.join("\n")} return addRange([updated], decorationStatements); } function transformClassDeclarationWithClassDecorators(node, name) { - const isExport = hasSyntacticModifier(node, 1 /* Export */); - const isDefault = hasSyntacticModifier(node, 1024 /* Default */); + const isExport = hasSyntacticModifier(node, 32 /* Export */); + const isDefault = hasSyntacticModifier(node, 2048 /* Default */); const modifiers = visitNodes2(node.modifiers, (node2) => isExportOrDefaultModifier(node2) || isDecorator(node2) ? void 0 : node2, isModifierLike); const location = moveRangePastModifiers(node); const classAlias = getClassAliasIfNeeded(node); @@ -363050,18 +366489,21 @@ ${lanes.join("\n")} let members = visitNodes2(node.members, visitor, isClassElement); let decorationStatements = []; ({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members)); - const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member, 32 /* Static */) || isClassStaticBlockDeclaration(member)); + const assignClassAliasInStaticBlock = languageVersion >= 9 /* ES2022 */ && !!classAlias && some(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier(member, 256 /* Static */) || isClassStaticBlockDeclaration(member)); if (assignClassAliasInStaticBlock) { - members = setTextRange(factory2.createNodeArray([ - factory2.createClassStaticBlockDeclaration( - factory2.createBlock([ - factory2.createExpressionStatement( - factory2.createAssignment(classAlias, factory2.createThis()) - ) - ]) - ), - ...members - ]), members); + members = setTextRange( + factory2.createNodeArray([ + factory2.createClassStaticBlockDeclaration( + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment(classAlias, factory2.createThis()) + ) + ]) + ), + ...members + ]), + members + ); } const classExpression = factory2.createClassExpression( modifiers, @@ -363073,39 +366515,36 @@ ${lanes.join("\n")} ); setOriginalNode(classExpression, node); setTextRange(classExpression, location); + const varInitializer = classAlias && !assignClassAliasInStaticBlock ? factory2.createAssignment(classAlias, classExpression) : classExpression; const varDecl = factory2.createVariableDeclaration( declName, /*exclamationToken*/ void 0, /*type*/ void 0, - classAlias && !assignClassAliasInStaticBlock ? factory2.createAssignment(classAlias, classExpression) : classExpression + varInitializer ); setOriginalNode(varDecl, node); - let varModifiers; - if (isExport && !isDefault) { - varModifiers = factory2.createModifiersFromModifierFlags(1 /* Export */); - } - const statement = factory2.createVariableStatement( - varModifiers, - factory2.createVariableDeclarationList([ - varDecl - ], 1 /* Let */) + const varDeclList = factory2.createVariableDeclarationList([varDecl], 1 /* Let */); + const varStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + varDeclList ); - setOriginalNode(statement, node); - setTextRange(statement, location); - setCommentRange(statement, node); - const statements = [statement]; + setOriginalNode(varStatement, node); + setTextRange(varStatement, location); + setCommentRange(varStatement, node); + const statements = [varStatement]; addRange(statements, decorationStatements); addConstructorDecorationStatement(statements, node); - if (isExport && isDefault) { - statements.push(factory2.createExportAssignment( - /*modifiers*/ - void 0, - /*isExportEquals*/ - false, - declName - )); + if (isExport) { + if (isDefault) { + const exportStatement = factory2.createExportDefault(declName); + statements.push(exportStatement); + } else { + const exportStatement = factory2.createExternalModuleExport(factory2.getDeclarationName(node)); + statements.push(exportStatement); + } } return statements; } @@ -363136,55 +366575,67 @@ ${lanes.join("\n")} return updated; } function visitMethodDeclaration(node) { - return finishClassElement(factory2.updateMethodDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - node.asteriskToken, - Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), - /*questionToken*/ - void 0, - /*typeParameters*/ - void 0, - visitNodes2(node.parameters, visitor, isParameter), - /*type*/ - void 0, - visitNode(node.body, visitor, isBlock) - ), node); + return finishClassElement( + factory2.updateMethodDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + node.asteriskToken, + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + visitNodes2(node.parameters, visitor, isParameter), + /*type*/ + void 0, + visitNode(node.body, visitor, isBlock) + ), + node + ); } function visitGetAccessorDeclaration(node) { - return finishClassElement(factory2.updateGetAccessorDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), - visitNodes2(node.parameters, visitor, isParameter), - /*type*/ - void 0, - visitNode(node.body, visitor, isBlock) - ), node); + return finishClassElement( + factory2.updateGetAccessorDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), + /*type*/ + void 0, + visitNode(node.body, visitor, isBlock) + ), + node + ); } function visitSetAccessorDeclaration(node) { - return finishClassElement(factory2.updateSetAccessorDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), - visitNodes2(node.parameters, visitor, isParameter), - visitNode(node.body, visitor, isBlock) - ), node); + return finishClassElement( + factory2.updateSetAccessorDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock) + ), + node + ); } function visitPropertyDeclaration(node) { - if (node.flags & 16777216 /* Ambient */ || hasSyntacticModifier(node, 2 /* Ambient */)) { + if (node.flags & 33554432 /* Ambient */ || hasSyntacticModifier(node, 128 /* Ambient */)) { return void 0; } - return finishClassElement(factory2.updatePropertyDeclaration( - node, - visitNodes2(node.modifiers, modifierVisitor, isModifier), - Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), - /*questionOrExclamationToken*/ - void 0, - /*type*/ - void 0, - visitNode(node.initializer, visitor, isExpression) - ), node); + return finishClassElement( + factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ), + node + ); } function visitParameterDeclaration(node) { const updated = factory2.updateParameterDeclaration( @@ -363257,7 +366708,7 @@ ${lanes.join("\n")} const memberName = getExpressionForPropertyName( member, /*generateNameForComputedPropertyName*/ - !hasSyntacticModifier(member, 2 /* Ambient */) + !hasSyntacticModifier(member, 128 /* Ambient */) ); const descriptor = languageVersion > 0 /* ES3 */ ? isPropertyDeclaration(member) && !hasAccessorModifier(member) ? factory2.createVoidZero() : factory2.createNull() : void 0; const helper = emitHelpers().createDecorateHelper( @@ -363340,7 +366791,7 @@ ${lanes.join("\n")} } } function getClassAliasIfNeeded(node) { - if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) { + if (resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */) { enableSubstitutionForClassAliases(); const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default"); classAliases[getOriginalNodeId(node)] = classAlias; @@ -363373,7 +366824,7 @@ ${lanes.join("\n")} } function trySubstituteClassAlias(node) { if (classAliases) { - if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) { + if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) { const declaration = resolver.getReferencedValueDeclaration(node); if (declaration) { const classAlias = classAliases[declaration.id]; @@ -363405,8 +366856,7 @@ ${lanes.join("\n")} endLexicalEnvironment, hoistVariableDeclaration } = context; - const compilerOptions = context.getCompilerOptions(); - const languageVersion = getEmitScriptTarget(compilerOptions); + const languageVersion = getEmitScriptTarget(context.getCompilerOptions()); let top; let classInfo; let classThis; @@ -363518,86 +366968,78 @@ ${lanes.join("\n")} return node; } switch (node.kind) { - case 169 /* Decorator */: + case 170 /* Decorator */: return Debug.fail("Use `modifierVisitor` instead."); - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ClassExpression */: - return visitClassExpression( - node, - /*referencedName*/ - void 0 - ); - case 175 /* Constructor */: - case 171 /* PropertyDeclaration */: - case 174 /* ClassStaticBlockDeclaration */: + case 231 /* ClassExpression */: + return visitClassExpression(node); + case 176 /* Constructor */: + case 172 /* PropertyDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead."); - case 168 /* Parameter */: + case 169 /* Parameter */: return visitParameterDeclaration(node); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ false ); - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return visitPropertyAssignment(node); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 207 /* BindingElement */: + case 208 /* BindingElement */: return visitBindingElement(node); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return visitExportAssignment(node); case 110 /* ThisKeyword */: return visitThisExpression(node); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatement(node); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return visitExpressionStatement(node); - case 360 /* CommaListExpression */: + case 361 /* CommaListExpression */: return visitCommaListExpression( node, /*discarded*/ false ); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ - false, - /*referencedName*/ - void 0 + false ); - case 359 /* PartiallyEmittedExpression */: + case 360 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression( node, /*discarded*/ - false, - /*referencedName*/ - void 0 + false ); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return visitCallExpression(node); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ false ); - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 173 /* MethodDeclaration */: - case 177 /* SetAccessor */: - case 176 /* GetAccessor */: - case 217 /* FunctionExpression */: - case 261 /* FunctionDeclaration */: { + case 174 /* MethodDeclaration */: + case 178 /* SetAccessor */: + case 177 /* GetAccessor */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: { enterOther(); const result = visitEachChild(node, fallbackVisitor, context); exitOther(); @@ -363609,7 +367051,7 @@ ${lanes.join("\n")} } function fallbackVisitor(node) { switch (node.kind) { - case 169 /* Decorator */: + case 170 /* Decorator */: return void 0; default: return visitor(node); @@ -363617,7 +367059,7 @@ ${lanes.join("\n")} } function modifierVisitor(node) { switch (node.kind) { - case 169 /* Decorator */: + case 170 /* Decorator */: return void 0; default: return node; @@ -363625,72 +367067,48 @@ ${lanes.join("\n")} } function classElementVisitor(node) { switch (node.kind) { - case 175 /* Constructor */: + case 176 /* Constructor */: return visitConstructorDeclaration(node); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 174 /* ClassStaticBlockDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: return visitClassStaticBlockDeclaration(node); default: return visitor(node); } } - function namedEvaluationVisitor(node, referencedName) { - switch (node.kind) { - case 359 /* PartiallyEmittedExpression */: - return visitPartiallyEmittedExpression( - node, - /*discarded*/ - false, - referencedName - ); - case 216 /* ParenthesizedExpression */: - return visitParenthesizedExpression( - node, - /*discarded*/ - false, - referencedName - ); - case 230 /* ClassExpression */: - return visitClassExpression(node, referencedName); - default: - return visitor(node); - } - } function discardedValueVisitor(node) { switch (node.kind) { - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression( node, /*discarded*/ true ); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return visitBinaryExpression( node, /*discarded*/ true ); - case 360 /* CommaListExpression */: + case 361 /* CommaListExpression */: return visitCommaListExpression( node, /*discarded*/ true ); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitParenthesizedExpression( node, /*discarded*/ - true, - /*referencedName*/ - void 0 + true ); default: return visitor(node); @@ -363728,26 +367146,56 @@ ${lanes.join("\n")} ); } function createClassInfo(node) { - let instanceExtraInitializersName; - let staticExtraInitializersName; + const metadataReference = factory2.createUniqueName("_metadata", 16 /* Optimistic */ | 32 /* FileLevel */); + 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 */)); + 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 */)); + 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)) { - hasStaticInitializers = true; + if (!isClassNamedEvaluationHelperBlock(member)) { + hasStaticInitializers = true; + } } else if (isPropertyDeclaration(member)) { if (hasStaticModifier(member)) { hasStaticInitializers || (hasStaticInitializers = !!member.initializer || hasDecorators(member)); @@ -363758,32 +367206,32 @@ ${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, - instanceExtraInitializersName, - staticExtraInitializersName, + classThis: classThis2, + metadataReference, + instanceMethodExtraInitializersName, + staticMethodExtraInitializersName, hasStaticInitializers, hasNonAmbientInstanceFields, - hasStaticPrivateClassElements + hasStaticPrivateClassElements, + pendingStaticInitializers, + pendingInstanceInitializers }; } - function containsLexicalSuperInStaticInitializer(node) { - for (const member of node.members) { - if (isClassStaticBlockDeclaration(member) || isPropertyDeclaration(member) && hasStaticModifier(member)) { - if (member.transformFlags & 134217728 /* ContainsLexicalSuper */) { - return true; - } - } - } - return false; - } - function transformClassLike(node, className) { - var _a; + function transformClassLike(node) { startLexicalEnvironment(); + if (!classHasDeclaredOrExplicitlyAssignedName(node) && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + )) { + node = injectClassNamedEvaluationHelperBlockIfMissing(context, node, factory2.createStringLiteral("")); + } const classReference = factory2.getLocalName( node, /*allowComments*/ @@ -363802,10 +367250,10 @@ ${lanes.join("\n")} let shouldTransformPrivateStaticElementsInClass = false; const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(node)); if (classDecorators) { - classInfo2.classDecoratorsName = factory2.createUniqueName("_classDecorators", 16 /* Optimistic */); - classInfo2.classDescriptorName = factory2.createUniqueName("_classDescriptor", 16 /* Optimistic */); - classInfo2.classExtraInitializersName = factory2.createUniqueName("_classExtraInitializers", 16 /* Optimistic */); - classInfo2.classThis = factory2.createUniqueName("_classThis", 16 /* Optimistic */); + 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 */); + Debug.assertIsDefined(classInfo2.classThis); classDefinitionStatements.push( createLet(classInfo2.classDecoratorsName, factory2.createArrayLiteralExpression(classDecorators)), createLet(classInfo2.classDescriptorName), @@ -363817,35 +367265,29 @@ ${lanes.join("\n")} shouldTransformPrivateStaticElementsInFile = true; } } - if (classDecorators && containsLexicalSuperInStaticInitializer(node)) { - const extendsClause = getHeritageClause(node.heritageClauses, 96 /* ExtendsKeyword */); - const extendsElement = extendsClause && firstOrUndefined(extendsClause.types); - const extendsExpression = extendsElement && visitNode(extendsElement.expression, visitor, isExpression); - if (extendsExpression) { - classInfo2.classSuper = factory2.createUniqueName("_classSuper", 16 /* Optimistic */); - const unwrapped = skipOuterExpressions(extendsExpression); - const safeExtendsExpression = isClassExpression(unwrapped) && !unwrapped.name || isFunctionExpression(unwrapped) && !unwrapped.name || isArrowFunction(unwrapped) ? factory2.createComma(factory2.createNumericLiteral(0), extendsExpression) : extendsExpression; - classDefinitionStatements.push(createLet(classInfo2.classSuper, safeExtendsExpression)); - const updatedExtendsElement = factory2.updateExpressionWithTypeArguments( - extendsElement, - classInfo2.classSuper, - /*typeArguments*/ - void 0 - ); - const updatedExtendsClause = factory2.updateHeritageClause(extendsClause, [updatedExtendsElement]); - heritageClauses = factory2.createNodeArray([updatedExtendsClause]); - } - } else { - heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + const extendsClause = getHeritageClause(node.heritageClauses, 96 /* ExtendsKeyword */); + const extendsElement = extendsClause && firstOrUndefined(extendsClause.types); + const extendsExpression = extendsElement && visitNode(extendsElement.expression, visitor, isExpression); + if (extendsExpression) { + classInfo2.classSuper = factory2.createUniqueName("_classSuper", 16 /* Optimistic */ | 32 /* FileLevel */); + const unwrapped = skipOuterExpressions(extendsExpression); + const safeExtendsExpression = isClassExpression(unwrapped) && !unwrapped.name || isFunctionExpression(unwrapped) && !unwrapped.name || isArrowFunction(unwrapped) ? factory2.createComma(factory2.createNumericLiteral(0), extendsExpression) : extendsExpression; + classDefinitionStatements.push(createLet(classInfo2.classSuper, safeExtendsExpression)); + const updatedExtendsElement = factory2.updateExpressionWithTypeArguments( + extendsElement, + classInfo2.classSuper, + /*typeArguments*/ + void 0 + ); + const updatedExtendsClause = factory2.updateHeritageClause(extendsClause, [updatedExtendsElement]); + heritageClauses = factory2.createNodeArray([updatedExtendsClause]); } const renamedClassThis = classInfo2.classThis ?? factory2.createThis(); - const needsSetNameHelper = !((_a = getOriginalNode(node, isClassLike)) == null ? void 0 : _a.name) && (classDecorators || !isStringLiteral(className) || !isEmptyStringLiteral(className)); - if (needsSetNameHelper) { - const setNameExpr = emitHelpers().createSetFunctionNameHelper(factory2.createThis(), className); - leadingBlockStatements = append(leadingBlockStatements, factory2.createExpressionStatement(setNameExpr)); - } enterClass(classInfo2); - let members = visitNodes2(node.members, classElementVisitor, isClassElement); + leadingBlockStatements = append(leadingBlockStatements, createMetadata(classInfo2.metadataReference, classInfo2.classSuper)); + 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) { @@ -363870,7 +367312,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); @@ -363900,14 +367342,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) { @@ -363917,6 +367359,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)); } @@ -363930,6 +367375,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)); } @@ -363942,15 +367390,15 @@ ${lanes.join("\n")} leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticFieldDecorationStatements); if (classInfo2.classDescriptorName && classInfo2.classDecoratorsName && classInfo2.classExtraInitializersName && classInfo2.classThis) { leadingBlockStatements ?? (leadingBlockStatements = []); - const valueProperty = factory2.createPropertyAssignment("value", factory2.createThis()); + const valueProperty = factory2.createPropertyAssignment("value", renamedClassThis); const classDescriptor = factory2.createObjectLiteralExpression([valueProperty]); const classDescriptorAssignment = factory2.createAssignment(classInfo2.classDescriptorName, classDescriptor); - const classNameReference = factory2.createPropertyAccessExpression(factory2.createThis(), "name"); + const classNameReference = factory2.createPropertyAccessExpression(renamedClassThis, "name"); const esDecorateHelper2 = emitHelpers().createESDecorateHelper( factory2.createNull(), classDescriptorAssignment, classInfo2.classDecoratorsName, - { kind: "class", name: classNameReference }, + { kind: "class", name: classNameReference, metadata: classInfo2.metadataReference }, factory2.createNull(), classInfo2.classExtraInitializersName ); @@ -363962,11 +367410,14 @@ ${lanes.join("\n")} const classReferenceAssignment = factory2.createAssignment(classReference, classThisAssignment); leadingBlockStatements.push(factory2.createExpressionStatement(classReferenceAssignment)); } - 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); + leadingBlockStatements.push(createSymbolMetadata(renamedClassThis, classInfo2.metadataReference)); + 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); @@ -363978,32 +367429,35 @@ ${lanes.join("\n")} addRange(leadingBlockStatements, trailingBlockStatements); trailingBlockStatements = void 0; } - let newMembers = members; - if (leadingBlockStatements) { - const leadingStaticBlockBody = factory2.createBlock( - leadingBlockStatements, - /*multiLine*/ - true - ); - const leadingStaticBlock = factory2.createClassStaticBlockDeclaration(leadingStaticBlockBody); - if (shouldTransformPrivateStaticElementsInClass) { - setInternalEmitFlags(leadingStaticBlock, 32 /* TransformPrivateStaticElements */); - } - newMembers = [leadingStaticBlock, ...newMembers]; - } - if (syntheticConstructor) { - newMembers = [...newMembers, syntheticConstructor]; - } - if (trailingBlockStatements) { - const trailingStaticBlockBody = factory2.createBlock( - trailingBlockStatements, - /*multiLine*/ - true - ); - const trailingStaticBlock = factory2.createClassStaticBlockDeclaration(trailingStaticBlockBody); - newMembers = [...newMembers, trailingStaticBlock]; + const leadingStaticBlock = leadingBlockStatements && factory2.createClassStaticBlockDeclaration(factory2.createBlock( + leadingBlockStatements, + /*multiLine*/ + true + )); + if (leadingStaticBlock && shouldTransformPrivateStaticElementsInClass) { + setInternalEmitFlags(leadingStaticBlock, 32 /* TransformPrivateStaticElements */); } - if (newMembers !== members) { + const trailingStaticBlock = trailingBlockStatements && factory2.createClassStaticBlockDeclaration(factory2.createBlock( + trailingBlockStatements, + /*multiLine*/ + true + )); + if (leadingStaticBlock || syntheticConstructor || trailingStaticBlock) { + const newMembers = []; + const existingNamedEvaluationHelperBlockIndex = members.findIndex(isClassNamedEvaluationHelperBlock); + if (leadingStaticBlock) { + addRange(newMembers, members, 0, existingNamedEvaluationHelperBlockIndex + 1); + newMembers.push(leadingStaticBlock); + addRange(newMembers, members, existingNamedEvaluationHelperBlockIndex + 1); + } else { + addRange(newMembers, members); + } + if (syntheticConstructor) { + newMembers.push(syntheticConstructor); + } + if (trailingStaticBlock) { + newMembers.push(trailingStaticBlock); + } members = setTextRange(factory2.createNodeArray(newMembers), members); } const lexicalEnvironment = endLexicalEnvironment(); @@ -364019,6 +367473,9 @@ ${lanes.join("\n")} heritageClauses, members ); + if (classInfo2.classThis) { + classExpression = injectClassThisAssignmentIfMissing(factory2, classExpression, classInfo2.classThis); + } const classReferenceDeclaration = factory2.createVariableDeclaration( classReference, /*exclamationToken*/ @@ -364058,7 +367515,6 @@ ${lanes.join("\n")} } } setOriginalNode(classExpression, node); - getOrCreateEmitNode(classExpression).classThis = classInfo2.classThis; return factory2.createImmediatelyInvokedArrowFunction(factory2.mergeLexicalEnvironment(classDefinitionStatements, lexicalEnvironment)); } function isDecoratedClassLike(node) { @@ -364074,26 +367530,51 @@ ${lanes.join("\n")} } function visitClassDeclaration(node) { if (isDecoratedClassLike(node)) { - if (hasSyntacticModifier(node, 1 /* Export */) && hasSyntacticModifier(node, 1024 /* Default */)) { - const originalClass = getOriginalNode(node, isClassLike) ?? node; - const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default"); - const iife = transformClassLike(node, className); - const statement = factory2.createExportDefault(iife); - setOriginalNode(statement, node); - setCommentRange(statement, getCommentRange(node)); - setSourceMapRange(statement, moveRangePastDecorators(node)); - return statement; + const statements = []; + const originalClass = getOriginalNode(node, isClassLike) ?? node; + const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default"); + const isExport = hasSyntacticModifier(node, 32 /* Export */); + const isDefault = hasSyntacticModifier(node, 2048 /* Default */); + if (!node.name) { + node = injectClassNamedEvaluationHelperBlockIfMissing(context, node, className); + } + if (isExport && isDefault) { + const iife = transformClassLike(node); + if (node.name) { + const varDecl = factory2.createVariableDeclaration( + factory2.getLocalName(node), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ); + setOriginalNode(varDecl, node); + const varDecls = factory2.createVariableDeclarationList([varDecl], 1 /* Let */); + const varStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + varDecls + ); + statements.push(varStatement); + const exportStatement = factory2.createExportDefault(factory2.getDeclarationName(node)); + setOriginalNode(exportStatement, node); + setCommentRange(exportStatement, getCommentRange(node)); + setSourceMapRange(exportStatement, moveRangePastDecorators(node)); + statements.push(exportStatement); + } else { + const exportStatement = factory2.createExportDefault(iife); + setOriginalNode(exportStatement, node); + setCommentRange(exportStatement, getCommentRange(node)); + setSourceMapRange(exportStatement, moveRangePastDecorators(node)); + statements.push(exportStatement); + } } else { Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name."); - const iife = transformClassLike(node, factory2.createStringLiteralFromNode(node.name)); - const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); - const declName = languageVersion <= 2 /* ES2015 */ ? factory2.getInternalName( - node, - /*allowComments*/ - false, - /*allowSourceMaps*/ - true - ) : factory2.getLocalName( + const iife = transformClassLike(node); + const modifierVisitorNoExport = isExport ? (node2) => isExportModifier(node2) ? void 0 : modifierVisitor(node2) : modifierVisitor; + const modifiers = visitNodes2(node.modifiers, modifierVisitorNoExport, isModifier); + const declName = factory2.getLocalName( node, /*allowComments*/ false, @@ -364110,11 +367591,17 @@ ${lanes.join("\n")} ); setOriginalNode(varDecl, node); const varDecls = factory2.createVariableDeclarationList([varDecl], 1 /* Let */); - const statement = factory2.createVariableStatement(modifiers, varDecls); - setOriginalNode(statement, node); - setCommentRange(statement, getCommentRange(node)); - return statement; + const varStatement = factory2.createVariableStatement(modifiers, varDecls); + setOriginalNode(varStatement, node); + setCommentRange(varStatement, getCommentRange(node)); + statements.push(varStatement); + if (isExport) { + const exportStatement = factory2.createExternalModuleExport(declName); + setOriginalNode(exportStatement, node); + statements.push(exportStatement); + } } + return singleOrMany(statements); } else { const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); @@ -364135,10 +367622,9 @@ ${lanes.join("\n")} ); } } - function visitClassExpression(node, referencedName) { + function visitClassExpression(node) { if (isDecoratedClassLike(node)) { - const className = node.name ? factory2.createStringLiteralFromNode(node.name) : referencedName ?? factory2.createStringLiteral(""); - const iife = transformClassLike(node, className); + const iife = transformClassLike(node); setOriginalNode(iife, node); return iife; } else { @@ -364162,19 +367648,46 @@ ${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; } } + function transformConstructorBodyWorker(statementsOut, statementsIn, statementOffset, superPath, superPathDepth, initializerStatements) { + const superStatementIndex = superPath[superPathDepth]; + const superStatement = statementsIn[superStatementIndex]; + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset, superStatementIndex - statementOffset)); + if (isTryStatement(superStatement)) { + const tryBlockStatements = []; + transformConstructorBodyWorker( + tryBlockStatements, + superStatement.tryBlock.statements, + /*statementOffset*/ + 0, + superPath, + superPathDepth + 1, + initializerStatements + ); + const tryBlockStatementsArray = factory2.createNodeArray(tryBlockStatements); + setTextRange(tryBlockStatementsArray, superStatement.tryBlock.statements); + statementsOut.push(factory2.updateTryStatement( + superStatement, + factory2.updateBlock(superStatement.tryBlock, tryBlockStatements), + visitNode(superStatement.catchClause, visitor, isCatchClause), + visitNode(superStatement.finallyBlock, visitor, isBlock) + )); + } else { + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex, 1)); + addRange(statementsOut, initializerStatements); + } + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex + 1)); + } function visitConstructorDeclaration(node) { enterClassElement(node); const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); @@ -364191,11 +367704,9 @@ ${lanes.join("\n")} false, visitor ); - const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart); - if (superStatementIndex >= 0) { - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart)); - addRange(statements, initializerStatements); - addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1)); + const superStatementIndices = findSuperStatementIndexPath(node.body.statements, nonPrologueStart); + if (superStatementIndices.length > 0) { + transformConstructorBodyWorker(statements, node.body.statements, nonPrologueStart, superStatementIndices, 0, initializerStatements); } else { addRange(statements, initializerStatements); addRange(statements, visitNodes2(node.body.statements, visitor, isStatement)); @@ -364220,20 +367731,17 @@ ${lanes.join("\n")} } return updated; } - function partialTransformClassElement(member, useNamedEvaluation, classInfo2, createDescriptor) { + function partialTransformClassElement(member, classInfo2, createDescriptor) { let referencedName; let name; let initializersName; + let extraInitializersName; let thisArg; let descriptorName; if (!classInfo2) { const modifiers2 = visitNodes2(member.modifiers, modifierVisitor, isModifier); enterName(); - if (useNamedEvaluation) { - ({ referencedName, name } = visitReferencedPropertyName(member.name)); - } else { - name = visitPropertyName(member.name); - } + name = visitPropertyName(member.name); exitName(); return { modifiers: modifiers2, referencedName, name, initializersName, descriptorName, thisArg }; } @@ -364282,22 +367790,25 @@ ${lanes.join("\n")} get: isPropertyDeclaration(member) || isGetAccessorDeclaration(member) || isMethodDeclaration(member), // 3. If _kind_ is ~field~, ~accessor~, or ~setter~, then ... set: isPropertyDeclaration(member) || isSetAccessorDeclaration(member) - } + }, + metadata: classInfo2.metadataReference }; - const extraInitializers = isStatic(member) ? classInfo2.staticExtraInitializersName ?? (classInfo2.staticExtraInitializersName = factory2.createUniqueName("_staticExtraInitializers", 16 /* Optimistic */)) : classInfo2.instanceExtraInitializersName ?? (classInfo2.instanceExtraInitializersName = factory2.createUniqueName("_instanceExtraInitializers", 16 /* Optimistic */)); 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; } @@ -364317,7 +367828,7 @@ ${lanes.join("\n")} memberDecoratorsName, context2, initializersName, - extraInitializers + extraInitializersName ); const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); @@ -364326,27 +367837,17 @@ ${lanes.join("\n")} } if (name === void 0) { enterName(); - if (useNamedEvaluation) { - ({ referencedName, name } = visitReferencedPropertyName(member.name)); - } else { - name = visitPropertyName(member.name); - } + name = visitPropertyName(member.name); exitName(); } 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); - const { modifiers, name, descriptorName } = partialTransformClassElement( - node, - /*useNamedEvaluation*/ - false, - classInfo, - createMethodDescriptorObject - ); + const { modifiers, name, descriptorName } = partialTransformClassElement(node, classInfo, createMethodDescriptorObject); if (descriptorName) { exitClassElement(); return finishClassElement(createMethodDescriptorForwarder(modifiers, name, descriptorName), node); @@ -364372,13 +367873,7 @@ ${lanes.join("\n")} } function visitGetAccessorDeclaration(node) { enterClassElement(node); - const { modifiers, name, descriptorName } = partialTransformClassElement( - node, - /*useNamedEvaluation*/ - false, - classInfo, - createGetAccessorDescriptorObject - ); + const { modifiers, name, descriptorName } = partialTransformClassElement(node, classInfo, createGetAccessorDescriptorObject); if (descriptorName) { exitClassElement(); return finishClassElement(createGetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); @@ -364399,13 +367894,7 @@ ${lanes.join("\n")} } function visitSetAccessorDeclaration(node) { enterClassElement(node); - const { modifiers, name, descriptorName } = partialTransformClassElement( - node, - /*useNamedEvaluation*/ - false, - classInfo, - createSetAccessorDescriptorObject - ); + const { modifiers, name, descriptorName } = partialTransformClassElement(node, classInfo, createSetAccessorDescriptorObject); if (descriptorName) { exitClassElement(); return finishClassElement(createSetAccessorDescriptorForwarder(modifiers, name, descriptorName), node); @@ -364418,19 +367907,49 @@ ${lanes.join("\n")} } function visitClassStaticBlockDeclaration(node) { enterClassElement(node); - if (classInfo) - classInfo.hasStaticInitializers = true; - const result = visitEachChild(node, visitor, context); + let result; + if (isClassNamedEvaluationHelperBlock(node)) { + result = visitEachChild(node, visitor, context); + } else if (isClassThisAssignmentBlock(node)) { + const savedClassThis = classThis; + classThis = void 0; + result = visitEachChild(node, visitor, context); + classThis = savedClassThis; + } else { + node = visitEachChild(node, visitor, context); + result = node; + if (classInfo) { + classInfo.hasStaticInitializers = true; + 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; } function visitPropertyDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); + } enterClassElement(node); Debug.assert(!isAmbientPropertyDeclaration(node), "Not yet implemented."); - const useNamedEvaluation = isNamedEvaluation(node, isAnonymousClassNeedingAssignedName); - const { modifiers, name, referencedName, initializersName, descriptorName, thisArg } = partialTransformClassElement(node, useNamedEvaluation, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0); + const { modifiers, name, initializersName, extraInitializersName, descriptorName, thisArg } = partialTransformClassElement(node, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0); startLexicalEnvironment(); - let initializer = referencedName ? visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression) : visitNode(node.initializer, visitor, isExpression); + let initializer = visitNode(node.initializer, visitor, isExpression); if (initializersName) { initializer = emitHelpers().createRunInitializersHelper( thisArg ?? factory2.createThis(), @@ -364438,17 +367957,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; } @@ -364459,6 +367967,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); @@ -364560,38 +368103,21 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitParameterDeclaration(node) { - let updated; if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); - const name = visitNode(node.name, visitor, isBindingName); - const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - updated = factory2.updateParameterDeclaration( - node, - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - name, - /*questionToken*/ - void 0, - /*type*/ - void 0, - initializer - ); - } else { - updated = factory2.updateParameterDeclaration( - node, - /*modifiers*/ - void 0, - node.dotDotDotToken, - visitNode(node.name, visitor, isBindingName), - /*questionToken*/ - void 0, - /*type*/ - void 0, - visitNode(node.initializer, visitor, isExpression) - ); + node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); } + const updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + visitNode(node.name, visitor, isBindingName), + /*questionToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); if (updated !== node) { setCommentRange(updated, node); setTextRange(updated, moveRangePastModifiers(node)); @@ -364603,6 +368129,14 @@ ${lanes.join("\n")} function isAnonymousClassNeedingAssignedName(node) { return isClassExpression(node) && !node.name && isDecoratedClassLike(node); } + function canIgnoreEmptyStringLiteralInAssignedName(node) { + const innerExpression = skipOuterExpressions(node); + return isClassExpression(innerExpression) && !innerExpression.name && !classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + innerExpression + ); + } function visitForStatement(node) { return factory2.updateForStatement( node, @@ -364623,10 +368157,8 @@ ${lanes.join("\n")} } if (isAssignmentExpression(node)) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.left, node.right); - const left = visitNode(node.left, visitor, isExpression); - const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.right)); + return visitEachChild(node, visitor, context); } if (isSuperProperty(node.left) && classThis && classSuper) { let setterName = isElementAccessExpression(node.left) ? visitNode(node.left.argumentExpression, visitor, isExpression) : isIdentifier(node.left.name) ? factory2.createStringLiteralFromNode(node.left.name) : void 0; @@ -364746,43 +368278,19 @@ ${lanes.join("\n")} } function visitPropertyAssignment(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const { referencedName, name } = visitReferencedPropertyName(node.name); - const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); - return factory2.updatePropertyAssignment(node, name, initializer); + node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); } return visitEachChild(node, visitor, context); } function visitVariableDeclaration(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); - const name = visitNode(node.name, visitor, isBindingName); - const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateVariableDeclaration( - node, - name, - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - initializer - ); + node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); } return visitEachChild(node, visitor, context); } function visitBindingElement(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.name, node.initializer); - const propertyName = visitNode(node.propertyName, visitor, isPropertyName); - const name = visitNode(node.name, visitor, isBindingName); - const initializer = visitNode(node.initializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateBindingElement( - node, - /*dotDotDotToken*/ - void 0, - propertyName, - name, - initializer - ); + node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); } return visitEachChild(node, visitor, context); } @@ -364819,14 +368327,11 @@ ${lanes.join("\n")} /*excludeCompoundAssignment*/ true )) { - const assignmentTarget = visitDestructuringAssignmentTarget(node.left); - let initializer; if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.left, node.right); - initializer = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - } else { - initializer = visitNode(node.right, visitor, isExpression); + node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.right)); } + const assignmentTarget = visitDestructuringAssignmentTarget(node.left); + const initializer = visitNode(node.right, visitor, isExpression); return factory2.updateBinaryExpression(node, assignmentTarget, node.operatorToken, initializer); } else { return visitDestructuringAssignmentTarget(node); @@ -364865,10 +368370,7 @@ ${lanes.join("\n")} } function visitShorthandAssignmentProperty(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const assignedName = getAssignedNameOfIdentifier(node.name, node.objectAssignmentInitializer); - const name = visitNode(node.name, visitor, isIdentifier); - const objectAssignmentInitializer = visitNode(node.objectAssignmentInitializer, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression); - return factory2.updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer); + node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.objectAssignmentInitializer)); } return visitEachChild(node, visitor, context); } @@ -364900,36 +368402,55 @@ ${lanes.join("\n")} } function visitExportAssignment(node) { if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { - const referencedName = factory2.createStringLiteral(node.isExportEquals ? "" : "default"); - const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); - const expression = visitNode(node.expression, (node2) => namedEvaluationVisitor(node2, referencedName), isExpression); - return factory2.updateExportAssignment(node, modifiers, expression); + node = transformNamedEvaluation(context, node, canIgnoreEmptyStringLiteralInAssignedName(node.expression)); } return visitEachChild(node, visitor, context); } - function visitParenthesizedExpression(node, discarded, referencedName) { - const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + function visitParenthesizedExpression(node, discarded) { + const visitorFunc = discarded ? discardedValueVisitor : visitor; const expression = visitNode(node.expression, visitorFunc, isExpression); return factory2.updateParenthesizedExpression(node, expression); } - function visitPartiallyEmittedExpression(node, discarded, referencedName) { - const visitorFunc = discarded ? discardedValueVisitor : referencedName ? (node2) => namedEvaluationVisitor(node2, referencedName) : visitor; + function visitPartiallyEmittedExpression(node, discarded) { + const visitorFunc = discarded ? discardedValueVisitor : visitor; 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; @@ -364941,6 +368462,17 @@ ${lanes.join("\n")} function transformDecorator(decorator) { const expression = visitNode(decorator.expression, visitor, isExpression); setEmitFlags(expression, 3072 /* NoComments */); + const innerExpression = skipOuterExpressions(expression); + if (isAccessExpression(innerExpression)) { + const { target, thisArg } = factory2.createCallBinding( + expression, + hoistVariableDeclaration, + languageVersion, + /*cacheIdentifiers*/ + true + ); + return factory2.restoreOuterExpressions(expression, factory2.createFunctionBindCall(target, thisArg, [])); + } return expression; } function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) { @@ -365126,9 +368658,59 @@ ${lanes.join("\n")} ]) ); } - function getAssignedNameOfIdentifier(name, initializer) { - const originalClass = getOriginalNode(initializer, isClassLike); - return originalClass && !originalClass.name && hasSyntacticModifier(originalClass, 1024 /* Default */) ? factory2.createStringLiteral("default") : factory2.createStringLiteralFromNode(name); + function createMetadata(name, classSuper2) { + const varDecl = factory2.createVariableDeclaration( + name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createConditionalExpression( + factory2.createLogicalAnd( + factory2.createTypeCheck(factory2.createIdentifier("Symbol"), "function"), + factory2.createPropertyAccessExpression(factory2.createIdentifier("Symbol"), "metadata") + ), + factory2.createToken(58 /* QuestionToken */), + factory2.createCallExpression( + factory2.createPropertyAccessExpression(factory2.createIdentifier("Object"), "create"), + /*typeArguments*/ + void 0, + [classSuper2 ? createSymbolMetadataReference(classSuper2) : factory2.createNull()] + ), + factory2.createToken(59 /* ColonToken */), + factory2.createVoidZero() + ) + ); + return factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([varDecl], 2 /* Const */) + ); + } + function createSymbolMetadata(target, value) { + const defineProperty = factory2.createObjectDefinePropertyCall( + target, + factory2.createPropertyAccessExpression(factory2.createIdentifier("Symbol"), "metadata"), + factory2.createPropertyDescriptor( + { configurable: true, writable: true, enumerable: true, value }, + /*singleLine*/ + true + ) + ); + return setEmitFlags( + factory2.createIfStatement(value, factory2.createExpressionStatement(defineProperty)), + 1 /* SingleLine */ + ); + } + function createSymbolMetadataReference(classSuper2) { + return factory2.createBinaryExpression( + factory2.createElementAccessExpression( + classSuper2, + factory2.createPropertyAccessExpression(factory2.createIdentifier("Symbol"), "metadata") + ), + 61 /* QuestionQuestionToken */, + factory2.createNull() + ); } } var init_esDecorators = __esm({ @@ -365155,6 +368737,7 @@ ${lanes.join("\n")} let enclosingFunctionParameterNames; let capturedSuperProperties; let hasSuperElementAccess; + let lexicalArgumentsBinding; const substitutedSuperAccessors = []; let contextFlags = 0 /* None */; const previousOnEmitNode = context.onEmitNode; @@ -365205,41 +368788,62 @@ ${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 */: return void 0; - case 222 /* AwaitExpression */: + case 223 /* AwaitExpression */: return visitAwaitExpression(node); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return visitEachChild(node, visitor, context); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 108 /* SuperKeyword */) { hasSuperElementAccess = true; } return visitEachChild(node, visitor, context); - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitGetAccessorDeclaration, node); - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitSetAccessorDeclaration, node); - case 175 /* Constructor */: + case 176 /* Constructor */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitConstructorDeclaration, node); - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return visitEachChild(node, visitor, context); @@ -365248,27 +368852,27 @@ ${lanes.join("\n")} function asyncBodyVisitor(node) { if (isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 240 /* Block */: - case 254 /* SwitchStatement */: - case 268 /* CaseBlock */: - case 295 /* CaseClause */: - case 296 /* DefaultClause */: - case 257 /* TryStatement */: - case 245 /* DoStatement */: - case 246 /* WhileStatement */: - case 244 /* IfStatement */: - case 253 /* WithStatement */: - case 255 /* LabeledStatement */: + case 241 /* Block */: + case 255 /* SwitchStatement */: + case 269 /* CaseBlock */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: + case 258 /* TryStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: + case 245 /* IfStatement */: + case 254 /* WithStatement */: + case 256 /* LabeledStatement */: return visitEachChild(node, asyncBodyVisitor, context); default: return Debug.assertNever(node, "Unhandled node."); @@ -365365,15 +368969,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, @@ -365382,14 +368994,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, @@ -365398,55 +369014,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) { @@ -365461,7 +369097,7 @@ ${lanes.join("\n")} } } function isVariableDeclarationListWithCollidingName(node) { - return !!node && isVariableDeclarationList(node) && !(node.flags & 3 /* BlockScoped */) && node.declarations.some(collidesWithParameterName); + return !!node && isVariableDeclarationList(node) && !(node.flags & 7 /* BlockScoped */) && node.declarations.some(collidesWithParameterName); } function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) { hoistVariableDeclarationList(node); @@ -365540,13 +369176,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 === 218 /* ArrowFunction */; + 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) { @@ -365558,27 +369272,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(); @@ -365588,6 +369298,9 @@ ${lanes.join("\n")} insertStatementsAfterStandardPrologue(statements, [variableStatement]); } } + if (captureLexicalArguments) { + insertStatementsAfterStandardPrologue(statements, [createCaptureArgumentsStatement()]); + } const block = factory2.createBlock( statements, /*multiLine*/ @@ -365603,24 +369316,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; } @@ -365644,15 +369356,15 @@ ${lanes.join("\n")} function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - context.enableSubstitution(212 /* CallExpression */); - context.enableSubstitution(210 /* PropertyAccessExpression */); - context.enableSubstitution(211 /* ElementAccessExpression */); - context.enableEmitNotification(262 /* ClassDeclaration */); - context.enableEmitNotification(173 /* MethodDeclaration */); - context.enableEmitNotification(176 /* GetAccessor */); - context.enableEmitNotification(177 /* SetAccessor */); - context.enableEmitNotification(175 /* Constructor */); - context.enableEmitNotification(242 /* VariableStatement */); + context.enableSubstitution(213 /* CallExpression */); + context.enableSubstitution(211 /* PropertyAccessExpression */); + context.enableSubstitution(212 /* ElementAccessExpression */); + context.enableEmitNotification(263 /* ClassDeclaration */); + context.enableEmitNotification(174 /* MethodDeclaration */); + context.enableEmitNotification(177 /* GetAccessor */); + context.enableEmitNotification(178 /* SetAccessor */); + context.enableEmitNotification(176 /* Constructor */); + context.enableEmitNotification(243 /* VariableStatement */); } } function onEmitNode(hint, node, emitCallback) { @@ -365683,11 +369395,11 @@ ${lanes.join("\n")} } function substituteExpression(node) { switch (node.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -365731,7 +369443,7 @@ ${lanes.join("\n")} } function isSuperContainer(node) { const kind = node.kind; - return kind === 262 /* ClassDeclaration */ || kind === 175 /* Constructor */ || kind === 173 /* MethodDeclaration */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */; + return kind === 263 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) { @@ -365977,119 +369689,119 @@ ${lanes.join("\n")} return node; } switch (node.kind) { - case 222 /* AwaitExpression */: + case 223 /* AwaitExpression */: return visitAwaitExpression(node); - case 228 /* YieldExpression */: + case 229 /* YieldExpression */: return visitYieldExpression(node); - case 252 /* ReturnStatement */: + case 253 /* ReturnStatement */: return visitReturnStatement(node); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return visitLabeledStatement(node); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 360 /* CommaListExpression */: + case 361 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return visitCatchClause(node); - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return visitVariableStatement(node); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 245 /* DoStatement */: - case 246 /* WhileStatement */: - case 248 /* ForInStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: + case 249 /* ForInStatement */: return doWithHierarchyFacts( visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */ ); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return visitForOfStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return doWithHierarchyFacts( visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */ ); - case 221 /* VoidExpression */: + case 222 /* VoidExpression */: return visitVoidExpression(node); - case 175 /* Constructor */: + case 176 /* Constructor */: return doWithHierarchyFacts( visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return doWithHierarchyFacts( visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return doWithHierarchyFacts( visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return doWithHierarchyFacts( visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return doWithHierarchyFacts( visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: return doWithHierarchyFacts( visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */ ); - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return doWithHierarchyFacts( visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */ ); - case 168 /* Parameter */: + case 169 /* Parameter */: return visitParameter(node); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return visitExpressionStatement(node); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, expressionResultIsUnused2); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return visitEachChild(node, visitor, context); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 108 /* SuperKeyword */) { hasSuperElementAccess = true; } return visitEachChild(node, visitor, context); - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: return doWithHierarchyFacts( visitDefault, node, @@ -366165,16 +369877,19 @@ ${lanes.join("\n")} } function visitReturnStatement(node) { if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { - return factory2.updateReturnStatement(node, createDownlevelAwait( - node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero() - )); + return factory2.updateReturnStatement( + node, + createDownlevelAwait( + node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero() + ) + ); } return visitEachChild(node, visitor, context); } function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { const statement = unwrapInnermostStatementOfLabel(node); - if (statement.kind === 249 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 250 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node); @@ -366185,7 +369900,7 @@ ${lanes.join("\n")} let chunkObject; const objects = []; for (const e of elements) { - if (e.kind === 304 /* SpreadAssignment */) { + if (e.kind === 305 /* SpreadAssignment */) { if (chunkObject) { objects.push(factory2.createObjectLiteralExpression(chunkObject)); chunkObject = void 0; @@ -366193,7 +369908,10 @@ ${lanes.join("\n")} const target = e.expression; objects.push(visitNode(target, visitor, isExpression)); } else { - chunkObject = append(chunkObject, e.kind === 302 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike)); + chunkObject = append( + chunkObject, + e.kind === 303 /* PropertyAssignment */ ? factory2.createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) : visitNode(e, visitor, isObjectLiteralElementLike) + ); } } if (chunkObject) { @@ -366204,7 +369922,7 @@ ${lanes.join("\n")} function visitObjectLiteralExpression(node) { if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { const objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 209 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 210 /* ObjectLiteralExpression */) { objects.unshift(factory2.createObjectLiteralExpression()); } let expression = objects[0]; @@ -366232,13 +369950,16 @@ ${lanes.join("\n")} ); exportedVariableStatement = false; const visited = visitEachChild(node, visitor, context); - const statement = concatenate(visited.statements, taggedTemplateStringDeclarations && [ - factory2.createVariableStatement( - /*modifiers*/ - void 0, - factory2.createVariableDeclarationList(taggedTemplateStringDeclarations) - ) - ]); + const statement = concatenate( + visited.statements, + taggedTemplateStringDeclarations && [ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList(taggedTemplateStringDeclarations) + ) + ] + ); const result = factory2.updateSourceFile(visited, setTextRange(factory2.createNodeArray(statement), node.statements)); exitSubtree(ancestorFacts); return result; @@ -366331,7 +370052,7 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitVariableStatement(node) { - if (hasSyntacticModifier(node, 1 /* Export */)) { + if (hasSyntacticModifier(node, 32 /* Export */)) { const savedExportedVariableStatement = exportedVariableStatement; exportedVariableStatement = true; const visited = visitEachChild(node, visitor, context); @@ -366733,7 +370454,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) @@ -366754,7 +370475,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) @@ -366795,7 +370516,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) @@ -366804,21 +370525,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( @@ -366828,14 +370566,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 */) ) @@ -366845,11 +370579,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); @@ -366973,15 +370706,15 @@ ${lanes.join("\n")} function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) { enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; - context.enableSubstitution(212 /* CallExpression */); - context.enableSubstitution(210 /* PropertyAccessExpression */); - context.enableSubstitution(211 /* ElementAccessExpression */); - context.enableEmitNotification(262 /* ClassDeclaration */); - context.enableEmitNotification(173 /* MethodDeclaration */); - context.enableEmitNotification(176 /* GetAccessor */); - context.enableEmitNotification(177 /* SetAccessor */); - context.enableEmitNotification(175 /* Constructor */); - context.enableEmitNotification(242 /* VariableStatement */); + context.enableSubstitution(213 /* CallExpression */); + context.enableSubstitution(211 /* PropertyAccessExpression */); + context.enableSubstitution(212 /* ElementAccessExpression */); + context.enableEmitNotification(263 /* ClassDeclaration */); + context.enableEmitNotification(174 /* MethodDeclaration */); + context.enableEmitNotification(177 /* GetAccessor */); + context.enableEmitNotification(178 /* SetAccessor */); + context.enableEmitNotification(176 /* Constructor */); + context.enableEmitNotification(243 /* VariableStatement */); } } function onEmitNode(hint, node, emitCallback) { @@ -367012,11 +370745,11 @@ ${lanes.join("\n")} } function substituteExpression(node) { switch (node.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -367060,7 +370793,7 @@ ${lanes.join("\n")} } function isSuperContainer(node) { const kind = node.kind; - return kind === 262 /* ClassDeclaration */ || kind === 175 /* Constructor */ || kind === 173 /* MethodDeclaration */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */; + return kind === 263 /* ClassDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) { @@ -367111,7 +370844,7 @@ ${lanes.join("\n")} return node; } switch (node.kind) { - case 298 /* CatchClause */: + case 299 /* CatchClause */: return visitCatchClause(node); default: return visitEachChild(node, visitor, context); @@ -367156,7 +370889,7 @@ ${lanes.join("\n")} return node; } switch (node.kind) { - case 212 /* CallExpression */: { + case 213 /* CallExpression */: { const updated = visitNonOptionalCallExpression( node, /*captureThisArg*/ @@ -367165,8 +370898,8 @@ ${lanes.join("\n")} Debug.assertNotNode(updated, isSyntheticReference); return updated; } - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: if (isOptionalChain(node)) { const updated = visitOptionalExpression( node, @@ -367179,12 +370912,12 @@ ${lanes.join("\n")} return updated; } return visitEachChild(node, visitor, context); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: if (node.operatorToken.kind === 61 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return visitEachChild(node, visitor, context); - case 219 /* DeleteExpression */: + case 220 /* DeleteExpression */: return visitDeleteExpression(node); default: return visitEachChild(node, visitor, context); @@ -367222,7 +370955,7 @@ ${lanes.join("\n")} thisArg = expression; } } - expression = node.kind === 210 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression)); + expression = node.kind === 211 /* PropertyAccessExpression */ ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression)); return thisArg ? factory2.createSyntheticReferenceExpression(expression, thisArg) : expression; } function visitNonOptionalCallExpression(node, captureThisArg) { @@ -367258,12 +370991,12 @@ ${lanes.join("\n")} } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return visitNode(node, visitor, isExpression); @@ -367289,8 +371022,8 @@ ${lanes.join("\n")} for (let i = 0; i < chain.length; i++) { const segment = chain[i]; switch (segment.kind) { - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (!isSimpleCopiableExpression(rightExpression)) { thisArg = factory2.createTempVariable(hoistVariableDeclaration); @@ -367299,9 +371032,9 @@ ${lanes.join("\n")} thisArg = rightExpression; } } - rightExpression = segment.kind === 210 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression)); + rightExpression = segment.kind === 211 /* PropertyAccessExpression */ ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression)); break; - case 212 /* CallExpression */: + case 213 /* CallExpression */: if (i === 0 && leftThisArg) { if (!isGeneratedIdentifier(leftThisArg)) { leftThisArg = factory2.cloneNode(leftThisArg); @@ -367376,15 +371109,18 @@ ${lanes.join("\n")} right = factory2.createTempVariable(hoistVariableDeclaration); left = factory2.createAssignment(right, left); } - return setTextRange(factory2.createConditionalExpression( - createNotNullCondition(left, right), - /*questionToken*/ - void 0, - right, - /*colonToken*/ - void 0, - visitNode(node.right, visitor, isExpression) - ), node); + return setTextRange( + factory2.createConditionalExpression( + createNotNullCondition(left, right), + /*questionToken*/ + void 0, + right, + /*colonToken*/ + void 0, + visitNode(node.right, visitor, isExpression) + ), + node + ); } function visitDeleteExpression(node) { return isOptionalChain(skipParentheses(node.expression)) ? setOriginalNode(visitNonOptionalExpression( @@ -367484,22 +371220,639 @@ ${lanes.join("\n")} // src/compiler/transformers/esnext.ts function transformESNext(context) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + hoistVariableDeclaration, + startLexicalEnvironment, + endLexicalEnvironment + } = context; + let exportBindings; + let exportVars; + let defaultExportBinding; + let exportEqualsBinding; return chainBundle(context, transformSourceFile); function transformSourceFile(node) { if (node.isDeclarationFile) { return node; } - return visitEachChild(node, visitor, context); + const visited = visitNode(node, visitor, isSourceFile); + addEmitHelpers(visited, context.readEmitHelpers()); + exportVars = void 0; + exportBindings = void 0; + defaultExportBinding = void 0; + return visited; } function visitor(node) { if ((node.transformFlags & 4 /* ContainsESNext */) === 0) { return node; } switch (node.kind) { + case 312 /* SourceFile */: + return visitSourceFile(node); + case 241 /* Block */: + return visitBlock(node); + case 248 /* ForStatement */: + return visitForStatement(node); + case 250 /* ForOfStatement */: + return visitForOfStatement(node); + case 255 /* SwitchStatement */: + return visitSwitchStatement(node); default: return visitEachChild(node, visitor, context); } } + function visitSourceFile(node) { + const usingKind = getUsingKindOfStatements(node.statements); + if (usingKind) { + startLexicalEnvironment(); + exportBindings = new IdentifierNameMap(); + exportVars = []; + const prologueCount = countPrologueStatements(node.statements); + const topLevelStatements = []; + addRange(topLevelStatements, visitArray(node.statements, visitor, isStatement, 0, prologueCount)); + let pos = prologueCount; + while (pos < node.statements.length) { + const statement = node.statements[pos]; + if (getUsingKind(statement) !== 0 /* None */) { + if (pos > prologueCount) { + addRange(topLevelStatements, visitNodes2(node.statements, visitor, isStatement, prologueCount, pos - prologueCount)); + } + break; + } + pos++; + } + Debug.assert(pos < node.statements.length, "Should have encountered at least one 'using' statement."); + const envBinding = createEnvBinding(); + const bodyStatements = transformUsingDeclarations(node.statements, pos, node.statements.length, envBinding, topLevelStatements); + if (exportBindings.size) { + append( + topLevelStatements, + factory2.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory2.createNamedExports(arrayFrom(exportBindings.values())) + ) + ); + } + addRange(topLevelStatements, endLexicalEnvironment()); + if (exportVars.length) { + topLevelStatements.push(factory2.createVariableStatement( + factory2.createModifiersFromModifierFlags(32 /* Export */), + factory2.createVariableDeclarationList( + exportVars, + 1 /* Let */ + ) + )); + } + addRange(topLevelStatements, createDownlevelUsingStatements(bodyStatements, envBinding, usingKind === 2 /* Async */)); + if (exportEqualsBinding) { + topLevelStatements.push(factory2.createExportAssignment( + /*modifiers*/ + void 0, + /*isExportEquals*/ + true, + exportEqualsBinding + )); + } + return factory2.updateSourceFile(node, topLevelStatements); + } + return visitEachChild(node, visitor, context); + } + function visitBlock(node) { + const usingKind = getUsingKindOfStatements(node.statements); + if (usingKind) { + const prologueCount = countPrologueStatements(node.statements); + const envBinding = createEnvBinding(); + return factory2.updateBlock( + node, + [ + ...visitArray(node.statements, visitor, isStatement, 0, prologueCount), + ...createDownlevelUsingStatements( + transformUsingDeclarations( + node.statements, + prologueCount, + node.statements.length, + envBinding, + /*topLevelStatements*/ + void 0 + ), + envBinding, + usingKind === 2 /* Async */ + ) + ] + ); + } + return visitEachChild(node, visitor, context); + } + function visitForStatement(node) { + if (node.initializer && isUsingVariableDeclarationList(node.initializer)) { + return visitNode( + factory2.createBlock([ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + node.initializer + ), + factory2.updateForStatement( + node, + /*initializer*/ + void 0, + node.condition, + node.incrementor, + node.statement + ) + ]), + visitor, + isStatement + ); + } + return visitEachChild(node, visitor, context); + } + function visitForOfStatement(node) { + if (isUsingVariableDeclarationList(node.initializer)) { + const forInitializer = node.initializer; + Debug.assertNode(forInitializer, isUsingVariableDeclarationList); + Debug.assert(forInitializer.declarations.length === 1, "ForInitializer may only have one declaration"); + const forDecl = forInitializer.declarations[0]; + Debug.assert(!forDecl.initializer, "ForInitializer may not have an initializer"); + const isAwaitUsing = getUsingKindOfVariableDeclarationList(forInitializer) === 2 /* Async */; + const temp = factory2.getGeneratedNameForNode(forDecl.name); + const usingVar = factory2.updateVariableDeclaration( + forDecl, + forDecl.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + temp + ); + const usingVarList = factory2.createVariableDeclarationList([usingVar], isAwaitUsing ? 6 /* AwaitUsing */ : 4 /* Using */); + const usingVarStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + usingVarList + ); + return visitNode( + factory2.updateForOfStatement( + node, + node.awaitModifier, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration(temp) + ], 2 /* Const */), + node.expression, + isBlock(node.statement) ? factory2.updateBlock(node.statement, [ + usingVarStatement, + ...node.statement.statements + ]) : factory2.createBlock( + [ + usingVarStatement, + node.statement + ], + /*multiLine*/ + true + ) + ), + visitor, + isStatement + ); + } + return visitEachChild(node, visitor, context); + } + function visitCaseOrDefaultClause(node, envBinding) { + if (getUsingKindOfStatements(node.statements) !== 0 /* None */) { + if (isCaseClause(node)) { + return factory2.updateCaseClause( + node, + visitNode(node.expression, visitor, isExpression), + transformUsingDeclarations( + node.statements, + /*start*/ + 0, + node.statements.length, + envBinding, + /*topLevelStatements*/ + void 0 + ) + ); + } else { + return factory2.updateDefaultClause( + node, + transformUsingDeclarations( + node.statements, + /*start*/ + 0, + node.statements.length, + envBinding, + /*topLevelStatements*/ + void 0 + ) + ); + } + } + return visitEachChild(node, visitor, context); + } + function visitSwitchStatement(node) { + const usingKind = getUsingKindOfCaseOrDefaultClauses(node.caseBlock.clauses); + if (usingKind) { + const envBinding = createEnvBinding(); + return createDownlevelUsingStatements( + [ + factory2.updateSwitchStatement( + node, + visitNode(node.expression, visitor, isExpression), + factory2.updateCaseBlock( + node.caseBlock, + node.caseBlock.clauses.map((clause) => visitCaseOrDefaultClause(clause, envBinding)) + ) + ) + ], + envBinding, + usingKind === 2 /* Async */ + ); + } + return visitEachChild(node, visitor, context); + } + function transformUsingDeclarations(statementsIn, start, end, envBinding, topLevelStatements) { + const statements = []; + for (let i = start; i < end; i++) { + const statement = statementsIn[i]; + const usingKind = getUsingKind(statement); + if (usingKind) { + Debug.assertNode(statement, isVariableStatement); + const declarations = []; + for (let declaration of statement.declarationList.declarations) { + if (!isIdentifier(declaration.name)) { + declarations.length = 0; + break; + } + if (isNamedEvaluation(declaration)) { + declaration = transformNamedEvaluation(context, declaration); + } + const initializer = visitNode(declaration.initializer, visitor, isExpression) ?? factory2.createVoidZero(); + declarations.push(factory2.updateVariableDeclaration( + declaration, + declaration.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + emitHelpers().createAddDisposableResourceHelper( + envBinding, + initializer, + usingKind === 2 /* Async */ + ) + )); + } + if (declarations.length) { + const varList = factory2.createVariableDeclarationList(declarations, 2 /* Const */); + setOriginalNode(varList, statement.declarationList); + setTextRange(varList, statement.declarationList); + hoistOrAppendNode(factory2.updateVariableStatement( + statement, + /*modifiers*/ + void 0, + varList + )); + continue; + } + } + const result = visitor(statement); + if (isArray(result)) { + result.forEach(hoistOrAppendNode); + } else if (result) { + hoistOrAppendNode(result); + } + } + return statements; + function hoistOrAppendNode(node) { + Debug.assertNode(node, isStatement); + append(statements, hoist(node)); + } + function hoist(node) { + if (!topLevelStatements) + return node; + switch (node.kind) { + case 272 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 278 /* ExportDeclaration */: + case 262 /* FunctionDeclaration */: + return hoistImportOrExportOrHoistedDeclaration(node, topLevelStatements); + case 277 /* ExportAssignment */: + return hoistExportAssignment(node); + case 263 /* ClassDeclaration */: + return hoistClassDeclaration(node); + case 243 /* VariableStatement */: + return hoistVariableStatement(node); + } + return node; + } + } + function hoistImportOrExportOrHoistedDeclaration(node, topLevelStatements) { + topLevelStatements.push(node); + return void 0; + } + function hoistExportAssignment(node) { + return node.isExportEquals ? hoistExportEquals(node) : hoistExportDefault(node); + } + function hoistExportDefault(node) { + if (defaultExportBinding) { + return node; + } + defaultExportBinding = factory2.createUniqueName("_default", 8 /* ReservedInNestedScopes */ | 32 /* FileLevel */ | 16 /* Optimistic */); + hoistBindingIdentifier( + defaultExportBinding, + /*isExport*/ + true, + "default", + node + ); + let expression = node.expression; + let innerExpression = skipOuterExpressions(expression); + if (isNamedEvaluation(innerExpression)) { + innerExpression = transformNamedEvaluation( + context, + innerExpression, + /*ignoreEmptyStringLiteral*/ + false, + "default" + ); + expression = factory2.restoreOuterExpressions(expression, innerExpression); + } + const assignment = factory2.createAssignment(defaultExportBinding, expression); + return factory2.createExpressionStatement(assignment); + } + function hoistExportEquals(node) { + if (exportEqualsBinding) { + return node; + } + exportEqualsBinding = factory2.createUniqueName("_default", 8 /* ReservedInNestedScopes */ | 32 /* FileLevel */ | 16 /* Optimistic */); + hoistVariableDeclaration(exportEqualsBinding); + const assignment = factory2.createAssignment(exportEqualsBinding, node.expression); + return factory2.createExpressionStatement(assignment); + } + function hoistClassDeclaration(node) { + if (!node.name && defaultExportBinding) { + return node; + } + const isExported2 = hasSyntacticModifier(node, 32 /* Export */); + const isDefault = hasSyntacticModifier(node, 2048 /* Default */); + let expression = factory2.converters.convertToClassExpression(node); + if (node.name) { + hoistBindingIdentifier( + factory2.getLocalName(node), + isExported2 && !isDefault, + /*exportAlias*/ + void 0, + node + ); + expression = factory2.createAssignment(factory2.getDeclarationName(node), expression); + if (isNamedEvaluation(expression)) { + expression = transformNamedEvaluation( + context, + expression, + /*ignoreEmptyStringLiteral*/ + false + ); + } + setOriginalNode(expression, node); + setSourceMapRange(expression, node); + setCommentRange(expression, node); + } + if (isDefault && !defaultExportBinding) { + defaultExportBinding = factory2.createUniqueName("_default", 8 /* ReservedInNestedScopes */ | 32 /* FileLevel */ | 16 /* Optimistic */); + hoistBindingIdentifier( + defaultExportBinding, + /*isExport*/ + true, + "default", + node + ); + expression = factory2.createAssignment(defaultExportBinding, expression); + if (isNamedEvaluation(expression)) { + expression = transformNamedEvaluation( + context, + expression, + /*ignoreEmptyStringLiteral*/ + false, + "default" + ); + } + setOriginalNode(expression, node); + } + return factory2.createExpressionStatement(expression); + } + function hoistVariableStatement(node) { + let expressions; + const isExported2 = hasSyntacticModifier(node, 32 /* Export */); + for (const variable of node.declarationList.declarations) { + hoistBindingElement(variable, isExported2, variable); + if (variable.initializer) { + expressions = append(expressions, hoistInitializedVariable(variable)); + } + } + if (expressions) { + const statement = factory2.createExpressionStatement(factory2.inlineExpressions(expressions)); + setOriginalNode(statement, node); + setCommentRange(statement, node); + setSourceMapRange(statement, node); + return statement; + } + return void 0; + } + function hoistInitializedVariable(node) { + Debug.assertIsDefined(node.initializer); + let target; + if (isIdentifier(node.name)) { + target = factory2.cloneNode(node.name); + setEmitFlags(target, getEmitFlags(target) & ~(32768 /* LocalName */ | 16384 /* ExportName */ | 65536 /* InternalName */)); + } else { + target = factory2.converters.convertToAssignmentPattern(node.name); + } + const assignment = factory2.createAssignment(target, node.initializer); + setOriginalNode(assignment, node); + setCommentRange(assignment, node); + setSourceMapRange(assignment, node); + return assignment; + } + function hoistBindingElement(node, isExportedDeclaration, original) { + if (isBindingPattern(node.name)) { + for (const element of node.name.elements) { + if (!isOmittedExpression(element)) { + hoistBindingElement(element, isExportedDeclaration, original); + } + } + } else { + hoistBindingIdentifier( + node.name, + isExportedDeclaration, + /*exportAlias*/ + void 0, + original + ); + } + } + function hoistBindingIdentifier(node, isExport, exportAlias, original) { + const name = isGeneratedIdentifier(node) ? node : factory2.cloneNode(node); + if (isExport) { + if (exportAlias === void 0 && !isLocalName(name)) { + const varDecl = factory2.createVariableDeclaration(name); + if (original) { + setOriginalNode(varDecl, original); + } + exportVars.push(varDecl); + return; + } + const localName = exportAlias !== void 0 ? name : void 0; + const exportName = exportAlias !== void 0 ? exportAlias : name; + const specifier = factory2.createExportSpecifier( + /*isTypeOnly*/ + false, + localName, + exportName + ); + if (original) { + setOriginalNode(specifier, original); + } + exportBindings.set(name, specifier); + } + hoistVariableDeclaration(name); + } + function createEnvBinding() { + return factory2.createUniqueName("env"); + } + function createDownlevelUsingStatements(bodyStatements, envBinding, async) { + const statements = []; + const envObject = factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment("stack", factory2.createArrayLiteralExpression()), + factory2.createPropertyAssignment("error", factory2.createVoidZero()), + factory2.createPropertyAssignment("hasError", factory2.createFalse()) + ]); + const envVar = factory2.createVariableDeclaration( + envBinding, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + envObject + ); + const envVarList = factory2.createVariableDeclarationList([envVar], 2 /* Const */); + const envVarStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + envVarList + ); + statements.push(envVarStatement); + const tryBlock = factory2.createBlock( + bodyStatements, + /*multiLine*/ + true + ); + const bodyCatchBinding = factory2.createUniqueName("e"); + const catchClause = factory2.createCatchClause( + bodyCatchBinding, + factory2.createBlock( + [ + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression(envBinding, "error"), + bodyCatchBinding + ) + ), + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression(envBinding, "hasError"), + factory2.createTrue() + ) + ) + ], + /*multiLine*/ + true + ) + ); + let finallyBlock; + if (async) { + const result = factory2.createUniqueName("result"); + finallyBlock = factory2.createBlock( + [ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + result, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + emitHelpers().createDisposeResourcesHelper(envBinding) + ) + ], 2 /* Const */) + ), + factory2.createIfStatement(result, factory2.createExpressionStatement(factory2.createAwaitExpression(result))) + ], + /*multiLine*/ + true + ); + } else { + finallyBlock = factory2.createBlock( + [ + factory2.createExpressionStatement( + emitHelpers().createDisposeResourcesHelper(envBinding) + ) + ], + /*multiLine*/ + true + ); + } + const tryStatement = factory2.createTryStatement(tryBlock, catchClause, finallyBlock); + statements.push(tryStatement); + return statements; + } + } + function countPrologueStatements(statements) { + for (let i = 0; i < statements.length; i++) { + if (!isPrologueDirective(statements[i]) && !isCustomPrologue(statements[i])) { + return i; + } + } + return 0; + } + function isUsingVariableDeclarationList(node) { + return isVariableDeclarationList(node) && getUsingKindOfVariableDeclarationList(node) !== 0 /* None */; + } + function getUsingKindOfVariableDeclarationList(node) { + return (node.flags & 7 /* BlockScoped */) === 6 /* AwaitUsing */ ? 2 /* Async */ : (node.flags & 7 /* BlockScoped */) === 4 /* Using */ ? 1 /* Sync */ : 0 /* None */; + } + function getUsingKindOfVariableStatement(node) { + return getUsingKindOfVariableDeclarationList(node.declarationList); + } + function getUsingKind(statement) { + return isVariableStatement(statement) ? getUsingKindOfVariableStatement(statement) : 0 /* None */; + } + function getUsingKindOfStatements(statements) { + let result = 0 /* None */; + for (const statement of statements) { + const usingKind = getUsingKind(statement); + if (usingKind === 2 /* Async */) + return 2 /* Async */; + if (usingKind > result) + result = usingKind; + } + return result; + } + function getUsingKindOfCaseOrDefaultClauses(clauses) { + let result = 0 /* None */; + for (const clause of clauses) { + const usingKind = getUsingKindOfStatements(clause.statements); + if (usingKind === 2 /* Async */) + return 2 /* Async */; + if (usingKind > result) + result = usingKind; + } + return result; } var init_esnext = __esm({ "src/compiler/transformers/esnext.ts"() { @@ -367600,7 +371953,7 @@ ${lanes.join("\n")} factory2.createNamedImports(arrayFrom(importSpecifiersMap.values())) ), factory2.createStringLiteral(importSource), - /*assertClause*/ + /*attributes*/ void 0 ); setParentRecursive( @@ -367659,25 +372012,25 @@ ${lanes.join("\n")} } function visitorWorker(node) { switch (node.kind) { - case 283 /* JsxElement */: + case 284 /* JsxElement */: return visitJsxElement( node, /*isChild*/ false ); - case 284 /* JsxSelfClosingElement */: + case 285 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement( node, /*isChild*/ false ); - case 287 /* JsxFragment */: + case 288 /* JsxFragment */: return visitJsxFragment( node, /*isChild*/ false ); - case 293 /* JsxExpression */: + case 294 /* JsxExpression */: return visitJsxExpression(node); default: return visitEachChild(node, visitor, context); @@ -367687,21 +372040,21 @@ ${lanes.join("\n")} switch (node.kind) { case 12 /* JsxText */: return visitJsxText(node); - case 293 /* JsxExpression */: + case 294 /* JsxExpression */: return visitJsxExpression(node); - case 283 /* JsxElement */: + case 284 /* JsxElement */: return visitJsxElement( node, /*isChild*/ true ); - case 284 /* JsxSelfClosingElement */: + case 285 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement( node, /*isChild*/ true ); - case 287 /* JsxFragment */: + case 288 /* JsxFragment */: return visitJsxFragment( node, /*isChild*/ @@ -367712,7 +372065,9 @@ ${lanes.join("\n")} } } function hasProto(obj) { - return obj.properties.some((p) => isPropertyAssignment(p) && (isIdentifier(p.name) && idText(p.name) === "__proto__" || isStringLiteral(p.name) && p.name.text === "__proto__")); + return obj.properties.some( + (p) => isPropertyAssignment(p) && (isIdentifier(p.name) && idText(p.name) === "__proto__" || isStringLiteral(p.name) && p.name.text === "__proto__") + ); } function hasKeyAfterPropsSpread(node) { let spread = false; @@ -367885,7 +372240,7 @@ ${lanes.join("\n")} } function transformJsxSpreadAttributeToProps(node) { if (isObjectLiteralExpression(node.expression) && !hasProto(node.expression)) { - return node.expression.properties; + return sameMap(node.expression.properties, (p) => Debug.checkDefined(visitNode(p, visitor, isObjectLiteralElementLike))); } return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); } @@ -367909,10 +372264,10 @@ ${lanes.join("\n")} for (const prop of attr.expression.properties) { if (isSpreadAssignment(prop)) { finishObjectLiteralIfNeeded(); - expressions.push(prop.expression); + expressions.push(Debug.checkDefined(visitNode(prop.expression, visitor, isExpression))); continue; } - properties.push(prop); + properties.push(Debug.checkDefined(visitNode(prop, visitor))); } continue; } @@ -367951,7 +372306,7 @@ ${lanes.join("\n")} const literal = factory2.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); return setTextRange(literal, node); } - if (node.kind === 293 /* JsxExpression */) { + if (node.kind === 294 /* JsxExpression */) { if (node.expression === void 0) { return factory2.createTrue(); } @@ -368025,7 +372380,7 @@ ${lanes.join("\n")} return decoded === text ? void 0 : decoded; } function getTagName(node) { - if (node.kind === 283 /* JsxElement */) { + if (node.kind === 284 /* JsxElement */) { return getTagName(node.openingElement); } else { const tagName = node.tagName; @@ -368332,7 +372687,7 @@ ${lanes.join("\n")} return node; } switch (node.kind) { - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return visitBinaryExpression(node); default: return visitEachChild(node, visitor, context); @@ -368466,7 +372821,7 @@ ${lanes.join("\n")} hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 /* SubtreeFactsMask */ | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 && node.kind === 252 /* ReturnStatement */ && !node.expression; + return (hierarchyFacts & 8192 /* ConstructorWithSuperCall */) !== 0 && node.kind === 253 /* ReturnStatement */ && !node.expression; } function isOrMayContainReturnCompletion(node) { return node.transformFlags & 4194304 /* ContainsHoistedDeclarationOrCompletion */ && (isReturnStatement(node) || isIfStatement(node) || isWithStatement(node) || isSwitchStatement(node) || isCaseBlock(node) || isCaseClause(node) || isDefaultClause(node) || isTryStatement(node) || isCatchClause(node) || isLabeledStatement(node) || isIterationStatement( @@ -368476,7 +372831,7 @@ ${lanes.join("\n")} ) || isBlock(node)); } function shouldVisitNode(node) { - return (node.transformFlags & 1024 /* ContainsES2015 */) !== 0 || convertedLoopState !== void 0 || hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && isOrMayContainReturnCompletion(node) || isIterationStatement( + return (node.transformFlags & 1024 /* ContainsES2015 */) !== 0 || convertedLoopState !== void 0 || hierarchyFacts & 8192 /* ConstructorWithSuperCall */ && isOrMayContainReturnCompletion(node) || isIterationStatement( node, /*lookInLabeledStatements*/ false @@ -368509,7 +372864,7 @@ ${lanes.join("\n")} /*expressionResultIsUnused*/ false ); - exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); return result; } return visitorWorker( @@ -368523,6 +372878,7 @@ ${lanes.join("\n")} function callExpressionVisitor(node) { if (node.kind === 108 /* SuperKeyword */) { return visitSuperKeyword( + node, /*isExpressionOfCall*/ true ); @@ -368533,85 +372889,85 @@ ${lanes.join("\n")} switch (node.kind) { case 126 /* StaticKeyword */: return void 0; - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return visitClassDeclaration(node); - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: return visitClassExpression(node); - case 168 /* Parameter */: + case 169 /* Parameter */: return visitParameter(node); - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return visitArrowFunction(node); - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: return visitFunctionExpression(node); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return visitVariableDeclaration(node); case 80 /* Identifier */: return visitIdentifier(node); - case 260 /* VariableDeclarationList */: + case 261 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: return visitSwitchStatement(node); - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: return visitCaseBlock(node); - case 240 /* Block */: + case 241 /* Block */: return visitBlock( node, /*isFunctionBody*/ false ); - case 251 /* BreakStatement */: - case 250 /* ContinueStatement */: + case 252 /* BreakStatement */: + case 251 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return visitLabeledStatement(node); - case 245 /* DoStatement */: - case 246 /* WhileStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: return visitDoOrWhileStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return visitForInStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return visitForOfStatement( node, /*outermostLabeledStatement*/ void 0 ); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return visitExpressionStatement(node); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return visitCatchClause(node); - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return visitCallExpression(node); - case 213 /* NewExpression */: + case 214 /* NewExpression */: return visitNewExpression(node); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, expressionResultIsUnused2); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return visitBinaryExpression(node, expressionResultIsUnused2); - case 360 /* CommaListExpression */: + case 361 /* CommaListExpression */: return visitCommaListExpression(node, expressionResultIsUnused2); case 15 /* NoSubstitutionTemplateLiteral */: case 16 /* TemplateHead */: @@ -368622,33 +372978,34 @@ ${lanes.join("\n")} return visitStringLiteral(node); case 9 /* NumericLiteral */: return visitNumericLiteral(node); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 227 /* TemplateExpression */: + case 228 /* TemplateExpression */: return visitTemplateExpression(node); - case 228 /* YieldExpression */: + case 229 /* YieldExpression */: return visitYieldExpression(node); - case 229 /* SpreadElement */: + case 230 /* SpreadElement */: return visitSpreadElement(node); case 108 /* SuperKeyword */: return visitSuperKeyword( + node, /*isExpressionOfCall*/ false ); case 110 /* ThisKeyword */: return visitThisKeyword(node); - case 235 /* MetaProperty */: + case 236 /* MetaProperty */: return visitMetaProperty(node); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return visitAccessorDeclaration(node); - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return visitVariableStatement(node); - case 252 /* ReturnStatement */: + case 253 /* ReturnStatement */: return visitReturnStatement(node); - case 221 /* VoidExpression */: + case 222 /* VoidExpression */: return visitVoidExpression(node); default: return visitEachChild(node, visitor, context); @@ -368701,7 +373058,10 @@ ${lanes.join("\n")} return updated; } function returnCapturedThis(node) { - return setOriginalNode(factory2.createReturnStatement(factory2.createUniqueName("_this", 16 /* Optimistic */ | 32 /* FileLevel */)), node); + return setOriginalNode(factory2.createReturnStatement(createCapturedThis()), node); + } + function createCapturedThis() { + return factory2.createUniqueName("_this", 16 /* Optimistic */ | 32 /* FileLevel */); } function visitReturnStatement(node) { if (convertedLoopState) { @@ -368725,8 +373085,9 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitThisKeyword(node) { + hierarchyFacts |= 65536 /* LexicalThis */; if (hierarchyFacts & 2 /* ArrowFunction */ && !(hierarchyFacts & 16384 /* StaticInitializer */)) { - hierarchyFacts |= 65536 /* CapturedLexicalThis */; + hierarchyFacts |= 131072 /* CapturedLexicalThis */; } if (convertedLoopState) { if (hierarchyFacts & 2 /* ArrowFunction */) { @@ -368746,23 +373107,26 @@ ${lanes.join("\n")} return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments")); } } - if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) { - return setOriginalNode(setTextRange( - factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)), + if (node.flags & 256 /* IdentifierHasExtendedUnicodeEscape */) { + return setOriginalNode( + setTextRange( + factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)), + node + ), node - ), node); + ); } return node; } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - const jump = node.kind === 251 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + const jump = node.kind === 252 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; const canUseBreakOrContinue = node.label && convertedLoopState.labels && convertedLoopState.labels.get(idText(node.label)) || !node.label && convertedLoopState.allowedNonLabeledJumps & jump; if (!canUseBreakOrContinue) { let labelMarker; const label = node.label; if (!label) { - if (node.kind === 251 /* BreakStatement */) { + if (node.kind === 252 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } else { @@ -368770,7 +373134,7 @@ ${lanes.join("\n")} labelMarker = "continue"; } } else { - if (node.kind === 251 /* BreakStatement */) { + if (node.kind === 252 /* BreakStatement */) { labelMarker = `break-${label.escapedText}`; setLabeledJump( convertedLoopState, @@ -368833,8 +373197,8 @@ ${lanes.join("\n")} setTextRange(statement, node); startOnNewLine(statement); statements.push(statement); - if (hasSyntacticModifier(node, 1 /* Export */)) { - const exportStatement = hasSyntacticModifier(node, 1024 /* Default */) ? factory2.createExportDefault(factory2.getLocalName(node)) : factory2.createExternalModuleExport(factory2.getLocalName(node)); + if (hasSyntacticModifier(node, 32 /* Export */)) { + const exportStatement = hasSyntacticModifier(node, 2048 /* Default */) ? factory2.createExportDefault(factory2.getLocalName(node)) : factory2.createExternalModuleExport(factory2.getLocalName(node)); setOriginalNode(exportStatement, statement); statements.push(exportStatement); } @@ -368862,7 +373226,7 @@ ${lanes.join("\n")} void 0, /*dotDotDotToken*/ void 0, - factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */) + createSyntheticSuper() )] : [], /*type*/ void 0, @@ -368952,7 +373316,7 @@ ${lanes.join("\n")} setEmitFlags(constructorFunction, 16 /* CapturesThis */); } statements.push(constructorFunction); - exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; } function transformConstructorParameters(constructor, hasSynthesizedSuper) { @@ -368976,6 +373340,36 @@ ${lanes.join("\n")} setEmitFlags(block, 3072 /* NoComments */); return block; } + function isUninitializedVariableStatement(node) { + return isVariableStatement(node) && every(node.declarationList.declarations, (decl) => isIdentifier(decl.name) && !decl.initializer); + } + function containsSuperCall(node) { + if (isSuperCall(node)) { + return true; + } + if (!(node.transformFlags & 134217728 /* ContainsLexicalSuper */)) { + return false; + } + switch (node.kind) { + case 219 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 176 /* Constructor */: + case 175 /* ClassStaticBlockDeclaration */: + return false; + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 172 /* PropertyDeclaration */: { + const named = node; + if (isComputedPropertyName(named.name)) { + return !!forEachChild(named.name, containsSuperCall); + } + return false; + } + } + return !!forEachChild(node, containsSuperCall); + } function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) { const isDerivedClass = !!extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 106 /* NullKeyword */; if (!constructor) @@ -368983,82 +373377,34 @@ ${lanes.join("\n")} const prologue = []; const statements = []; resumeLexicalEnvironment(); - const existingPrologue = takeWhile(constructor.body.statements, isPrologueDirective); - const { superCall, superStatementIndex } = findSuperCallAndStatementIndex(constructor.body.statements, existingPrologue); - const postSuperStatementsStart = superStatementIndex === -1 ? existingPrologue.length : superStatementIndex + 1; - let statementOffset = postSuperStatementsStart; - if (!hasSynthesizedSuper) - statementOffset = factory2.copyStandardPrologue( - constructor.body.statements, - prologue, - statementOffset, - /*ensureUseStrict*/ - false - ); - if (!hasSynthesizedSuper) - statementOffset = factory2.copyCustomPrologue( - constructor.body.statements, - statements, - statementOffset, - visitor, - /*filter*/ - void 0 - ); - let superCallExpression; - if (hasSynthesizedSuper) { - superCallExpression = createDefaultSuperCallOrThis(); - } else if (superCall) { - superCallExpression = visitSuperCallInBody(superCall); - } - if (superCallExpression) { - hierarchyFacts |= 8192 /* ConstructorWithCapturedSuper */; - } - addDefaultValueAssignmentsIfNeeded2(prologue, constructor); - addRestParameterIfNeeded(prologue, constructor, hasSynthesizedSuper); - addRange(statements, visitNodes2( + const standardPrologueEnd = factory2.copyStandardPrologue( constructor.body.statements, - visitor, - isStatement, - /*start*/ - statementOffset - )); - factory2.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); - insertCaptureNewTargetIfNeeded( prologue, - constructor, - /*copyOnWrite*/ - false + /*statementOffset*/ + 0 ); - if (isDerivedClass || superCallExpression) { - if (superCallExpression && postSuperStatementsStart === constructor.body.statements.length && !(constructor.body.transformFlags & 16384 /* ContainsLexicalThis */)) { - const superCall2 = cast(cast(superCallExpression, isBinaryExpression).left, isCallExpression); - const returnStatement = factory2.createReturnStatement(superCallExpression); - setCommentRange(returnStatement, getCommentRange(superCall2)); - setEmitFlags(superCall2, 3072 /* NoComments */); - statements.push(returnStatement); - } else { - if (superStatementIndex <= existingPrologue.length) { - insertCaptureThisForNode(statements, constructor, superCallExpression || createActualThis()); - } else { - insertCaptureThisForNode(prologue, constructor, createActualThis()); - if (superCallExpression) { - insertSuperThisCaptureThisForNode(statements, superCallExpression); - } - } - if (!isSufficientlyCoveredByReturnStatements(constructor.body)) { - statements.push(factory2.createReturnStatement(factory2.createUniqueName("_this", 16 /* Optimistic */ | 32 /* FileLevel */))); - } - } + if (hasSynthesizedSuper || containsSuperCall(constructor.body)) { + hierarchyFacts |= 8192 /* ConstructorWithSuperCall */; + } + addRange(statements, visitNodes2(constructor.body.statements, visitor, isStatement, standardPrologueEnd)); + const mayReplaceThis = isDerivedClass || hierarchyFacts & 8192 /* ConstructorWithSuperCall */; + addDefaultValueAssignmentsIfNeeded2(prologue, constructor); + addRestParameterIfNeeded(prologue, constructor, hasSynthesizedSuper); + insertCaptureNewTargetIfNeeded(prologue, constructor); + if (mayReplaceThis) { + insertCaptureThisForNode(prologue, constructor, createActualThis()); } else { insertCaptureThisForNodeIfNeeded(prologue, constructor); } + factory2.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); + if (mayReplaceThis && !isSufficientlyCoveredByReturnStatements(constructor.body)) { + statements.push(factory2.createReturnStatement(createCapturedThis())); + } const body = factory2.createBlock( setTextRange( factory2.createNodeArray( [ - ...existingPrologue, ...prologue, - ...superStatementIndex <= existingPrologue.length ? emptyArray : visitNodes2(constructor.body.statements, visitor, isStatement, existingPrologue.length, superStatementIndex - existingPrologue.length), ...statements ] ), @@ -369069,31 +373415,261 @@ ${lanes.join("\n")} true ); setTextRange(body, constructor.body); + return simplifyConstructor(body, constructor.body, hasSynthesizedSuper); + } + function isCapturedThis(node) { + return isGeneratedIdentifier(node) && idText(node) === "_this"; + } + function isSyntheticSuper(node) { + return isGeneratedIdentifier(node) && idText(node) === "_super"; + } + function isThisCapturingVariableStatement(node) { + return isVariableStatement(node) && node.declarationList.declarations.length === 1 && isThisCapturingVariableDeclaration(node.declarationList.declarations[0]); + } + function isThisCapturingVariableDeclaration(node) { + return isVariableDeclaration(node) && isCapturedThis(node.name) && !!node.initializer; + } + function isThisCapturingAssignment(node) { + return isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ) && isCapturedThis(node.left); + } + function isTransformedSuperCall(node) { + return isCallExpression(node) && isPropertyAccessExpression(node.expression) && isSyntheticSuper(node.expression.expression) && isIdentifier(node.expression.name) && (idText(node.expression.name) === "call" || idText(node.expression.name) === "apply") && node.arguments.length >= 1 && node.arguments[0].kind === 110 /* ThisKeyword */; + } + function isTransformedSuperCallWithFallback(node) { + return isBinaryExpression(node) && node.operatorToken.kind === 57 /* BarBarToken */ && node.right.kind === 110 /* ThisKeyword */ && isTransformedSuperCall(node.left); + } + function isImplicitSuperCall(node) { + return isBinaryExpression(node) && node.operatorToken.kind === 56 /* AmpersandAmpersandToken */ && isBinaryExpression(node.left) && node.left.operatorToken.kind === 38 /* ExclamationEqualsEqualsToken */ && isSyntheticSuper(node.left.left) && node.left.right.kind === 106 /* NullKeyword */ && isTransformedSuperCall(node.right) && idText(node.right.expression.name) === "apply"; + } + function isImplicitSuperCallWithFallback(node) { + return isBinaryExpression(node) && node.operatorToken.kind === 57 /* BarBarToken */ && node.right.kind === 110 /* ThisKeyword */ && isImplicitSuperCall(node.left); + } + function isThisCapturingTransformedSuperCallWithFallback(node) { + return isThisCapturingAssignment(node) && isTransformedSuperCallWithFallback(node.right); + } + function isThisCapturingImplicitSuperCallWithFallback(node) { + return isThisCapturingAssignment(node) && isImplicitSuperCallWithFallback(node.right); + } + function isTransformedSuperCallLike(node) { + return isTransformedSuperCall(node) || isTransformedSuperCallWithFallback(node) || isThisCapturingTransformedSuperCallWithFallback(node) || isImplicitSuperCall(node) || isImplicitSuperCallWithFallback(node) || isThisCapturingImplicitSuperCallWithFallback(node); + } + function simplifyConstructorInlineSuperInThisCaptureVariable(body) { + for (let i = 0; i < body.statements.length - 1; i++) { + const statement = body.statements[i]; + if (!isThisCapturingVariableStatement(statement)) { + continue; + } + const varDecl = statement.declarationList.declarations[0]; + if (varDecl.initializer.kind !== 110 /* ThisKeyword */) { + continue; + } + const thisCaptureStatementIndex = i; + let superCallIndex = i + 1; + while (superCallIndex < body.statements.length) { + const statement2 = body.statements[superCallIndex]; + if (isExpressionStatement(statement2)) { + if (isTransformedSuperCallLike(skipOuterExpressions(statement2.expression))) { + break; + } + } + if (isUninitializedVariableStatement(statement2)) { + superCallIndex++; + continue; + } + return body; + } + const following = body.statements[superCallIndex]; + let expression = following.expression; + if (isThisCapturingAssignment(expression)) { + expression = expression.right; + } + const newVarDecl = factory2.updateVariableDeclaration( + varDecl, + varDecl.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + expression + ); + const newDeclList = factory2.updateVariableDeclarationList(statement.declarationList, [newVarDecl]); + const newVarStatement = factory2.createVariableStatement(statement.modifiers, newDeclList); + setOriginalNode(newVarStatement, following); + setTextRange(newVarStatement, following); + const newStatements = factory2.createNodeArray([ + ...body.statements.slice(0, thisCaptureStatementIndex), + // copy statements preceding to `var _this` + ...body.statements.slice(thisCaptureStatementIndex + 1, superCallIndex), + // copy intervening temp variables + newVarStatement, + ...body.statements.slice(superCallIndex + 1) + // copy statements following `super.call(this, ...)` + ]); + setTextRange(newStatements, body.statements); + return factory2.updateBlock(body, newStatements); + } return body; } - function findSuperCallAndStatementIndex(originalBodyStatements, existingPrologue) { - for (let i = existingPrologue.length; i < originalBodyStatements.length; i += 1) { - const superCall = getSuperCallFromStatement(originalBodyStatements[i]); - if (superCall) { - return { - superCall, - superStatementIndex: i - }; + function simplifyConstructorInlineSuperReturn(body, original) { + for (const statement of original.statements) { + if (statement.transformFlags & 134217728 /* ContainsLexicalSuper */ && !getSuperCallFromStatement(statement)) { + return body; } } - return { - superStatementIndex: -1 - }; + const canElideThisCapturingVariable = !(original.transformFlags & 16384 /* ContainsLexicalThis */) && !(hierarchyFacts & 65536 /* LexicalThis */) && !(hierarchyFacts & 131072 /* CapturedLexicalThis */); + for (let i = body.statements.length - 1; i > 0; i--) { + const statement = body.statements[i]; + if (isReturnStatement(statement) && statement.expression && isCapturedThis(statement.expression)) { + const preceding = body.statements[i - 1]; + let expression; + if (isExpressionStatement(preceding) && isThisCapturingTransformedSuperCallWithFallback(skipOuterExpressions(preceding.expression))) { + expression = preceding.expression; + } else if (canElideThisCapturingVariable && isThisCapturingVariableStatement(preceding)) { + const varDecl = preceding.declarationList.declarations[0]; + if (isTransformedSuperCallLike(skipOuterExpressions(varDecl.initializer))) { + expression = factory2.createAssignment( + createCapturedThis(), + varDecl.initializer + ); + } + } + if (!expression) { + break; + } + const newReturnStatement = factory2.createReturnStatement(expression); + setOriginalNode(newReturnStatement, preceding); + setTextRange(newReturnStatement, preceding); + const newStatements = factory2.createNodeArray([ + ...body.statements.slice(0, i - 1), + // copy all statements preceding `_super.call(this, ...)` + newReturnStatement, + ...body.statements.slice(i + 1) + // copy all statements following `return _this;` + ]); + setTextRange(newStatements, body.statements); + return factory2.updateBlock(body, newStatements); + } + } + return body; + } + function elideUnusedThisCaptureWorker(node) { + if (isThisCapturingVariableStatement(node)) { + const varDecl = node.declarationList.declarations[0]; + if (varDecl.initializer.kind === 110 /* ThisKeyword */) { + return void 0; + } + } else if (isThisCapturingAssignment(node)) { + return factory2.createPartiallyEmittedExpression(node.right, node); + } + switch (node.kind) { + case 219 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 176 /* Constructor */: + case 175 /* ClassStaticBlockDeclaration */: + return node; + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 172 /* PropertyDeclaration */: { + const named = node; + if (isComputedPropertyName(named.name)) { + return factory2.replacePropertyName(named, visitEachChild( + named.name, + elideUnusedThisCaptureWorker, + /*context*/ + void 0 + )); + } + return node; + } + } + return visitEachChild( + node, + elideUnusedThisCaptureWorker, + /*context*/ + void 0 + ); + } + function simplifyConstructorElideUnusedThisCapture(body, original) { + if (original.transformFlags & 16384 /* ContainsLexicalThis */ || hierarchyFacts & 65536 /* LexicalThis */ || hierarchyFacts & 131072 /* CapturedLexicalThis */) { + return body; + } + for (const statement of original.statements) { + if (statement.transformFlags & 134217728 /* ContainsLexicalSuper */ && !getSuperCallFromStatement(statement)) { + return body; + } + } + return factory2.updateBlock(body, visitNodes2(body.statements, elideUnusedThisCaptureWorker, isStatement)); + } + function injectSuperPresenceCheckWorker(node) { + if (isTransformedSuperCall(node) && node.arguments.length === 2 && isIdentifier(node.arguments[1]) && idText(node.arguments[1]) === "arguments") { + return factory2.createLogicalAnd( + factory2.createStrictInequality( + createSyntheticSuper(), + factory2.createNull() + ), + node + ); + } + switch (node.kind) { + case 219 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 176 /* Constructor */: + case 175 /* ClassStaticBlockDeclaration */: + return node; + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 172 /* PropertyDeclaration */: { + const named = node; + if (isComputedPropertyName(named.name)) { + return factory2.replacePropertyName(named, visitEachChild( + named.name, + injectSuperPresenceCheckWorker, + /*context*/ + void 0 + )); + } + return node; + } + } + return visitEachChild( + node, + injectSuperPresenceCheckWorker, + /*context*/ + void 0 + ); + } + function complicateConstructorInjectSuperPresenceCheck(body) { + return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement)); + } + function simplifyConstructor(body, original, hasSynthesizedSuper) { + const inputBody = body; + body = simplifyConstructorInlineSuperInThisCaptureVariable(body); + body = simplifyConstructorInlineSuperReturn(body, original); + if (body !== inputBody) { + body = simplifyConstructorElideUnusedThisCapture(body, original); + } + if (hasSynthesizedSuper) { + body = complicateConstructorInjectSuperPresenceCheck(body); + } + return body; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 252 /* ReturnStatement */) { + if (statement.kind === 253 /* ReturnStatement */) { return true; - } else if (statement.kind === 244 /* IfStatement */) { + } else if (statement.kind === 245 /* IfStatement */) { const ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } - } else if (statement.kind === 240 /* Block */) { + } else if (statement.kind === 241 /* Block */) { const lastStatement = lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -369108,11 +373684,11 @@ ${lanes.join("\n")} return factory2.createLogicalOr( factory2.createLogicalAnd( factory2.createStrictInequality( - factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */), + createSyntheticSuper(), factory2.createNull() ), factory2.createFunctionApplyCall( - factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */), + createSyntheticSuper(), createActualThis(), factory2.createIdentifier("arguments") ) @@ -369367,24 +373943,12 @@ ${lanes.join("\n")} return true; } function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 65536 /* CapturedLexicalThis */ && node.kind !== 218 /* ArrowFunction */) { + if (hierarchyFacts & 131072 /* CapturedLexicalThis */ && node.kind !== 219 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, factory2.createThis()); return true; } return false; } - function insertSuperThisCaptureThisForNode(statements, superExpression) { - enableSubstitutionsForCapturedThis(); - const assignSuperExpression = factory2.createExpressionStatement( - factory2.createBinaryExpression( - factory2.createThis(), - 64 /* EqualsToken */, - superExpression - ) - ); - insertStatementAfterCustomPrologue(statements, assignSuperExpression); - setCommentRange(assignSuperExpression, getOriginalNode(superExpression).parent); - } function insertCaptureThisForNode(statements, node, initializer) { enableSubstitutionsForCapturedThis(); const captureThisStatement = factory2.createVariableStatement( @@ -369392,7 +373956,7 @@ ${lanes.join("\n")} void 0, factory2.createVariableDeclarationList([ factory2.createVariableDeclaration( - factory2.createUniqueName("_this", 16 /* Optimistic */ | 32 /* FileLevel */), + createCapturedThis(), /*exclamationToken*/ void 0, /*type*/ @@ -369405,25 +373969,25 @@ ${lanes.join("\n")} setSourceMapRange(captureThisStatement, node); insertStatementAfterCustomPrologue(statements, captureThisStatement); } - function insertCaptureNewTargetIfNeeded(statements, node, copyOnWrite) { + function insertCaptureNewTargetIfNeeded(statements, node) { if (hierarchyFacts & 32768 /* NewTarget */) { let newTarget; switch (node.kind) { - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return statements; - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: newTarget = factory2.createVoidZero(); break; - case 175 /* Constructor */: + case 176 /* Constructor */: newTarget = factory2.createPropertyAccessExpression( setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), "constructor" ); break; - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: newTarget = factory2.createConditionalExpression( factory2.createLogicalAnd( setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */), @@ -369462,9 +374026,6 @@ ${lanes.join("\n")} ]) ); setEmitFlags(captureNewTargetStatement, 3072 /* NoComments */ | 2097152 /* CustomPrologue */); - if (copyOnWrite) { - statements = statements.slice(); - } insertStatementAfterCustomPrologue(statements, captureNewTargetStatement); } return statements; @@ -369472,21 +374033,21 @@ ${lanes.join("\n")} function addClassMembers(statements, node) { for (const member of node.members) { switch (member.kind) { - case 239 /* SemicolonClassElement */: + case 240 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: const accessors = getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 175 /* Constructor */: - case 174 /* ClassStaticBlockDeclaration */: + case 176 /* Constructor */: + case 175 /* ClassStaticBlockDeclaration */: break; default: Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName); @@ -369616,7 +374177,7 @@ ${lanes.join("\n")} } function visitArrowFunction(node) { if (node.transformFlags & 16384 /* ContainsLexicalThis */ && !(hierarchyFacts & 16384 /* StaticInitializer */)) { - hierarchyFacts |= 65536 /* CapturedLexicalThis */; + hierarchyFacts |= 131072 /* CapturedLexicalThis */; } const savedConvertedLoopState = convertedLoopState; convertedLoopState = void 0; @@ -369649,7 +374210,7 @@ ${lanes.join("\n")} const parameters = visitParameterList(node.parameters, visitor, context); const body = transformFunctionBody2(node); const name = hierarchyFacts & 32768 /* NewTarget */ ? factory2.getLocalName(node) : node.name; - exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; return factory2.updateFunctionExpression( node, @@ -369672,7 +374233,7 @@ ${lanes.join("\n")} const parameters = visitParameterList(node.parameters, visitor, context); const body = transformFunctionBody2(node); const name = hierarchyFacts & 32768 /* NewTarget */ ? factory2.getLocalName(node) : node.name; - exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; return factory2.updateFunctionDeclaration( node, @@ -369693,10 +374254,10 @@ ${lanes.join("\n")} const ancestorFacts = container && isClassLike(container) && !isStatic(node) ? enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */); const parameters = visitParameterList(node.parameters, visitor, context); const body = transformFunctionBody2(node); - if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 261 /* FunctionDeclaration */ || node.kind === 217 /* FunctionExpression */)) { + if (hierarchyFacts & 32768 /* NewTarget */ && !name && (node.kind === 262 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) { name = factory2.getGeneratedNameForNode(node); } - exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; return setOriginalNode( setTextRange( @@ -369754,7 +374315,7 @@ ${lanes.join("\n")} multiLine = true; } } else { - Debug.assert(node.kind === 218 /* ArrowFunction */); + Debug.assert(node.kind === 219 /* ArrowFunction */); statementsLocation = moveRangeEnd(body, -1); const equalsGreaterThanToken = node.equalsGreaterThanToken; if (!nodeIsSynthesized(equalsGreaterThanToken) && !nodeIsSynthesized(body)) { @@ -369773,12 +374334,7 @@ ${lanes.join("\n")} closeBraceLocation = body; } factory2.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); - insertCaptureNewTargetIfNeeded( - prologue, - node, - /*copyOnWrite*/ - false - ); + insertCaptureNewTargetIfNeeded(prologue, node); insertCaptureThisForNodeIfNeeded(prologue, node); if (some(prologue)) { multiLine = true; @@ -369854,9 +374410,9 @@ ${lanes.join("\n")} return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1 /* TypeScriptClassWrapper */); } function visitVariableStatement(node) { - const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); + const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 32 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */); let updated; - if (convertedLoopState && (node.declarationList.flags & 3 /* BlockScoped */) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) { + if (convertedLoopState && (node.declarationList.flags & 7 /* BlockScoped */) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) { let assignments; for (const decl of node.declarationList.declarations) { hoistVariableDeclarationDeclaredInConvertedLoop(convertedLoopState, decl); @@ -369888,11 +374444,15 @@ ${lanes.join("\n")} return updated; } function visitVariableDeclarationList(node) { - if (node.flags & 3 /* BlockScoped */ || node.transformFlags & 524288 /* ContainsBindingPattern */) { - if (node.flags & 3 /* BlockScoped */) { + if (node.flags & 7 /* BlockScoped */ || node.transformFlags & 524288 /* ContainsBindingPattern */) { + if (node.flags & 7 /* BlockScoped */) { enableSubstitutionsForBlockScopedBindings(); } - const declarations = visitNodes2(node.declarations, node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration, isVariableDeclaration); + const declarations = visitNodes2( + node.declarations, + node.flags & 1 /* Let */ ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration, + isVariableDeclaration + ); const declarationList = factory2.createVariableDeclarationList(declarations); setOriginalNode(declarationList, node); setTextRange(declarationList, node); @@ -369980,14 +374540,14 @@ ${lanes.join("\n")} } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 245 /* DoStatement */: - case 246 /* WhileStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -370043,7 +374603,7 @@ ${lanes.join("\n")} const statements = []; const initializer = node.initializer; if (isVariableDeclarationList(initializer)) { - if (node.initializer.flags & 3 /* BlockScoped */) { + if (node.initializer.flags & 7 /* BlockScoped */) { enableSubstitutionsForBlockScopedBindings(); } const firstOriginalDeclaration = firstOrUndefined(initializer.declarations); @@ -370337,7 +374897,7 @@ ${lanes.join("\n")} let numInitialProperties = -1, hasComputed = false; for (let i = 0; i < properties.length; i++) { const property = properties[i]; - if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 166 /* ComputedPropertyName */)) { + if (property.transformFlags & 1048576 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */ || (hasComputed = Debug.checkDefined(property.name).kind === 167 /* ComputedPropertyName */)) { numInitialProperties = i; break; } @@ -370459,15 +375019,15 @@ ${lanes.join("\n")} } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 247 /* ForStatement */: + case 248 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 245 /* DoStatement */: + case 246 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 246 /* WhileStatement */: + case 247 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return Debug.failBadSyntaxKind(node, "IterationStatement expected"); @@ -370519,18 +375079,18 @@ ${lanes.join("\n")} function createConvertedLoopState(node) { let loopInitializer; switch (node.kind) { - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: const initializer = node.initializer; - if (initializer && initializer.kind === 260 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 261 /* VariableDeclarationList */) { loopInitializer = initializer; } break; } const loopParameters = []; const loopOutParameters = []; - if (loopInitializer && getCombinedNodeFlags(loopInitializer) & 3 /* BlockScoped */) { + if (loopInitializer && getCombinedNodeFlags(loopInitializer) & 7 /* BlockScoped */) { const hasCapturedBindingsInForHead = shouldConvertInitializerOfForStatement(node) || shouldConvertConditionOfForStatement(node) || shouldConvertIncrementorOfForStatement(node); for (const decl of loopInitializer.declarations) { processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead); @@ -370938,10 +375498,10 @@ ${lanes.join("\n")} name )); const checkFlags = resolver.getNodeCheckFlags(decl); - if (checkFlags & 262144 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) { + if (checkFlags & 65536 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) { const outParamName = factory2.createUniqueName("out_" + idText(name)); let flags = 0 /* None */; - if (checkFlags & 262144 /* NeedsLoopOutParameter */) { + if (checkFlags & 65536 /* NeedsLoopOutParameter */) { flags |= 1 /* Body */; } if (isForStatement(container)) { @@ -370962,20 +375522,20 @@ ${lanes.join("\n")} for (let i = start; i < numProperties; i++) { const property = properties[i]; switch (property.kind) { - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: const accessors = getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -371101,12 +375661,12 @@ ${lanes.join("\n")} let updated; const parameters = visitParameterList(node.parameters, visitor, context); const body = transformFunctionBody2(node); - if (node.kind === 176 /* GetAccessor */) { + if (node.kind === 177 /* GetAccessor */) { updated = factory2.updateGetAccessorDeclaration(node, node.modifiers, node.name, parameters, node.type, body); } else { updated = factory2.updateSetAccessorDeclaration(node, node.modifiers, node.name, parameters, body); } - exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 229376 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; return updated; } @@ -371256,13 +375816,6 @@ ${lanes.join("\n")} ) ); } - function visitSuperCallInBody(node) { - return visitCallExpressionWithPotentialCapturedThisAssignment( - node, - /*assignToCapturedThis*/ - false - ); - } function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) { if (node.transformFlags & 32768 /* ContainsRestOrSpread */ || node.expression.kind === 108 /* SuperKeyword */ || isSuperProperty(skipOuterExpressions(node.expression))) { const { target, thisArg } = factory2.createCallBinding(node.expression, hoistVariableDeclaration); @@ -371299,10 +375852,13 @@ ${lanes.join("\n")} resultingCall, createActualThis() ); - resultingCall = assignToCapturedThis ? factory2.createAssignment(factory2.createUniqueName("_this", 16 /* Optimistic */ | 32 /* FileLevel */), initializer) : initializer; + resultingCall = assignToCapturedThis ? factory2.createAssignment(createCapturedThis(), initializer) : initializer; } return setOriginalNode(resultingCall, node); } + if (isSuperCall(node)) { + hierarchyFacts |= 131072 /* CapturedLexicalThis */; + } return visitEachChild(node, visitor, context); } function visitNewExpression(node) { @@ -371335,11 +375891,7 @@ ${lanes.join("\n")} // As we visit each element, we return one of two functions to use as the "key": // - `visitSpanOfSpreads` for one or more contiguous `...` spread expressions, i.e. `...a, ...b` in `[1, 2, ...a, ...b]` // - `visitSpanOfNonSpreads` for one or more contiguous non-spread elements, i.e. `1, 2`, in `[1, 2, ...a, ...b]` - spanMap( - elements, - partitionSpread, - (partition, visitPartition, _start, end) => visitPartition(partition, multiLine, hasTrailingComma && end === numElements) - ) + spanMap(elements, partitionSpread, (partition, visitPartition, _start, end) => visitPartition(partition, multiLine, hasTrailingComma && end === numElements)) ); if (segments.length === 1) { const firstSegment = segments[0]; @@ -371433,8 +375985,15 @@ ${lanes.join("\n")} } return setTextRange(expression, node); } - function visitSuperKeyword(isExpressionOfCall) { - return hierarchyFacts & 8 /* NonStaticClassElement */ && !isExpressionOfCall ? factory2.createPropertyAccessExpression(factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */), "prototype") : factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */); + function createSyntheticSuper() { + return factory2.createUniqueName("_super", 16 /* Optimistic */ | 32 /* FileLevel */); + } + function visitSuperKeyword(node, isExpressionOfCall) { + const expression = hierarchyFacts & 8 /* NonStaticClassElement */ && !isExpressionOfCall ? factory2.createPropertyAccessExpression(setOriginalNode(createSyntheticSuper(), node), "prototype") : createSyntheticSuper(); + setOriginalNode(expression, node); + setCommentRange(expression, node); + setSourceMapRange(expression, node); + return expression; } function visitMetaProperty(node) { if (node.keywordToken === 105 /* NewKeyword */ && node.name.escapedText === "target") { @@ -371465,13 +376024,13 @@ ${lanes.join("\n")} if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(110 /* ThisKeyword */); - context.enableEmitNotification(175 /* Constructor */); - context.enableEmitNotification(173 /* MethodDeclaration */); - context.enableEmitNotification(176 /* GetAccessor */); - context.enableEmitNotification(177 /* SetAccessor */); - context.enableEmitNotification(218 /* ArrowFunction */); - context.enableEmitNotification(217 /* FunctionExpression */); - context.enableEmitNotification(261 /* FunctionDeclaration */); + context.enableEmitNotification(176 /* Constructor */); + context.enableEmitNotification(174 /* MethodDeclaration */); + context.enableEmitNotification(177 /* GetAccessor */); + context.enableEmitNotification(178 /* SetAccessor */); + context.enableEmitNotification(219 /* ArrowFunction */); + context.enableEmitNotification(218 /* FunctionExpression */); + context.enableEmitNotification(262 /* FunctionDeclaration */); } } function onSubstituteNode(hint, node) { @@ -371495,10 +376054,10 @@ ${lanes.join("\n")} } function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 207 /* BindingElement */: - case 262 /* ClassDeclaration */: - case 265 /* EnumDeclaration */: - case 259 /* VariableDeclaration */: + case 208 /* BindingElement */: + case 263 /* ClassDeclaration */: + case 266 /* EnumDeclaration */: + case 260 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } return false; @@ -371540,7 +376099,7 @@ ${lanes.join("\n")} } function substituteThisKeyword(node) { if (enabledSubstitutions & 1 /* CapturedThis */ && hierarchyFacts & 16 /* CapturesThis */) { - return setTextRange(factory2.createUniqueName("_this", 16 /* Optimistic */ | 32 /* FileLevel */), node); + return setTextRange(createCapturedThis(), node); } return node; } @@ -371555,11 +376114,11 @@ ${lanes.join("\n")} return false; } const statement = firstOrUndefined(constructor.body.statements); - if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 243 /* ExpressionStatement */) { + if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 244 /* ExpressionStatement */) { return false; } const statementExpression = statement.expression; - if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 212 /* CallExpression */) { + if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 213 /* CallExpression */) { return false; } const callTarget = statementExpression.expression; @@ -371567,7 +376126,7 @@ ${lanes.join("\n")} return false; } const callArgument = singleOrUndefined(statementExpression.arguments); - if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 229 /* SpreadElement */) { + if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 230 /* SpreadElement */) { return false; } const expression = callArgument.expression; @@ -371590,24 +376149,24 @@ ${lanes.join("\n")} if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(285 /* JsxOpeningElement */); - context.enableEmitNotification(286 /* JsxClosingElement */); - context.enableEmitNotification(284 /* JsxSelfClosingElement */); + context.enableEmitNotification(286 /* JsxOpeningElement */); + context.enableEmitNotification(287 /* JsxClosingElement */); + context.enableEmitNotification(285 /* JsxSelfClosingElement */); noSubstitution = []; } const previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(210 /* PropertyAccessExpression */); - context.enableSubstitution(302 /* PropertyAssignment */); + context.enableSubstitution(211 /* PropertyAccessExpression */); + context.enableSubstitution(303 /* PropertyAssignment */); return chainBundle(context, transformSourceFile); function transformSourceFile(node) { return node; } function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 285 /* JsxOpeningElement */: - case 286 /* JsxClosingElement */: - case 284 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 287 /* JsxClosingElement */: + case 285 /* JsxSelfClosingElement */: const tagName = node.tagName; noSubstitution[getOriginalNodeId(tagName)] = true; break; @@ -371739,13 +376298,13 @@ ${lanes.join("\n")} } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 245 /* DoStatement */: + case 246 /* DoStatement */: return visitDoStatement(node); - case 246 /* WhileStatement */: + case 247 /* WhileStatement */: return visitWhileStatement(node); - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: return visitSwitchStatement(node); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -371753,24 +376312,24 @@ ${lanes.join("\n")} } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: return visitFunctionExpression(node); - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return visitAccessorDeclaration(node); - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return visitVariableStatement(node); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatement(node); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return visitForInStatement(node); - case 251 /* BreakStatement */: + case 252 /* BreakStatement */: return visitBreakStatement(node); - case 250 /* ContinueStatement */: + case 251 /* ContinueStatement */: return visitContinueStatement(node); - case 252 /* ReturnStatement */: + case 253 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 1048576 /* ContainsYield */) { @@ -371784,23 +376343,23 @@ ${lanes.join("\n")} } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return visitBinaryExpression(node); - case 360 /* CommaListExpression */: + case 361 /* CommaListExpression */: return visitCommaListExpression(node); - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: return visitConditionalExpression(node); - case 228 /* YieldExpression */: + case 229 /* YieldExpression */: return visitYieldExpression(node); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return visitCallExpression(node); - case 213 /* NewExpression */: + case 214 /* NewExpression */: return visitNewExpression(node); default: return visitEachChild(node, visitor, context); @@ -371808,9 +376367,9 @@ ${lanes.join("\n")} } function visitGenerator(node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: return visitFunctionExpression(node); default: return Debug.failBadSyntaxKind(node); @@ -371995,19 +376554,15 @@ ${lanes.join("\n")} if (containsYield(right)) { let target; switch (left.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: target = factory2.updatePropertyAccessExpression( left, cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), left.name ); break; - case 211 /* ElementAccessExpression */: - target = factory2.updateElementAccessExpression( - left, - cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), - cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression))) - ); + case 212 /* ElementAccessExpression */: + target = factory2.updateElementAccessExpression(left, cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression)))); break; default: target = Debug.checkDefined(visitNode(left, visitor, isExpression)); @@ -372042,12 +376597,7 @@ ${lanes.join("\n")} } else if (node.operatorToken.kind === 28 /* CommaToken */) { return visitCommaExpression(node); } - return factory2.updateBinaryExpression( - node, - cacheExpression(Debug.checkDefined(visitNode(node.left, visitor, isExpression))), - node.operatorToken, - Debug.checkDefined(visitNode(node.right, visitor, isExpression)) - ); + return factory2.updateBinaryExpression(node, cacheExpression(Debug.checkDefined(visitNode(node.left, visitor, isExpression))), node.operatorToken, Debug.checkDefined(visitNode(node.right, visitor, isExpression))); } return visitEachChild(node, visitor, context); } @@ -372255,11 +376805,7 @@ ${lanes.join("\n")} } function visitElementAccessExpression(node) { if (containsYield(node.argumentExpression)) { - return factory2.updateElementAccessExpression( - node, - cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression))), - Debug.checkDefined(visitNode(node.argumentExpression, visitor, isExpression)) - ); + return factory2.updateElementAccessExpression(node, cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression))), Debug.checkDefined(visitNode(node.argumentExpression, visitor, isExpression))); } return visitEachChild(node, visitor, context); } @@ -372335,35 +376881,35 @@ ${lanes.join("\n")} } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 240 /* Block */: + case 241 /* Block */: return transformAndEmitBlock(node); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 244 /* IfStatement */: + case 245 /* IfStatement */: return transformAndEmitIfStatement(node); - case 245 /* DoStatement */: + case 246 /* DoStatement */: return transformAndEmitDoStatement(node); - case 246 /* WhileStatement */: + case 247 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return transformAndEmitForStatement(node); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 250 /* ContinueStatement */: + case 251 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 251 /* BreakStatement */: + case 252 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 252 /* ReturnStatement */: + case 253 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 253 /* WithStatement */: + case 254 /* WithStatement */: return transformAndEmitWithStatement(node); - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 256 /* ThrowStatement */: + case 257 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 257 /* TryStatement */: + case 258 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(visitNode(node, visitor, isStatement)); @@ -372617,12 +377163,7 @@ ${lanes.join("\n")} for (const variable of initializer.declarations) { hoistVariableDeclaration(variable.name); } - node = factory2.updateForInStatement( - node, - initializer.declarations[0].name, - Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), - Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) - ); + node = factory2.updateForInStatement(node, initializer.declarations[0].name, Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock))); } else { node = visitEachChild(node, visitor, context); } @@ -372715,7 +377256,7 @@ ${lanes.join("\n")} for (let i = 0; i < numClauses; i++) { const clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 296 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 297 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -372725,7 +377266,7 @@ ${lanes.join("\n")} let defaultClausesSkipped = 0; for (let i = clausesWritten; i < numClauses; i++) { const clause = caseBlock.clauses[i]; - if (clause.kind === 295 /* CaseClause */) { + if (clause.kind === 296 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -373161,7 +377702,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 { @@ -373698,12 +378239,12 @@ ${lanes.join("\n")} const previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; - context.enableSubstitution(212 /* CallExpression */); - context.enableSubstitution(214 /* TaggedTemplateExpression */); + context.enableSubstitution(213 /* CallExpression */); + context.enableSubstitution(215 /* TaggedTemplateExpression */); context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(225 /* BinaryExpression */); - context.enableSubstitution(303 /* ShorthandPropertyAssignment */); - context.enableEmitNotification(311 /* SourceFile */); + context.enableSubstitution(226 /* BinaryExpression */); + context.enableSubstitution(304 /* ShorthandPropertyAssignment */); + context.enableEmitNotification(312 /* SourceFile */); const moduleInfoMap = []; let currentSourceFile; let currentModuleInfo; @@ -373715,7 +378256,7 @@ ${lanes.join("\n")} return node; } currentSourceFile = node; - currentModuleInfo = collectExternalModuleInfo(context, node, resolver, compilerOptions); + currentModuleInfo = collectExternalModuleInfo(context, node); moduleInfoMap[getOriginalNodeId(node)] = currentModuleInfo; const transformModule2 = getTransformModuleDelegate(moduleKind); const updated = transformModule2(node); @@ -373789,12 +378330,14 @@ ${lanes.join("\n")} // Add the dependency array argument: // // ["require", "exports", module1", "module2", ...] - factory2.createArrayLiteralExpression(jsonSourceFile ? emptyArray : [ - factory2.createStringLiteral("require"), - factory2.createStringLiteral("exports"), - ...aliasedModuleNames, - ...unaliasedModuleNames - ]), + factory2.createArrayLiteralExpression( + jsonSourceFile ? emptyArray : [ + factory2.createStringLiteral("require"), + factory2.createStringLiteral("exports"), + ...aliasedModuleNames, + ...unaliasedModuleNames + ] + ), // Add the module body function argument: // // function (require, exports, module1, module2) ... @@ -374115,63 +378658,59 @@ ${lanes.join("\n")} } function topLevelVisitor(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: - return visitImportDeclaration(node); - case 270 /* ImportEqualsDeclaration */: - return visitImportEqualsDeclaration(node); - case 277 /* ExportDeclaration */: - return visitExportDeclaration(node); - case 276 /* ExportAssignment */: - return visitExportAssignment(node); - case 261 /* FunctionDeclaration */: - return visitFunctionDeclaration(node); - case 262 /* ClassDeclaration */: - return visitClassDeclaration(node); + case 272 /* ImportDeclaration */: + return visitTopLevelImportDeclaration(node); + case 271 /* ImportEqualsDeclaration */: + return visitTopLevelImportEqualsDeclaration(node); + case 278 /* ExportDeclaration */: + return visitTopLevelExportDeclaration(node); + case 277 /* ExportAssignment */: + return visitTopLevelExportAssignment(node); default: return topLevelNestedVisitor(node); } } function topLevelNestedVisitor(node) { switch (node.kind) { - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return visitVariableStatement(node); - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return visitClassDeclaration(node); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ true ); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return visitForInStatement(node); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return visitForOfStatement(node); - case 245 /* DoStatement */: + case 246 /* DoStatement */: return visitDoStatement(node); - case 246 /* WhileStatement */: + case 247 /* WhileStatement */: return visitWhileStatement(node); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return visitLabeledStatement(node); - case 253 /* WithStatement */: + case 254 /* WithStatement */: return visitWithStatement(node); - case 244 /* IfStatement */: + case 245 /* IfStatement */: return visitIfStatement(node); - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: return visitSwitchStatement(node); - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: return visitCaseBlock(node); - case 295 /* CaseClause */: + case 296 /* CaseClause */: return visitCaseClause(node); - case 296 /* DefaultClause */: + case 297 /* DefaultClause */: return visitDefaultClause(node); - case 257 /* TryStatement */: + case 258 /* TryStatement */: return visitTryStatement(node); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return visitCatchClause(node); - case 240 /* Block */: + case 241 /* Block */: return visitBlock(node); default: return visitor(node); @@ -374182,30 +378721,30 @@ ${lanes.join("\n")} return node; } switch (node.kind) { - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ false ); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return visitExpressionStatement(node); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 359 /* PartiallyEmittedExpression */: + case 360 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); - case 212 /* CallExpression */: + case 213 /* CallExpression */: if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) { return visitImportCallExpression(node); } break; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: if (isDestructuringAssignment(node)) { return visitDestructuringAssignment(node, valueIsDiscarded); } break; - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded); } return visitEachChild(node, visitor, context); @@ -374228,24 +378767,24 @@ ${lanes.join("\n")} if (isObjectLiteralExpression(node)) { for (const elem of node.properties) { switch (elem.kind) { - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 304 /* SpreadAssignment */: + case 305 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return false; default: Debug.assertNever(elem, "Unhandled object member kind"); @@ -374273,7 +378812,7 @@ ${lanes.join("\n")} return visitEachChild(node, visitor, context); } function visitForStatement(node, isTopLevel) { - if (isTopLevel && node.initializer && isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 3 /* BlockScoped */)) { + if (isTopLevel && node.initializer && isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 7 /* BlockScoped */)) { const exportStatements = appendExportsOfVariableDeclarationList( /*statements*/ void 0, @@ -374314,7 +378853,7 @@ ${lanes.join("\n")} ); } function visitForInStatement(node) { - if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 3 /* BlockScoped */)) { + if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 7 /* BlockScoped */)) { const exportStatements = appendExportsOfVariableDeclarationList( /*statements*/ void 0, @@ -374342,7 +378881,7 @@ ${lanes.join("\n")} ); } function visitForOfStatement(node) { - if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 3 /* BlockScoped */)) { + if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 7 /* BlockScoped */)) { const exportStatements = appendExportsOfVariableDeclarationList( /*statements*/ void 0, @@ -374524,22 +379063,25 @@ ${lanes.join("\n")} ); } else { const temp = factory2.createTempVariable(hoistVariableDeclaration); - return factory2.createComma(factory2.createAssignment(temp, arg), factory2.createConditionalExpression( - /*condition*/ - factory2.createIdentifier("__syncRequire"), - /*questionToken*/ - void 0, - /*whenTrue*/ - createImportCallExpressionCommonJS( - temp, - /*isInlineable*/ - true - ), - /*colonToken*/ - void 0, - /*whenFalse*/ - createImportCallExpressionAMD(temp, containsLexicalThis) - )); + return factory2.createComma( + factory2.createAssignment(temp, arg), + factory2.createConditionalExpression( + /*condition*/ + factory2.createIdentifier("__syncRequire"), + /*questionToken*/ + void 0, + /*whenTrue*/ + createImportCallExpressionCommonJS( + temp, + /*isInlineable*/ + true + ), + /*colonToken*/ + void 0, + /*whenFalse*/ + createImportCallExpressionAMD(temp, containsLexicalThis) + ) + ); } } function createImportCallExpressionAMD(arg, containsLexicalThis) { @@ -374722,7 +379264,7 @@ ${lanes.join("\n")} } return innerExpr; } - function visitImportDeclaration(node) { + function visitTopLevelImportDeclaration(node) { let statements; const namespaceDeclaration = getNamespaceDeclarationNode(node); if (moduleKind !== 2 /* AMD */) { @@ -374831,11 +379373,11 @@ ${lanes.join("\n")} args ); } - function visitImportEqualsDeclaration(node) { + function visitTopLevelImportEqualsDeclaration(node) { Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); let statements; if (moduleKind !== 2 /* AMD */) { - if (hasSyntacticModifier(node, 1 /* Export */)) { + if (hasSyntacticModifier(node, 32 /* Export */)) { statements = append( statements, setOriginalNode( @@ -374881,7 +379423,7 @@ ${lanes.join("\n")} ); } } else { - if (hasSyntacticModifier(node, 1 /* Export */)) { + if (hasSyntacticModifier(node, 32 /* Export */)) { statements = append( statements, setOriginalNode( @@ -374899,7 +379441,7 @@ ${lanes.join("\n")} statements = appendExportsOfImportEqualsDeclaration(statements, node); return singleOrMany(statements); } - function visitExportDeclaration(node) { + function visitTopLevelExportDeclaration(node) { if (!node.moduleSpecifier) { return void 0; } @@ -374980,7 +379522,10 @@ ${lanes.join("\n")} factory2.createExpressionStatement( createExportExpression( factory2.cloneNode(node.exportClause.name), - getHelperExpressionForExport(node, moduleKind !== 2 /* AMD */ ? createRequireCall2(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory2.createIdentifier(idText(node.exportClause.name))) + getHelperExpressionForExport( + node, + moduleKind !== 2 /* AMD */ ? createRequireCall2(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory2.createIdentifier(idText(node.exportClause.name)) + ) ) ), node @@ -375001,7 +379546,7 @@ ${lanes.join("\n")} ); } } - function visitExportAssignment(node) { + function visitTopLevelExportAssignment(node) { if (node.isExportEquals) { return void 0; } @@ -375016,7 +379561,7 @@ ${lanes.join("\n")} } function visitFunctionDeclaration(node) { let statements; - if (hasSyntacticModifier(node, 1 /* Export */)) { + if (hasSyntacticModifier(node, 32 /* Export */)) { statements = append( statements, setOriginalNode( @@ -375053,7 +379598,7 @@ ${lanes.join("\n")} } function visitClassDeclaration(node) { let statements; - if (hasSyntacticModifier(node, 1 /* Export */)) { + if (hasSyntacticModifier(node, 32 /* Export */)) { statements = append( statements, setOriginalNode( @@ -375087,7 +379632,7 @@ ${lanes.join("\n")} let statements; let variables; let expressions; - if (hasSyntacticModifier(node, 1 /* Export */)) { + if (hasSyntacticModifier(node, 32 /* Export */)) { let modifiers; let removeCommentsOnExpressions = false; for (const variable of node.declarationList.declarations) { @@ -375205,19 +379750,21 @@ ${lanes.join("\n")} if (!importClause) { return statements; } + const seen = new IdentifierNameMap(); if (importClause.name) { - statements = appendExportsOfDeclaration(statements, importClause); + statements = appendExportsOfDeclaration(statements, seen, importClause); } const namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 273 /* NamespaceImport */: - statements = appendExportsOfDeclaration(statements, namedBindings); + case 274 /* NamespaceImport */: + statements = appendExportsOfDeclaration(statements, seen, namedBindings); break; - case 274 /* NamedImports */: + case 275 /* NamedImports */: for (const importBinding of namedBindings.elements) { statements = appendExportsOfDeclaration( statements, + seen, importBinding, /*liveBinding*/ true @@ -375232,7 +379779,7 @@ ${lanes.join("\n")} if (currentModuleInfo.exportEquals) { return statements; } - return appendExportsOfDeclaration(statements, decl); + return appendExportsOfDeclaration(statements, new IdentifierNameMap(), decl); } function appendExportsOfVariableStatement(statements, node) { return appendExportsOfVariableDeclarationList( @@ -375262,7 +379809,7 @@ ${lanes.join("\n")} } } } else if (!isGeneratedIdentifier(decl.name) && (!isVariableDeclaration(decl) || decl.initializer || isForInOrOfInitializer)) { - statements = appendExportsOfDeclaration(statements, decl); + statements = appendExportsOfDeclaration(statements, new IdentifierNameMap(), decl); } return statements; } @@ -375270,10 +379817,12 @@ ${lanes.join("\n")} if (currentModuleInfo.exportEquals) { return statements; } - if (hasSyntacticModifier(decl, 1 /* Export */)) { - const exportName = hasSyntacticModifier(decl, 1024 /* Default */) ? factory2.createIdentifier("default") : factory2.getDeclarationName(decl); + const seen = new IdentifierNameMap(); + if (hasSyntacticModifier(decl, 32 /* Export */)) { + const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createIdentifier("default") : factory2.getDeclarationName(decl); statements = appendExportStatement( statements, + seen, exportName, factory2.getLocalName(decl), /*location*/ @@ -375281,17 +379830,18 @@ ${lanes.join("\n")} ); } if (decl.name) { - statements = appendExportsOfDeclaration(statements, decl); + statements = appendExportsOfDeclaration(statements, seen, decl); } return statements; } - function appendExportsOfDeclaration(statements, decl, liveBinding) { + function appendExportsOfDeclaration(statements, seen, decl, liveBinding) { const name = factory2.getDeclarationName(decl); - const exportSpecifiers = currentModuleInfo.exportSpecifiers.get(idText(name)); + const exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name); if (exportSpecifiers) { for (const exportSpecifier of exportSpecifiers) { statements = appendExportStatement( statements, + seen, exportSpecifier.name, name, /*location*/ @@ -375304,8 +379854,11 @@ ${lanes.join("\n")} } return statements; } - function appendExportStatement(statements, exportName, expression, location, allowComments, liveBinding) { - statements = append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding)); + function appendExportStatement(statements, seen, exportName, expression, location, allowComments, liveBinding) { + if (!seen.has(exportName)) { + seen.set(exportName, true); + statements = append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding)); + } return statements; } function createUnderscoreUnderscoreESModule() { @@ -375364,21 +379917,24 @@ ${lanes.join("\n")} factory2.createStringLiteralFromNode(name), factory2.createObjectLiteralExpression([ factory2.createPropertyAssignment("enumerable", factory2.createTrue()), - factory2.createPropertyAssignment("get", factory2.createFunctionExpression( - /*modifiers*/ - void 0, - /*asteriskToken*/ - void 0, - /*name*/ - void 0, - /*typeParameters*/ - void 0, - /*parameters*/ - [], - /*type*/ - void 0, - factory2.createBlock([factory2.createReturnStatement(value)]) - )) + factory2.createPropertyAssignment( + "get", + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + factory2.createBlock([factory2.createReturnStatement(value)]) + ) + ) ]) ] ) : factory2.createAssignment( @@ -375400,7 +379956,7 @@ ${lanes.join("\n")} return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 311 /* SourceFile */) { + if (node.kind === 312 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[getOriginalNodeId(currentSourceFile)]; previousOnEmitNode(hint, node, emitCallback); @@ -375438,11 +379994,11 @@ ${lanes.join("\n")} switch (node.kind) { case 80 /* Identifier */: return substituteExpressionIdentifier(node); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return substituteCallExpression(node); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return substituteTaggedTemplateExpression(node); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return substituteBinaryExpression(node); } return node; @@ -375495,7 +380051,7 @@ ${lanes.join("\n")} return node; } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) { const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node)); - if (exportContainer && exportContainer.kind === 311 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 312 /* SourceFile */) { return setTextRange( factory2.createPropertyAccessExpression( factory2.createIdentifier("exports"), @@ -375532,7 +380088,7 @@ ${lanes.join("\n")} return node; } function substituteBinaryExpression(node) { - if (isAssignmentOperator(node.operatorToken.kind) && isIdentifier(node.left) && !isGeneratedIdentifier(node.left) && !isLocalName(node.left)) { + if (isAssignmentOperator(node.operatorToken.kind) && isIdentifier(node.left) && (!isGeneratedIdentifier(node.left) || isFileLevelReservedGeneratedIdentifier(node.left)) && !isLocalName(node.left)) { const exportedNames = getExports(node.left); if (exportedNames) { let expression = node; @@ -375571,6 +380127,15 @@ ${lanes.join("\n")} return arrayFrom(bindingsSet); } } + } else if (isFileLevelReservedGeneratedIdentifier(name)) { + const exportSpecifiers = currentModuleInfo == null ? void 0 : currentModuleInfo.exportSpecifiers.get(name); + if (exportSpecifiers) { + const exportedNames = []; + for (const exportSpecifier of exportSpecifiers) { + exportedNames.push(exportSpecifier.name); + } + return exportedNames; + } } } } @@ -375604,10 +380169,10 @@ ${lanes.join("\n")} context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(80 /* Identifier */); - context.enableSubstitution(303 /* ShorthandPropertyAssignment */); - context.enableSubstitution(225 /* BinaryExpression */); - context.enableSubstitution(235 /* MetaProperty */); - context.enableEmitNotification(311 /* SourceFile */); + context.enableSubstitution(304 /* ShorthandPropertyAssignment */); + context.enableSubstitution(226 /* BinaryExpression */); + context.enableSubstitution(236 /* MetaProperty */); + context.enableEmitNotification(312 /* SourceFile */); const moduleInfoMap = []; const exportFunctionsMap = []; const noSubstitutionMap = []; @@ -375627,7 +380192,7 @@ ${lanes.join("\n")} const id = getOriginalNodeId(node); currentSourceFile = node; enclosingBlockScopedContainer = node; - moduleInfo = moduleInfoMap[id] = collectExternalModuleInfo(context, node, resolver, compilerOptions); + moduleInfo = moduleInfoMap[id] = collectExternalModuleInfo(context, node); exportFunction = factory2.createUniqueName("exports"); exportFunctionsMap[id] = exportFunction; contextObject = contextObjectMap[id] = factory2.createUniqueName("context"); @@ -375748,13 +380313,10 @@ ${lanes.join("\n")} addRange(statements, hoistedStatements); insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); const exportStarFunction = addExportStarIfNeeded(statements); - const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(512 /* Async */) : void 0; + const modifiers = node.transformFlags & 2097152 /* ContainsAwait */ ? factory2.createModifiersFromModifierFlags(1024 /* Async */) : void 0; const moduleObject = factory2.createObjectLiteralExpression( [ - factory2.createPropertyAssignment( - "setters", - createSettersArray(exportStarFunction, dependencyGroups) - ), + factory2.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), factory2.createPropertyAssignment( "execute", factory2.createFunctionExpression( @@ -375794,7 +380356,7 @@ ${lanes.join("\n")} if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) { let hasExportDeclarationWithExportClause = false; for (const externalImport of moduleInfo.externalImports) { - if (externalImport.kind === 277 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -375942,18 +380504,18 @@ ${lanes.join("\n")} for (const entry of group2.externalImports) { const importVariableName = getLocalNameForExternalImport(factory2, entry, currentSourceFile); switch (entry.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: if (!entry.importClause) { break; } - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: Debug.assert(importVariableName !== void 0); statements.push( factory2.createExpressionStatement( factory2.createAssignment(importVariableName, parameterName) ) ); - if (hasSyntacticModifier(entry, 1 /* Export */)) { + if (hasSyntacticModifier(entry, 32 /* Export */)) { statements.push( factory2.createExpressionStatement( factory2.createCallExpression( @@ -375969,7 +380531,7 @@ ${lanes.join("\n")} ); } break; - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: Debug.assert(importVariableName !== void 0); if (entry.exportClause) { if (isNamedExports(entry.exportClause)) { @@ -376064,13 +380626,13 @@ ${lanes.join("\n")} } function topLevelVisitor(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return visitImportDeclaration(node); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: return visitExportDeclaration(node); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return visitExportAssignment(node); default: return topLevelNestedVisitor(node); @@ -376106,7 +380668,7 @@ ${lanes.join("\n")} ); } function visitFunctionDeclaration(node) { - if (hasSyntacticModifier(node, 1 /* Export */)) { + if (hasSyntacticModifier(node, 32 /* Export */)) { hoistedStatements = append( hoistedStatements, factory2.updateFunctionDeclaration( @@ -376167,18 +380729,43 @@ ${lanes.join("\n")} if (!shouldHoistVariableDeclarationList(node.declarationList)) { return visitNode(node, visitor, isStatement); } - let expressions; - const isExportedDeclaration = hasSyntacticModifier(node, 1 /* Export */); - for (const variable of node.declarationList.declarations) { - if (variable.initializer) { - expressions = append(expressions, transformInitializedVariable(variable, isExportedDeclaration)); - } else { - hoistBindingElement(variable); - } - } let statements; - if (expressions) { - statements = append(statements, setTextRange(factory2.createExpressionStatement(factory2.inlineExpressions(expressions)), node)); + if (isVarUsing(node.declarationList) || isVarAwaitUsing(node.declarationList)) { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifierLike); + const declarations = []; + for (const variable of node.declarationList.declarations) { + declarations.push(factory2.updateVariableDeclaration( + variable, + factory2.getGeneratedNameForNode(variable.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + transformInitializedVariable( + variable, + /*isExportedDeclaration*/ + false + ) + )); + } + const declarationList = factory2.updateVariableDeclarationList( + node.declarationList, + declarations + ); + statements = append(statements, factory2.updateVariableStatement(node, modifiers, declarationList)); + } else { + let expressions; + const isExportedDeclaration = hasSyntacticModifier(node, 32 /* Export */); + for (const variable of node.declarationList.declarations) { + if (variable.initializer) { + expressions = append(expressions, transformInitializedVariable(variable, isExportedDeclaration)); + } else { + hoistBindingElement(variable); + } + } + if (expressions) { + statements = append(statements, setTextRange(factory2.createExpressionStatement(factory2.inlineExpressions(expressions)), node)); + } } statements = appendExportsOfVariableStatement( statements, @@ -376200,7 +380787,7 @@ ${lanes.join("\n")} } } function shouldHoistVariableDeclarationList(node) { - return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 311 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); + return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 312 /* SourceFile */ || (getOriginalNode(node).flags & 7 /* BlockScoped */) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; @@ -376250,10 +380837,10 @@ ${lanes.join("\n")} const namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 274 /* NamedImports */: + case 275 /* NamedImports */: for (const importBinding of namedBindings.elements) { statements = appendExportsOfDeclaration(statements, importBinding); } @@ -376304,8 +380891,8 @@ ${lanes.join("\n")} return statements; } let excludeName; - if (hasSyntacticModifier(decl, 1 /* Export */)) { - const exportName = hasSyntacticModifier(decl, 1024 /* Default */) ? factory2.createStringLiteral("default") : decl.name; + if (hasSyntacticModifier(decl, 32 /* Export */)) { + const exportName = hasSyntacticModifier(decl, 2048 /* Default */) ? factory2.createStringLiteral("default") : decl.name; statements = appendExportStatement(statements, exportName, factory2.getLocalName(decl)); excludeName = getTextOfIdentifierOrLiteral(exportName); } @@ -376319,7 +380906,7 @@ ${lanes.join("\n")} return statements; } const name = factory2.getDeclarationName(decl); - const exportSpecifiers = moduleInfo.exportSpecifiers.get(idText(name)); + const exportSpecifiers = moduleInfo.exportSpecifiers.get(name); if (exportSpecifiers) { for (const exportSpecifier of exportSpecifiers) { if (exportSpecifier.name.escapedText !== excludeName) { @@ -376353,45 +380940,45 @@ ${lanes.join("\n")} } function topLevelNestedVisitor(node) { switch (node.kind) { - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return visitVariableStatement(node); - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return visitClassDeclaration(node); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ true ); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return visitForInStatement(node); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return visitForOfStatement(node); - case 245 /* DoStatement */: + case 246 /* DoStatement */: return visitDoStatement(node); - case 246 /* WhileStatement */: + case 247 /* WhileStatement */: return visitWhileStatement(node); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return visitLabeledStatement(node); - case 253 /* WithStatement */: + case 254 /* WithStatement */: return visitWithStatement(node); - case 244 /* IfStatement */: + case 245 /* IfStatement */: return visitIfStatement(node); - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: return visitSwitchStatement(node); - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: return visitCaseBlock(node); - case 295 /* CaseClause */: + case 296 /* CaseClause */: return visitCaseClause(node); - case 296 /* DefaultClause */: + case 297 /* DefaultClause */: return visitDefaultClause(node); - case 257 /* TryStatement */: + case 258 /* TryStatement */: return visitTryStatement(node); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return visitCatchClause(node); - case 240 /* Block */: + case 241 /* Block */: return visitBlock(node); default: return visitor(node); @@ -376545,30 +381132,30 @@ ${lanes.join("\n")} return node; } switch (node.kind) { - case 247 /* ForStatement */: + case 248 /* ForStatement */: return visitForStatement( node, /*isTopLevel*/ false ); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return visitExpressionStatement(node); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, valueIsDiscarded); - case 359 /* PartiallyEmittedExpression */: + case 360 /* PartiallyEmittedExpression */: return visitPartiallyEmittedExpression(node, valueIsDiscarded); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: if (isDestructuringAssignment(node)) { return visitDestructuringAssignment(node, valueIsDiscarded); } break; - case 212 /* CallExpression */: + case 213 /* CallExpression */: if (isImportCall(node)) { return visitImportCallExpression(node); } break; - case 223 /* PrefixUnaryExpression */: - case 224 /* PostfixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded); } return visitEachChild(node, visitor, context); @@ -376641,7 +381228,7 @@ ${lanes.join("\n")} return hasExportedReferenceInDestructuringTarget(node.initializer); } else if (isIdentifier(node)) { const container = resolver.getReferencedExportContainer(node); - return container !== void 0 && container.kind === 311 /* SourceFile */; + return container !== void 0 && container.kind === 312 /* SourceFile */; } else { return false; } @@ -376685,7 +381272,7 @@ ${lanes.join("\n")} return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 311 /* SourceFile */) { + if (node.kind === 312 /* SourceFile */) { const id = getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -376719,7 +381306,7 @@ ${lanes.join("\n")} } function substituteUnspecified(node) { switch (node.kind) { - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -376763,9 +381350,9 @@ ${lanes.join("\n")} switch (node.kind) { case 80 /* Identifier */: return substituteExpressionIdentifier(node); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return substituteBinaryExpression(node); - case 235 /* MetaProperty */: + case 236 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -376806,7 +381393,7 @@ ${lanes.join("\n")} return node; } function substituteBinaryExpression(node) { - if (isAssignmentOperator(node.operatorToken.kind) && isIdentifier(node.left) && !isGeneratedIdentifier(node.left) && !isLocalName(node.left)) { + if (isAssignmentOperator(node.operatorToken.kind) && isIdentifier(node.left) && (!isGeneratedIdentifier(node.left) || isFileLevelReservedGeneratedIdentifier(node.left)) && !isLocalName(node.left)) { const exportedNames = getExports(node.left); if (exportedNames) { let expression = node; @@ -376833,10 +381420,19 @@ ${lanes.join("\n")} /*prefixLocals*/ false ); - if (exportContainer && exportContainer.kind === 311 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 312 /* SourceFile */) { exportedNames = append(exportedNames, factory2.getDeclarationName(valueDeclaration)); } exportedNames = addRange(exportedNames, moduleInfo == null ? void 0 : moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)]); + } else if (isGeneratedIdentifier(name) && isFileLevelReservedGeneratedIdentifier(name)) { + const exportSpecifiers = moduleInfo == null ? void 0 : moduleInfo.exportSpecifiers.get(name); + if (exportSpecifiers) { + const exportedNames2 = []; + for (const exportSpecifier of exportSpecifiers) { + exportedNames2.push(exportSpecifier.name); + } + return exportedNames2; + } } return exportedNames; } @@ -376889,7 +381485,7 @@ ${lanes.join("\n")} const previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(311 /* SourceFile */); + context.enableEmitNotification(312 /* SourceFile */); context.enableSubstitution(80 /* Identifier */); let helperNameSubstitutions; let currentSourceFile; @@ -376910,7 +381506,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( @@ -376937,11 +381533,11 @@ ${lanes.join("\n")} } function visitor(node) { switch (node.kind) { - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return getEmitModuleKind(compilerOptions) >= 100 /* Node16 */ ? visitImportEqualsDeclaration(node) : void 0; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return visitExportAssignment(node); - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: const exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -376953,6 +381549,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( @@ -376972,7 +381576,9 @@ ${lanes.join("\n")} ) ]) ), - factory2.createStringLiteral("module") + factory2.createStringLiteral("module"), + /*attributes*/ + void 0 ); const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */); const requireStatement = factory2.createVariableStatement( @@ -377045,24 +381651,45 @@ ${lanes.join("\n")} return singleOrMany(statements); } function appendExportsOfImportEqualsDeclaration(statements, node) { - if (hasSyntacticModifier(node, 1 /* Export */)) { - statements = append(statements, factory2.createExportDeclaration( - /*modifiers*/ - void 0, - node.isTypeOnly, - factory2.createNamedExports([factory2.createExportSpecifier( - /*isTypeOnly*/ - false, - /*propertyName*/ + if (hasSyntacticModifier(node, 32 /* Export */)) { + statements = append( + statements, + factory2.createExportDeclaration( + /*modifiers*/ void 0, - idText(node.name) - )]) - )); + node.isTypeOnly, + factory2.createNamedExports([factory2.createExportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + idText(node.name) + )]) + ) + ); } 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 */) { @@ -377086,7 +381713,7 @@ ${lanes.join("\n")} ) ), node.moduleSpecifier, - node.assertClause + node.attributes ); setOriginalNode(importDecl, node.exportClause); const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration( @@ -377152,8 +381779,8 @@ ${lanes.join("\n")} const cjsOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; - context.enableSubstitution(311 /* SourceFile */); - context.enableEmitNotification(311 /* SourceFile */); + context.enableSubstitution(312 /* SourceFile */); + context.enableEmitNotification(312 /* SourceFile */); let currentSourceFile; return transformSourceFileOrBundle; function onSubstituteNode(hint, node) { @@ -377196,7 +381823,7 @@ ${lanes.join("\n")} return result; } function transformSourceFileOrBundle(node) { - return node.kind === 311 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 312 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(map(node.sourceFiles, transformSourceFile), node.prepends); @@ -377232,7 +381859,7 @@ ${lanes.join("\n")} function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { if (isStatic(node)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.kind === 262 /* ClassDeclaration */) { + } else if (node.parent.kind === 263 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; @@ -377249,7 +381876,7 @@ ${lanes.join("\n")} function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { if (isStatic(node)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.kind === 262 /* ClassDeclaration */) { + } else if (node.parent.kind === 263 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1; @@ -377264,7 +381891,7 @@ ${lanes.join("\n")} } else if (isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isIndexSignatureDeclaration(node)) { return getReturnTypeVisibilityError; } else if (isParameter(node)) { - if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent, 8 /* Private */)) { + if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier(node.parent, 2 /* Private */)) { return getVariableDeclarationTypeVisibilityError; } return getParameterDeclarationTypeVisibilityError; @@ -377280,12 +381907,12 @@ ${lanes.join("\n")} return Debug.assertNever(node, `Attempted to set a declaration diagnostic context for unhandled node kind: ${Debug.formatSyntaxKind(node.kind)}`); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 259 /* VariableDeclaration */ || node.kind === 207 /* BindingElement */) { + if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; - } else if (node.kind === 171 /* PropertyDeclaration */ || node.kind === 210 /* PropertyAccessExpression */ || node.kind === 211 /* ElementAccessExpression */ || node.kind === 225 /* BinaryExpression */ || node.kind === 170 /* PropertySignature */ || node.kind === 168 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) { + } else if (node.kind === 172 /* PropertyDeclaration */ || node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */ || node.kind === 226 /* BinaryExpression */ || node.kind === 171 /* PropertySignature */ || node.kind === 169 /* Parameter */ && hasSyntacticModifier(node.parent, 2 /* Private */)) { if (isStatic(node)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.kind === 262 /* ClassDeclaration */ || node.kind === 168 /* Parameter */) { + } else if (node.parent.kind === 263 /* ClassDeclaration */ || node.kind === 169 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; @@ -377302,7 +381929,7 @@ ${lanes.join("\n")} } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { let diagnosticMessage; - if (node.kind === 177 /* SetAccessor */) { + if (node.kind === 178 /* SetAccessor */) { if (isStatic(node)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1; } else { @@ -377324,26 +381951,26 @@ ${lanes.join("\n")} function getReturnTypeVisibilityError(symbolAccessibilityResult) { let diagnosticMessage; switch (node.kind) { - case 179 /* ConstructSignature */: + case 180 /* ConstructSignature */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 178 /* CallSignature */: + case 179 /* CallSignature */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 180 /* IndexSignature */: + case 181 /* IndexSignature */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: if (isStatic(node)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; - } else if (node.parent.kind === 262 /* ClassDeclaration */) { + } else if (node.parent.kind === 263 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: @@ -377364,29 +381991,29 @@ ${lanes.join("\n")} } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 175 /* Constructor */: + case 176 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 179 /* ConstructSignature */: - case 184 /* ConstructorType */: + case 180 /* ConstructSignature */: + case 185 /* ConstructorType */: return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 178 /* CallSignature */: + case 179 /* CallSignature */: return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 180 /* IndexSignature */: + case 181 /* IndexSignature */: return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: if (isStatic(node.parent)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.parent.kind === 262 /* ClassDeclaration */) { + } else if (node.parent.parent.kind === 263 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 261 /* FunctionDeclaration */: - case 183 /* FunctionType */: + case 262 /* FunctionDeclaration */: + case 184 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 177 /* SetAccessor */: - case 176 /* GetAccessor */: + case 178 /* SetAccessor */: + case 177 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1; default: return Debug.fail(`Unknown parent for parameter: ${Debug.formatSyntaxKind(node.parent.kind)}`); @@ -377395,40 +382022,40 @@ ${lanes.join("\n")} function getTypeParameterConstraintVisibilityError() { let diagnosticMessage; switch (node.parent.kind) { - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 199 /* MappedType */: + case 200 /* MappedType */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 184 /* ConstructorType */: - case 179 /* ConstructSignature */: + case 185 /* ConstructorType */: + case 180 /* ConstructSignature */: diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 178 /* CallSignature */: + case 179 /* CallSignature */: diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: if (isStatic(node.parent)) { diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } else if (node.parent.parent.kind === 262 /* ClassDeclaration */) { + } else if (node.parent.parent.kind === 263 /* ClassDeclaration */) { diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 183 /* FunctionType */: - case 261 /* FunctionDeclaration */: + case 184 /* FunctionType */: + case 262 /* FunctionDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 194 /* InferType */: + case 195 /* InferType */: diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1; break; - case 264 /* TypeAliasDeclaration */: + case 265 /* TypeAliasDeclaration */: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -377490,44 +382117,6 @@ ${lanes.join("\n")} ); return result.diagnostics; } - function hasInternalAnnotation(range, currentSourceFile) { - const comment = currentSourceFile.text.substring(range.pos, range.end); - return stringContains(comment, "@internal"); - } - function isInternalDeclaration(node, currentSourceFile) { - const parseTreeNode = getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 168 /* 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; @@ -377556,8 +382145,7 @@ ${lanes.join("\n")} trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode, reportNonlocalAugmentation, - reportNonSerializableProperty, - reportImportTypeNodeResolutionModeOverride + reportNonSerializableProperty }; let errorNameNode; let errorFallbackNode; @@ -377579,16 +382167,27 @@ ${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); } const container = getSourceFileOfNode(node); refs.set(getOriginalNodeId(container), container); } + function trackReferencedAmbientModuleFromImport(node) { + const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(node); + const symbol = moduleSpecifier && resolver.tryFindAmbientModule(moduleSpecifier); + if (symbol == null ? void 0 : symbol.declarations) { + for (const decl of symbol.declarations) { + if (isAmbientModule(decl) && getSourceFileOfNode(decl) !== currentSourceFile) { + trackReferencedAmbientModule(decl, symbol); + } + } + } + } function handleSymbolAccessibilityError(symbolAccessibilityResult) { if (symbolAccessibilityResult.accessibility === 0 /* Accessible */) { - if (symbolAccessibilityResult && symbolAccessibilityResult.aliasesToMakeVisible) { + if (symbolAccessibilityResult.aliasesToMakeVisible) { if (!lateMarkedStatements) { lateMarkedStatements = symbolAccessibilityResult.aliasesToMakeVisible; } else { @@ -377601,20 +382200,9 @@ ${lanes.join("\n")} const errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult); if (errorInfo) { if (errorInfo.typeName) { - context.addDiagnostic(createDiagnosticForNode( - symbolAccessibilityResult.errorNode || errorInfo.errorNode, - errorInfo.diagnosticMessage, - getTextOfNode(errorInfo.typeName), - symbolAccessibilityResult.errorSymbolName, - symbolAccessibilityResult.errorModuleName - )); + context.addDiagnostic(createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, getTextOfNode(errorInfo.typeName), symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName)); } else { - context.addDiagnostic(createDiagnosticForNode( - symbolAccessibilityResult.errorNode || errorInfo.errorNode, - errorInfo.diagnosticMessage, - symbolAccessibilityResult.errorSymbolName, - symbolAccessibilityResult.errorModuleName - )); + context.addDiagnostic(createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName)); } return true; } @@ -377651,41 +382239,22 @@ ${lanes.join("\n")} } function reportInaccessibleUniqueSymbolError() { if (errorNameNode || errorFallbackNode) { - context.addDiagnostic(createDiagnosticForNode( - errorNameNode || errorFallbackNode, - Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, - errorDeclarationNameWithFallback(), - "unique symbol" - )); + context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "unique symbol")); } } function reportCyclicStructureError() { if (errorNameNode || errorFallbackNode) { - context.addDiagnostic(createDiagnosticForNode( - errorNameNode || errorFallbackNode, - Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, - errorDeclarationNameWithFallback() - )); + context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, errorDeclarationNameWithFallback())); } } function reportInaccessibleThisError() { if (errorNameNode || errorFallbackNode) { - context.addDiagnostic(createDiagnosticForNode( - errorNameNode || errorFallbackNode, - Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, - errorDeclarationNameWithFallback(), - "this" - )); + context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "this")); } } function reportLikelyUnsafeImportRequiredError(specifier) { if (errorNameNode || errorFallbackNode) { - context.addDiagnostic(createDiagnosticForNode( - errorNameNode || errorFallbackNode, - Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, - errorDeclarationNameWithFallback(), - specifier - )); + context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), specifier)); } } function reportTruncationError() { @@ -377711,11 +382280,6 @@ ${lanes.join("\n")} context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName)); } } - function reportImportTypeNodeResolutionModeOverride() { - if (!isNightly() && (errorNameNode || errorFallbackNode)) { - context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next)); - } - } function transformDeclarationsForJS(sourceFile, bundled) { const oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : { @@ -377727,17 +382291,16 @@ ${lanes.join("\n")} return result; } function transformRoot(node) { - if (node.kind === 311 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 312 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 312 /* Bundle */) { + if (node.kind === 313 /* Bundle */) { isBundledEmit = true; refs = /* @__PURE__ */ new Map(); libs2 = /* @__PURE__ */ new Map(); let hasNoDefaultLib = false; - const bundle = factory2.createBundle(map( - node.sourceFiles, - (sourceFile) => { + const bundle = factory2.createBundle( + map(node.sourceFiles, (sourceFile) => { if (sourceFile.isDeclarationFile) return void 0; hasNoDefaultLib = hasNoDefaultLib || sourceFile.hasNoDefaultLib; @@ -377795,18 +382358,19 @@ ${lanes.join("\n")} /*libReferences*/ [] ); - } - ), mapDefined(node.prepends, (prepend) => { - if (prepend.kind === 314 /* InputFiles */) { - const sourceFile = createUnparsedSourceFile(prepend, "dts", stripInternal); - hasNoDefaultLib = hasNoDefaultLib || !!sourceFile.hasNoDefaultLib; - collectReferences(sourceFile, refs); - recordTypeReferenceDirectivesIfNecessary(map(sourceFile.typeReferenceDirectives, (ref) => [ref.fileName, ref.resolutionMode])); - collectLibs(sourceFile, libs2); - return sourceFile; - } - return prepend; - })); + }), + mapDefined(node.prepends, (prepend) => { + if (prepend.kind === 315 /* InputFiles */) { + const sourceFile = createUnparsedSourceFile(prepend, "dts", stripInternal); + hasNoDefaultLib = hasNoDefaultLib || !!sourceFile.hasNoDefaultLib; + collectReferences(sourceFile, refs); + recordTypeReferenceDirectivesIfNecessary(map(sourceFile.typeReferenceDirectives, (ref) => [ref.fileName, ref.resolutionMode])); + collectLibs(sourceFile, libs2); + return sourceFile; + } + return prepend; + }) + ); bundle.syntheticFileReferences = []; bundle.syntheticTypeReferences = getFileReferencesForUsedTypeReferences(); bundle.syntheticLibReferences = getLibReferences(); @@ -377892,6 +382456,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; @@ -377910,8 +382477,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)) { @@ -377961,35 +382528,28 @@ ${lanes.join("\n")} }); return ret; } - function filterBindingPatternInitializersAndRenamings(name) { + function filterBindingPatternInitializers(name) { if (name.kind === 80 /* Identifier */) { return name; } else { - if (name.kind === 206 /* ArrayBindingPattern */) { + if (name.kind === 207 /* ArrayBindingPattern */) { return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement)); } else { return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement)); } } function visitBindingElement(elem) { - if (elem.kind === 231 /* OmittedExpression */) { + if (elem.kind === 232 /* OmittedExpression */) { return elem; } - 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 - ); + if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) { + checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration); } return factory2.updateBindingElement( elem, elem.dotDotDotToken, elem.propertyName, - filterBindingPatternInitializersAndRenamings(elem.name), + filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : void 0 ); } @@ -378004,7 +382564,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, @@ -378030,20 +382590,20 @@ ${lanes.join("\n")} return void 0; } function ensureType(node, type, ignorePrivate) { - if (!ignorePrivate && hasEffectiveModifier(node, 8 /* Private */)) { + if (!ignorePrivate && hasEffectiveModifier(node, 2 /* Private */)) { return; } if (shouldPrintWithInitializer(node)) { return; } - const shouldUseResolverType = node.kind === 168 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); + const shouldUseResolverType = node.kind === 169 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { return visitNode(type, visitDeclarationSubtree, isTypeNode); } if (!getParseTreeNode(node)) { return type ? visitNode(type, visitDeclarationSubtree, isTypeNode) : factory2.createKeywordTypeNode(133 /* AnyKeyword */); } - if (node.kind === 177 /* SetAccessor */) { + if (node.kind === 178 /* SetAccessor */) { return factory2.createKeywordTypeNode(133 /* AnyKeyword */); } errorNameNode = node.name; @@ -378052,10 +382612,10 @@ ${lanes.join("\n")} oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 259 /* VariableDeclaration */ || node.kind === 207 /* BindingElement */) { + if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 168 /* Parameter */ || node.kind === 171 /* PropertyDeclaration */ || node.kind === 170 /* PropertySignature */) { + if (node.kind === 169 /* Parameter */ || node.kind === 172 /* PropertyDeclaration */ || node.kind === 171 /* PropertySignature */) { if (isPropertySignature(node) || !node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -378072,21 +382632,21 @@ ${lanes.join("\n")} function isDeclarationAndNotVisible(node) { node = getParseTreeNode(node); switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 266 /* ModuleDeclaration */: - case 263 /* InterfaceDeclaration */: - case 262 /* ClassDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 265 /* EnumDeclaration */: + case 262 /* FunctionDeclaration */: + case 267 /* ModuleDeclaration */: + case 264 /* InterfaceDeclaration */: + case 263 /* ClassDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 266 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 270 /* ImportEqualsDeclaration */: - case 271 /* ImportDeclaration */: - case 277 /* ExportDeclaration */: - case 276 /* ExportAssignment */: + case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportDeclaration */: + case 278 /* ExportDeclaration */: + case 277 /* ExportAssignment */: return false; - case 174 /* ClassStaticBlockDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: return true; } return false; @@ -378110,7 +382670,7 @@ ${lanes.join("\n")} } } function updateParamsList(node, params, modifierMask) { - if (hasEffectiveModifier(node, 8 /* Private */)) { + if (hasEffectiveModifier(node, 2 /* Private */)) { return factory2.createNodeArray(); } const newParams = map(params, (p) => ensureParameter(p, modifierMask)); @@ -378155,7 +382715,7 @@ ${lanes.join("\n")} return factory2.createNodeArray(newParams || emptyArray); } function ensureTypeParams(node, params) { - return hasEffectiveModifier(node, 8 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration); + return hasEffectiveModifier(node, 2 /* Private */) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration); } function isEnclosingDeclaration(node) { return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node); @@ -378174,7 +382734,7 @@ ${lanes.join("\n")} function rewriteModuleSpecifier(parent2, input) { if (!input) return void 0; - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 266 /* ModuleDeclaration */ && parent2.kind !== 204 /* ImportType */; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 267 /* ModuleDeclaration */ && parent2.kind !== 205 /* ImportType */; if (isStringLiteralLike(input)) { if (isBundledEmit) { const newName = getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent2); @@ -378193,7 +382753,7 @@ ${lanes.join("\n")} function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 282 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 283 /* ExternalModuleReference */) { const specifier = getExternalModuleImportEqualsDeclarationExpression(decl); return factory2.updateImportEqualsDeclaration( decl, @@ -378217,30 +382777,42 @@ ${lanes.join("\n")} decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClauseInNightly(decl.assertClause) + tryGetResolutionModeOverride(decl.attributes) ); } const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0; if (!decl.importClause.namedBindings) { - return visibleDefaultBinding && factory2.updateImportDeclaration(decl, decl.modifiers, factory2.updateImportClause( - decl.importClause, - decl.importClause.isTypeOnly, - visibleDefaultBinding, - /*namedBindings*/ - void 0 - ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)); + return visibleDefaultBinding && factory2.updateImportDeclaration( + decl, + decl.modifiers, + factory2.updateImportClause( + decl.importClause, + decl.importClause.isTypeOnly, + visibleDefaultBinding, + /*namedBindings*/ + void 0 + ), + rewriteModuleSpecifier(decl, decl.moduleSpecifier), + tryGetResolutionModeOverride(decl.attributes) + ); } - if (decl.importClause.namedBindings.kind === 273 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) { const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : ( /*namedBindings*/ void 0 ); - return visibleDefaultBinding || namedBindings ? factory2.updateImportDeclaration(decl, decl.modifiers, factory2.updateImportClause( - decl.importClause, - decl.importClause.isTypeOnly, - visibleDefaultBinding, - namedBindings - ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)) : void 0; + return visibleDefaultBinding || namedBindings ? factory2.updateImportDeclaration( + decl, + decl.modifiers, + factory2.updateImportClause( + decl.importClause, + decl.importClause.isTypeOnly, + visibleDefaultBinding, + namedBindings + ), + rewriteModuleSpecifier(decl, decl.moduleSpecifier), + tryGetResolutionModeOverride(decl.attributes) + ) : void 0; } const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0); if (bindingList && bindingList.length || visibleDefaultBinding) { @@ -378254,7 +382826,7 @@ ${lanes.join("\n")} bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0 ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClauseInNightly(decl.assertClause) + tryGetResolutionModeOverride(decl.attributes) ); } if (resolver.isImportRequiredByAugmentation(decl)) { @@ -378264,19 +382836,13 @@ ${lanes.join("\n")} /*importClause*/ void 0, rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClauseInNightly(decl.assertClause) + tryGetResolutionModeOverride(decl.attributes) ); } } - function getResolutionModeOverrideForClauseInNightly(assertClause) { - const mode = getResolutionModeOverrideForClause(assertClause); - if (mode !== void 0) { - if (!isNightly()) { - context.addDiagnostic(createDiagnosticForNode(assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next)); - } - return assertClause; - } - return void 0; + function tryGetResolutionModeOverride(node) { + const mode = getResolutionModeOverride(node); + return node && mode !== void 0 ? node : void 0; } function transformAndReplaceLatePaintedStatements(statements) { while (length(lateMarkedStatements)) { @@ -378333,9 +382899,9 @@ ${lanes.join("\n")} const oldDiag = getSymbolAccessibilityDiagnostic; const canProduceDiagnostic = canProduceDiagnostics(input); const oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 186 /* TypeLiteral */ || input.kind === 199 /* MappedType */) && input.parent.kind !== 264 /* TypeAliasDeclaration */; + let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 /* TypeLiteral */ || input.kind === 200 /* MappedType */) && input.parent.kind !== 265 /* TypeAliasDeclaration */; if (isMethodDeclaration(input) || isMethodSignature(input)) { - if (hasEffectiveModifier(input, 8 /* Private */)) { + if (hasEffectiveModifier(input, 2 /* Private */)) { if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) return; return cleanup(factory2.createPropertyDeclaration( @@ -378361,26 +382927,26 @@ ${lanes.join("\n")} } if (isProcessedComponent(input)) { switch (input.kind) { - case 232 /* ExpressionWithTypeArguments */: { + case 233 /* ExpressionWithTypeArguments */: { if (isEntityName(input.expression) || isEntityNameExpression(input.expression)) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } const node = visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory2.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); } - case 182 /* TypeReference */: { + case 183 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); const node = visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); } - case 179 /* ConstructSignature */: + case 180 /* ConstructSignature */: return cleanup(factory2.updateConstructSignature( input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type) )); - case 175 /* Constructor */: { + case 176 /* Constructor */: { const ctor = factory2.createConstructorDeclaration( /*modifiers*/ ensureModifiers(input), @@ -378390,7 +382956,7 @@ ${lanes.join("\n")} ); return cleanup(ctor); } - case 173 /* MethodDeclaration */: { + case 174 /* MethodDeclaration */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -378411,7 +382977,7 @@ ${lanes.join("\n")} ); return cleanup(sig); } - case 176 /* GetAccessor */: { + case 177 /* GetAccessor */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -378423,13 +382989,13 @@ ${lanes.join("\n")} input, ensureModifiers(input), input.name, - updateAccessorParamsList(input, hasEffectiveModifier(input, 8 /* Private */)), + updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)), ensureType(input, accessorType), /*body*/ void 0 )); } - case 177 /* SetAccessor */: { + case 178 /* SetAccessor */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -378440,12 +383006,12 @@ ${lanes.join("\n")} input, ensureModifiers(input), input.name, - updateAccessorParamsList(input, hasEffectiveModifier(input, 8 /* Private */)), + updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)), /*body*/ void 0 )); } - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -378460,7 +383026,7 @@ ${lanes.join("\n")} ensureType(input, input.type), ensureNoInitializer(input) )); - case 170 /* PropertySignature */: + case 171 /* PropertySignature */: if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -378474,7 +383040,7 @@ ${lanes.join("\n")} input.questionToken, ensureType(input, input.type) )); - case 172 /* MethodSignature */: { + case 173 /* MethodSignature */: { if (isPrivateIdentifier(input.name)) { return cleanup( /*returnValue*/ @@ -378491,15 +383057,17 @@ ${lanes.join("\n")} ensureType(input, input.type) )); } - case 178 /* CallSignature */: { - return cleanup(factory2.updateCallSignature( - input, - ensureTypeParams(input, input.typeParameters), - updateParamsList(input, input.parameters), - ensureType(input, input.type) - )); + case 179 /* CallSignature */: { + return cleanup( + factory2.updateCallSignature( + input, + ensureTypeParams(input, input.typeParameters), + updateParamsList(input, input.parameters), + ensureType(input, input.type) + ) + ); } - case 180 /* IndexSignature */: { + case 181 /* IndexSignature */: { return cleanup(factory2.updateIndexSignature( input, ensureModifiers(input), @@ -378507,7 +383075,7 @@ ${lanes.join("\n")} visitNode(input.type, visitDeclarationSubtree, isTypeNode) || factory2.createKeywordTypeNode(133 /* AnyKeyword */) )); } - case 259 /* VariableDeclaration */: { + case 260 /* VariableDeclaration */: { if (isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -378522,7 +383090,7 @@ ${lanes.join("\n")} ensureNoInitializer(input) )); } - case 167 /* TypeParameter */: { + case 168 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(factory2.updateTypeParameterDeclaration( input, @@ -378536,7 +383104,7 @@ ${lanes.join("\n")} } return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); } - case 193 /* ConditionalType */: { + case 194 /* ConditionalType */: { const checkType = visitNode(input.checkType, visitDeclarationSubtree, isTypeNode); const extendsType = visitNode(input.extendsType, visitDeclarationSubtree, isTypeNode); const oldEnclosingDecl = enclosingDeclaration; @@ -378550,19 +383118,31 @@ ${lanes.join("\n")} Debug.assert(falseType); return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 183 /* FunctionType */: { - return cleanup(factory2.updateFunctionTypeNode(input, visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), updateParamsList(input, input.parameters), Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)))); + case 184 /* FunctionType */: { + return cleanup(factory2.updateFunctionTypeNode( + input, + visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), + updateParamsList(input, input.parameters), + Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) + )); } - case 184 /* ConstructorType */: { - return cleanup(factory2.updateConstructorTypeNode(input, ensureModifiers(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)) + )); } - case 204 /* ImportType */: { + case 205 /* ImportType */: { if (!isLiteralImportTypeNode(input)) return cleanup(input); + trackReferencedAmbientModuleFromImport(input); return cleanup(factory2.updateImportTypeNode( input, factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), - input.assertions, + input.attributes, input.qualifier, visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode), input.isTypeOf @@ -378596,7 +383176,7 @@ ${lanes.join("\n")} } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 173 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 8 /* Private */); + return node.parent.kind === 174 /* MethodDeclaration */ && hasEffectiveModifier(node.parent, 2 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -378605,21 +383185,22 @@ ${lanes.join("\n")} if (shouldStripInternal(input)) return; switch (input.kind) { - case 277 /* ExportDeclaration */: { + case 278 /* ExportDeclaration */: { if (isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } resultHasScopeMarker = true; + trackReferencedAmbientModuleFromImport(input); return factory2.updateExportDeclaration( input, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), - getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : void 0 + tryGetResolutionModeOverride(input.attributes) ); } - case 276 /* ExportAssignment */: { + case 277 /* ExportAssignment */: { if (isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -378654,11 +383235,26 @@ ${lanes.join("\n")} return input; } function stripExportModifiers(statement) { - if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement, 1024 /* Default */) || !canHaveModifiers(statement)) { + if (isImportEqualsDeclaration(statement) || hasEffectiveModifier(statement, 2048 /* Default */) || !canHaveModifiers(statement)) { return statement; } - const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (258047 /* All */ ^ 1 /* Export */)); - return factory2.updateModifiers(statement, modifiers); + const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (131071 /* All */ ^ 32 /* Export */)); + return factory2.replaceModifiers(statement, modifiers); + } + function updateModuleDeclarationAndKeyword(node, modifiers, name, body) { + const updated = factory2.updateModuleDeclaration(node, modifiers, name, body); + if (isAmbientModule(updated) || updated.flags & 32 /* Namespace */) { + return updated; + } + const fixed = factory2.createModuleDeclaration( + updated.modifiers, + updated.name, + updated.body, + updated.flags | 32 /* Namespace */ + ); + setOriginalNode(fixed, updated); + setTextRange(fixed, updated); + return fixed; } function transformTopLevelDeclaration(input) { if (lateMarkedStatements) { @@ -378668,11 +383264,19 @@ ${lanes.join("\n")} if (shouldStripInternal(input)) return; switch (input.kind) { - case 270 /* ImportEqualsDeclaration */: { - return transformImportEqualsDeclaration(input); + case 271 /* ImportEqualsDeclaration */: { + const transformed = transformImportEqualsDeclaration(input); + if (transformed) { + trackReferencedAmbientModuleFromImport(input); + } + return transformed; } - case 271 /* ImportDeclaration */: { - return transformImportDeclaration(input); + case 272 /* ImportDeclaration */: { + const transformed = transformImportDeclaration(input); + if (transformed) { + trackReferencedAmbientModuleFromImport(input); + } + return transformed; } } if (isDeclaration(input) && isDeclarationAndNotVisible(input)) @@ -378691,7 +383295,7 @@ ${lanes.join("\n")} } const previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 264 /* TypeAliasDeclaration */: { + case 265 /* TypeAliasDeclaration */: { needsDeclare = false; const clean2 = cleanup(factory2.updateTypeAliasDeclaration( input, @@ -378703,7 +383307,7 @@ ${lanes.join("\n")} needsDeclare = previousNeedsDeclare; return clean2; } - case 263 /* InterfaceDeclaration */: { + case 264 /* InterfaceDeclaration */: { return cleanup(factory2.updateInterfaceDeclaration( input, ensureModifiers(input), @@ -378713,7 +383317,7 @@ ${lanes.join("\n")} visitNodes2(input.members, visitDeclarationSubtree, isTypeElement) )); } - case 261 /* FunctionDeclaration */: { + case 262 /* FunctionDeclaration */: { const clean2 = cleanup(factory2.updateFunctionDeclaration( input, ensureModifiers(input), @@ -378733,14 +383337,14 @@ ${lanes.join("\n")} void 0, clean2.name || factory2.createIdentifier("_default"), factory2.createModuleBlock([]), - 16 /* Namespace */ + 32 /* Namespace */ ); setParent(fakespace, enclosingDeclaration); fakespace.locals = createSymbolTable(props); fakespace.symbol = props[0].parent; const exportMappings = []; let declarations = mapDefined(props, (p) => { - if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) { + if (!isExpandoPropertyDeclaration(p.valueDeclaration)) { return void 0; } const nameStr = unescapeLeadingUnderscores(p.escapedName); @@ -378766,7 +383370,7 @@ ${lanes.join("\n")} return factory2.createVariableStatement(isNonContextualKeywordName ? void 0 : [factory2.createToken(95 /* ExportKeyword */)], factory2.createVariableDeclarationList([varDecl])); }); if (!exportMappings.length) { - declarations = mapDefined(declarations, (declaration) => factory2.updateModifiers(declaration, 0 /* None */)); + declarations = mapDefined(declarations, (declaration) => factory2.replaceModifiers(declaration, 0 /* None */)); } else { declarations.push(factory2.createExportDeclaration( /*modifiers*/ @@ -378783,11 +383387,11 @@ ${lanes.join("\n")} })) )); } - const namespaceDecl = factory2.createModuleDeclaration(ensureModifiers(input), input.name, factory2.createModuleBlock(declarations), 16 /* Namespace */); - if (!hasEffectiveModifier(clean2, 1024 /* Default */)) { + const namespaceDecl = factory2.createModuleDeclaration(ensureModifiers(input), input.name, factory2.createModuleBlock(declarations), 32 /* Namespace */); + if (!hasEffectiveModifier(clean2, 2048 /* Default */)) { return [clean2, namespaceDecl]; } - const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~1025 /* ExportDefault */ | 2 /* Ambient */); + const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(clean2) & ~2080 /* ExportDefault */ | 128 /* Ambient */); const cleanDeclaration = factory2.updateFunctionDeclaration( clean2, modifiers, @@ -378822,17 +383426,17 @@ ${lanes.join("\n")} return clean2; } } - case 266 /* ModuleDeclaration */: { + case 267 /* ModuleDeclaration */: { needsDeclare = false; const inner = input.body; - if (inner && inner.kind === 267 /* ModuleBlock */) { + if (inner && inner.kind === 268 /* ModuleBlock */) { const oldNeedsScopeFix = needsScopeFixMarker; const oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; needsScopeFixMarker = false; const statements = visitNodes2(inner.statements, visitDeclarationStatements, isStatement); let lateStatements = transformAndReplaceLatePaintedStatements(statements); - if (input.flags & 16777216 /* Ambient */) { + if (input.flags & 33554432 /* Ambient */) { needsScopeFixMarker = false; } if (!isGlobalScopeAugmentation(input) && !hasScopeMarker2(lateStatements) && !resultHasScopeMarker) { @@ -378847,7 +383451,7 @@ ${lanes.join("\n")} needsScopeFixMarker = oldNeedsScopeFix; resultHasScopeMarker = oldHasScopeFix; const mods = ensureModifiers(input); - return cleanup(factory2.updateModuleDeclaration( + return cleanup(updateModuleDeclarationAndKeyword( input, mods, isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name, @@ -378861,7 +383465,7 @@ ${lanes.join("\n")} const id = getOriginalNodeId(inner); const body = lateStatementReplacementMap.get(id); lateStatementReplacementMap.delete(id); - return cleanup(factory2.updateModuleDeclaration( + return cleanup(updateModuleDeclarationAndKeyword( input, mods, input.name, @@ -378869,7 +383473,7 @@ ${lanes.join("\n")} )); } } - case 262 /* ClassDeclaration */: { + case 263 /* ClassDeclaration */: { errorNameNode = input.name; errorFallbackNode = input; const modifiers = factory2.createNodeArray(ensureModifiers(input)); @@ -378879,17 +383483,20 @@ ${lanes.join("\n")} if (ctor) { const oldDiag2 = getSymbolAccessibilityDiagnostic; parameterProperties = compact(flatMap(ctor.parameters, (param) => { - if (!hasSyntacticModifier(param, 16476 /* ParameterPropertyModifier */) || shouldStripInternal(param)) + if (!hasSyntacticModifier(param, 31 /* ParameterPropertyModifier */) || shouldStripInternal(param)) return; getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(param); if (param.name.kind === 80 /* Identifier */) { - return preserveJsDoc(factory2.createPropertyDeclaration( - ensureModifiers(param), - param.name, - param.questionToken, - ensureType(param, param.type), - ensureNoInitializer(param) - ), param); + return preserveJsDoc( + factory2.createPropertyDeclaration( + ensureModifiers(param), + param.name, + param.questionToken, + ensureType(param, param.type), + ensureNoInitializer(param) + ), + param + ); } else { return walkBindingPattern(param.name); } @@ -378965,14 +383572,17 @@ ${lanes.join("\n")} } return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => isEntityNameExpression(t.expression) || t.expression.kind === 106 /* NullKeyword */)), visitDeclarationSubtree, isExpressionWithTypeArguments)); })); - return [statement, cleanup(factory2.updateClassDeclaration( - input, - modifiers, - input.name, - typeParameters, - heritageClauses, - members - ))]; + return [ + statement, + cleanup(factory2.updateClassDeclaration( + input, + modifiers, + input.name, + typeParameters, + heritageClauses, + members + )) + ]; } else { const heritageClauses = transformHeritageClauses(input.heritageClauses); return cleanup(factory2.updateClassDeclaration( @@ -378985,16 +383595,22 @@ ${lanes.join("\n")} )); } } - case 242 /* VariableStatement */: { + case 243 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 265 /* EnumDeclaration */: { - return cleanup(factory2.updateEnumDeclaration(input, factory2.createNodeArray(ensureModifiers(input)), input.name, factory2.createNodeArray(mapDefined(input.members, (m) => { - 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); - })))); + case 266 /* EnumDeclaration */: { + return cleanup(factory2.updateEnumDeclaration( + input, + factory2.createNodeArray(ensureModifiers(input)), + input.name, + factory2.createNodeArray(mapDefined(input.members, (m) => { + if (shouldStripInternal(m)) + return; + const constValue = resolver.getConstantValue(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); + })) + )); } } return Debug.assertNever(input, `Unhandled top-level node in declaration emit: ${Debug.formatSyntaxKind(input.kind)}`); @@ -379005,7 +383621,7 @@ ${lanes.join("\n")} if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 266 /* ModuleDeclaration */) { + if (input.kind === 267 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -379022,13 +383638,23 @@ ${lanes.join("\n")} const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree, isVariableDeclaration); if (!length(nodes)) return; - return factory2.updateVariableStatement(input, factory2.createNodeArray(ensureModifiers(input)), factory2.updateVariableDeclarationList(input.declarationList, nodes)); + const modifiers = factory2.createNodeArray(ensureModifiers(input)); + let declList; + if (isVarUsing(input.declarationList) || isVarAwaitUsing(input.declarationList)) { + declList = factory2.createVariableDeclarationList(nodes, 2 /* Const */); + setOriginalNode(declList, input.declarationList); + setTextRange(declList, input.declarationList); + setCommentRange(declList, input.declarationList); + } else { + declList = factory2.updateVariableDeclarationList(input.declarationList, nodes); + } + return factory2.updateVariableStatement(input, modifiers, declList); } function recreateBindingPattern(d) { return flatten(mapDefined(d.elements, (e) => recreateBindingElement(e))); } function recreateBindingElement(e) { - if (e.kind === 231 /* OmittedExpression */) { + if (e.kind === 232 /* OmittedExpression */) { return; } if (e.name) { @@ -379086,11 +383712,11 @@ ${lanes.join("\n")} return factory2.createModifiersFromModifierFlags(newFlags); } function ensureModifierFlags(node) { - let mask2 = 258047 /* All */ ^ (4 /* Public */ | 512 /* Async */ | 16384 /* Override */); - let additions = needsDeclare && !isAlwaysType(node) ? 2 /* Ambient */ : 0 /* None */; - const parentIsFile = node.parent.kind === 311 /* SourceFile */; + let mask2 = 131071 /* All */ ^ (1 /* Public */ | 1024 /* Async */ | 16 /* Override */); + let additions = needsDeclare && !isAlwaysType(node) ? 128 /* Ambient */ : 0 /* None */; + const parentIsFile = node.parent.kind === 312 /* SourceFile */; if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) { - mask2 ^= 2 /* Ambient */; + mask2 ^= 128 /* Ambient */; additions = 0 /* None */; } return maskModifierFlags(node, mask2, additions); @@ -379108,13 +383734,23 @@ ${lanes.join("\n")} return accessorType; } function transformHeritageClauses(nodes) { - return factory2.createNodeArray(filter(map(nodes, (clause) => factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter(clause.types, (t) => { - return isEntityNameExpression(t.expression) || clause.token === 96 /* ExtendsKeyword */ && t.expression.kind === 106 /* NullKeyword */; - })), visitDeclarationSubtree, isExpressionWithTypeArguments))), (clause) => clause.types && !!clause.types.length)); + return factory2.createNodeArray(filter( + map(nodes, (clause) => factory2.updateHeritageClause( + clause, + visitNodes2( + factory2.createNodeArray(filter(clause.types, (t) => { + return isEntityNameExpression(t.expression) || clause.token === 96 /* ExtendsKeyword */ && t.expression.kind === 106 /* NullKeyword */; + })), + visitDeclarationSubtree, + isExpressionWithTypeArguments + ) + )), + (clause) => clause.types && !!clause.types.length + )); } } function isAlwaysType(node) { - if (node.kind === 263 /* InterfaceDeclaration */) { + if (node.kind === 264 /* InterfaceDeclaration */) { return true; } return false; @@ -379122,69 +383758,69 @@ ${lanes.join("\n")} function maskModifiers(factory2, node, modifierMask, modifierAdditions) { return factory2.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions)); } - function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public */, modifierAdditions = 0 /* None */) { + function maskModifierFlags(node, modifierMask = 131071 /* All */ ^ 1 /* Public */, modifierAdditions = 0 /* None */) { let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions; - if (flags & 1024 /* Default */ && !(flags & 1 /* Export */)) { - flags ^= 1 /* Export */; + if (flags & 2048 /* Default */ && !(flags & 32 /* Export */)) { + flags ^= 32 /* Export */; } - if (flags & 1024 /* Default */ && flags & 2 /* Ambient */) { - flags ^= 2 /* Ambient */; + if (flags & 2048 /* Default */ && flags & 128 /* Ambient */) { + flags ^= 128 /* Ambient */; } return flags; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 176 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0; + return accessor.kind === 177 /* GetAccessor */ ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0; } } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - return !hasEffectiveModifier(node, 8 /* Private */); - case 168 /* Parameter */: - case 259 /* VariableDeclaration */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + return !hasEffectiveModifier(node, 2 /* Private */); + case 169 /* Parameter */: + case 260 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 266 /* ModuleDeclaration */: - case 270 /* ImportEqualsDeclaration */: - case 263 /* InterfaceDeclaration */: - case 262 /* ClassDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 265 /* EnumDeclaration */: - case 242 /* VariableStatement */: - case 271 /* ImportDeclaration */: - case 277 /* ExportDeclaration */: - case 276 /* ExportAssignment */: + case 262 /* FunctionDeclaration */: + case 267 /* ModuleDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 264 /* InterfaceDeclaration */: + case 263 /* ClassDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 266 /* EnumDeclaration */: + case 243 /* VariableStatement */: + case 272 /* ImportDeclaration */: + case 278 /* ExportDeclaration */: + case 277 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 179 /* ConstructSignature */: - case 175 /* Constructor */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 172 /* MethodSignature */: - case 178 /* CallSignature */: - case 180 /* IndexSignature */: - case 259 /* VariableDeclaration */: - case 167 /* TypeParameter */: - case 232 /* ExpressionWithTypeArguments */: - case 182 /* TypeReference */: - case 193 /* ConditionalType */: - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 204 /* ImportType */: + case 180 /* ConstructSignature */: + case 176 /* Constructor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 173 /* MethodSignature */: + case 179 /* CallSignature */: + case 181 /* IndexSignature */: + case 260 /* VariableDeclaration */: + case 168 /* TypeParameter */: + case 233 /* ExpressionWithTypeArguments */: + case 183 /* TypeReference */: + case 194 /* ConditionalType */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 205 /* ImportType */: return true; } return false; @@ -379206,6 +383842,7 @@ ${lanes.join("\n")} case 7 /* ES2022 */: case 6 /* ES2020 */: case 5 /* ES2015 */: + case 200 /* Preserve */: return transformECMAScriptModule; case 4 /* System */: return transformSystemModule; @@ -379233,16 +383870,17 @@ ${lanes.join("\n")} transformers.push(transformTypeScript); if (compilerOptions.experimentalDecorators) { transformers.push(transformLegacyDecorators); - } else if (languageVersion < 99 /* ESNext */ || !useDefineForClassFields) { - transformers.push(transformESDecorators); } - transformers.push(transformClassFields); if (getJSXTransformEnabled(compilerOptions)) { transformers.push(transformJsx); } if (languageVersion < 99 /* ESNext */) { transformers.push(transformESNext); } + if (!compilerOptions.experimentalDecorators && (languageVersion < 99 /* ESNext */ || !useDefineForClassFields)) { + transformers.push(transformESDecorators); + } + transformers.push(transformClassFields); if (languageVersion < 8 /* ES2021 */) { transformers.push(transformES2021); } @@ -379301,7 +383939,7 @@ ${lanes.join("\n")} } function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) { var _a, _b; - const enabledSyntaxKindFeatures = new Array(362 /* Count */); + const enabledSyntaxKindFeatures = new Array(363 /* Count */); let lexicalEnvironmentVariableDeclarations; let lexicalEnvironmentFunctionDeclarations; let lexicalEnvironmentStatements; @@ -379380,7 +384018,7 @@ ${lanes.join("\n")} state = 1 /* Initialized */; const transformed = []; for (const node of nodes) { - (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Emit, "transformNodes", node.kind === 311 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Emit, "transformNodes", node.kind === 312 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); (_b = tracing) == null ? void 0 : _b.pop(); } @@ -379708,7 +384346,7 @@ ${lanes.join("\n")} } function getOutputPathsFor(sourceFile, host, forceDtsPaths) { const options = host.getCompilerOptions(); - if (sourceFile.kind === 312 /* Bundle */) { + if (sourceFile.kind === 313 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options)); @@ -379727,28 +384365,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 }; @@ -379911,27 +384555,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)); } @@ -379959,6 +384582,7 @@ ${lanes.join("\n")} void 0, { buildInfo } ); + emittedFilesList == null ? void 0 : emittedFilesList.push(buildInfoPath); } function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) { if (!sourceFileOrBundle || emitOnly || !jsFilePath) { @@ -380004,6 +384628,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 */) @@ -380034,32 +384664,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, - 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, @@ -380073,10 +384704,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)) { @@ -380100,8 +384737,8 @@ ${lanes.join("\n")} } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer, mapOptions) { const sourceFileOrBundle = transform2.transformed[0]; - const bundle = sourceFileOrBundle.kind === 312 /* Bundle */ ? sourceFileOrBundle : void 0; - const sourceFile = sourceFileOrBundle.kind === 311 /* SourceFile */ ? sourceFileOrBundle : void 0; + const bundle = sourceFileOrBundle.kind === 313 /* Bundle */ ? sourceFileOrBundle : void 0; + const sourceFile = sourceFileOrBundle.kind === 312 /* SourceFile */ ? sourceFileOrBundle : void 0; const sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; let sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -380163,7 +384800,7 @@ ${lanes.join("\n")} writer.clear(); } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { - return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 311 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 312 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { const sourceRoot = normalizeSlashes(mapOptions.sourceRoot || ""); @@ -380406,6 +385043,7 @@ ${lanes.join("\n")} onAfterEmitToken } = handlers; var extendedDiagnostics = !!printerOptions.extendedDiagnostics; + var omitBraceSourcePositions = !!printerOptions.omitBraceSourceMapPositions; var newLine = getNewLineCharacter(printerOptions); var moduleKind = getEmitModuleKind(printerOptions); var bundledHelpers = /* @__PURE__ */ new Map(); @@ -380483,11 +385121,11 @@ ${lanes.join("\n")} break; } switch (node.kind) { - case 311 /* SourceFile */: + case 312 /* SourceFile */: return printFile(node); - case 312 /* Bundle */: + case 313 /* Bundle */: return printBundle(node); - case 313 /* UnparsedSource */: + case 314 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); @@ -380845,6 +385483,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( @@ -380866,301 +385506,301 @@ ${lanes.join("\n")} return emitIdentifier(node); case 81 /* PrivateIdentifier */: return emitPrivateIdentifier(node); - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: return emitQualifiedName(node); - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: return emitComputedPropertyName(node); - case 167 /* TypeParameter */: + case 168 /* TypeParameter */: return emitTypeParameter(node); - case 168 /* Parameter */: + case 169 /* Parameter */: return emitParameter(node); - case 169 /* Decorator */: + case 170 /* Decorator */: return emitDecorator(node); - case 170 /* PropertySignature */: + case 171 /* PropertySignature */: return emitPropertySignature(node); - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 172 /* MethodSignature */: + case 173 /* MethodSignature */: return emitMethodSignature(node); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 174 /* ClassStaticBlockDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: return emitClassStaticBlockDeclaration(node); - case 175 /* Constructor */: + case 176 /* Constructor */: return emitConstructor(node); - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return emitAccessorDeclaration(node); - case 178 /* CallSignature */: + case 179 /* CallSignature */: return emitCallSignature(node); - case 179 /* ConstructSignature */: + case 180 /* ConstructSignature */: return emitConstructSignature(node); - case 180 /* IndexSignature */: + case 181 /* IndexSignature */: return emitIndexSignature(node); - case 181 /* TypePredicate */: + case 182 /* TypePredicate */: return emitTypePredicate(node); - case 182 /* TypeReference */: + case 183 /* TypeReference */: return emitTypeReference(node); - case 183 /* FunctionType */: + case 184 /* FunctionType */: return emitFunctionType(node); - case 184 /* ConstructorType */: + case 185 /* ConstructorType */: return emitConstructorType(node); - case 185 /* TypeQuery */: + case 186 /* TypeQuery */: return emitTypeQuery(node); - case 186 /* TypeLiteral */: + case 187 /* TypeLiteral */: return emitTypeLiteral(node); - case 187 /* ArrayType */: + case 188 /* ArrayType */: return emitArrayType(node); - case 188 /* TupleType */: + case 189 /* TupleType */: return emitTupleType(node); - case 189 /* OptionalType */: + case 190 /* OptionalType */: return emitOptionalType(node); - case 191 /* UnionType */: + case 192 /* UnionType */: return emitUnionType(node); - case 192 /* IntersectionType */: + case 193 /* IntersectionType */: return emitIntersectionType(node); - case 193 /* ConditionalType */: + case 194 /* ConditionalType */: return emitConditionalType(node); - case 194 /* InferType */: + case 195 /* InferType */: return emitInferType(node); - case 195 /* ParenthesizedType */: + case 196 /* ParenthesizedType */: return emitParenthesizedType(node); - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 196 /* ThisType */: + case 197 /* ThisType */: return emitThisType(); - case 197 /* TypeOperator */: + case 198 /* TypeOperator */: return emitTypeOperator(node); - case 198 /* IndexedAccessType */: + case 199 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 199 /* MappedType */: + case 200 /* MappedType */: return emitMappedType(node); - case 200 /* LiteralType */: + case 201 /* LiteralType */: return emitLiteralType(node); - case 201 /* NamedTupleMember */: + case 202 /* NamedTupleMember */: return emitNamedTupleMember(node); - case 202 /* TemplateLiteralType */: + case 203 /* TemplateLiteralType */: return emitTemplateType(node); - case 203 /* TemplateLiteralTypeSpan */: + case 204 /* TemplateLiteralTypeSpan */: return emitTemplateTypeSpan(node); - case 204 /* ImportType */: + case 205 /* ImportType */: return emitImportTypeNode(node); - case 205 /* ObjectBindingPattern */: + case 206 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 206 /* ArrayBindingPattern */: + case 207 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 207 /* BindingElement */: + case 208 /* BindingElement */: return emitBindingElement(node); - case 238 /* TemplateSpan */: + case 239 /* TemplateSpan */: return emitTemplateSpan(node); - case 239 /* SemicolonClassElement */: + case 240 /* SemicolonClassElement */: return emitSemicolonClassElement(); - case 240 /* Block */: + case 241 /* Block */: return emitBlock(node); - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return emitVariableStatement(node); - case 241 /* EmptyStatement */: + case 242 /* EmptyStatement */: return emitEmptyStatement( /*isEmbeddedStatement*/ false ); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return emitExpressionStatement(node); - case 244 /* IfStatement */: + case 245 /* IfStatement */: return emitIfStatement(node); - case 245 /* DoStatement */: + case 246 /* DoStatement */: return emitDoStatement(node); - case 246 /* WhileStatement */: + case 247 /* WhileStatement */: return emitWhileStatement(node); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return emitForStatement(node); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return emitForInStatement(node); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return emitForOfStatement(node); - case 250 /* ContinueStatement */: + case 251 /* ContinueStatement */: return emitContinueStatement(node); - case 251 /* BreakStatement */: + case 252 /* BreakStatement */: return emitBreakStatement(node); - case 252 /* ReturnStatement */: + case 253 /* ReturnStatement */: return emitReturnStatement(node); - case 253 /* WithStatement */: + case 254 /* WithStatement */: return emitWithStatement(node); - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: return emitSwitchStatement(node); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return emitLabeledStatement(node); - case 256 /* ThrowStatement */: + case 257 /* ThrowStatement */: return emitThrowStatement(node); - case 257 /* TryStatement */: + case 258 /* TryStatement */: return emitTryStatement(node); - case 258 /* DebuggerStatement */: + case 259 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 260 /* VariableDeclarationList */: + case 261 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return emitClassDeclaration(node); - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 264 /* TypeAliasDeclaration */: + case 265 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 267 /* ModuleBlock */: + case 268 /* ModuleBlock */: return emitModuleBlock(node); - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: return emitCaseBlock(node); - case 269 /* NamespaceExportDeclaration */: + case 270 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return emitImportDeclaration(node); - case 272 /* ImportClause */: + case 273 /* ImportClause */: return emitImportClause(node); - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: return emitNamespaceImport(node); - case 279 /* NamespaceExport */: + case 280 /* NamespaceExport */: return emitNamespaceExport(node); - case 274 /* NamedImports */: + case 275 /* NamedImports */: return emitNamedImports(node); - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: return emitImportSpecifier(node); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return emitExportAssignment(node); - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: return emitExportDeclaration(node); - case 278 /* NamedExports */: + case 279 /* NamedExports */: return emitNamedExports(node); - case 280 /* ExportSpecifier */: + case 281 /* ExportSpecifier */: return emitExportSpecifier(node); - case 299 /* AssertClause */: - return emitAssertClause(node); - case 300 /* AssertEntry */: - return emitAssertEntry(node); - case 281 /* MissingDeclaration */: + case 300 /* ImportAttributes */: + return emitImportAttributes(node); + case 301 /* ImportAttribute */: + return emitImportAttribute(node); + case 282 /* MissingDeclaration */: return; - case 282 /* ExternalModuleReference */: + case 283 /* ExternalModuleReference */: return emitExternalModuleReference(node); case 12 /* JsxText */: return emitJsxText(node); - case 285 /* JsxOpeningElement */: - case 288 /* JsxOpeningFragment */: + case 286 /* JsxOpeningElement */: + case 289 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 286 /* JsxClosingElement */: - case 289 /* JsxClosingFragment */: + case 287 /* JsxClosingElement */: + case 290 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 290 /* JsxAttribute */: + case 291 /* JsxAttribute */: return emitJsxAttribute(node); - case 291 /* JsxAttributes */: + case 292 /* JsxAttributes */: return emitJsxAttributes(node); - case 292 /* JsxSpreadAttribute */: + case 293 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 293 /* JsxExpression */: + case 294 /* JsxExpression */: return emitJsxExpression(node); - case 294 /* JsxNamespacedName */: + case 295 /* JsxNamespacedName */: return emitJsxNamespacedName(node); - case 295 /* CaseClause */: + case 296 /* CaseClause */: return emitCaseClause(node); - case 296 /* DefaultClause */: + case 297 /* DefaultClause */: return emitDefaultClause(node); - case 297 /* HeritageClause */: + case 298 /* HeritageClause */: return emitHeritageClause(node); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return emitCatchClause(node); - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 304 /* SpreadAssignment */: + case 305 /* SpreadAssignment */: return emitSpreadAssignment(node); - case 305 /* EnumMember */: + case 306 /* EnumMember */: return emitEnumMember(node); - case 306 /* UnparsedPrologue */: + case 307 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 313 /* UnparsedSource */: - case 307 /* UnparsedPrepend */: + case 314 /* UnparsedSource */: + case 308 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 308 /* UnparsedText */: - case 309 /* UnparsedInternalText */: + case 309 /* UnparsedText */: + case 310 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 310 /* UnparsedSyntheticReference */: + case 311 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); - case 311 /* SourceFile */: + case 312 /* SourceFile */: return emitSourceFile(node); - case 312 /* Bundle */: + case 313 /* Bundle */: return Debug.fail("Bundles should be printed using printBundle"); - case 314 /* InputFiles */: + case 315 /* InputFiles */: return Debug.fail("InputFiles should not be printed"); - case 315 /* JSDocTypeExpression */: + case 316 /* JSDocTypeExpression */: return emitJSDocTypeExpression(node); - case 316 /* JSDocNameReference */: + case 317 /* JSDocNameReference */: return emitJSDocNameReference(node); - case 318 /* JSDocAllType */: + case 319 /* JSDocAllType */: return writePunctuation("*"); - case 319 /* JSDocUnknownType */: + case 320 /* JSDocUnknownType */: return writePunctuation("?"); - case 320 /* JSDocNullableType */: + case 321 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 321 /* JSDocNonNullableType */: + case 322 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 322 /* JSDocOptionalType */: + case 323 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 323 /* JSDocFunctionType */: + case 324 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 190 /* RestType */: - case 324 /* JSDocVariadicType */: + case 191 /* RestType */: + case 325 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); - case 325 /* JSDocNamepathType */: + case 326 /* JSDocNamepathType */: return; - case 326 /* JSDoc */: + case 327 /* JSDoc */: return emitJSDoc(node); - case 328 /* JSDocTypeLiteral */: + case 329 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 329 /* JSDocSignature */: + case 330 /* JSDocSignature */: return emitJSDocSignature(node); - case 333 /* JSDocTag */: - case 338 /* JSDocClassTag */: - case 343 /* JSDocOverrideTag */: + case 334 /* JSDocTag */: + case 339 /* JSDocClassTag */: + case 344 /* JSDocOverrideTag */: return emitJSDocSimpleTag(node); - case 334 /* JSDocAugmentsTag */: - case 335 /* JSDocImplementsTag */: + case 335 /* JSDocAugmentsTag */: + case 336 /* JSDocImplementsTag */: return emitJSDocHeritageTag(node); - case 336 /* JSDocAuthorTag */: - case 337 /* JSDocDeprecatedTag */: + case 337 /* JSDocAuthorTag */: + case 338 /* JSDocDeprecatedTag */: return; - case 339 /* JSDocPublicTag */: - case 340 /* JSDocPrivateTag */: - case 341 /* JSDocProtectedTag */: - case 342 /* JSDocReadonlyTag */: + case 340 /* JSDocPublicTag */: + case 341 /* JSDocPrivateTag */: + case 342 /* JSDocProtectedTag */: + case 343 /* JSDocReadonlyTag */: return; - case 344 /* JSDocCallbackTag */: + case 345 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 345 /* JSDocOverloadTag */: + case 346 /* JSDocOverloadTag */: return emitJSDocOverloadTag(node); - case 347 /* JSDocParameterTag */: - case 354 /* JSDocPropertyTag */: + case 348 /* JSDocParameterTag */: + case 355 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 346 /* JSDocEnumTag */: - case 348 /* JSDocReturnTag */: - case 349 /* JSDocThisTag */: - case 350 /* JSDocTypeTag */: - case 355 /* JSDocThrowsTag */: - case 356 /* JSDocSatisfiesTag */: + case 347 /* JSDocEnumTag */: + case 349 /* JSDocReturnTag */: + case 350 /* JSDocThisTag */: + case 351 /* JSDocTypeTag */: + case 356 /* JSDocThrowsTag */: + case 357 /* JSDocSatisfiesTag */: return emitJSDocSimpleTypedTag(node); - case 351 /* JSDocTemplateTag */: + case 352 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 352 /* JSDocTypedefTag */: + case 353 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 353 /* JSDocSeeTag */: + case 354 /* JSDocSeeTag */: return emitJSDocSeeTag(node); - case 358 /* NotEmittedStatement */: + case 359 /* NotEmittedStatement */: return; } if (isExpression(node)) { @@ -381193,83 +385833,83 @@ ${lanes.join("\n")} return emitIdentifier(node); case 81 /* PrivateIdentifier */: return emitPrivateIdentifier(node); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return emitCallExpression(node); - case 213 /* NewExpression */: + case 214 /* NewExpression */: return emitNewExpression(node); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 215 /* TypeAssertionExpression */: + case 216 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: return emitFunctionExpression(node); - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return emitArrowFunction(node); - case 219 /* DeleteExpression */: + case 220 /* DeleteExpression */: return emitDeleteExpression(node); - case 220 /* TypeOfExpression */: + case 221 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 221 /* VoidExpression */: + case 222 /* VoidExpression */: return emitVoidExpression(node); - case 222 /* AwaitExpression */: + case 223 /* AwaitExpression */: return emitAwaitExpression(node); - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 224 /* PostfixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return emitBinaryExpression(node); - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: return emitConditionalExpression(node); - case 227 /* TemplateExpression */: + case 228 /* TemplateExpression */: return emitTemplateExpression(node); - case 228 /* YieldExpression */: + case 229 /* YieldExpression */: return emitYieldExpression(node); - case 229 /* SpreadElement */: + case 230 /* SpreadElement */: return emitSpreadElement(node); - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: return emitClassExpression(node); - case 231 /* OmittedExpression */: + case 232 /* OmittedExpression */: return; - case 233 /* AsExpression */: + case 234 /* AsExpression */: return emitAsExpression(node); - case 234 /* NonNullExpression */: + case 235 /* NonNullExpression */: return emitNonNullExpression(node); - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 237 /* SatisfiesExpression */: + case 238 /* SatisfiesExpression */: return emitSatisfiesExpression(node); - case 235 /* MetaProperty */: + case 236 /* MetaProperty */: return emitMetaProperty(node); - case 236 /* SyntheticExpression */: + case 237 /* SyntheticExpression */: return Debug.fail("SyntheticExpression should never be printed."); - case 281 /* MissingDeclaration */: + case 282 /* MissingDeclaration */: return; - case 283 /* JsxElement */: + case 284 /* JsxElement */: return emitJsxElement(node); - case 284 /* JsxSelfClosingElement */: + case 285 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 287 /* JsxFragment */: + case 288 /* JsxFragment */: return emitJsxFragment(node); - case 357 /* SyntaxList */: + case 358 /* SyntaxList */: return Debug.fail("SyntaxList should not be printed"); - case 358 /* NotEmittedStatement */: + case 359 /* NotEmittedStatement */: return; - case 359 /* PartiallyEmittedExpression */: + case 360 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 360 /* CommaListExpression */: + case 361 /* CommaListExpression */: return emitCommaList(node); - case 361 /* SyntheticReferenceExpression */: + case 362 /* SyntheticReferenceExpression */: return Debug.fail("SyntheticReferenceExpression should not be printed"); } } @@ -381315,7 +385955,7 @@ ${lanes.join("\n")} } function emitHelpers(node) { let helpersEmitted = false; - const bundle = node.kind === 312 /* Bundle */ ? node : void 0; + const bundle = node.kind === 313 /* Bundle */ ? node : void 0; if (bundle && moduleKind === 0 /* None */) { return; } @@ -381390,7 +386030,7 @@ ${lanes.join("\n")} updateOrPushBundleFileTextLike( pos, writer.getTextPos(), - unparsed.kind === 308 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */ + unparsed.kind === 309 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */ ); } } @@ -381425,14 +386065,8 @@ ${lanes.join("\n")} nonEscapingWrite(`}`); } function emitTabStop(hint, node, snippet) { - Debug.assert( - node.kind === 241 /* EmptyStatement */, - `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.` - ); - Debug.assert( - hint !== 5 /* EmbeddedStatement */, - `A tab stop cannot be attached to an embedded statement.` - ); + Debug.assert(node.kind === 242 /* EmptyStatement */, `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`); + Debug.assert(hint !== 5 /* EmbeddedStatement */, `A tab stop cannot be attached to an embedded statement.`); nonEscapingWrite(`$${snippet.order}`); } function emitIdentifier(node) { @@ -381498,7 +386132,7 @@ ${lanes.join("\n")} emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 323 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 324 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { emitTypeAnnotation(node.type); @@ -381574,7 +386208,7 @@ ${lanes.join("\n")} /*allowDecorators*/ true ); - const token = node.kind === 176 /* GetAccessor */ ? 139 /* GetKeyword */ : 153 /* SetKeyword */; + const token = node.kind === 177 /* GetAccessor */ ? 139 /* GetKeyword */ : 153 /* SetKeyword */; emitTokenWithComment(token, pos, writeKeyword, node); writeSpace(); emit(node.name); @@ -381824,18 +386458,10 @@ ${lanes.join("\n")} writeKeyword("import"); writePunctuation("("); emit(node.argument); - if (node.assertions) { + if (node.attributes) { writePunctuation(","); writeSpace(); - writePunctuation("{"); - writeSpace(); - writeKeyword("assert"); - writePunctuation(":"); - writeSpace(); - const elements = node.assertions.assertClause.elements; - emitList(node.assertions.assertClause, elements, 526226 /* ImportClauseEntries */); - writeSpace(); - writePunctuation("}"); + pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes); } writePunctuation(")"); if (node.qualifier) { @@ -381925,10 +386551,10 @@ ${lanes.join("\n")} /*jsxAttributeEscape*/ false ); - return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !stringContains(text, tokenToString(25 /* DotToken */)) && !stringContains(text, String.fromCharCode(69 /* E */)) && !stringContains(text, String.fromCharCode(101 /* e */)); + return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */)); } else if (isAccessExpression(expression)) { const constantValue = getConstantValue(expression); - return typeof constantValue === "number" && isFinite(constantValue) && Math.floor(constantValue) === constantValue; + return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue; } } function emitElementAccessExpression(node) { @@ -382039,7 +386665,7 @@ ${lanes.join("\n")} } function shouldEmitWhitespaceBeforeOperand(node) { const operand = node.operand; - return operand.kind === 223 /* PrefixUnaryExpression */ && (node.operator === 40 /* PlusToken */ && (operand.operator === 40 /* PlusToken */ || operand.operator === 46 /* PlusPlusToken */) || node.operator === 41 /* MinusToken */ && (operand.operator === 41 /* MinusToken */ || operand.operator === 47 /* MinusMinusToken */)); + return operand.kind === 224 /* PrefixUnaryExpression */ && (node.operator === 40 /* PlusToken */ && (operand.operator === 40 /* PlusToken */ || operand.operator === 46 /* PlusPlusToken */) || node.operator === 41 /* MinusToken */ && (operand.operator === 41 /* MinusToken */ || operand.operator === 47 /* MinusMinusToken */)); } function emitPostfixUnaryExpression(node) { emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary); @@ -382298,7 +386924,7 @@ ${lanes.join("\n")} if (node.elseStatement) { writeLineOrSpace(node, node.thenStatement, node.elseStatement); emitTokenWithComment(93 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 244 /* IfStatement */) { + if (node.elseStatement.kind === 245 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } else { @@ -382365,7 +386991,7 @@ ${lanes.join("\n")} emitTokenWithComment(21 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(164 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(165 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(22 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -382373,7 +386999,7 @@ ${lanes.join("\n")} } function emitForBinding(node) { if (node !== void 0) { - if (node.kind === 260 /* VariableDeclarationList */) { + if (node.kind === 261 /* VariableDeclarationList */) { emit(node); } else { emitExpression(node); @@ -382407,9 +387033,13 @@ ${lanes.join("\n")} decreaseIndent(); } } - pos = writeTokenText(token, writer2, pos); + if (!omitBraceSourcePositions && (token === 19 /* OpenBraceToken */ || token === 20 /* CloseBraceToken */)) { + pos = writeToken(token, pos, writer2, contextNode); + } else { + pos = writeTokenText(token, writer2, pos); + } if (isSimilarNode && contextNode.end !== pos) { - const isJsxExprContext = contextNode.kind === 293 /* JsxExpression */; + const isJsxExprContext = contextNode.kind === 294 /* JsxExpression */; emitTrailingCommentsOfPosition( pos, /*prefixSpace*/ @@ -382426,7 +387056,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; @@ -382521,7 +387158,14 @@ ${lanes.join("\n")} emitInitializer(node.initializer, ((_a = node.type) == null ? void 0 : _a.end) ?? ((_c = (_b = node.name.emitNode) == null ? void 0 : _b.typeNode) == null ? void 0 : _c.end) ?? node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); } function emitVariableDeclarationList(node) { - writeKeyword(isLet(node) ? "let" : isVarConst(node) ? "const" : "var"); + if (isVarAwaitUsing(node)) { + writeKeyword("await"); + writeSpace(); + writeKeyword("using"); + } else { + const head = isLet(node) ? "let" : isVarConst(node) ? "const" : isVarUsing(node) ? "using" : "var"; + writeKeyword(head); + } writeSpace(); emitList(node, node.declarations, 528 /* VariableDeclarationList */); } @@ -382730,8 +387374,8 @@ ${lanes.join("\n")} /*allowDecorators*/ false ); - if (~node.flags & 1024 /* GlobalAugmentation */) { - writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); + if (~node.flags & 2048 /* GlobalAugmentation */) { + writeKeyword(node.flags & 32 /* Namespace */ ? "namespace" : "module"); writeSpace(); } emit(node.name); @@ -382807,12 +387451,12 @@ ${lanes.join("\n")} if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(160 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(161 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); - if (node.assertClause) { - emitWithLeadingSpace(node.assertClause); + if (node.attributes) { + emitWithLeadingSpace(node.attributes); } writeTrailingSemicolon(); } @@ -382850,7 +387494,10 @@ ${lanes.join("\n")} emitTokenWithComment(90 /* DefaultKeyword */, nextPos, writeKeyword, node); } writeSpace(); - emitExpression(node.expression, node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator(64 /* EqualsToken */) : parenthesizer.parenthesizeExpressionOfExportDefault); + emitExpression( + node.expression, + node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator(64 /* EqualsToken */) : parenthesizer.parenthesizeExpressionOfExportDefault + ); writeTrailingSemicolon(); } function emitExportDeclaration(node) { @@ -382874,22 +387521,33 @@ ${lanes.join("\n")} if (node.moduleSpecifier) { writeSpace(); const fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(160 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(161 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } - if (node.assertClause) { - emitWithLeadingSpace(node.assertClause); + if (node.attributes) { + emitWithLeadingSpace(node.attributes); } writeTrailingSemicolon(); } - function emitAssertClause(node) { - emitTokenWithComment(132 /* AssertKeyword */, node.pos, writeKeyword, node); + function emitImportTypeNodeAttributes(node) { + writePunctuation("{"); + writeSpace(); + writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with"); + writePunctuation(":"); writeSpace(); const elements = node.elements; - emitList(node, elements, 526226 /* ImportClauseEntries */); + emitList(node, elements, 526226 /* ImportAttributes */); + writeSpace(); + writePunctuation("}"); + } + function emitImportAttributes(node) { + emitTokenWithComment(node.token, node.pos, writeKeyword, node); + writeSpace(); + const elements = node.elements; + emitList(node, elements, 526226 /* ImportAttributes */); } - function emitAssertEntry(node) { + function emitImportAttribute(node) { emit(node.name); writePunctuation(":"); writeSpace(); @@ -383129,7 +387787,7 @@ ${lanes.join("\n")} } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 350 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 351 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } else { @@ -383173,7 +387831,7 @@ ${lanes.join("\n")} function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 315 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 316 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { writeSpace(); @@ -383191,7 +387849,7 @@ ${lanes.join("\n")} emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 328 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 329 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -383748,6 +388406,16 @@ ${lanes.join("\n")} increaseIndent(); shouldDecreaseIndentAfterEmit = true; } + if (shouldEmitInterveningComments && format & 60 /* DelimitersMask */ && !positionIsSynthesized(child.pos)) { + const commentRange = getCommentRange(child); + emitTrailingCommentsOfPosition( + commentRange.pos, + /*prefixSpace*/ + !!(format & 512 /* SpaceBetweenSiblings */), + /*forceNoNewline*/ + true + ); + } writeLine(separatingLineTerminatorCount); shouldEmitInterveningComments = false; } else if (previousSibling && format & 512 /* SpaceBetweenSiblings */) { @@ -384074,7 +388742,7 @@ ${lanes.join("\n")} return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); } function skipSynthesizedParentheses(node) { - while (node.kind === 216 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { + while (node.kind === 217 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -384114,7 +388782,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) { @@ -384161,84 +388829,84 @@ ${lanes.join("\n")} if (!node) return; switch (node.kind) { - case 240 /* Block */: + case 241 /* Block */: forEach(node.statements, generateNames); break; - case 255 /* LabeledStatement */: - case 253 /* WithStatement */: - case 245 /* DoStatement */: - case 246 /* WhileStatement */: + case 256 /* LabeledStatement */: + case 254 /* WithStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: generateNames(node.statement); break; - case 244 /* IfStatement */: + case 245 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 247 /* ForStatement */: - case 249 /* ForOfStatement */: - case 248 /* ForInStatement */: + case 248 /* ForStatement */: + case 250 /* ForOfStatement */: + case 249 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: forEach(node.clauses, generateNames); break; - case 295 /* CaseClause */: - case 296 /* DefaultClause */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: forEach(node.statements, generateNames); break; - case 257 /* TryStatement */: + case 258 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 298 /* CatchClause */: + case 299 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: generateNames(node.declarationList); break; - case 260 /* VariableDeclarationList */: + case 261 /* VariableDeclarationList */: forEach(node.declarations, generateNames); break; - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: - case 207 /* BindingElement */: - case 262 /* ClassDeclaration */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: + case 208 /* BindingElement */: + case 263 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) { forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 205 /* ObjectBindingPattern */: - case 206 /* ArrayBindingPattern */: + case 206 /* ObjectBindingPattern */: + case 207 /* ArrayBindingPattern */: forEach(node.elements, generateNames); break; - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: generateNames(node.importClause); break; - case 272 /* ImportClause */: + case 273 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 279 /* NamespaceExport */: + case 280 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 274 /* NamedImports */: + case 275 /* NamedImports */: forEach(node.elements, generateNames); break; - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -384247,12 +388915,12 @@ ${lanes.join("\n")} if (!node) return; switch (node.kind) { - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: - case 171 /* PropertyDeclaration */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: + case 172 /* PropertyDeclaration */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -384510,16 +389178,16 @@ ${lanes.join("\n")} prefix, suffix ); - case 266 /* ModuleDeclaration */: - case 265 /* EnumDeclaration */: + case 267 /* ModuleDeclaration */: + case 266 /* EnumDeclaration */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForModuleOrEnum(node); - case 271 /* ImportDeclaration */: - case 277 /* ExportDeclaration */: + case 272 /* ImportDeclaration */: + case 278 /* ExportDeclaration */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForImportOrExportDeclaration(node); - case 261 /* FunctionDeclaration */: - case 262 /* ClassDeclaration */: { + case 262 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: { Debug.assert(!prefix && !suffix && !privateName); const name = node.name; if (name && !isGeneratedIdentifier(name)) { @@ -384534,17 +389202,17 @@ ${lanes.join("\n")} } return generateNameForExportDefault(); } - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForExportDefault(); - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: Debug.assert(!prefix && !suffix && !privateName); return generateNameForClassExpression(); - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: return makeTempVariableName( 0 /* Auto */, /*reservedInNestedScopes*/ @@ -384638,7 +389306,7 @@ ${lanes.join("\n")} emitLeadingComments( pos, /*isEmittedNode*/ - node.kind !== 358 /* NotEmittedStatement */ + node.kind !== 359 /* NotEmittedStatement */ ); } if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) { @@ -384646,7 +389314,7 @@ ${lanes.join("\n")} } if (!skipTrailingComments || end >= 0 && (emitFlags & 2048 /* NoTrailingComments */) !== 0) { containerEnd = end; - if (node.kind === 260 /* VariableDeclarationList */) { + if (node.kind === 261 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -384662,7 +389330,7 @@ ${lanes.join("\n")} containerPos = savedContainerPos; containerEnd = savedContainerEnd; declarationListContainerEnd = savedDeclarationListContainerEnd; - if (!skipTrailingComments && node.kind !== 358 /* NotEmittedStatement */) { + if (!skipTrailingComments && node.kind !== 359 /* NotEmittedStatement */) { emitTrailingComments(end); } } @@ -384934,7 +389602,7 @@ ${lanes.join("\n")} } } else { const source = sourceMapRange.source || sourceMapSource; - if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { + if (node.kind !== 359 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); } if (emitFlags & 128 /* NoNestedSourceMaps */) { @@ -384949,7 +389617,7 @@ ${lanes.join("\n")} if (emitFlags & 128 /* NoNestedSourceMaps */) { sourceMapsDisabled = false; } - if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { + if (node.kind !== 359 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); } } @@ -385106,7 +389774,8 @@ ${lanes.join("\n")} getSymbolOfExternalModuleSpecifier: notImplemented, isBindingCapturedByNode: notImplemented, getDeclarationStatementsForSourceFile: notImplemented, - isImportRequiredByAugmentation: notImplemented + isImportRequiredByAugmentation: notImplemented, + tryFindAmbientModule: notImplemented }; createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({})); createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true })); @@ -385116,14 +389785,14 @@ ${lanes.join("\n")} }); // src/compiler/watchUtilities.ts - function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) { + function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2) { if (!host.getDirectories || !host.readDirectory) { return void 0; } const cachedReadDirectoryResult = /* @__PURE__ */ new Map(); - const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); + const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); return { - useCaseSensitiveFileNames, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, fileExists, readFile: (path, encoding) => host.readFile(path, encoding), directoryExists: host.directoryExists && directoryExists, @@ -385245,7 +389914,7 @@ ${lanes.join("\n")} const rootResult = tryReadDirectory2(rootDir, rootDirPath); let rootSymLinkResult; if (rootResult !== void 0) { - return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath); + return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath); } return host.readDirectory(rootDir, extensions, excludes, includes, depth); function getFileSystemEntries(dir) { @@ -385295,8 +389964,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(); @@ -385378,23 +390047,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, @@ -385405,18 +390061,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), @@ -385440,9 +390100,10 @@ ${lanes.join("\n")} program, extraFileExtensions, currentDirectory, - useCaseSensitiveFileNames, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, writeLog, - toPath: toPath3 + toPath: toPath3, + getScriptKind: getScriptKind2 }) { const newPath = removeIgnoredPath(fileOrDirectoryPath); if (!newPath) { @@ -385452,11 +390113,11 @@ ${lanes.join("\n")} fileOrDirectoryPath = newPath; if (fileOrDirectoryPath === watchedDirPath) return false; - if (hasExtension(fileOrDirectoryPath) && !isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) { + if (hasExtension(fileOrDirectoryPath) && !(isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions) || isSupportedScriptKind())) { writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`); return true; } - if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) { + if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames2, currentDirectory)) { writeLog(`Project: ${configFileName} Detected excluded file: ${fileOrDirectory}`); return true; } @@ -385481,6 +390142,25 @@ ${lanes.join("\n")} function hasSourceFile(file) { return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.getState().fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file); } + function isSupportedScriptKind() { + if (!getScriptKind2) + return false; + const scriptKind = getScriptKind2(fileOrDirectory); + switch (scriptKind) { + case 3 /* TS */: + case 4 /* TSX */: + case 7 /* Deferred */: + case 5 /* External */: + return true; + case 1 /* JS */: + case 2 /* JSX */: + return getAllowJSCompilerOption(options); + case 6 /* JSON */: + return getResolveJsonModule(options); + case 0 /* Unknown */: + return false; + } + } } function isBuilderProgram(program) { return !!program.getState; @@ -385491,7 +390171,7 @@ ${lanes.join("\n")} } return program.isEmittedFile(file); } - function getWatchFactory(host, watchLogLevel, log, getDetailWatchInfo) { + function getWatchFactory(host, watchLogLevel, log, getDetailWatchInfo2) { setSysLog(watchLogLevel === 2 /* Verbose */ ? log : noop); const plainInvokeFactory = { watchFile: (file, callback, pollingInterval, options) => host.watchFile(file, callback, pollingInterval, options), @@ -385513,7 +390193,7 @@ ${lanes.join("\n")} function createExcludeHandlingAddWatch(key) { return (file, cb, flags, options, detailInfo1, detailInfo2) => { var _a; - return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames(), ((_a = host.getCurrentDirectory) == null ? void 0 : _a.call(host)) || "") ? factory2[key].call( + return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2(), ((_a = host.getCurrentDirectory) == null ? void 0 : _a.call(host)) || "") ? factory2[key].call( /*thisArgs*/ void 0, file, @@ -385525,27 +390205,27 @@ ${lanes.join("\n")} ) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2); }; } - function useCaseSensitiveFileNames() { + function useCaseSensitiveFileNames2() { return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames(); } function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) { - log(`ExcludeWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)}`); + log(`ExcludeWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); return { - close: () => log(`ExcludeWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)}`) + close: () => log(`ExcludeWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`) }; } function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { - log(`FileWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)}`); + log(`FileWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); const watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2); return { close: () => { - log(`FileWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)}`); + log(`FileWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); watcher.close(); } }; } function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { - const watchInfo = `DirectoryWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)}`; + const watchInfo = `DirectoryWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; log(watchInfo); const start = timestamp(); const watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2); @@ -385553,7 +390233,7 @@ ${lanes.join("\n")} log(`Elapsed:: ${elapsed}ms ${watchInfo}`); return { close: () => { - const watchInfo2 = `DirectoryWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)}`; + const watchInfo2 = `DirectoryWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; log(watchInfo2); const start2 = timestamp(); watcher.close(); @@ -385568,7 +390248,7 @@ ${lanes.join("\n")} void 0, file, (...args) => { - const triggerredInfo = `${key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"}:: Triggered with ${args[0]} ${args[1] !== void 0 ? args[1] : ""}:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)}`; + const triggerredInfo = `${key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"}:: Triggered with ${args[0]} ${args[1] !== void 0 ? args[1] : ""}:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; log(triggerredInfo); const start = timestamp(); cb.call( @@ -385585,8 +390265,8 @@ ${lanes.join("\n")} detailInfo2 ); } - function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2) { - return `WatchInfo: ${file} ${flags} ${JSON.stringify(options)} ${getDetailWatchInfo2 ? getDetailWatchInfo2(detailInfo1, detailInfo2) : detailInfo2 === void 0 ? detailInfo1 : `${detailInfo1} ${detailInfo2}`}`; + function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo3) { + return `WatchInfo: ${file} ${flags} ${JSON.stringify(options)} ${getDetailWatchInfo3 ? getDetailWatchInfo3(detailInfo1, detailInfo2) : detailInfo2 === void 0 ? detailInfo1 : `${detailInfo1} ${detailInfo2}`}`; } } function getFallbackOptions(options) { @@ -385598,17 +390278,17 @@ ${lanes.join("\n")} function closeFileWatcherOf(objWithWatcher) { objWithWatcher.watcher.close(); } - var ConfigFileProgramReloadLevel, WatchLogLevel; + var ProgramUpdateLevel, WatchLogLevel; var init_watchUtilities = __esm({ "src/compiler/watchUtilities.ts"() { "use strict"; init_ts2(); - ConfigFileProgramReloadLevel = /* @__PURE__ */ ((ConfigFileProgramReloadLevel2) => { - ConfigFileProgramReloadLevel2[ConfigFileProgramReloadLevel2["None"] = 0] = "None"; - ConfigFileProgramReloadLevel2[ConfigFileProgramReloadLevel2["Partial"] = 1] = "Partial"; - ConfigFileProgramReloadLevel2[ConfigFileProgramReloadLevel2["Full"] = 2] = "Full"; - return ConfigFileProgramReloadLevel2; - })(ConfigFileProgramReloadLevel || {}); + ProgramUpdateLevel = /* @__PURE__ */ ((ProgramUpdateLevel2) => { + ProgramUpdateLevel2[ProgramUpdateLevel2["Update"] = 0] = "Update"; + ProgramUpdateLevel2[ProgramUpdateLevel2["RootNamesAndUpdate"] = 1] = "RootNamesAndUpdate"; + ProgramUpdateLevel2[ProgramUpdateLevel2["Full"] = 2] = "Full"; + return ProgramUpdateLevel2; + })(ProgramUpdateLevel || {}); WatchLogLevel = /* @__PURE__ */ ((WatchLogLevel2) => { WatchLogLevel2[WatchLogLevel2["None"] = 0] = "None"; WatchLogLevel2[WatchLogLevel2["TriggerOnly"] = 1] = "TriggerOnly"; @@ -385891,7 +390571,7 @@ ${lanes.join("\n")} function formatColorAndReset(text, formatStyle) { return formatStyle + text + resetEscapeSequence; } - function formatCodeSpan(file, start, length2, indent2, squiggleColor, host) { + function formatCodeSpan(file, start, length2, indent3, squiggleColor, host) { const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start); const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file, start + length2); const lastLineInFile = getLineAndCharacterOfPosition(file, file.text.length).line; @@ -385904,17 +390584,17 @@ ${lanes.join("\n")} for (let i = firstLine; i <= lastLine; i++) { context += host.getNewLine(); if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { - context += indent2 + formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); + context += indent3 + formatColorAndReset(ellipsis.padStart(gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); i = lastLine - 1; } const lineStart = getPositionOfLineAndCharacter(file, i, 0); const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length; let lineContent = file.text.slice(lineStart, lineEnd); - lineContent = trimStringEnd(lineContent); + lineContent = lineContent.trimEnd(); lineContent = lineContent.replace(/\t/g, " "); - context += indent2 + formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += indent3 + formatColorAndReset((i + 1 + "").padStart(gutterWidth), gutterStyleSequence) + gutterSeparator; context += lineContent + host.getNewLine(); - context += indent2 + formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += indent3 + formatColorAndReset("".padStart(gutterWidth), gutterStyleSequence) + gutterSeparator; context += squiggleColor; if (i === firstLine) { const lastCharForLine = i === lastLine ? lastLineChar : void 0; @@ -385971,24 +390651,24 @@ ${lanes.join("\n")} } return output; } - function flattenDiagnosticMessageText(diag2, newLine, indent2 = 0) { + function flattenDiagnosticMessageText(diag2, newLine, indent3 = 0) { if (isString(diag2)) { return diag2; } else if (diag2 === void 0) { return ""; } let result = ""; - if (indent2) { + if (indent3) { result += newLine; - for (let i = 0; i < indent2; i++) { + for (let i = 0; i < indent3; i++) { result += " "; } } result += diag2.messageText; - indent2++; + indent3++; if (diag2.next) { for (const kid of diag2.next) { - result += flattenDiagnosticMessageText(kid, newLine, indent2); + result += flattenDiagnosticMessageText(kid, newLine, indent3); } } return result; @@ -385996,10 +390676,8 @@ ${lanes.join("\n")} function getModeForFileReference(ref, containingFileMode) { return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode; } - function getModeForResolutionAtIndex(file, index) { - if (file.impliedNodeFormat === void 0) - return void 0; - return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index)); + function getModeForResolutionAtIndex(file, index, compilerOptions) { + return getModeForUsageLocationWorker(file, getModuleNameStringLiteralAt(file, index), compilerOptions); } function isExclusivelyTypeOnlyImportOrExport(decl) { var _a; @@ -386011,43 +390689,59 @@ ${lanes.join("\n")} } return false; } - function getModeForUsageLocation(file, usage) { - var _a, _b; - if (file.impliedNodeFormat === void 0) - return void 0; + 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); if (isTypeOnly) { - const override = getResolutionModeOverrideForClause(usage.parent.assertClause); + const override = getResolutionModeOverride(usage.parent.attributes); if (override) { return override; } } } if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) { - const override = getResolutionModeOverrideForClause((_a = usage.parent.parent.assertions) == null ? void 0 : _a.assertClause); + const override = getResolutionModeOverride(usage.parent.parent.attributes); if (override) { 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 */) { return isImportCall(walkUpParenthesizedExpressions(usage.parent)) ? 99 /* ESNext */ : 1 /* CommonJS */; } - const exprParentParent = (_b = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _b.parent; + const exprParentParent = (_a = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a.parent; return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */; } - function getResolutionModeOverrideForClause(clause, grammarErrorOnNode) { - if (!clause) + function getResolutionModeOverride(node, grammarErrorOnNode) { + if (!node) return void 0; - if (length(clause.elements) !== 1) { - grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(clause, Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require); + if (length(node.elements) !== 1) { + grammarErrorOnNode == null ? void 0 : grammarErrorOnNode( + node, + node.token === 118 /* WithKeyword */ ? Diagnostics.Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require : Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require + ); return void 0; } - const elem = clause.elements[0]; + const elem = node.elements[0]; if (!isStringLiteralLike(elem.name)) return void 0; if (elem.name.text !== "resolution-mode") { - grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(elem.name, Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions); + grammarErrorOnNode == null ? void 0 : grammarErrorOnNode( + elem.name, + node.token === 118 /* WithKeyword */ ? Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_attributes : Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions + ); return void 0; } if (!isStringLiteralLike(elem.value)) @@ -386100,7 +390794,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) { @@ -386177,15 +390871,15 @@ ${lanes.join("\n")} function isReferenceFileLocation(location) { return location.pos !== void 0; } - function getReferencedFileLocation(getSourceFileByPath, ref) { - var _a, _b, _c, _d, _e, _f; - const file = Debug.checkDefined(getSourceFileByPath(ref.file)); + function getReferencedFileLocation(program, ref) { + var _a, _b, _c, _d; + const file = Debug.checkDefined(program.getSourceFileByPath(ref.file)); const { kind, index } = ref; let pos, end, packageId, resolutionMode; switch (kind) { case 3 /* Import */: const importLiteral = getModuleNameStringLiteralAt(file, index); - packageId = (_c = (_b = (_a = file.resolvedModules) == null ? void 0 : _a.get(importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _b.resolvedModule) == null ? void 0 : _c.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); @@ -386196,7 +390890,7 @@ ${lanes.join("\n")} break; case 5 /* TypeReferenceDirective */: ({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]); - packageId = (_f = (_e = (_d = file.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _d.get(toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _e.resolvedTypeReferenceDirective) == null ? void 0 : _f.packageId; + packageId = (_d = (_c = program.getResolvedTypeReferenceDirective(file, toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _c.resolvedTypeReferenceDirective) == null ? void 0 : _d.packageId; break; case 7 /* LibReferenceDirective */: ({ pos, end } = file.libReferenceDirectives[index]); @@ -386216,7 +390910,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)) @@ -386317,6 +391012,10 @@ ${lanes.join("\n")} let automaticTypeDirectiveResolutions; let resolvedLibReferences; let resolvedLibProcessing; + let resolvedModules; + let resolvedModulesProcessing; + let resolvedTypeReferenceDirectiveNames; + let resolvedTypeReferenceDirectiveNamesProcessing; let packageMap; const maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0; let currentNodeModulesDepth = 0; @@ -386392,7 +391091,8 @@ ${lanes.join("\n")} getCanonicalFileName, /*options*/ void 0, - moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache() + moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), + moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey ); actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( typeDirectiveNames, @@ -386418,7 +391118,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; @@ -386537,12 +391237,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) { @@ -386580,13 +391278,14 @@ ${lanes.join("\n")} } oldProgram = void 0; resolvedLibProcessing = void 0; + resolvedModulesProcessing = void 0; + resolvedTypeReferenceDirectiveNamesProcessing = void 0; const program = { getRootFileNames: () => rootNames, getSourceFile, getSourceFileByPath, getSourceFiles: () => files, - getMissingFilePaths: () => missingFilePaths, - // TODO: GH#18217 + getMissingFilePaths: () => missingFileNames, getModuleResolutionCache: () => moduleResolutionCache, getFilesByNameMap: () => filesByName, getCompilerOptions: () => options, @@ -386616,12 +391315,21 @@ ${lanes.join("\n")} getAutomaticTypeDirectiveResolutions: () => automaticTypeDirectiveResolutions, isSourceFileFromExternalLibrary, isSourceFileDefaultLibrary, + getModeForUsageLocation: getModeForUsageLocation2, + getModeForResolutionAtIndex: getModeForResolutionAtIndex2, getSourceFileFromReference, getLibFileFromReference, sourceFileToPackageName, redirectTargetsMap, usesUriStyleNodeCoreModules, + resolvedModules, + resolvedTypeReferenceDirectiveNames, resolvedLibReferences, + getResolvedModule, + getResolvedModuleFromModuleSpecifier, + getResolvedTypeReferenceDirective, + forEachResolvedModule, + forEachResolvedTypeReferenceDirective, getCurrentPackagesMap: () => packageMap, typesPackageExists, packageBundlesTypes, @@ -386652,7 +391360,7 @@ ${lanes.join("\n")} case 1 /* FilePreprocessingFileExplainingDiagnostic */: return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || emptyArray)); case 0 /* FilePreprocessingReferencedDiagnostic */: - const { file, pos, end } = getReferencedFileLocation(getSourceFileByPath, diagnostic.reason); + const { file, pos, end } = getReferencedFileLocation(program, diagnostic.reason); return programDiagnostics.add(createFileDiagnostic(file, Debug.checkDefined(pos), Debug.checkDefined(end) - pos, diagnostic.diagnostic, ...diagnostic.args || emptyArray)); case 2 /* ResolutionDiagnostics */: return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d)); @@ -386665,17 +391373,39 @@ ${lanes.join("\n")} measure("Program", "beforeProgram", "afterProgram"); (_p = tracing) == null ? void 0 : _p.pop(); return program; + function getResolvedModule(file, moduleName, mode) { + 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); + } + function forEachResolvedModule(callback, file) { + forEachResolution(resolvedModules, callback, file); + } + function forEachResolvedTypeReferenceDirective(callback, file) { + forEachResolution(resolvedTypeReferenceDirectiveNames, callback, file); + } + function forEachResolution(resolutionCache, callback, file) { + var _a2; + if (file) + (_a2 = resolutionCache == null ? void 0 : resolutionCache.get(file.path)) == null ? void 0 : _a2.forEach((resolution, name, mode) => callback(resolution, name, mode, file.path)); + else + resolutionCache == null ? void 0 : resolutionCache.forEach((resolutions, filePath) => resolutions.forEach((resolution, name, mode) => callback(resolution, name, mode, filePath))); + } function getPackagesMap() { if (packageMap) return packageMap; packageMap = /* @__PURE__ */ new Map(); - files.forEach((sf) => { - if (!sf.resolvedModules) - return; - sf.resolvedModules.forEach(({ resolvedModule }) => { - if (resolvedModule == null ? void 0 : resolvedModule.packageId) - packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name)); - }); + forEachResolvedModule(({ resolvedModule }) => { + if (resolvedModule == null ? void 0 : resolvedModule.packageId) + packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name)); }); return packageMap; } @@ -386742,7 +391472,7 @@ ${lanes.join("\n")} const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path); if (resultFromDts) return resultFromDts; - if (!host.realpath || !options.preserveSymlinks || !stringContains(file.originalFileName, nodeModulesPathPart)) + if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart)) return void 0; const realDeclarationPath = toPath3(host.realpath(file.originalFileName)); return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath); @@ -386808,7 +391538,6 @@ ${lanes.join("\n")} return classifiableNames; } function resolveModuleNamesReusingOldState(moduleNames, file) { - var _a2; if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { return resolveModuleNamesWorker( moduleNames, @@ -386817,24 +391546,15 @@ ${lanes.join("\n")} void 0 ); } - const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName); - if (oldSourceFile !== file && file.resolvedModules) { - const result2 = []; - for (const moduleName of moduleNames) { - const resolvedModule = file.resolvedModules.get(moduleName.text, getModeForUsageLocation(file, moduleName)); - result2.push(resolvedModule); - } - return result2; - } let unknownModuleNames; let result; let reusedNames; const predictedToResolveToAmbientModuleMarker = emptyResolution; + const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName); for (let i = 0; i < moduleNames.length; i++) { const moduleName = moduleNames[i]; - if (file === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path)) { - const mode = getModeForUsageLocation(file, moduleName); - const oldResolution = (_a2 = oldSourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleName.text, mode); + if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) { + 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( @@ -386881,7 +391601,8 @@ ${lanes.join("\n")} Debug.assert(j === resolutions.length); return result; function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) { - const resolutionToFile = getResolvedModule(oldSourceFile, moduleName.text, getModeForUsageLocation(file, moduleName)); + var _a2; + 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; @@ -386906,28 +391627,18 @@ ${lanes.join("\n")} void 0 ); } - const oldSourceFile = !isString(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : void 0; - if (!isString(containingFile)) { - if (oldSourceFile !== containingFile && containingFile.resolvedTypeReferenceDirectiveNames) { - const result2 = []; - for (const typeDirectiveName of typeDirectiveNames) { - const resolvedTypeReferenceDirective = containingFile.resolvedTypeReferenceDirectiveNames.get(getTypeReferenceResolutionName(typeDirectiveName), getModeForFileReference(typeDirectiveName, containingFile.impliedNodeFormat)); - result2.push(resolvedTypeReferenceDirective); - } - return result2; - } - } let unknownTypeReferenceDirectiveNames; let result; let reusedNames; const containingSourceFile = !isString(containingFile) ? containingFile : void 0; - const canReuseResolutions = !isString(containingFile) ? containingFile === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path) : !hasInvalidatedResolutions(toPath3(containingFile)); + const oldSourceFile = !isString(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : void 0; + const canReuseResolutions = !isString(containingFile) ? containingFile === oldSourceFile && !hasInvalidatedResolutions(containingFile.path) : !hasInvalidatedResolutions(toPath3(containingFile)); for (let i = 0; i < typeDirectiveNames.length; i++) { const entry = typeDirectiveNames[i]; if (canReuseResolutions) { const typeDirectiveName = getTypeReferenceResolutionName(entry); const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat); - const oldResolution = (_a2 = !isString(containingFile) ? oldSourceFile == null ? void 0 : oldSourceFile.resolvedTypeReferenceDirectiveNames : oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(typeDirectiveName, mode); + const oldResolution = !isString(containingFile) ? oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(containingFile, typeDirectiveName, mode) : (_a2 = oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(typeDirectiveName, mode); if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) { if (isTraceEnabled(options, host)) { trace( @@ -387008,7 +391719,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(); @@ -387026,13 +391737,13 @@ ${lanes.join("\n")} sourceFileOptions, /*onError*/ void 0, - shouldCreateNewSourceFile || sourceFileOptions.impliedNodeFormat !== oldSourceFile.impliedNodeFormat + shouldCreateNewSourceFile ) : host.getSourceFile( oldSourceFile.fileName, sourceFileOptions, /*onError*/ void 0, - shouldCreateNewSourceFile || sourceFileOptions.impliedNodeFormat !== oldSourceFile.impliedNodeFormat + shouldCreateNewSourceFile ); if (!newSourceFile) { return 0 /* Not */; @@ -387083,49 +391794,49 @@ ${lanes.join("\n")} structureIsReused = 1 /* SafeModules */; } else if (!arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { structureIsReused = 1 /* SafeModules */; - } else if ((oldSourceFile.flags & 6291456 /* PermanentlySetIncrementalFlags */) !== (newSourceFile.flags & 6291456 /* PermanentlySetIncrementalFlags */)) { + } else if ((oldSourceFile.flags & 12582912 /* PermanentlySetIncrementalFlags */) !== (newSourceFile.flags & 12582912 /* PermanentlySetIncrementalFlags */)) { structureIsReused = 1 /* SafeModules */; } else if (!arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { structureIsReused = 1 /* SafeModules */; } } - modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); + modifiedSourceFiles.push(newSourceFile); } else if (hasInvalidatedResolutions(oldSourceFile.path)) { structureIsReused = 1 /* SafeModules */; - modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); + modifiedSourceFiles.push(newSourceFile); + } else { + for (const moduleName of oldSourceFile.ambientModuleNames) { + ambientModuleNameToUnmodifiedFileName.set(moduleName, oldSourceFile.fileName); + } } newSourceFiles.push(newSourceFile); } if (structureIsReused !== 2 /* Completely */) { return structureIsReused; } - const modifiedFiles = modifiedSourceFiles.map((f) => f.oldFile); - for (const oldFile of oldSourceFiles) { - if (!contains(modifiedFiles, oldFile)) { - for (const moduleName of oldFile.ambientModuleNames) { - ambientModuleNameToUnmodifiedFileName.set(moduleName, oldFile.fileName); - } - } - } - for (const { oldFile: oldSourceFile, newFile: newSourceFile } of modifiedSourceFiles) { + for (const newSourceFile of modifiedSourceFiles) { const moduleNames = getModuleNames(newSourceFile); const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); - const resolutionsChanged = hasChangesInResolutions(moduleNames, newSourceFile, resolutions, oldSourceFile.resolvedModules, moduleResolutionIsEqualTo, moduleResolutionNameAndModeGetter); - if (resolutionsChanged) { + (resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions); + const resolutionsChanged = hasChangesInResolutions( + moduleNames, + resolutions, + (name) => oldProgram.getResolvedModule(newSourceFile, name.text, getModeForUsageLocation2(newSourceFile, name)), + moduleResolutionIsEqualTo + ); + if (resolutionsChanged) structureIsReused = 1 /* SafeModules */; - newSourceFile.resolvedModules = zipToModeAwareCache(newSourceFile, moduleNames, resolutions, moduleResolutionNameAndModeGetter); - } else { - newSourceFile.resolvedModules = oldSourceFile.resolvedModules; - } const typesReferenceDirectives = newSourceFile.typeReferenceDirectives; const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile); - const typeReferenceResolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, newSourceFile, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, typeDirectiveIsEqualTo, typeReferenceResolutionNameAndModeGetter); - if (typeReferenceResolutionsChanged) { + (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions); + const typeReferenceResolutionsChanged = hasChangesInResolutions( + typesReferenceDirectives, + typeReferenceResolutions, + (name) => oldProgram.getResolvedTypeReferenceDirective(newSourceFile, getTypeReferenceResolutionName(name), getModeForFileReference(name, newSourceFile.impliedNodeFormat)), + typeDirectiveIsEqualTo + ); + if (typeReferenceResolutionsChanged) structureIsReused = 1 /* SafeModules */; - newSourceFile.resolvedTypeReferenceDirectiveNames = zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions, typeReferenceResolutionNameAndModeGetter); - } else { - newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; - } } if (structureIsReused !== 2 /* Completely */) { return structureIsReused; @@ -387144,7 +391855,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); @@ -387172,6 +391883,8 @@ ${lanes.join("\n")} sourceFileToPackageName = oldProgram.sourceFileToPackageName; redirectTargetsMap = oldProgram.redirectTargetsMap; usesUriStyleNodeCoreModules = oldProgram.usesUriStyleNodeCoreModules; + resolvedModules = oldProgram.resolvedModules; + resolvedTypeReferenceDirectiveNames = oldProgram.resolvedTypeReferenceDirectiveNames; resolvedLibReferences = oldProgram.resolvedLibReferences; packageMap = oldProgram.getCurrentPackagesMap(); return 2 /* Completely */; @@ -387199,7 +391912,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); }, @@ -387474,89 +392187,97 @@ ${lanes.join("\n")} return diagnostics; function walk(node, parent2) { switch (parent2.kind) { - case 168 /* Parameter */: - case 171 /* PropertyDeclaration */: - case 173 /* MethodDeclaration */: + case 169 /* Parameter */: + case 172 /* PropertyDeclaration */: + case 174 /* MethodDeclaration */: if (parent2.questionToken === node) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } - case 172 /* MethodSignature */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 217 /* FunctionExpression */: - case 261 /* FunctionDeclaration */: - case 218 /* ArrowFunction */: - case 259 /* VariableDeclaration */: + case 173 /* MethodSignature */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 219 /* ArrowFunction */: + case 260 /* VariableDeclaration */: if (parent2.type === node) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); return "skip"; } } switch (node.kind) { - case 272 /* ImportClause */: + case 273 /* ImportClause */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode2(parent2, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 275 /* ImportSpecifier */: - case 280 /* ExportSpecifier */: + case 276 /* ImportSpecifier */: + case 281 /* ExportSpecifier */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, isImportSpecifier(node) ? "import...type" : "export...type")); return "skip"; } break; - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode2(node, Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 297 /* HeritageClause */: + case 298 /* HeritageClause */: const heritageClause = node; if (heritageClause.token === 119 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode2(node, Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: const interfaceKeyword = tokenToString(120 /* InterfaceKeyword */); Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 266 /* ModuleDeclaration */: - const moduleKeyword = node.flags & 16 /* Namespace */ ? tokenToString(145 /* NamespaceKeyword */) : tokenToString(144 /* ModuleKeyword */); + case 267 /* ModuleDeclaration */: + const moduleKeyword = node.flags & 32 /* Namespace */ ? tokenToString(145 /* NamespaceKeyword */) : tokenToString(144 /* ModuleKeyword */); Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 264 /* TypeAliasDeclaration */: + case 265 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 265 /* EnumDeclaration */: + case 176 /* Constructor */: + case 174 /* MethodDeclaration */: + case 262 /* FunctionDeclaration */: + if (!node.body) { + diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + return; + case 266 /* EnumDeclaration */: const enumKeyword = Debug.checkDefined(tokenToString(94 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 234 /* NonNullExpression */: + case 235 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 233 /* AsExpression */: + case 234 /* AsExpression */: diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 237 /* SatisfiesExpression */: + case 238 /* SatisfiesExpression */: diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 215 /* TypeAssertionExpression */: + case 216 /* TypeAssertionExpression */: Debug.fail(); } } @@ -387591,26 +392312,26 @@ ${lanes.join("\n")} } } switch (parent2.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 173 /* MethodDeclaration */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 217 /* FunctionExpression */: - case 261 /* FunctionDeclaration */: - case 218 /* ArrowFunction */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 174 /* MethodDeclaration */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 219 /* ArrowFunction */: if (nodes === parent2.typeParameters) { diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: if (nodes === parent2.modifiers) { - checkModifiers(parent2.modifiers, parent2.kind === 242 /* VariableStatement */); + checkModifiers(parent2.modifiers, parent2.kind === 243 /* VariableStatement */); return "skip"; } break; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: if (nodes === parent2.modifiers) { for (const modifier of nodes) { if (isModifier(modifier) && modifier.kind !== 126 /* StaticKeyword */ && modifier.kind !== 129 /* AccessorKeyword */) { @@ -387620,18 +392341,18 @@ ${lanes.join("\n")} return "skip"; } break; - case 168 /* Parameter */: + case 169 /* Parameter */: if (nodes === parent2.modifiers && some(nodes, isModifier)) { diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 232 /* ExpressionWithTypeArguments */: - case 284 /* JsxSelfClosingElement */: - case 285 /* JsxOpeningElement */: - case 214 /* TaggedTemplateExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 233 /* ExpressionWithTypeArguments */: + case 285 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 215 /* TaggedTemplateExpression */: if (nodes === parent2.typeArguments) { diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); return "skip"; @@ -387652,7 +392373,7 @@ ${lanes.join("\n")} case 148 /* ReadonlyKeyword */: case 138 /* DeclareKeyword */: case 128 /* AbstractKeyword */: - case 163 /* OverrideKeyword */: + case 164 /* OverrideKeyword */: case 103 /* InKeyword */: case 147 /* OutKeyword */: diagnostics.push(createDiagnosticForNode2(modifier, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, tokenToString(modifier.kind))); @@ -387744,14 +392465,14 @@ ${lanes.join("\n")} /*importClause*/ void 0, externalHelpersModuleReference, - /*assertClause*/ + /*attributes*/ void 0 ); addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */); setParent(externalHelpersModuleReference, importDecl); setParent(importDecl, file); - externalHelpersModuleReference.flags &= ~8 /* Synthesized */; - importDecl.flags &= ~8 /* Synthesized */; + externalHelpersModuleReference.flags &= ~16 /* Synthesized */; + importDecl.flags &= ~16 /* Synthesized */; return externalHelpersModuleReference; } function collectExternalModuleReferences(file) { @@ -387779,8 +392500,7 @@ ${lanes.join("\n")} false ); } - const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options); - if (file.flags & 2097152 /* PossiblyContainsDynamicImport */ || shouldProcessRequires) { + if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) { collectDynamicImportOrRequireCalls(file); } file.imports = imports || emptyArray; @@ -387802,7 +392522,7 @@ ${lanes.join("\n")} } } } else if (isModuleDeclaration(node)) { - if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node, 2 /* Ambient */) || file.isDeclarationFile)) { + if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier(node, 128 /* Ambient */) || file.isDeclarationFile)) { node.name.parent = node; const nameText = getTextOfIdentifierOrLiteral(node.name); if (isExternalModuleFile || inAmbientModule && !isExternalModuleNameRelative(nameText)) { @@ -387829,7 +392549,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 @@ -387985,14 +392705,14 @@ ${lanes.join("\n")} const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2); const languageVersion = getEmitScriptTarget(options2); const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2); - return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 }; + return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode }; } function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) { - var _a2, _b2; + var _a2; const path = toPath3(fileName); if (useSourceOfProjectReferenceRedirect) { let source = getSourceOfProjectReferenceRedirect(path); - if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && stringContains(fileName, nodeModulesPathPart)) { + if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) { const realPath2 = toPath3(host.realpath(fileName)); if (realPath2 !== path) source = getSourceOfProjectReferenceRedirect(realPath2); @@ -388003,6 +392723,7 @@ ${lanes.join("\n")} addFileToFilesByName( file2, path, + fileName, /*redirectedPath*/ void 0 ); @@ -388067,7 +392788,7 @@ ${lanes.join("\n")} Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage] ), - shouldCreateNewSourceFile || ((_a2 = oldProgram == null ? void 0 : oldProgram.getSourceFileByPath(toPath3(fileName))) == null ? void 0 : _a2.impliedNodeFormat) !== sourceFileOptions.impliedNodeFormat + shouldCreateNewSourceFile ); if (packageId) { const packageIdKey = packageIdToString(packageId); @@ -388075,7 +392796,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); @@ -388085,14 +392806,14 @@ ${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; file.path = path; file.resolvedPath = toPath3(fileName); file.originalFileName = originalFileName; - file.packageJsonLocations = ((_b2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _b2.length) ? sourceFileOptions.packageJsonLocations : void 0; + file.packageJsonLocations = ((_a2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a2.length) ? sourceFileOptions.packageJsonLocations : void 0; file.packageJsonScope = sourceFileOptions.packageJsonScope; addFileIncludeReason(file, reason); if (host.useCaseSensitiveFileNames()) { @@ -388125,14 +392846,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); @@ -388209,25 +392937,17 @@ ${lanes.join("\n")} } function processTypeReferenceDirectives(file) { const typeDirectives = file.typeReferenceDirectives; - if (!typeDirectives.length) { - file.resolvedTypeReferenceDirectiveNames = void 0; + if (!typeDirectives.length) return; - } - const resolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file); + const resolutions = (resolvedTypeReferenceDirectiveNamesProcessing == null ? void 0 : resolvedTypeReferenceDirectiveNamesProcessing.get(file.path)) || resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file); + const resolutionsInFile = createModeAwareCache(); + (resolvedTypeReferenceDirectiveNames ?? (resolvedTypeReferenceDirectiveNames = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile); for (let index = 0; index < typeDirectives.length; index++) { const ref = file.typeReferenceDirectives[index]; const resolvedTypeReferenceDirective = resolutions[index]; const fileName = toFileNameLowerCase(ref.fileName); - setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective, getModeForFileReference(ref, file.impliedNodeFormat)); + resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective); const mode = ref.resolutionMode || file.impliedNodeFormat; - if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) { - (fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({ - kind: 2 /* ResolutionDiagnostics */, - diagnostics: [ - createDiagnosticForRange(file, ref, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext) - ] - }); - } processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index }); } } @@ -388382,27 +393102,29 @@ ${lanes.join("\n")} collectExternalModuleReferences(file); if (file.imports.length || file.moduleAugmentations.length) { const moduleNames = getModuleNames(file); - const resolutions = resolveModuleNamesReusingOldState(moduleNames, 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]); - setResolvedModule(file, moduleName, resolutions[index], mode); + const mode = getModeForUsageLocationWorker(file, moduleNames[index], optionsForFile); + resolutionsInFile.set(moduleName, mode, resolutions[index]); addResolutionDiagnosticsFromResolutionOrCache(file, moduleName, resolutions[index], mode); if (!resolution) { continue; } 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++; } const elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth; - const shouldAddFile = resolvedFileName && !getResolutionDiagnostic(optionsForFile, resolution, file) && !optionsForFile.noResolve && index < file.imports.length && !elideImport && !(isJsFile && !getAllowJSCompilerOption(optionsForFile)) && (isInJSFile(file.imports[index]) || !(file.imports[index].flags & 8388608 /* JSDoc */)); + const shouldAddFile = resolvedFileName && !getResolutionDiagnostic(optionsForFile, resolution, file) && !optionsForFile.noResolve && index < file.imports.length && !elideImport && !(isJsFile && !getAllowJSCompilerOption(optionsForFile)) && (isInJSFile(file.imports[index]) || !(file.imports[index].flags & 16777216 /* JSDoc */)); if (elideImport) { modulesWithElidedImports.set(file.path, true); } else if (shouldAddFile) { @@ -388420,8 +393142,6 @@ ${lanes.join("\n")} currentNodeModulesDepth--; } } - } else { - file.resolvedModules = void 0; } } function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { @@ -388461,6 +393181,7 @@ ${lanes.join("\n")} /*file*/ void 0, sourceFilePath, + refPath, /*redirectedPath*/ void 0 ); @@ -388472,6 +393193,7 @@ ${lanes.join("\n")} addFileToFilesByName( sourceFile, sourceFilePath, + refPath, /*redirectedPath*/ void 0 ); @@ -388481,6 +393203,7 @@ ${lanes.join("\n")} addFileToFilesByName( sourceFile, sourceFilePath, + refPath, /*redirectedPath*/ void 0 ); @@ -388667,7 +393390,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 @@ -388731,7 +393454,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) { @@ -388758,8 +393481,15 @@ ${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]; + createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, moduleKindName, moduleKindName); + } else if (ModuleResolutionKind[moduleResolution] && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */) && !(100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */)) { + const moduleResolutionName = ModuleResolutionKind[moduleResolution]; + createOptionValueDiagnostic("module", Diagnostics.Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1, moduleResolutionName, moduleResolutionName); } if (!options.noEmit && !options.suppressOutputPathCheck) { const emitHost = getEmitHost(); @@ -388929,7 +393659,7 @@ ${lanes.join("\n")} processReason(fileProcessingReason); if (locationReason && (fileIncludeReasons == null ? void 0 : fileIncludeReasons.length) === 1) fileIncludeReasons = void 0; - const location = locationReason && getReferencedFileLocation(getSourceFileByPath, locationReason); + const location = locationReason && getReferencedFileLocation(program, locationReason); const fileIncludeReasonDetails = fileIncludeReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon); const redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file); const chain = chainDiagnosticMessages(redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails, diagnostic, ...args || emptyArray); @@ -388965,7 +393695,7 @@ ${lanes.join("\n")} } function fileIncludeReasonToRelatedInformation(reason) { if (isReferencedFile(reason)) { - const referenceLocation = getReferencedFileLocation(getSourceFileByPath, reason); + const referenceLocation = getReferencedFileLocation(program, reason); let message2; switch (reason.kind) { case 3 /* Import */: @@ -389014,19 +393744,11 @@ ${lanes.join("\n")} case 1 /* SourceFromProjectReference */: case 2 /* OutputFromProjectReference */: const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]); - const referenceInfo = forEachProjectReference( - projectReferences, - resolvedProjectReferences, - (resolvedRef, parent2, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent2 == null ? void 0 : parent2.sourceFile) || options.configFile, index: index2 } : void 0 - ); + const referenceInfo = forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent2, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent2 == null ? void 0 : parent2.sourceFile) || options.configFile, index: index2 } : void 0); if (!referenceInfo) return void 0; const { sourceFile, index } = referenceInfo; - const referencesSyntax = forEachTsConfigPropArray( - sourceFile, - "references", - (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 - ); + const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0); return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile( sourceFile, referencesSyntax.elements[index], @@ -389166,11 +393888,7 @@ ${lanes.join("\n")} ); } function createDiagnosticForReference(sourceFile, index, message, ...args) { - const referencesSyntax = forEachTsConfigPropArray( - sourceFile || options.configFile, - "references", - (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0 - ); + const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0); if (referencesSyntax && referencesSyntax.elements.length > index) { programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, ...args)); } else { @@ -389266,11 +393984,19 @@ ${lanes.join("\n")} if (!symlinks) { symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName); } - if (files && automaticTypeDirectiveResolutions && !symlinks.hasProcessedResolutions()) { - symlinks.setSymlinksFromResolutions(files, automaticTypeDirectiveResolutions); + if (files && !symlinks.hasProcessedResolutions()) { + symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions); } 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; @@ -389357,7 +394083,7 @@ ${lanes.join("\n")} var _a; if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory)) return; - if (!originalRealpath || !stringContains(directory, nodeModulesPathPart)) + if (!originalRealpath || !directory.includes(nodeModulesPathPart)) return; const symlinkCache = host.getSymlinkCache(); const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory)); @@ -389385,7 +394111,7 @@ ${lanes.join("\n")} if (!symlinkedDirectories) return false; const fileOrDirectoryPath = host.toPath(fileOrDirectory); - if (!stringContains(fileOrDirectoryPath, nodeModulesPathPart)) + if (!fileOrDirectoryPath.includes(nodeModulesPathPart)) return false; if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath))) return true; @@ -389450,6 +394176,9 @@ ${lanes.join("\n")} return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth); }, readFile: (f) => directoryStructureHost.readFile(f), + directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists), + getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories), + realpath: maybeBind(directoryStructureHost, directoryStructureHost.realpath), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(), getCurrentDirectory: () => host.getCurrentDirectory(), onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || returnUndefined, @@ -389564,7 +394293,7 @@ ${lanes.join("\n")} }; moduleResolutionNameAndModeGetter = { getName: getModuleResolutionName, - getMode: (entry, file) => getModeForUsageLocation(file, entry) + getMode: (entry, file, compilerOptions) => getModeForUsageLocation(file, entry, compilerOptions) }; typeReferenceResolutionNameAndModeGetter = { getName: getTypeReferenceResolutionName, @@ -389625,8 +394354,8 @@ ${lanes.join("\n")} Diagnostics.Classes_may_not_have_a_field_named_constructor.code, 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, Diagnostics.Duplicate_label_0.code, - Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code, - Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code, + Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code, + Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code, Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code, @@ -389656,14 +394385,17 @@ ${lanes.join("\n")} Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code, Diagnostics._0_modifier_cannot_be_used_here.code, Diagnostics._0_modifier_must_precede_1_modifier.code, - Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code, - Diagnostics.const_declarations_must_be_initialized.code, + Diagnostics._0_declarations_can_only_be_declared_inside_a_block.code, + Diagnostics._0_declarations_must_be_initialized.code, Diagnostics.extends_clause_already_seen.code, - Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code, Diagnostics.Class_constructor_may_not_be_a_generator.code, Diagnostics.Class_constructor_may_not_be_an_accessor.code, - Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code + 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.Private_field_0_must_be_declared_in_an_enclosing_class.code, + // Type errors + Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code ]); emitSkippedWithNoDiagnostics = { diagnostics: emptyArray, sourceMaps: void 0, emittedFiles: void 0, emitSkipped: true }; } @@ -389781,16 +394513,14 @@ ${lanes.join("\n")} addReferencedFile(referencedPath); } } - if (sourceFile.resolvedTypeReferenceDirectiveNames) { - sourceFile.resolvedTypeReferenceDirectiveNames.forEach(({ resolvedTypeReferenceDirective }) => { - if (!resolvedTypeReferenceDirective) { - return; - } - const fileName = resolvedTypeReferenceDirective.resolvedFileName; - const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName); - addReferencedFile(typeFilePath); - }); - } + program.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective }) => { + if (!resolvedTypeReferenceDirective) { + return; + } + const fileName = resolvedTypeReferenceDirective.resolvedFileName; + const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(typeFilePath); + }, sourceFile); if (sourceFile.moduleAugmentations.length) { const checker = program.getTypeChecker(); for (const moduleName of sourceFile.moduleAugmentations) { @@ -389909,13 +394639,16 @@ ${lanes.join("\n")} sourceFile, (fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => { Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`); - onNewSignature(computeSignatureWithDiagnostics( - programOfThisState, - sourceFile, - text, - host, - data - ), sourceFiles); + onNewSignature( + computeSignatureWithDiagnostics( + programOfThisState, + sourceFile, + text, + host, + data + ), + sourceFiles + ); }, cancellationToken, /*emitOnly*/ @@ -390162,6 +394895,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 @@ -390171,22 +394905,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) { @@ -390323,7 +395063,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) { @@ -390334,6 +395076,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; } @@ -390424,15 +395168,28 @@ ${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; const program = Debug.checkDefined(state.program); const options = program.getCompilerOptions(); - forEach( - program.getSourceFiles(), - (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath) - ); + forEach(program.getSourceFiles(), (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath)); } } function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) { @@ -390500,12 +395257,14 @@ ${lanes.join("\n")} state.program, /*firstSourceFile*/ void 0 - ).forEach((file) => handleDtsMayChangeOf( - state, - file.resolvedPath, - cancellationToken, - host - )); + ).forEach( + (file) => handleDtsMayChangeOf( + state, + file.resolvedPath, + cancellationToken, + host + ) + ); removeDiagnosticsOfLibraryFiles(state); return true; } @@ -390538,16 +395297,13 @@ ${lanes.join("\n")} if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, host)) return true; const references = state.referencedMap.getKeys(exportedFromPath); - return references && forEachKey( - references, - (filePath) => handleDtsMayChangeOfFileAndExportsOfFile( - state, - filePath, - seenFileAndExportsOfFile, - cancellationToken, - host - ) - ); + return references && forEachKey(references, (filePath) => handleDtsMayChangeOfFileAndExportsOfFile( + state, + filePath, + seenFileAndExportsOfFile, + cancellationToken, + host + )); }); } function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, host) { @@ -390655,11 +395411,13 @@ ${lanes.join("\n")} if (!isJsonSourceFile(file) && sourceFileMayBeEmitted(file, state.program)) { const emitSignature = (_b2 = state.emitSignatures) == null ? void 0 : _b2.get(key); if (emitSignature !== actualSignature) { - (emitSignatures || (emitSignatures = [])).push(emitSignature === void 0 ? fileId : ( - // There is no emit, encode as false - // fileId, signature: emptyArray if signature only differs in dtsMap option than our own compilerOptions otherwise EmitSignature - [fileId, !isString(emitSignature) && emitSignature[0] === actualSignature ? emptyArray : emitSignature] - )); + (emitSignatures || (emitSignatures = [])).push( + emitSignature === void 0 ? fileId : ( + // There is no emit, encode as false + // fileId, signature: emptyArray if signature only differs in dtsMap option than our own compilerOptions otherwise EmitSignature + [fileId, !isString(emitSignature) && emitSignature[0] === actualSignature ? emptyArray : emitSignature] + ) + ); } } } @@ -390702,18 +395460,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); @@ -390743,6 +395490,7 @@ ${lanes.join("\n")} (changeFileSet || (changeFileSet = [])).push(toFileId(path)); } } + const emitDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.emitDiagnosticsPerFile); const program = { fileNames, fileInfos, @@ -390752,6 +395500,7 @@ ${lanes.join("\n")} referencedMap, exportedModulesMap, semanticDiagnosticsPerFile, + emitDiagnosticsPerFile, affectedFilesPendingEmit, changeFileSet, emitSignatures, @@ -390808,73 +395557,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; @@ -390913,9 +395676,7 @@ ${lanes.join("\n")} text = getTextHandlingSourceMapForSignature(text, data); let sourceFileDirectory; if ((_a = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a.length) { - text += data.diagnostics.map( - (diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}` - ).join("\n"); + text += data.diagnostics.map((diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}`).join("\n"); } return (host.createHash ?? generateDjb2Hash)(text); function flattenDiagnosticMessageText2(diagnostic) { @@ -390985,6 +395746,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; @@ -391033,6 +395802,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(); } @@ -391205,9 +395976,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 }; @@ -391272,7 +396044,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)), @@ -391322,11 +396095,12 @@ ${lanes.join("\n")} return void 0; } const map2 = BuilderState.createManyToManyPathMap(); - referenceMap.forEach( - ([fileId, fileIdListId]) => map2.set(toFilePath(fileId), toFilePathsSet(fileIdListId)) - ); + 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())); @@ -391430,24 +396204,27 @@ ${lanes.join("\n")} if (endsWith(path, "/node_modules/.staging")) { return removeSuffix(path, "/.staging"); } - return some(ignoredPaths, (searchPath) => stringContains(path, searchPath)) ? void 0 : path; + return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path; } function perceivedOsRootLengthForWatching(pathComponents2, length2) { if (length2 <= 1) return 1; - let userCheckIndex = 1; + let indexAfterOsRoot = 1; let isDosStyle = pathComponents2[0].search(/[a-zA-Z]:/) === 0; if (pathComponents2[0] !== directorySeparator && !isDosStyle && // Non dos style paths pathComponents2[1].search(/[a-zA-Z]\$$/) === 0) { if (length2 === 2) return 2; - userCheckIndex = 2; + indexAfterOsRoot = 2; isDosStyle = true; } - if (isDosStyle && !pathComponents2[userCheckIndex].match(/^users$/i)) { - return userCheckIndex; + if (isDosStyle && !pathComponents2[indexAfterOsRoot].match(/^users$/i)) { + return indexAfterOsRoot; } - return userCheckIndex + 2; + if (pathComponents2[indexAfterOsRoot].match(/^workspaces$/i)) { + return indexAfterOsRoot + 1; + } + return indexAfterOsRoot + 2; } function canWatchDirectoryOrFile(pathComponents2, length2) { if (length2 === void 0) @@ -391550,6 +396327,50 @@ ${lanes.join("\n")} function getRootPathSplitLength(rootPath) { return rootPath.split(directorySeparator).length - (hasTrailingDirectorySeparator(rootPath) ? 1 : 0); } + function getModuleResolutionHost(resolutionHost) { + var _a; + return ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost; + } + function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) { + return { + nameAndMode: moduleResolutionNameAndModeGetter, + resolve: (moduleName, resoluionMode) => resolveModuleNameUsingGlobalCache( + resolutionHost, + moduleResolutionCache, + moduleName, + containingFile, + options, + redirectedReference, + resoluionMode + ) + }; + } + function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) { + const host = getModuleResolutionHost(resolutionHost); + const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode); + if (!resolutionHost.getGlobalCache) { + return primaryResult; + } + const globalCache = resolutionHost.getGlobalCache(); + if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) { + const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache( + Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), + resolutionHost.projectName, + compilerOptions, + host, + globalCache, + moduleResolutionCache + ); + if (resolvedModule) { + primaryResult.resolvedModule = resolvedModule; + primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations); + primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations); + primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics); + return primaryResult; + } + } + return primaryResult; + } function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { let filesWithChangedSetOfUnresolvedImports; let filesWithInvalidatedResolutions; @@ -391579,7 +396400,8 @@ ${lanes.join("\n")} getCurrentDirectory(), resolutionHost.getCanonicalFileName, resolutionHost.getCompilationSettings(), - moduleResolutionCache.getPackageJsonInfoCache() + moduleResolutionCache.getPackageJsonInfoCache(), + moduleResolutionCache.optionsToRedirectsKey ); const resolvedLibraries = /* @__PURE__ */ new Map(); const libraryResolutionCache = createModuleResolutionCache( @@ -391595,6 +396417,16 @@ ${lanes.join("\n")} const rootPathComponents = getPathComponents(rootPath); const typeRootsWatches = /* @__PURE__ */ new Map(); return { + rootDirForResolution, + resolvedModuleNames, + resolvedTypeReferenceDirectives, + resolvedLibraries, + resolvedFileToResolution, + resolutionsWithFailedLookups, + resolutionsWithOnlyAffectingLocations, + directoryWatchesOfFailedLookups, + fileWatchesOfAffectingLocations, + watchFailedLookupLocationsOfExternalModuleResolutions, getModuleResolutionCache: () => moduleResolutionCache, startRecordingFilesWithChangedResolutions, finishRecordingFilesWithChangedResolutions, @@ -391619,10 +396451,10 @@ ${lanes.join("\n")} clear: clear2, onChangesAffectModuleResolution }; - function getResolvedModule2(resolution) { + function getResolvedModule(resolution) { return resolution.resolvedModule; } - function getResolvedTypeReferenceDirective2(resolution) { + function getResolvedTypeReferenceDirective(resolution) { return resolution.resolvedTypeReferenceDirective; } function clear2() { @@ -391685,6 +396517,10 @@ ${lanes.join("\n")} }; } function startCachingPerDirectoryResolution() { + moduleResolutionCache.isReadonly = void 0; + typeReferenceDirectiveResolutionCache.isReadonly = void 0; + libraryResolutionCache.isReadonly = void 0; + moduleResolutionCache.getPackageJsonInfoCache().isReadonly = void 0; moduleResolutionCache.clearAllExceptPackageJsonInfoCache(); typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache(); libraryResolutionCache.clearAllExceptPackageJsonInfoCache(); @@ -391697,8 +396533,8 @@ ${lanes.join("\n")} if (!((_a = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a.has(libFileName))) { stopWatchFailedLookupLocationOfResolution( resolution, - resolutionHost.toPath(getInferredLibraryNameResolveFrom(newProgram.getCompilerOptions(), getCurrentDirectory(), libFileName)), - getResolvedModule2 + resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)), + getResolvedModule ); resolvedLibraries.delete(libFileName); } @@ -391739,58 +396575,26 @@ ${lanes.join("\n")} } }); } - directoryWatchesOfFailedLookups.forEach((watcher, path) => { - if (watcher.refCount === 0) { - directoryWatchesOfFailedLookups.delete(path); - watcher.watcher.close(); - } - }); - fileWatchesOfAffectingLocations.forEach((watcher, path) => { - if (watcher.files === 0 && watcher.resolutions === 0) { - fileWatchesOfAffectingLocations.delete(path); - watcher.watcher.close(); - } - }); + directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup); + fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation); hasChangedAutomaticTypeDirectiveNames = false; + moduleResolutionCache.isReadonly = true; + typeReferenceDirectiveResolutionCache.isReadonly = true; + libraryResolutionCache.isReadonly = true; + moduleResolutionCache.getPackageJsonInfoCache().isReadonly = true; } - function resolveModuleName2(moduleName, containingFile, compilerOptions, redirectedReference, mode) { - var _a; - const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost; - const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode); - if (!resolutionHost.getGlobalCache) { - return primaryResult; + function closeDirectoryWatchesOfFailedLookup(watcher, path) { + if (watcher.refCount === 0) { + directoryWatchesOfFailedLookups.delete(path); + watcher.watcher.close(); } - const globalCache = resolutionHost.getGlobalCache(); - if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) { - const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache( - Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), - resolutionHost.projectName, - compilerOptions, - host, - globalCache, - moduleResolutionCache - ); - if (resolvedModule) { - primaryResult.resolvedModule = resolvedModule; - primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations); - primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations); - primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics); - return primaryResult; - } - } - return primaryResult; } - function createModuleResolutionLoader2(containingFile, redirectedReference, options) { - return { - nameAndMode: moduleResolutionNameAndModeGetter, - resolve: (moduleName, resoluionMode) => resolveModuleName2( - moduleName, - containingFile, - options, - redirectedReference, - resoluionMode - ) - }; + function closeFileWatcherOfAffectingLocation(watcher, path) { + var _a; + if (watcher.files === 0 && watcher.resolutions === 0 && !((_a = watcher.symlinks) == null ? void 0 : _a.size)) { + fileWatchesOfAffectingLocations.delete(path); + watcher.watcher.close(); + } } function resolveNamesWithLocalCache({ entries, @@ -391806,7 +396610,6 @@ ${lanes.join("\n")} shouldRetryResolution, logChanges }) { - var _a; const path = resolutionHost.toPath(containingFile); const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path); const resolvedModules = []; @@ -391817,7 +396620,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))) { @@ -391827,16 +396630,18 @@ ${lanes.join("\n")} resolutionHost.onDiscoveredSymlink(); } resolutionsInFile.set(name, mode, resolution); - watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution); - if (existingResolution) { - stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName); + if (resolution !== existingResolution) { + watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution); + if (existingResolution) { + stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName); + } } if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { filesWithChangedSetOfUnresolvedImports.push(path); logChanges = false; } } else { - const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost; + const host = getModuleResolutionHost(resolutionHost); if (isTraceEnabled(options, host) && !seenNamesInFile.has(name, mode)) { const resolved = getResolutionWithResolvedFileName(resolution); trace( @@ -391853,11 +396658,13 @@ ${lanes.join("\n")} seenNamesInFile.set(name, mode, true); resolvedModules.push(resolution); } - reusedNames == null ? void 0 : reusedNames.forEach((entry) => seenNamesInFile.set( - loader.nameAndMode.getName(entry), - loader.nameAndMode.getMode(entry, containingSourceFile), - true - )); + reusedNames == null ? void 0 : reusedNames.forEach( + (entry) => seenNamesInFile.set( + loader.nameAndMode.getName(entry), + loader.nameAndMode.getMode(entry, containingSourceFile, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options), + true + ) + ); if (resolutionsInFile.size() !== seenNamesInFile.size()) { resolutionsInFile.forEach((resolution, name, mode) => { if (!seenNamesInFile.has(name, mode)) { @@ -391886,7 +396693,6 @@ ${lanes.join("\n")} } } function resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) { - var _a; return resolveNamesWithLocalCache({ entries: typeDirectiveReferences, containingFile, @@ -391899,10 +396705,10 @@ ${lanes.join("\n")} containingFile, redirectedReference, options, - ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost, + getModuleResolutionHost(resolutionHost), typeReferenceDirectiveResolutionCache ), - getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective2, + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective, shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0, deferWatchingNonRelativeResolution: false }); @@ -391916,12 +396722,14 @@ ${lanes.join("\n")} options, reusedNames, perFileCache: resolvedModuleNames, - loader: createModuleResolutionLoader2( + loader: createModuleResolutionLoaderUsingGlobalCache( containingFile, redirectedReference, - options + options, + resolutionHost, + moduleResolutionCache ), - getResolutionWithResolvedFileName: getResolvedModule2, + getResolutionWithResolvedFileName: getResolvedModule, shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension), logChanges: logChangesWhenResolvingModule, deferWatchingNonRelativeResolution: true @@ -391929,8 +396737,7 @@ ${lanes.join("\n")} }); } function resolveLibrary2(libraryName, resolveFrom, options, libFileName) { - var _a; - const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost; + const host = getModuleResolutionHost(resolutionHost); let resolution = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName); if (!resolution || resolution.isInvalidated) { const existingResolution = resolution; @@ -391940,17 +396747,17 @@ ${lanes.join("\n")} libraryName, resolution, path, - getResolvedModule2, + getResolvedModule, /*deferWatchingNonRelativeResolution*/ false ); resolvedLibraries.set(libFileName, resolution); if (existingResolution) { - stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolvedModule2); + stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolvedModule); } } else { if (isTraceEnabled(options, host)) { - const resolved = getResolvedModule2(resolution); + const resolved = getResolvedModule(resolution); trace( host, (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved, @@ -391964,6 +396771,7 @@ ${lanes.join("\n")} return resolution; } function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) { + var _a, _b; const path = resolutionHost.toPath(containingFile); const resolutionsInFile = resolvedModuleNames.get(path); const resolution = resolutionsInFile == null ? void 0 : resolutionsInFile.get( @@ -391973,7 +396781,17 @@ ${lanes.join("\n")} ); if (resolution && !resolution.isInvalidated) return resolution; - return resolveModuleName2(moduleName, containingFile, resolutionHost.getCompilationSettings()); + const data = (_a = resolutionHost.beforeResolveSingleModuleNameWithoutWatching) == null ? void 0 : _a.call(resolutionHost, moduleResolutionCache); + const host = getModuleResolutionHost(resolutionHost); + const result = resolveModuleName( + moduleName, + containingFile, + resolutionHost.getCompilationSettings(), + host, + moduleResolutionCache + ); + (_b = resolutionHost.afterResolveSingleModuleNameWithoutWatching) == null ? void 0 : _b.call(resolutionHost, moduleResolutionCache, moduleName, containingFile, result, data); + return result; } function isNodeModulesAtTypesDirectory(dirPath) { return endsWith(dirPath, "/node_modules/@types"); @@ -392025,10 +396843,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) { @@ -392036,8 +396854,8 @@ ${lanes.join("\n")} setAtRoot = watchFailedLookupLocation(failedLookupLocation, setAtRoot); } } - if (node10Result) - setAtRoot = watchFailedLookupLocation(node10Result, setAtRoot); + if (alternateResult) + setAtRoot = watchFailedLookupLocation(alternateResult, setAtRoot); if (setAtRoot) { setDirectoryWatcher( rootDir, @@ -392046,7 +396864,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); @@ -392073,52 +396891,63 @@ ${lanes.join("\n")} return; } let locationToWatch = affectingLocation; + let isSymlink = false; + let symlinkWatcher; if (resolutionHost.realpath) { locationToWatch = resolutionHost.realpath(affectingLocation); if (affectingLocation !== locationToWatch) { - const fileWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch); - if (fileWatcher2) { - if (forResolution) - fileWatcher2.resolutions++; - else - fileWatcher2.files++; - fileWatcher2.paths.add(affectingLocation); - fileWatchesOfAffectingLocations.set(affectingLocation, fileWatcher2); - return; - } - } - } - const paths = /* @__PURE__ */ new Set(); - paths.add(locationToWatch); - let actualWatcher = canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => { - cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind); - const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap(); - paths.forEach((path) => { - if (watcher.resolutions) - (affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path); - if (watcher.files) - (affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path); - packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path)); - }); - resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations(); - }) : noopFileWatcher; - const watcher = { - watcher: actualWatcher !== noopFileWatcher ? { - close: () => { - actualWatcher.close(); - actualWatcher = noopFileWatcher; - } - } : actualWatcher, - resolutions: forResolution ? 1 : 0, - files: forResolution ? 0 : 1, - paths - }; - fileWatchesOfAffectingLocations.set(locationToWatch, watcher); - if (affectingLocation !== locationToWatch) { + isSymlink = true; + symlinkWatcher = fileWatchesOfAffectingLocations.get(locationToWatch); + } + } + const resolutions = forResolution ? 1 : 0; + const files = forResolution ? 0 : 1; + if (!isSymlink || !symlinkWatcher) { + const watcher = { + watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => { + cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind); + invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap()); + resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations(); + }) : noopFileWatcher, + resolutions: isSymlink ? 0 : resolutions, + files: isSymlink ? 0 : files, + symlinks: void 0 + }; + fileWatchesOfAffectingLocations.set(locationToWatch, watcher); + if (isSymlink) + symlinkWatcher = watcher; + } + if (isSymlink) { + Debug.assert(!!symlinkWatcher); + const watcher = { + watcher: { + close: () => { + var _a; + const symlinkWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch); + if (((_a = symlinkWatcher2 == null ? void 0 : symlinkWatcher2.symlinks) == null ? void 0 : _a.delete(affectingLocation)) && !symlinkWatcher2.symlinks.size && !symlinkWatcher2.resolutions && !symlinkWatcher2.files) { + fileWatchesOfAffectingLocations.delete(locationToWatch); + symlinkWatcher2.watcher.close(); + } + } + }, + resolutions, + files, + symlinks: void 0 + }; fileWatchesOfAffectingLocations.set(affectingLocation, watcher); - paths.add(affectingLocation); + (symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation); } } + function invalidateAffectingFileWatcher(path, packageJsonMap) { + var _a; + const watcher = fileWatchesOfAffectingLocations.get(path); + if (watcher == null ? void 0 : watcher.resolutions) + (affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path); + if (watcher == null ? void 0 : watcher.files) + (affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path); + (_a = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a.forEach((path2) => invalidateAffectingFileWatcher(path2, packageJsonMap)); + packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path)); + } function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) { const program = resolutionHost.getCurrentProgram(); if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) { @@ -392140,7 +396969,7 @@ ${lanes.join("\n")} directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive }); } } - function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot) { + function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove) { const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); const toWatch = getDirectoryToWatchFailedLookupLocation( failedLookupLocation, @@ -392155,12 +396984,12 @@ ${lanes.join("\n")} if (dirPath === rootPath) { removeAtRoot = true; } else { - removeDirectoryWatcher(dirPath); + removeDirectoryWatcher(dirPath, syncDirWatcherRemove); } } return removeAtRoot; } - function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) { + function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) { Debug.checkDefined(resolution.files).delete(filePath); resolution.refCount--; if (resolution.refCount) { @@ -392173,18 +397002,18 @@ ${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) { for (const failedLookupLocation of failedLookupLocations) { - removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot); + removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove); } } - if (node10Result) - removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot); + if (alternateResult) + removeAtRoot = stopWatchFailedLookupLocation(alternateResult, removeAtRoot, syncDirWatcherRemove); if (removeAtRoot) - removeDirectoryWatcher(rootPath); + removeDirectoryWatcher(rootPath, syncDirWatcherRemove); } else if (affectingLocations == null ? void 0 : affectingLocations.length) { resolutionsWithOnlyAffectingLocations.delete(resolution); } @@ -392192,12 +397021,16 @@ ${lanes.join("\n")} for (const affectingLocation of affectingLocations) { const watcher = fileWatchesOfAffectingLocations.get(affectingLocation); watcher.resolutions--; + if (syncDirWatcherRemove) + closeFileWatcherOfAffectingLocation(watcher, affectingLocation); } } } - function removeDirectoryWatcher(dirPath) { + function removeDirectoryWatcher(dirPath, syncDirWatcherRemove) { const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); dirWatcher.refCount--; + if (syncDirWatcherRemove) + closeDirectoryWatchesOfFailedLookup(dirWatcher, dirPath); } function createDirectoryWatcher(directory, dirPath, nonRecursive) { return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, (fileOrDirectory) => { @@ -392208,10 +397041,17 @@ ${lanes.join("\n")} scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath); }, nonRecursive ? 0 /* None */ : 1 /* Recursive */); } - function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) { + function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) { const resolutions = cache.get(filePath); if (resolutions) { - resolutions.forEach((resolution) => stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName)); + resolutions.forEach( + (resolution) => stopWatchFailedLookupLocationOfResolution( + resolution, + filePath, + getResolutionWithResolvedFileName, + syncDirWatcherRemove + ) + ); cache.delete(filePath); } } @@ -392226,9 +397066,9 @@ ${lanes.join("\n")} return; resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f))); } - function removeResolutionsOfFile(filePath) { - removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule2); - removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective2); + function removeResolutionsOfFile(filePath, syncDirWatcherRemove) { + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule, syncDirWatcherRemove); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective, syncDirWatcherRemove); } function invalidateResolutions(resolutions, canInvalidate) { if (!resolutions) @@ -392338,7 +397178,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); @@ -392350,8 +397190,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); @@ -392360,7 +397200,7 @@ ${lanes.join("\n")} resolutionHost.onChangedAutomaticTypeDirectiveNames(); const dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot( typeRoot, - typeRootPath, + resolutionHost.toPath(typeRoot), rootPath, rootPathComponents, getCurrentDirectory, @@ -392381,7 +397221,7 @@ ${lanes.join("\n")} if (typeRoots) { mutateMap( typeRootsWatches, - arrayToMap(typeRoots, (tr) => resolutionHost.toPath(tr)), + new Set(typeRoots), { createNewValue: createTypeRootsWatch, onDeleteValue: closeFileWatcher @@ -392483,10 +397323,7 @@ ${lanes.join("\n")} if (fileName === void 0) { return void 0; } - const diagnosticForFileName = find( - diagnostics, - (diagnostic) => diagnostic.file !== void 0 && diagnostic.file.fileName === fileName - ); + const diagnosticForFileName = find(diagnostics, (diagnostic) => diagnostic.file !== void 0 && diagnostic.file.fileName === fileName); if (diagnosticForFileName !== void 0) { const { line } = getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start); return { @@ -392499,17 +397336,17 @@ ${lanes.join("\n")} function getWatchErrorSummaryDiagnosticMessage(errorCount) { return errorCount === 1 ? Diagnostics.Found_1_error_Watching_for_file_changes : Diagnostics.Found_0_errors_Watching_for_file_changes; } - function prettyPathForFileError(error, cwd) { - const line = formatColorAndReset(":" + error.line, "\x1B[90m" /* Grey */); - if (pathIsAbsolute(error.fileName) && pathIsAbsolute(cwd)) { + function prettyPathForFileError(error2, cwd) { + const line = formatColorAndReset(":" + error2.line, "\x1B[90m" /* Grey */); + if (pathIsAbsolute(error2.fileName) && pathIsAbsolute(cwd)) { return getRelativePathFromDirectory( cwd, - error.fileName, + error2.fileName, /*ignoreCase*/ false ) + line; } - return error.fileName + line; + return error2.fileName + line; } function getErrorSummaryText(errorCount, filesInError, newLine, host) { if (errorCount === 0) @@ -392642,19 +397479,19 @@ ${lanes.join("\n")} return true; const isJsonFile = fileExtensionIs(fileName, ".json" /* Json */); const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); - const useCaseSensitiveFileNames = program.useCaseSensitiveFileNames(); + const useCaseSensitiveFileNames2 = program.useCaseSensitiveFileNames(); return find((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => { if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */)) return false; const pattern = getPatternFromSpec(includeSpec, basePath, "files"); - return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames).test(fileName); + return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName); }); } function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) { var _a, _b; const options = program.getCompilerOptions(); if (isReferencedFile(reason)) { - const referenceLocation = getReferencedFileLocation((path) => program.getSourceFileByPath(path), reason); + const referenceLocation = getReferencedFileLocation(program, reason); const referenceText = isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : `"${referenceLocation.text}"`; let message; Debug.assert(isReferenceFileLocation(referenceLocation) || reason.kind === 3 /* Import */, "Only synthetic references are imports"); @@ -392851,7 +397688,7 @@ ${lanes.join("\n")} return result; } function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) { - const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); + const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames(); const compilerHost = { getSourceFile: createGetSourceFile( (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding), @@ -392867,8 +397704,8 @@ ${lanes.join("\n")} (path) => host.directoryExists(path) ), getCurrentDirectory: memoize(() => host.getCurrentDirectory()), - useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, - getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames), + useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2, + getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames2), getNewLine: () => getNewLineCharacter(getCompilerOptions()), fileExists: (f) => host.fileExists(f), readFile: (f) => host.readFile(f), @@ -392879,7 +397716,8 @@ ${lanes.join("\n")} getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""), createHash: maybeBind(host, host.createHash), readDirectory: maybeBind(host, host.readDirectory), - storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit + storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit, + jsDocParsingMode: host.jsDocParsingMode }; return compilerHost; } @@ -393137,7 +397975,7 @@ ${lanes.join("\n")} } function createWatchProgram(host) { let builderProgram; - let reloadLevel; + let updateLevel; let missingFilesMap; let watchedWildcardDirectories; let timerToUpdateProgram; @@ -393149,7 +397987,7 @@ ${lanes.join("\n")} const sourceFilesCache = /* @__PURE__ */ new Map(); let missingFilePathsRequestedForRelease; let hasChangedCompilerOptions = false; - const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); + const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames(); const currentDirectory = host.getCurrentDirectory(); const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram: createProgram2 } = host; let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host; @@ -393157,7 +397995,7 @@ ${lanes.join("\n")} let configFileParsingDiagnostics; let canConfigFileJsonReportNoInputFiles = false; let hasChangedConfigFileParsingErrors = false; - const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); + const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2); const directoryStructureHost = cachedDirectoryStructureHost || host; const parseConfigFileHost = parseConfigHostFromCompilerHostLike(host, directoryStructureHost); let newLine = updateNewLine(); @@ -393175,8 +398013,8 @@ ${lanes.join("\n")} Debug.assert(compilerOptions); Debug.assert(rootFileNames); const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions); - const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); - writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames}`); + const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); + writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames2}`); let configFileWatcher; if (configFileName) { configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile); @@ -393230,7 +398068,7 @@ ${lanes.join("\n")} watchConfigFileWildCardDirectories(); if (configFileName) updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile); - return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close }; + return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache }; function close() { clearInvalidateResolutionsOfFailedLookupLocations(); resolutionCache.clear(); @@ -393270,6 +398108,9 @@ ${lanes.join("\n")} parsedConfigs = void 0; } } + function getResolutionCache() { + return resolutionCache; + } function getCurrentBuilderProgram() { return builderProgram; } @@ -393285,7 +398126,6 @@ ${lanes.join("\n")} if (hasChangedCompilerOptions) { newLine = updateNewLine(); if (program && changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) { - debugger; resolutionCache.onChangesAffectModuleResolution(); } } @@ -393348,7 +398188,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(); } @@ -393390,7 +398234,8 @@ ${lanes.join("\n")} if (isFileMissingOnHost(hostSourceFile)) { return void 0; } - if (hostSourceFile === void 0 || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile)) { + const impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : void 0; + if (hostSourceFile === void 0 || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile) || hostSourceFile.sourceFile.impliedNodeFormat !== impliedNodeFormat) { const sourceFile = getNewSourceFile(fileName, languageVersionOrOptions, onError); if (hostSourceFile) { if (sourceFile) { @@ -393493,7 +398338,7 @@ ${lanes.join("\n")} } function scheduleProgramReload() { Debug.assert(!!configFileName); - reloadLevel = 2 /* Full */; + updateLevel = 2 /* Full */; scheduleProgramUpdate(); } function updateProgramWithWatchStatus() { @@ -393503,8 +398348,8 @@ ${lanes.join("\n")} } function updateProgram() { var _a, _b, _c, _d; - switch (reloadLevel) { - case 1 /* Partial */: + switch (updateLevel) { + case 1 /* RootNamesAndUpdate */: (_a = perfLogger) == null ? void 0 : _a.logStartUpdateProgram("PartialConfigReload"); reloadFileNamesFromConfigFile(); break; @@ -393524,7 +398369,7 @@ ${lanes.join("\n")} writeLog("Reloading new file names and options"); Debug.assert(compilerOptions); Debug.assert(configFileName); - reloadLevel = 0 /* None */; + updateLevel = 0 /* Update */; rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { hasChangedConfigFileParsingErrors = true; @@ -393534,7 +398379,7 @@ ${lanes.join("\n")} function reloadConfigFile() { Debug.assert(configFileName); writeLog(`Reloading config file: ${configFileName}`); - reloadLevel = 0 /* None */; + updateLevel = 0 /* Update */; if (cachedDirectoryStructureHost) { cachedDirectoryStructureHost.clearCache(); } @@ -393546,14 +398391,16 @@ ${lanes.join("\n")} } function parseConfigFile2() { Debug.assert(configFileName); - setConfigFileParsingResult(getParsedCommandLineOfConfigFile( - configFileName, - optionsToExtendForConfigFile, - parseConfigFileHost, - extendedConfigCache || (extendedConfigCache = /* @__PURE__ */ new Map()), - watchOptionsToExtend, - extraFileExtensions - )); + setConfigFileParsingResult( + getParsedCommandLineOfConfigFile( + configFileName, + optionsToExtendForConfigFile, + parseConfigFileHost, + extendedConfigCache || (extendedConfigCache = /* @__PURE__ */ new Map()), + watchOptionsToExtend, + extraFileExtensions + ) + ); } function setConfigFileParsingResult(configFileParseResult) { rootFileNames = configFileParseResult.fileNames; @@ -393569,9 +398416,9 @@ ${lanes.join("\n")} const configPath = toPath3(configFileName2); let config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath); if (config) { - if (!config.reloadLevel) + if (!config.updateLevel) return config.parsedCommandLine; - if (config.parsedCommandLine && config.reloadLevel === 1 /* Partial */ && !host.getParsedCommandLine) { + if (config.parsedCommandLine && config.updateLevel === 1 /* RootNamesAndUpdate */ && !host.getParsedCommandLine) { writeLog("Reloading new file names and options"); Debug.assert(compilerOptions); const fileNames = getFileNamesFromConfigSpecs( @@ -393581,7 +398428,7 @@ ${lanes.join("\n")} parseConfigFileHost ); config.parsedCommandLine = { ...config.parsedCommandLine, fileNames }; - config.reloadLevel = void 0; + config.updateLevel = void 0; return config.parsedCommandLine; } } @@ -393589,7 +398436,7 @@ ${lanes.join("\n")} const parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2); if (config) { config.parsedCommandLine = parsedCommandLine; - config.reloadLevel = void 0; + config.updateLevel = void 0; } else { (parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine }); } @@ -393638,8 +398485,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); @@ -393651,15 +398505,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( @@ -393681,13 +398531,13 @@ ${lanes.join("\n")} options: compilerOptions, program: getCurrentBuilderProgram() || rootFileNames, currentDirectory, - useCaseSensitiveFileNames, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, writeLog, toPath: toPath3 })) return; - if (reloadLevel !== 2 /* Full */) { - reloadLevel = 1 /* Partial */; + if (updateLevel !== 2 /* Full */) { + updateLevel = 1 /* RootNamesAndUpdate */; scheduleProgramUpdate(); } }, @@ -393713,11 +398563,11 @@ ${lanes.join("\n")} return; projects.forEach((projectPath) => { if (configFileName && toPath3(configFileName) === projectPath) { - reloadLevel = 2 /* Full */; + updateLevel = 2 /* Full */; } else { const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath); if (config) - config.reloadLevel = 2 /* Full */; + config.updateLevel = 2 /* Full */; resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath); } scheduleProgramUpdate(); @@ -393731,14 +398581,14 @@ ${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) => { updateCachedSystemWithFile(configFileName2, configPath, eventKind); const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath); if (config) - config.reloadLevel = 2 /* Full */; + config.updateLevel = 2 /* Full */; resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath); scheduleProgramUpdate(); }, @@ -393746,55 +398596,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, - writeLog, - toPath: toPath3 - })) - return; - if (config.reloadLevel !== 2 /* Full */) { - config.reloadLevel = 1 /* Partial */; - 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 ); } @@ -393953,7 +398798,8 @@ ${lanes.join("\n")} compilerHost.getCanonicalFileName, /*options*/ void 0, - moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache() + moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), + moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey ); compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( typeDirectiveNames, @@ -394131,9 +398977,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 }; @@ -394145,6 +398991,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, @@ -394250,12 +399097,12 @@ ${lanes.join("\n")} state.projectStatus.delete(resolved); state.diagnostics.delete(resolved); } - function addProjToQueue({ projectPendingBuild }, proj, reloadLevel) { + function addProjToQueue({ projectPendingBuild }, proj, updateLevel) { const value = projectPendingBuild.get(proj); if (value === void 0) { - projectPendingBuild.set(proj, reloadLevel); - } else if (value < reloadLevel) { - projectPendingBuild.set(proj, reloadLevel); + projectPendingBuild.set(proj, updateLevel); + } else if (value < updateLevel) { + projectPendingBuild.set(proj, updateLevel); } } function setupInitialBuild(state, cancellationToken) { @@ -394269,7 +399116,7 @@ ${lanes.join("\n")} buildOrder.forEach( (configFileName) => state.projectPendingBuild.set( toResolvedConfigFilePath(state, configFileName), - 0 /* None */ + 0 /* Update */ ) ); if (cancellationToken) { @@ -394393,7 +399240,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); @@ -394422,10 +399269,14 @@ ${lanes.join("\n")} config.projectReferences ); if (state.watch) { - 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] - )); + const internalMap = (_c = state.moduleResolutionCache) == null ? void 0 : _c.getPackageJsonInfoCache().getInternalMap(); + state.lastCachedPackageJsonLookups.set( + projectPath, + 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); } step++; @@ -394702,8 +399553,8 @@ ${lanes.join("\n")} for (let projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) { const project = buildOrder[projectIndex]; const projectPath = toResolvedConfigFilePath(state, project); - const reloadLevel = state.projectPendingBuild.get(projectPath); - if (reloadLevel === void 0) + const updateLevel = state.projectPendingBuild.get(projectPath); + if (updateLevel === void 0) continue; if (reportQueue) { reportQueue = false; @@ -394715,13 +399566,13 @@ ${lanes.join("\n")} projectPendingBuild.delete(projectPath); continue; } - if (reloadLevel === 2 /* Full */) { + if (updateLevel === 2 /* Full */) { watchConfigFile(state, project, projectPath, config); watchExtendedConfigFiles(state, projectPath, config); watchWildCardDirectories(state, project, projectPath, config); watchInputFiles(state, project, projectPath, config); watchPackageJsonFiles(state, project, projectPath, config); - } else if (reloadLevel === 1 /* Partial */) { + } else if (updateLevel === 1 /* RootNamesAndUpdate */) { config.fileNames = getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, getDirectoryPath(project), config.options, state.parseConfigFileHost); updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, canJsonReportNoInputFiles(config.raw)); watchInputFiles(state, project, projectPath, config); @@ -394948,7 +399799,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 */ @@ -395022,7 +399873,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 @@ -395157,9 +400008,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; @@ -395308,7 +400160,7 @@ ${lanes.join("\n")} break; } } - addProjToQueue(state, nextProjectPath, 0 /* None */); + addProjToQueue(state, nextProjectPath, 0 /* Update */); break; } } @@ -395377,7 +400229,7 @@ ${lanes.join("\n")} filesToDelete.push(output); } else { host.deleteFile(output); - invalidateProject(state, resolvedPath, 0 /* None */); + invalidateProject(state, resolvedPath, 0 /* Update */); } } } @@ -395388,22 +400240,22 @@ ${lanes.join("\n")} } return 0 /* Success */; } - function invalidateProject(state, resolved, reloadLevel) { - if (state.host.getParsedCommandLine && reloadLevel === 1 /* Partial */) { - reloadLevel = 2 /* Full */; + function invalidateProject(state, resolved, updateLevel) { + if (state.host.getParsedCommandLine && updateLevel === 1 /* RootNamesAndUpdate */) { + updateLevel = 2 /* Full */; } - if (reloadLevel === 2 /* Full */) { + if (updateLevel === 2 /* Full */) { state.configFileCache.delete(resolved); state.buildOrder = void 0; } state.needsSummary = true; clearProjectStatus(state, resolved); - addProjToQueue(state, resolved, reloadLevel); + addProjToQueue(state, resolved, updateLevel); enableCache(state); } - function invalidateProjectAndScheduleBuilds(state, resolvedPath, reloadLevel) { + function invalidateProjectAndScheduleBuilds(state, resolvedPath, updateLevel) { state.reportFileChangeDetected = true; - invalidateProject(state, resolvedPath, reloadLevel); + invalidateProject(state, resolvedPath, updateLevel); scheduleBuildInvalidatedProject( state, 250, @@ -395479,15 +400331,18 @@ ${lanes.join("\n")} function watchConfigFile(state, resolved, resolvedPath, parsed) { if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath)) return; - state.allWatchedConfigFiles.set(resolvedPath, watchFile( - state, - resolved, - () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 2 /* Full */), - 2e3 /* High */, - parsed == null ? void 0 : parsed.watchOptions, - WatchType.ConfigFile, - resolved - )); + state.allWatchedConfigFiles.set( + resolvedPath, + watchFile( + state, + resolved, + () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 2 /* Full */), + 2e3 /* High */, + parsed == null ? void 0 : parsed.watchOptions, + WatchType.ConfigFile, + resolved + ) + ); } function watchExtendedConfigFiles(state, resolvedPath, parsed) { updateSharedExtendedConfigFileWatcher( @@ -395513,7 +400368,7 @@ ${lanes.join("\n")} return; updateWatchingWildcardDirectories( getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath), - new Map(Object.entries(parsed.wildcardDirectories)), + parsed.wildcardDirectories, (dir, flags) => state.watchDirectory( dir, (fileOrDirectory) => { @@ -395531,7 +400386,7 @@ ${lanes.join("\n")} toPath: (fileName) => toPath2(state, fileName) })) return; - invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* Partial */); + invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* RootNamesAndUpdate */); }, flags, parsed == null ? void 0 : parsed.watchOptions, @@ -395545,12 +400400,12 @@ ${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 /* None */), + () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */), 250 /* Low */, parsed == null ? void 0 : parsed.watchOptions, WatchType.SourceFile, @@ -395565,12 +400420,12 @@ ${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, - () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* None */), + input, + () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */), 2e3 /* High */, parsed == null ? void 0 : parsed.watchOptions, WatchType.PackageJson, @@ -395641,7 +400496,7 @@ ${lanes.join("\n")} const configFilePath = toResolvedConfigFilePath(state, configFileName); return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath); }, - invalidateProject: (configFilePath, reloadLevel) => invalidateProject(state, configFilePath, reloadLevel || 0 /* None */), + invalidateProject: (configFilePath, updateLevel) => invalidateProject(state, configFilePath, updateLevel || 0 /* Update */), close: () => stopWatching(state) }; } @@ -395891,6 +400746,8 @@ ${lanes.join("\n")} init_sourcemap(); init_utilities3(); init_destructuring(); + init_classThis(); + init_namedEvaluation(); init_taggedTemplate(); init_ts(); init_classFields(); @@ -395932,6 +400789,66 @@ ${lanes.join("\n")} } }); + // src/jsTyping/shared.ts + function hasArgument(argumentName) { + return sys.args.includes(argumentName); + } + function findArgument(argumentName) { + const index = sys.args.indexOf(argumentName); + return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0; + } + function nowString() { + const d = /* @__PURE__ */ new Date(); + return `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`; + } + function indent2(str) { + return indentStr + str.replace(/\n/g, indentStr); + } + function stringifyIndented(json) { + return indent2(JSON.stringify(json, void 0, 2)); + } + var ActionSet, ActionInvalidate, ActionPackageInstalled, EventTypesRegistry, EventBeginInstallTypes, EventEndInstallTypes, EventInitializationFailed, ActionWatchTypingLocations, Arguments, indentStr; + var init_shared = __esm({ + "src/jsTyping/shared.ts"() { + "use strict"; + init_ts3(); + ActionSet = "action::set"; + ActionInvalidate = "action::invalidate"; + ActionPackageInstalled = "action::packageInstalled"; + EventTypesRegistry = "event::typesRegistry"; + EventBeginInstallTypes = "event::beginInstallTypes"; + EventEndInstallTypes = "event::endInstallTypes"; + EventInitializationFailed = "event::initializationFailed"; + ActionWatchTypingLocations = "action::watchTypingLocations"; + ((Arguments2) => { + Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation"; + Arguments2.LogFile = "--logFile"; + Arguments2.EnableTelemetry = "--enableTelemetry"; + Arguments2.TypingSafeListLocation = "--typingSafeListLocation"; + Arguments2.TypesMapLocation = "--typesMapLocation"; + Arguments2.NpmLocation = "--npmLocation"; + Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation"; + })(Arguments || (Arguments = {})); + indentStr = "\n "; + } + }); + + // src/jsTyping/types.ts + var init_types2 = __esm({ + "src/jsTyping/types.ts"() { + "use strict"; + } + }); + + // src/jsTyping/_namespaces/ts.server.ts + var init_ts_server = __esm({ + "src/jsTyping/_namespaces/ts.server.ts"() { + "use strict"; + init_shared(); + init_types2(); + } + }); + // src/jsTyping/jsTyping.ts function isTypingUpToDate(cachedTyping, availableTypingVersions) { const availableVersion = new Version(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest")); @@ -395986,21 +400903,21 @@ ${lanes.join("\n")} ); addInferredTypings(module2, "Inferred typings from unresolved imports"); } - packageNameToTypingLocation.forEach((typing, name) => { - const registryEntry = typesRegistry.get(name); - if (inferredTypings.has(name) && inferredTypings.get(name) === void 0 && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) { - inferredTypings.set(name, typing.typingLocation); - } - }); for (const excludeTypingName of exclude) { const didDelete = inferredTypings.delete(excludeTypingName); if (didDelete && log) log(`Typing for ${excludeTypingName} is in exclude list, will be ignored.`); } + packageNameToTypingLocation.forEach((typing, name) => { + const registryEntry = typesRegistry.get(name); + if (inferredTypings.get(name) === false && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) { + inferredTypings.set(name, typing.typingLocation); + } + }); const newTypingNames = []; const cachedTypingPaths = []; inferredTypings.forEach((inferred, typing) => { - if (inferred !== void 0) { + if (inferred) { cachedTypingPaths.push(inferred); } else { newTypingNames.push(typing); @@ -396008,11 +400925,11 @@ ${lanes.join("\n")} }); const result = { cachedTypingPaths, newTypingNames, filesToWatch }; if (log) - log(`Result: ${JSON.stringify(result)}`); + log(`Finished typings discovery:${stringifyIndented(result)}`); return result; function addInferredTyping(typingName) { if (!inferredTypings.has(typingName)) { - inferredTypings.set(typingName, void 0); + inferredTypings.set(typingName, false); } } function addInferredTypings(typingNames, message) { @@ -396179,6 +401096,7 @@ ${lanes.join("\n")} "src/jsTyping/jsTyping.ts"() { "use strict"; init_ts3(); + init_ts_server(); unprefixedNodeCoreModuleList = [ "assert", "assert/strict", @@ -396266,74 +401184,6 @@ ${lanes.join("\n")} } }); - // src/jsTyping/shared.ts - function hasArgument(argumentName) { - return sys.args.indexOf(argumentName) >= 0; - } - function findArgument(argumentName) { - const index = sys.args.indexOf(argumentName); - return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0; - } - function nowString() { - const d = /* @__PURE__ */ new Date(); - return `${padLeft(d.getHours().toString(), 2, "0")}:${padLeft(d.getMinutes().toString(), 2, "0")}:${padLeft(d.getSeconds().toString(), 2, "0")}.${padLeft(d.getMilliseconds().toString(), 3, "0")}`; - } - var ActionSet, ActionInvalidate, ActionPackageInstalled, EventTypesRegistry, EventBeginInstallTypes, EventEndInstallTypes, EventInitializationFailed, ActionWatchTypingLocations, Arguments; - var init_shared = __esm({ - "src/jsTyping/shared.ts"() { - "use strict"; - init_ts3(); - ActionSet = "action::set"; - ActionInvalidate = "action::invalidate"; - ActionPackageInstalled = "action::packageInstalled"; - EventTypesRegistry = "event::typesRegistry"; - EventBeginInstallTypes = "event::beginInstallTypes"; - EventEndInstallTypes = "event::endInstallTypes"; - EventInitializationFailed = "event::initializationFailed"; - ActionWatchTypingLocations = "action::watchTypingLocations"; - ((Arguments2) => { - Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation"; - Arguments2.LogFile = "--logFile"; - Arguments2.EnableTelemetry = "--enableTelemetry"; - Arguments2.TypingSafeListLocation = "--typingSafeListLocation"; - Arguments2.TypesMapLocation = "--typesMapLocation"; - Arguments2.NpmLocation = "--npmLocation"; - Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation"; - })(Arguments || (Arguments = {})); - } - }); - - // src/jsTyping/types.ts - var init_types2 = __esm({ - "src/jsTyping/types.ts"() { - "use strict"; - } - }); - - // src/jsTyping/_namespaces/ts.server.ts - var ts_server_exports = {}; - __export(ts_server_exports, { - ActionInvalidate: () => ActionInvalidate, - ActionPackageInstalled: () => ActionPackageInstalled, - ActionSet: () => ActionSet, - ActionWatchTypingLocations: () => ActionWatchTypingLocations, - Arguments: () => Arguments, - EventBeginInstallTypes: () => EventBeginInstallTypes, - EventEndInstallTypes: () => EventEndInstallTypes, - EventInitializationFailed: () => EventInitializationFailed, - EventTypesRegistry: () => EventTypesRegistry, - findArgument: () => findArgument, - hasArgument: () => hasArgument, - nowString: () => nowString - }); - var init_ts_server = __esm({ - "src/jsTyping/_namespaces/ts.server.ts"() { - "use strict"; - init_shared(); - init_types2(); - } - }); - // src/jsTyping/_namespaces/ts.ts var init_ts3 = __esm({ "src/jsTyping/_namespaces/ts.ts"() { @@ -396416,22 +401266,22 @@ ${lanes.join("\n")} return LanguageServiceMode2; })(LanguageServiceMode || {}); emptyOptions = {}; - SemanticClassificationFormat = /* @__PURE__ */ ((SemanticClassificationFormat3) => { - SemanticClassificationFormat3["Original"] = "original"; - SemanticClassificationFormat3["TwentyTwenty"] = "2020"; - return SemanticClassificationFormat3; + SemanticClassificationFormat = /* @__PURE__ */ ((SemanticClassificationFormat2) => { + SemanticClassificationFormat2["Original"] = "original"; + SemanticClassificationFormat2["TwentyTwenty"] = "2020"; + return SemanticClassificationFormat2; })(SemanticClassificationFormat || {}); - OrganizeImportsMode = /* @__PURE__ */ ((OrganizeImportsMode2) => { - OrganizeImportsMode2["All"] = "All"; - OrganizeImportsMode2["SortAndCombine"] = "SortAndCombine"; - OrganizeImportsMode2["RemoveUnused"] = "RemoveUnused"; - return OrganizeImportsMode2; + OrganizeImportsMode = /* @__PURE__ */ ((OrganizeImportsMode3) => { + OrganizeImportsMode3["All"] = "All"; + OrganizeImportsMode3["SortAndCombine"] = "SortAndCombine"; + OrganizeImportsMode3["RemoveUnused"] = "RemoveUnused"; + return OrganizeImportsMode3; })(OrganizeImportsMode || {}); - CompletionTriggerKind = /* @__PURE__ */ ((CompletionTriggerKind2) => { - CompletionTriggerKind2[CompletionTriggerKind2["Invoked"] = 1] = "Invoked"; - CompletionTriggerKind2[CompletionTriggerKind2["TriggerCharacter"] = 2] = "TriggerCharacter"; - CompletionTriggerKind2[CompletionTriggerKind2["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions"; - return CompletionTriggerKind2; + CompletionTriggerKind = /* @__PURE__ */ ((CompletionTriggerKind4) => { + CompletionTriggerKind4[CompletionTriggerKind4["Invoked"] = 1] = "Invoked"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerCharacter"] = 2] = "TriggerCharacter"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions"; + return CompletionTriggerKind4; })(CompletionTriggerKind || {}); InlayHintKind = /* @__PURE__ */ ((InlayHintKind2) => { InlayHintKind2["Type"] = "Type"; @@ -396446,17 +401296,17 @@ ${lanes.join("\n")} HighlightSpanKind2["writtenReference"] = "writtenReference"; return HighlightSpanKind2; })(HighlightSpanKind || {}); - IndentStyle = /* @__PURE__ */ ((IndentStyle2) => { - IndentStyle2[IndentStyle2["None"] = 0] = "None"; - IndentStyle2[IndentStyle2["Block"] = 1] = "Block"; - IndentStyle2[IndentStyle2["Smart"] = 2] = "Smart"; - return IndentStyle2; + IndentStyle = /* @__PURE__ */ ((IndentStyle3) => { + IndentStyle3[IndentStyle3["None"] = 0] = "None"; + IndentStyle3[IndentStyle3["Block"] = 1] = "Block"; + IndentStyle3[IndentStyle3["Smart"] = 2] = "Smart"; + return IndentStyle3; })(IndentStyle || {}); - SemicolonPreference = /* @__PURE__ */ ((SemicolonPreference2) => { - SemicolonPreference2["Ignore"] = "ignore"; - SemicolonPreference2["Insert"] = "insert"; - SemicolonPreference2["Remove"] = "remove"; - return SemicolonPreference2; + SemicolonPreference = /* @__PURE__ */ ((SemicolonPreference3) => { + SemicolonPreference3["Ignore"] = "ignore"; + SemicolonPreference3["Insert"] = "insert"; + SemicolonPreference3["Remove"] = "remove"; + return SemicolonPreference3; })(SemicolonPreference || {}); testFormatSettings = getDefaultFormatCodeSettings("\n"); SymbolDisplayPartKind = /* @__PURE__ */ ((SymbolDisplayPartKind2) => { @@ -396510,15 +401360,15 @@ ${lanes.join("\n")} OutputFileType2[OutputFileType2["Declaration"] = 2] = "Declaration"; return OutputFileType2; })(OutputFileType || {}); - EndOfLineState = /* @__PURE__ */ ((EndOfLineState3) => { - EndOfLineState3[EndOfLineState3["None"] = 0] = "None"; - EndOfLineState3[EndOfLineState3["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; - EndOfLineState3[EndOfLineState3["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; - EndOfLineState3[EndOfLineState3["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; - EndOfLineState3[EndOfLineState3["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate"; - EndOfLineState3[EndOfLineState3["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail"; - EndOfLineState3[EndOfLineState3["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition"; - return EndOfLineState3; + EndOfLineState = /* @__PURE__ */ ((EndOfLineState2) => { + EndOfLineState2[EndOfLineState2["None"] = 0] = "None"; + EndOfLineState2[EndOfLineState2["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; + EndOfLineState2[EndOfLineState2["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; + EndOfLineState2[EndOfLineState2["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; + EndOfLineState2[EndOfLineState2["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate"; + EndOfLineState2[EndOfLineState2["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail"; + EndOfLineState2[EndOfLineState2["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition"; + return EndOfLineState2; })(EndOfLineState || {}); TokenClass = /* @__PURE__ */ ((TokenClass2) => { TokenClass2[TokenClass2["Punctuation"] = 0] = "Punctuation"; @@ -396547,6 +401397,8 @@ ${lanes.join("\n")} ScriptElementKind2["enumMemberElement"] = "enum member"; ScriptElementKind2["variableElement"] = "var"; ScriptElementKind2["localVariableElement"] = "local var"; + ScriptElementKind2["variableUsingElement"] = "using"; + ScriptElementKind2["variableAwaitUsingElement"] = "await using"; ScriptElementKind2["functionElement"] = "function"; ScriptElementKind2["localFunctionElement"] = "local function"; ScriptElementKind2["memberFunctionElement"] = "method"; @@ -396626,33 +401478,33 @@ ${lanes.join("\n")} ClassificationTypeNames2["jsxAttributeStringLiteralValue"] = "jsx attribute string literal value"; return ClassificationTypeNames2; })(ClassificationTypeNames || {}); - ClassificationType = /* @__PURE__ */ ((ClassificationType2) => { - ClassificationType2[ClassificationType2["comment"] = 1] = "comment"; - ClassificationType2[ClassificationType2["identifier"] = 2] = "identifier"; - ClassificationType2[ClassificationType2["keyword"] = 3] = "keyword"; - ClassificationType2[ClassificationType2["numericLiteral"] = 4] = "numericLiteral"; - ClassificationType2[ClassificationType2["operator"] = 5] = "operator"; - ClassificationType2[ClassificationType2["stringLiteral"] = 6] = "stringLiteral"; - ClassificationType2[ClassificationType2["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; - ClassificationType2[ClassificationType2["whiteSpace"] = 8] = "whiteSpace"; - ClassificationType2[ClassificationType2["text"] = 9] = "text"; - ClassificationType2[ClassificationType2["punctuation"] = 10] = "punctuation"; - ClassificationType2[ClassificationType2["className"] = 11] = "className"; - ClassificationType2[ClassificationType2["enumName"] = 12] = "enumName"; - ClassificationType2[ClassificationType2["interfaceName"] = 13] = "interfaceName"; - ClassificationType2[ClassificationType2["moduleName"] = 14] = "moduleName"; - ClassificationType2[ClassificationType2["typeParameterName"] = 15] = "typeParameterName"; - ClassificationType2[ClassificationType2["typeAliasName"] = 16] = "typeAliasName"; - ClassificationType2[ClassificationType2["parameterName"] = 17] = "parameterName"; - ClassificationType2[ClassificationType2["docCommentTagName"] = 18] = "docCommentTagName"; - ClassificationType2[ClassificationType2["jsxOpenTagName"] = 19] = "jsxOpenTagName"; - ClassificationType2[ClassificationType2["jsxCloseTagName"] = 20] = "jsxCloseTagName"; - ClassificationType2[ClassificationType2["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; - ClassificationType2[ClassificationType2["jsxAttribute"] = 22] = "jsxAttribute"; - ClassificationType2[ClassificationType2["jsxText"] = 23] = "jsxText"; - ClassificationType2[ClassificationType2["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; - ClassificationType2[ClassificationType2["bigintLiteral"] = 25] = "bigintLiteral"; - return ClassificationType2; + ClassificationType = /* @__PURE__ */ ((ClassificationType3) => { + ClassificationType3[ClassificationType3["comment"] = 1] = "comment"; + ClassificationType3[ClassificationType3["identifier"] = 2] = "identifier"; + ClassificationType3[ClassificationType3["keyword"] = 3] = "keyword"; + ClassificationType3[ClassificationType3["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType3[ClassificationType3["operator"] = 5] = "operator"; + ClassificationType3[ClassificationType3["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType3[ClassificationType3["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType3[ClassificationType3["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType3[ClassificationType3["text"] = 9] = "text"; + ClassificationType3[ClassificationType3["punctuation"] = 10] = "punctuation"; + ClassificationType3[ClassificationType3["className"] = 11] = "className"; + ClassificationType3[ClassificationType3["enumName"] = 12] = "enumName"; + ClassificationType3[ClassificationType3["interfaceName"] = 13] = "interfaceName"; + ClassificationType3[ClassificationType3["moduleName"] = 14] = "moduleName"; + ClassificationType3[ClassificationType3["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType3[ClassificationType3["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType3[ClassificationType3["parameterName"] = 17] = "parameterName"; + ClassificationType3[ClassificationType3["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType3[ClassificationType3["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType3[ClassificationType3["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType3[ClassificationType3["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType3[ClassificationType3["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType3[ClassificationType3["jsxText"] = 23] = "jsxText"; + ClassificationType3[ClassificationType3["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; + ClassificationType3[ClassificationType3["bigintLiteral"] = 25] = "bigintLiteral"; + return ClassificationType3; })(ClassificationType || {}); } }); @@ -396660,36 +401512,36 @@ ${lanes.join("\n")} // src/services/utilities.ts function getMeaningFromDeclaration(node) { switch (node.kind) { - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return isInJSFile(node) && getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 168 /* Parameter */: - case 207 /* BindingElement */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 298 /* CatchClause */: - case 290 /* JsxAttribute */: + case 169 /* Parameter */: + case 208 /* BindingElement */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 299 /* CatchClause */: + case 291 /* JsxAttribute */: return 1 /* Value */; - case 167 /* TypeParameter */: - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 186 /* TypeLiteral */: + case 168 /* TypeParameter */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 187 /* TypeLiteral */: return 2 /* Type */; - case 352 /* JSDocTypedefTag */: + case 353 /* JSDocTypedefTag */: return node.name === void 0 ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 305 /* EnumMember */: - case 262 /* ClassDeclaration */: + case 306 /* EnumMember */: + case 263 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: if (isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } else if (getModuleInstanceState(node) === 1 /* Instantiated */) { @@ -396697,15 +401549,15 @@ ${lanes.join("\n")} } else { return 4 /* Namespace */; } - case 265 /* EnumDeclaration */: - case 274 /* NamedImports */: - case 275 /* ImportSpecifier */: - case 270 /* ImportEqualsDeclaration */: - case 271 /* ImportDeclaration */: - case 276 /* ExportAssignment */: - case 277 /* ExportDeclaration */: + case 266 /* EnumDeclaration */: + case 275 /* NamedImports */: + case 276 /* ImportSpecifier */: + case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportDeclaration */: + case 277 /* ExportAssignment */: + case 278 /* ExportDeclaration */: return 7 /* All */; - case 311 /* SourceFile */: + case 312 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -396713,7 +401565,7 @@ ${lanes.join("\n")} function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); const parent2 = node.parent; - if (node.kind === 311 /* SourceFile */) { + if (node.kind === 312 /* SourceFile */) { return 1 /* Value */; } else if (isExportAssignment(parent2) || isExportSpecifier(parent2) || isExternalModuleReference(parent2) || isImportSpecifier(parent2) || isImportClause(parent2) || isImportEqualsDeclaration(parent2) && node === parent2.name) { return 7 /* All */; @@ -396737,11 +401589,11 @@ ${lanes.join("\n")} } } function getMeaningFromRightHandSideOfImportEquals(node) { - const name = node.kind === 165 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0; - return name && name.parent.kind === 270 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + const name = node.kind === 166 /* QualifiedName */ ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0; + return name && name.parent.kind === 271 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 165 /* QualifiedName */) { + while (node.parent.kind === 166 /* QualifiedName */) { node = node.parent; } return isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -396752,26 +401604,26 @@ ${lanes.join("\n")} function isQualifiedNameNamespaceReference(node) { let root = node; let isLastClause = true; - if (root.parent.kind === 165 /* QualifiedName */) { - while (root.parent && root.parent.kind === 165 /* QualifiedName */) { + if (root.parent.kind === 166 /* QualifiedName */) { + while (root.parent && root.parent.kind === 166 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 182 /* TypeReference */ && !isLastClause; + return root.parent.kind === 183 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { let root = node; let isLastClause = true; - if (root.parent.kind === 210 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 210 /* PropertyAccessExpression */) { + if (root.parent.kind === 211 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 211 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 232 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 297 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 233 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 298 /* HeritageClause */) { const decl = root.parent.parent.parent; - return decl.kind === 262 /* ClassDeclaration */ && root.parent.parent.token === 119 /* ImplementsKeyword */ || decl.kind === 263 /* InterfaceDeclaration */ && root.parent.parent.token === 96 /* ExtendsKeyword */; + return decl.kind === 263 /* ClassDeclaration */ && root.parent.parent.token === 119 /* ImplementsKeyword */ || decl.kind === 264 /* InterfaceDeclaration */ && root.parent.parent.token === 96 /* ExtendsKeyword */; } return false; } @@ -396782,15 +401634,15 @@ ${lanes.join("\n")} switch (node.kind) { case 110 /* ThisKeyword */: return !isExpressionNode(node); - case 196 /* ThisType */: + case 197 /* ThisType */: return true; } switch (node.parent.kind) { - case 182 /* TypeReference */: + case 183 /* TypeReference */: return true; - case 204 /* ImportType */: + case 205 /* ImportType */: return !node.parent.isTypeOf; - case 232 /* ExpressionWithTypeArguments */: + case 233 /* ExpressionWithTypeArguments */: return isPartOfTypeNode(node.parent); } return false; @@ -396837,7 +401689,7 @@ ${lanes.join("\n")} } function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 255 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 256 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -396887,22 +401739,22 @@ ${lanes.join("\n")} } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 302 /* PropertyAssignment */: - case 305 /* EnumMember */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 266 /* ModuleDeclaration */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 303 /* PropertyAssignment */: + case 306 /* EnumMember */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 267 /* ModuleDeclaration */: return getNameOfDeclaration(node.parent) === node; - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 166 /* ComputedPropertyName */: + case 167 /* ComputedPropertyName */: return true; - case 200 /* LiteralType */: - return node.parent.parent.kind === 198 /* IndexedAccessType */; + case 201 /* LiteralType */: + return node.parent.parent.kind === 199 /* IndexedAccessType */; default: return false; } @@ -396920,83 +401772,83 @@ ${lanes.join("\n")} return void 0; } switch (node.kind) { - case 311 /* SourceFile */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: - case 266 /* ModuleDeclaration */: + case 312 /* SourceFile */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: + case 267 /* ModuleDeclaration */: return node; } } } function getNodeKind(node) { switch (node.kind) { - case 311 /* SourceFile */: + case 312 /* SourceFile */: return isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: return "class" /* classElement */; - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 264 /* TypeAliasDeclaration */: - case 344 /* JSDocCallbackTag */: - case 352 /* JSDocTypedefTag */: + case 265 /* TypeAliasDeclaration */: + case 345 /* JSDocCallbackTag */: + case 353 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: return "enum" /* enumElement */; - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 207 /* BindingElement */: + case 208 /* BindingElement */: return getKindOfVariableDeclaration(getRootDeclaration(node)); - case 218 /* ArrowFunction */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: return "function" /* functionElement */; - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: const { initializer } = node; return isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 303 /* ShorthandPropertyAssignment */: - case 304 /* SpreadAssignment */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 304 /* ShorthandPropertyAssignment */: + case 305 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 180 /* IndexSignature */: + case 181 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 179 /* ConstructSignature */: + case 180 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 178 /* CallSignature */: + case 179 /* CallSignature */: return "call" /* callSignatureElement */; - case 175 /* Constructor */: - case 174 /* ClassStaticBlockDeclaration */: + case 176 /* Constructor */: + case 175 /* ClassStaticBlockDeclaration */: return "constructor" /* constructorImplementationElement */; - case 167 /* TypeParameter */: + case 168 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 305 /* EnumMember */: + case 306 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 168 /* Parameter */: - return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 270 /* ImportEqualsDeclaration */: - case 275 /* ImportSpecifier */: - case 280 /* ExportSpecifier */: - case 273 /* NamespaceImport */: - case 279 /* NamespaceExport */: + case 169 /* Parameter */: + return hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 271 /* ImportEqualsDeclaration */: + case 276 /* ImportSpecifier */: + case 281 /* ExportSpecifier */: + case 274 /* NamespaceImport */: + case 280 /* NamespaceExport */: return "alias" /* alias */; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: const kind = getAssignmentDeclarationKind(node); const { right } = node; switch (kind) { @@ -397024,7 +401876,7 @@ ${lanes.join("\n")} } case 80 /* Identifier */: return isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: const scriptKind = getNodeKind(node.expression); return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; default: @@ -397039,7 +401891,7 @@ ${lanes.join("\n")} case 110 /* ThisKeyword */: return true; case 80 /* Identifier */: - return identifierIsThisKeyword(node) && node.parent.kind === 168 /* Parameter */; + return identifierIsThisKeyword(node) && node.parent.kind === 169 /* Parameter */; default: return false; } @@ -397087,41 +401939,41 @@ ${lanes.join("\n")} return false; } switch (n.kind) { - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: - case 209 /* ObjectLiteralExpression */: - case 205 /* ObjectBindingPattern */: - case 186 /* TypeLiteral */: - case 240 /* Block */: - case 267 /* ModuleBlock */: - case 268 /* CaseBlock */: - case 274 /* NamedImports */: - case 278 /* NamedExports */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: + case 210 /* ObjectLiteralExpression */: + case 206 /* ObjectBindingPattern */: + case 187 /* TypeLiteral */: + case 241 /* Block */: + case 268 /* ModuleBlock */: + case 269 /* CaseBlock */: + case 275 /* NamedImports */: + case 279 /* NamedExports */: return nodeEndsWith(n, 20 /* CloseBraceToken */, sourceFile); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 213 /* NewExpression */: + case 214 /* NewExpression */: if (!n.arguments) { return true; } - case 212 /* CallExpression */: - case 216 /* ParenthesizedExpression */: - case 195 /* ParenthesizedType */: + case 213 /* CallExpression */: + case 217 /* ParenthesizedExpression */: + case 196 /* ParenthesizedType */: return nodeEndsWith(n, 22 /* CloseParenToken */, sourceFile); - case 183 /* FunctionType */: - case 184 /* ConstructorType */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 179 /* ConstructSignature */: - case 178 /* CallSignature */: - case 218 /* ArrowFunction */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 180 /* ConstructSignature */: + case 179 /* CallSignature */: + case 219 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -397129,60 +401981,60 @@ ${lanes.join("\n")} return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 22 /* CloseParenToken */, sourceFile); - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 244 /* IfStatement */: + case 245 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 27 /* SemicolonToken */, sourceFile); - case 208 /* ArrayLiteralExpression */: - case 206 /* ArrayBindingPattern */: - case 211 /* ElementAccessExpression */: - case 166 /* ComputedPropertyName */: - case 188 /* TupleType */: + case 209 /* ArrayLiteralExpression */: + case 207 /* ArrayBindingPattern */: + case 212 /* ElementAccessExpression */: + case 167 /* ComputedPropertyName */: + case 189 /* TupleType */: return nodeEndsWith(n, 24 /* CloseBracketToken */, sourceFile); - case 180 /* IndexSignature */: + case 181 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 24 /* CloseBracketToken */, sourceFile); - case 295 /* CaseClause */: - case 296 /* DefaultClause */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: return false; - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 246 /* WhileStatement */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 247 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 245 /* DoStatement */: + case 246 /* DoStatement */: return hasChildOfKind(n, 117 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 22 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 185 /* TypeQuery */: + case 186 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 220 /* TypeOfExpression */: - case 219 /* DeleteExpression */: - case 221 /* VoidExpression */: - case 228 /* YieldExpression */: - case 229 /* SpreadElement */: + case 221 /* TypeOfExpression */: + case 220 /* DeleteExpression */: + case 222 /* VoidExpression */: + case 229 /* YieldExpression */: + case 230 /* SpreadElement */: const unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 227 /* TemplateExpression */: + case 228 /* TemplateExpression */: const lastSpan = lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 238 /* TemplateSpan */: + case 239 /* TemplateSpan */: return nodeIsPresent(n.literal); - case 277 /* ExportDeclaration */: - case 271 /* ImportDeclaration */: + case 278 /* ExportDeclaration */: + case 272 /* ImportDeclaration */: return nodeIsPresent(n.moduleSpecifier); - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 226 /* ConditionalExpression */: + case 227 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -397273,7 +402125,7 @@ ${lanes.join("\n")} return lastTypeNode; } function getContextualTypeFromParentOrAncestorTypeNode(node, checker) { - if (node.flags & (8388608 /* JSDoc */ & ~262144 /* JavaScriptFile */)) + if (node.flags & (16777216 /* JSDoc */ & ~524288 /* JavaScriptFile */)) return void 0; const contextualType = getContextualTypeFromParent(node, checker); if (contextualType) @@ -397284,13 +402136,13 @@ ${lanes.join("\n")} function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: return getAdjustedLocationForFunction(node); - case 175 /* Constructor */: + case 176 /* Constructor */: return node; } } @@ -397399,7 +402251,7 @@ ${lanes.join("\n")} if (node.kind === 149 /* RequireKeyword */ && isExternalModuleReference(parent2)) { return parent2.expression; } - if (node.kind === 160 /* FromKeyword */ && (isImportDeclaration(parent2) || isExportDeclaration(parent2)) && parent2.moduleSpecifier) { + if (node.kind === 161 /* FromKeyword */ && (isImportDeclaration(parent2) || isExportDeclaration(parent2)) && parent2.moduleSpecifier) { return parent2.moduleSpecifier; } if ((node.kind === 96 /* ExtendsKeyword */ || node.kind === 119 /* ImplementsKeyword */) && isHeritageClause(parent2) && parent2.token === node.kind) { @@ -397440,7 +402292,7 @@ ${lanes.join("\n")} if (node.kind === 130 /* AsKeyword */ && isAsExpression(parent2) && isTypeReferenceNode(parent2.type)) { return parent2.type.typeName; } - if (node.kind === 103 /* InKeyword */ && isForInStatement(parent2) || node.kind === 164 /* OfKeyword */ && isForOfStatement(parent2)) { + if (node.kind === 103 /* InKeyword */ && isForInStatement(parent2) || node.kind === 165 /* OfKeyword */ && isForOfStatement(parent2)) { return skipOuterExpressions(parent2.expression); } } @@ -397633,7 +402485,7 @@ ${lanes.join("\n")} } } } - Debug.assert(startNode2 !== void 0 || n.kind === 311 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n)); + Debug.assert(startNode2 !== void 0 || n.kind === 312 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || isJSDocCommentContainingNode(n)); const candidate = findRightmostChildNodeWithTokens( children, /*exclusiveStartPosition*/ @@ -397668,7 +402520,7 @@ ${lanes.join("\n")} for (let i = exclusiveStartPosition - 1; i >= 0; i--) { const child = children[i]; if (isWhiteSpaceOnlyJsxText(child)) { - if (i === 0 && (parentKind === 12 /* JsxText */ || parentKind === 284 /* JsxSelfClosingElement */)) { + if (i === 0 && (parentKind === 12 /* JsxText */ || parentKind === 285 /* JsxSelfClosingElement */)) { Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); } } else if (nodeHasTokens(children[i], sourceFile)) { @@ -397700,13 +402552,13 @@ ${lanes.join("\n")} if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 12 /* JsxText */) { return true; } - if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 293 /* JsxExpression */) { + if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 294 /* JsxExpression */) { return true; } - if (token && token.kind === 20 /* CloseBraceToken */ && token.parent.kind === 293 /* JsxExpression */) { + if (token && token.kind === 20 /* CloseBraceToken */ && token.parent.kind === 294 /* JsxExpression */) { return true; } - if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 286 /* JsxClosingElement */) { + if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 287 /* JsxClosingElement */) { return true; } return false; @@ -397734,9 +402586,9 @@ ${lanes.join("\n")} function isInsideJsxElement(sourceFile, position) { function isInsideJsxElementTraversal(node) { while (node) { - if (node.kind >= 284 /* JsxSelfClosingElement */ && node.kind <= 293 /* JsxExpression */ || node.kind === 12 /* JsxText */ || node.kind === 30 /* LessThanToken */ || node.kind === 32 /* GreaterThanToken */ || node.kind === 80 /* Identifier */ || node.kind === 20 /* CloseBraceToken */ || node.kind === 19 /* OpenBraceToken */ || node.kind === 44 /* SlashToken */) { + if (node.kind >= 285 /* JsxSelfClosingElement */ && node.kind <= 294 /* JsxExpression */ || node.kind === 12 /* JsxText */ || node.kind === 30 /* LessThanToken */ || node.kind === 32 /* GreaterThanToken */ || node.kind === 80 /* Identifier */ || node.kind === 20 /* CloseBraceToken */ || node.kind === 19 /* OpenBraceToken */ || node.kind === 44 /* SlashToken */) { node = node.parent; - } else if (node.kind === 283 /* JsxElement */) { + } else if (node.kind === 284 /* JsxElement */) { if (position > node.getStart(sourceFile)) return true; node = node.parent; @@ -397892,31 +402744,31 @@ ${lanes.join("\n")} function getNodeModifiers(node, excludeFlags = 0 /* None */) { const result = []; const flags = isDeclaration(node) ? getCombinedNodeFlagsAlwaysIncludeJSDoc(node) & ~excludeFlags : 0 /* None */; - if (flags & 8 /* Private */) + if (flags & 2 /* Private */) result.push("private" /* privateMemberModifier */); - if (flags & 16 /* Protected */) + if (flags & 4 /* Protected */) result.push("protected" /* protectedMemberModifier */); - if (flags & 4 /* Public */) + if (flags & 1 /* Public */) result.push("public" /* publicMemberModifier */); - if (flags & 32 /* Static */ || isClassStaticBlockDeclaration(node)) + if (flags & 256 /* Static */ || isClassStaticBlockDeclaration(node)) result.push("static" /* staticModifier */); - if (flags & 256 /* Abstract */) + if (flags & 64 /* Abstract */) result.push("abstract" /* abstractModifier */); - if (flags & 1 /* Export */) + if (flags & 32 /* Export */) result.push("export" /* exportedModifier */); - if (flags & 8192 /* Deprecated */) + if (flags & 65536 /* Deprecated */) result.push("deprecated" /* deprecatedModifier */); - if (node.flags & 16777216 /* Ambient */) + if (node.flags & 33554432 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 276 /* ExportAssignment */) + if (node.kind === 277 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 182 /* TypeReference */ || node.kind === 212 /* CallExpression */) { + if (node.kind === 183 /* TypeReference */ || node.kind === 213 /* CallExpression */) { return node.typeArguments; } - if (isFunctionLike(node) || node.kind === 262 /* ClassDeclaration */ || node.kind === 263 /* InterfaceDeclaration */) { + if (isFunctionLike(node) || node.kind === 263 /* ClassDeclaration */ || node.kind === 264 /* InterfaceDeclaration */) { return node.typeParameters; } return void 0; @@ -397958,14 +402810,14 @@ ${lanes.join("\n")} return result; } function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 208 /* ArrayLiteralExpression */ || node.kind === 209 /* ObjectLiteralExpression */) { - if (node.parent.kind === 225 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */) { + if (node.kind === 209 /* ArrayLiteralExpression */ || node.kind === 210 /* ObjectLiteralExpression */) { + if (node.parent.kind === 226 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 64 /* EqualsToken */) { return true; } - if (node.parent.kind === 249 /* ForOfStatement */ && node.parent.initializer === node) { + if (node.parent.kind === 250 /* ForOfStatement */ && node.parent.initializer === node) { return true; } - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 302 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 303 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -398063,7 +402915,7 @@ ${lanes.join("\n")} return type.isTypeParameter() ? type.getConstraint() || type : type; } function getNameFromPropertyName(name) { - return name.kind === 166 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name); + return name.kind === 167 /* ComputedPropertyName */ ? isStringOrNumericLiteralLike(name.expression) ? name.expression.text : void 0 : isPrivateIdentifier(name) ? idText(name) : getTextOfIdentifierOrLiteral(name); } function programContainsModules(program) { return program.getSourceFiles().some((s) => !s.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s) && !!(s.externalModuleIndicator || s.commonJsModuleIndicator)); @@ -398091,7 +402943,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) { @@ -398112,7 +402965,7 @@ ${lanes.join("\n")} void 0, defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0, typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier, - /*assertClause*/ + /*attributes*/ void 0 ); } @@ -398185,7 +403038,7 @@ ${lanes.join("\n")} } function insertImports(changes, sourceFile, imports, blankLineBetween, preferences) { const decl = isArray(imports) ? imports[0] : imports; - const importKindPredicate = decl.kind === 242 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; + const importKindPredicate = decl.kind === 243 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax; const existingImportStatements = filter(sourceFile.statements, importKindPredicate); let sortKind = isArray(imports) ? ts_OrganizeImports_exports.detectImportDeclarationSorting(imports, preferences) : 3 /* Both */; const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */); @@ -398227,8 +403080,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) { @@ -398295,7 +403151,7 @@ ${lanes.join("\n")} const absoluteMaximumLength = defaultMaximumTruncationLength * 10; let displayParts; let lineStart; - let indent2; + let indent3; let length2; resetWriter(); const unknownWrite = (text) => writeKind(text, 17 /* text */); @@ -398331,12 +403187,12 @@ ${lanes.join("\n")} hasTrailingWhitespace: () => false, hasTrailingComment: () => false, rawWrite: notImplemented, - getIndent: () => indent2, + getIndent: () => indent3, increaseIndent: () => { - indent2++; + indent3++; }, decreaseIndent: () => { - indent2--; + indent3--; }, clear: resetWriter }; @@ -398344,7 +403200,7 @@ ${lanes.join("\n")} if (length2 > absoluteMaximumLength) return; if (lineStart) { - const indentString = getIndentString(indent2); + const indentString = getIndentString(indent3); if (indentString) { length2 += indentString.length; displayParts.push(displayPart(indentString, 16 /* space */)); @@ -398376,7 +403232,7 @@ ${lanes.join("\n")} function resetWriter() { displayParts = []; lineStart = true; - indent2 = 0; + indent3 = 0; length2 = 0; } } @@ -398476,16 +403332,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("}")); @@ -398634,7 +403492,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); @@ -398750,18 +403615,18 @@ ${lanes.join("\n")} return idx === -1 ? -1 : idx + 1; } function needsParentheses(expression) { - return isBinaryExpression(expression) && expression.operatorToken.kind === 28 /* CommaToken */ || isObjectLiteralExpression(expression) || isAsExpression(expression) && isObjectLiteralExpression(expression.expression); + return isBinaryExpression(expression) && expression.operatorToken.kind === 28 /* CommaToken */ || isObjectLiteralExpression(expression) || (isAsExpression(expression) || isSatisfiesExpression(expression)) && isObjectLiteralExpression(expression.expression); } function getContextualTypeFromParent(node, checker, contextFlags) { const parent2 = walkUpParenthesizedExpressions(node.parent); switch (parent2.kind) { - case 213 /* NewExpression */: + case 214 /* NewExpression */: return checker.getContextualType(parent2, contextFlags); - case 225 /* BinaryExpression */: { + case 226 /* BinaryExpression */: { const { left, operatorToken, right } = parent2; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags); } - case 295 /* CaseClause */: + case 296 /* CaseClause */: return getSwitchedType(parent2, checker); default: return checker.getContextualType(node, contextFlags); @@ -398770,7 +403635,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) { @@ -398787,8 +403652,8 @@ ${lanes.join("\n")} switch (node.kind) { case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: - case 227 /* TemplateExpression */: - case 214 /* TaggedTemplateExpression */: + case 228 /* TemplateExpression */: + case 215 /* TaggedTemplateExpression */: return true; default: return false; @@ -398823,16 +403688,16 @@ ${lanes.join("\n")} return typeIsAccessible ? res : void 0; } function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 178 /* CallSignature */ || kind === 179 /* ConstructSignature */ || kind === 180 /* IndexSignature */ || kind === 170 /* PropertySignature */ || kind === 172 /* MethodSignature */; + return kind === 179 /* CallSignature */ || kind === 180 /* ConstructSignature */ || kind === 181 /* IndexSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */; } function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 261 /* FunctionDeclaration */ || kind === 175 /* Constructor */ || kind === 173 /* MethodDeclaration */ || kind === 176 /* GetAccessor */ || kind === 177 /* SetAccessor */; + return kind === 262 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; } function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 266 /* ModuleDeclaration */; + return kind === 267 /* ModuleDeclaration */; } function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 242 /* VariableStatement */ || kind === 243 /* ExpressionStatement */ || kind === 245 /* DoStatement */ || kind === 250 /* ContinueStatement */ || kind === 251 /* BreakStatement */ || kind === 252 /* ReturnStatement */ || kind === 256 /* ThrowStatement */ || kind === 258 /* DebuggerStatement */ || kind === 171 /* PropertyDeclaration */ || kind === 264 /* TypeAliasDeclaration */ || kind === 271 /* ImportDeclaration */ || kind === 270 /* ImportEqualsDeclaration */ || kind === 277 /* ExportDeclaration */ || kind === 269 /* NamespaceExportDeclaration */ || kind === 276 /* ExportAssignment */; + return kind === 243 /* VariableStatement */ || kind === 244 /* ExpressionStatement */ || kind === 246 /* DoStatement */ || kind === 251 /* ContinueStatement */ || kind === 252 /* BreakStatement */ || kind === 253 /* ReturnStatement */ || kind === 257 /* ThrowStatement */ || kind === 259 /* DebuggerStatement */ || kind === 172 /* PropertyDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 270 /* NamespaceExportDeclaration */ || kind === 277 /* ExportAssignment */; } function nodeIsASICandidate(node, sourceFile) { const lastToken = node.getLastToken(sourceFile); @@ -398856,7 +403721,7 @@ ${lanes.join("\n")} } else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) { return false; } - if (node.kind === 245 /* DoStatement */) { + if (node.kind === 246 /* DoStatement */) { return true; } const topNode = findAncestor(node, (ancestor) => !ancestor.parent); @@ -399109,7 +403974,7 @@ ${lanes.join("\n")} return false; } function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) { - if (!stringContains(importedFileName, "node_modules")) { + if (!importedFileName.includes("node_modules")) { return void 0; } const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName( @@ -399134,13 +403999,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)); } @@ -399234,13 +404092,16 @@ ${lanes.join("\n")} return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */); } function getDefaultLikeExportNameFromDeclaration(symbol) { - return firstDefined( - symbol.declarations, - (d) => { - var _a, _b; - return isExportAssignment(d) ? (_a = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text; + return firstDefined(symbol.declarations, (d) => { + var _a, _b, _c; + if (isExportAssignment(d)) { + return (_a = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a.text; } - ); + if (isExportSpecifier(d) && d.symbol.flags === 2097152 /* Alias */) { + return (_b = tryCast(d.propertyName, isIdentifier)) == null ? void 0 : _b.text; + } + return (_c = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _c.text; + }); } function getSymbolParentOrFail(symbol) { var _a; @@ -399279,7 +404140,7 @@ ${lanes.join("\n")} return isInJSFile(declaration) || !findAncestor(declaration, (d) => isModuleDeclaration(d) && isGlobalScopeAugmentation(d)); } function isDeprecatedDeclaration(decl) { - return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 8192 /* Deprecated */); + return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 65536 /* Deprecated */); } function shouldUseUriStyleNodeCoreModules(file, program) { const decisionFromFile = firstDefined(file.imports, (node) => { @@ -399420,7 +404281,7 @@ ${lanes.join("\n")} typeKeywords = [ 133 /* AnyKeyword */, 131 /* AssertsKeyword */, - 162 /* BigIntKeyword */, + 163 /* BigIntKeyword */, 136 /* BooleanKeyword */, 97 /* FalseKeyword */, 140 /* InferKeyword */, @@ -399572,7 +404433,7 @@ ${lanes.join("\n")} } }; if (Debug.isDebugging) { - Object.defineProperty(cache, "__cache", { get: () => exportInfo }); + Object.defineProperty(cache, "__cache", { value: exportInfo }); } return cache; function rehydrateCachedInfo(info) { @@ -399591,7 +404452,9 @@ ${lanes.join("\n")} }; } const checker = (isFromPackageJson ? host.getPackageJsonAutoImportProvider() : host.getCurrentProgram()).getTypeChecker(); - const moduleSymbol = info.moduleSymbol || cachedModuleSymbol || Debug.checkDefined(info.moduleFile ? checker.getMergedSymbol(info.moduleFile.symbol) : checker.tryFindAmbientModule(info.moduleName)); + const moduleSymbol = info.moduleSymbol || cachedModuleSymbol || Debug.checkDefined( + info.moduleFile ? checker.getMergedSymbol(info.moduleFile.symbol) : checker.tryFindAmbientModule(info.moduleName) + ); const symbol = info.symbol || cachedSymbol || Debug.checkDefined( exportKind === 2 /* ExportEquals */ ? checker.resolveExternalModuleSymbol(moduleSymbol) : checker.tryGetMemberInModuleExportsAndProperties(unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), `Could not find symbol '${info.symbolName}' by key '${info.symbolTableKey}' in module ${moduleSymbol.name}` @@ -399608,11 +404471,15 @@ ${lanes.join("\n")} } function key(importedName, symbol, ambientModuleName, checker) { const moduleKey = ambientModuleName || ""; - return `${importedName}|${getSymbolId(skipAlias(symbol, checker))}|${moduleKey}`; + return `${importedName.length} ${getSymbolId(skipAlias(symbol, checker))} ${importedName} ${moduleKey}`; } function parseKey(key2) { - const symbolName2 = key2.substring(0, key2.indexOf("|")); - const moduleKey = key2.substring(key2.lastIndexOf("|") + 1); + const firstSpace = key2.indexOf(" "); + const secondSpace = key2.indexOf(" ", firstSpace + 1); + const symbolNameLength = parseInt(key2.substring(0, firstSpace), 10); + const data = key2.substring(secondSpace + 1); + const symbolName2 = data.substring(0, symbolNameLength); + const moduleKey = data.substring(symbolNameLength + 1); const ambientModuleName = moduleKey === "" ? void 0 : moduleKey; return { symbolName: symbolName2, ambientModuleName }; } @@ -399680,12 +404547,12 @@ ${lanes.join("\n")} } function forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, cb) { var _a, _b; - const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host); + const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host); const excludePatterns = preferences.autoImportFileExcludePatterns && mapDefined(preferences.autoImportFileExcludePatterns, (spec) => { - const pattern = getPatternFromSpec(spec, "", "exclude"); - return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames) : void 0; + 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, @@ -399696,7 +404563,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*/ @@ -399717,11 +404584,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 (!stringContains(ambient.name, "*") && !(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*/ @@ -399730,7 +404612,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); } } @@ -400218,13 +405100,13 @@ ${lanes.join("\n")} } function checkForClassificationCancellation(cancellationToken, kind) { switch (kind) { - case 266 /* ModuleDeclaration */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 261 /* FunctionDeclaration */: - case 230 /* ClassExpression */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 267 /* ModuleDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 262 /* FunctionDeclaration */: + case 231 /* ClassExpression */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -400440,49 +405322,49 @@ ${lanes.join("\n")} pos = tag.tagName.end; let commentStart = tag.tagName.end; switch (tag.kind) { - case 347 /* JSDocParameterTag */: + case 348 /* JSDocParameterTag */: const param = tag; processJSDocParameterTag(param); commentStart = param.isNameFirst && ((_a = param.typeExpression) == null ? void 0 : _a.end) || param.name.end; break; - case 354 /* JSDocPropertyTag */: + case 355 /* JSDocPropertyTag */: const prop = tag; commentStart = prop.isNameFirst && ((_b = prop.typeExpression) == null ? void 0 : _b.end) || prop.name.end; break; - case 351 /* JSDocTemplateTag */: + case 352 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; commentStart = tag.typeParameters.end; break; - case 352 /* JSDocTypedefTag */: + case 353 /* JSDocTypedefTag */: const type = tag; - commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 315 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart; + commentStart = ((_c = type.typeExpression) == null ? void 0 : _c.kind) === 316 /* JSDocTypeExpression */ && ((_d = type.fullName) == null ? void 0 : _d.end) || ((_e = type.typeExpression) == null ? void 0 : _e.end) || commentStart; break; - case 344 /* JSDocCallbackTag */: + case 345 /* JSDocCallbackTag */: commentStart = tag.typeExpression.end; break; - case 350 /* JSDocTypeTag */: + case 351 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; commentStart = tag.typeExpression.end; break; - case 349 /* JSDocThisTag */: - case 346 /* JSDocEnumTag */: + case 350 /* JSDocThisTag */: + case 347 /* JSDocEnumTag */: commentStart = tag.typeExpression.end; break; - case 348 /* JSDocReturnTag */: + case 349 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; commentStart = ((_f = tag.typeExpression) == null ? void 0 : _f.end) || commentStart; break; - case 353 /* JSDocSeeTag */: + case 354 /* JSDocSeeTag */: commentStart = ((_g = tag.name) == null ? void 0 : _g.end) || commentStart; break; - case 334 /* JSDocAugmentsTag */: - case 335 /* JSDocImplementsTag */: + case 335 /* JSDocAugmentsTag */: + case 336 /* JSDocImplementsTag */: commentStart = tag.class.end; break; - case 355 /* JSDocThrowsTag */: + case 356 /* JSDocThrowsTag */: processElement(tag.typeExpression); pos = tag.end; commentStart = ((_h = tag.typeExpression) == null ? void 0 : _h.end) || commentStart; @@ -400627,22 +405509,22 @@ ${lanes.join("\n")} } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 285 /* JsxOpeningElement */: + case 286 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 286 /* JsxClosingElement */: + case 287 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 284 /* JsxSelfClosingElement */: + case 285 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 290 /* JsxAttribute */: + case 291 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -400663,11 +405545,11 @@ ${lanes.join("\n")} if (token) { const parent2 = token.parent; if (tokenKind === 64 /* EqualsToken */) { - if (parent2.kind === 259 /* VariableDeclaration */ || parent2.kind === 171 /* PropertyDeclaration */ || parent2.kind === 168 /* Parameter */ || parent2.kind === 290 /* JsxAttribute */) { + if (parent2.kind === 260 /* VariableDeclaration */ || parent2.kind === 172 /* PropertyDeclaration */ || parent2.kind === 169 /* Parameter */ || parent2.kind === 291 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent2.kind === 225 /* BinaryExpression */ || parent2.kind === 223 /* PrefixUnaryExpression */ || parent2.kind === 224 /* PostfixUnaryExpression */ || parent2.kind === 226 /* ConditionalExpression */) { + if (parent2.kind === 226 /* BinaryExpression */ || parent2.kind === 224 /* PrefixUnaryExpression */ || parent2.kind === 225 /* PostfixUnaryExpression */ || parent2.kind === 227 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -400677,7 +405559,7 @@ ${lanes.join("\n")} } else if (tokenKind === 10 /* BigIntLiteral */) { return 25 /* bigintLiteral */; } else if (tokenKind === 11 /* StringLiteral */) { - return token && token.parent.kind === 290 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 291 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 14 /* RegularExpressionLiteral */) { return 6 /* stringLiteral */; } else if (isTemplateLiteralKind(tokenKind)) { @@ -400687,32 +405569,32 @@ ${lanes.join("\n")} } else if (tokenKind === 80 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 167 /* TypeParameter */: + case 168 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 168 /* Parameter */: + case 169 /* Parameter */: if (token.parent.name === token) { return isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -400744,21 +405626,25 @@ ${lanes.join("\n")} "src/services/classifier.ts"() { "use strict"; init_ts4(); - noRegexTable = arrayToNumericMap([ - 80 /* Identifier */, - 11 /* StringLiteral */, - 9 /* NumericLiteral */, - 10 /* BigIntLiteral */, - 14 /* RegularExpressionLiteral */, - 110 /* ThisKeyword */, - 46 /* PlusPlusToken */, - 47 /* MinusMinusToken */, - 22 /* CloseParenToken */, - 24 /* CloseBracketToken */, - 20 /* CloseBraceToken */, - 112 /* TrueKeyword */, - 97 /* FalseKeyword */ - ], (token) => token, () => true); + noRegexTable = arrayToNumericMap( + [ + 80 /* Identifier */, + 11 /* StringLiteral */, + 9 /* NumericLiteral */, + 10 /* BigIntLiteral */, + 14 /* RegularExpressionLiteral */, + 110 /* ThisKeyword */, + 46 /* PlusPlusToken */, + 47 /* MinusMinusToken */, + 22 /* CloseParenToken */, + 24 /* CloseBracketToken */, + 20 /* CloseBraceToken */, + 112 /* TrueKeyword */, + 97 /* FalseKeyword */ + ], + (token) => token, + () => true + ); } }); @@ -400768,7 +405654,7 @@ ${lanes.join("\n")} "src/services/documentHighlights.ts"() { "use strict"; init_ts4(); - ((DocumentHighlights2) => { + ((DocumentHighlights3) => { function getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch) { const node = getTouchingPropertyName(sourceFile, position); if (node.parent && (isJsxOpeningElement(node.parent) && node.parent.tagName === node || isJsxClosingElement(node.parent))) { @@ -400778,7 +405664,7 @@ ${lanes.join("\n")} } return getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); } - DocumentHighlights2.getDocumentHighlights = getDocumentHighlights; + DocumentHighlights3.getDocumentHighlights = getDocumentHighlights; function getHighlightSpanForNode(node, sourceFile) { return { fileName: sourceFile.fileName, @@ -400865,6 +405751,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; @@ -400897,7 +405784,7 @@ ${lanes.join("\n")} let child = throwStatement; while (child.parent) { const parent2 = child.parent; - if (isFunctionBlock(parent2) || parent2.kind === 311 /* SourceFile */) { + if (isFunctionBlock(parent2) || parent2.kind === 312 /* SourceFile */) { return parent2; } if (isTryStatement(parent2) && parent2.tryBlock === child && parent2.catchClause) { @@ -400927,15 +405814,15 @@ ${lanes.join("\n")} function getBreakOrContinueOwner(statement) { return findAncestor(statement, (node) => { switch (node.kind) { - case 254 /* SwitchStatement */: - if (statement.kind === 250 /* ContinueStatement */) { + case 255 /* SwitchStatement */: + if (statement.kind === 251 /* ContinueStatement */) { return false; } - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 246 /* WhileStatement */: - case 245 /* DoStatement */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 247 /* WhileStatement */: + case 246 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: return isFunctionLike(node) && "quit"; @@ -400948,35 +405835,35 @@ ${lanes.join("\n")} function getNodesToSearchForModifier(declaration, modifierFlag) { const container = declaration.parent; switch (container.kind) { - case 267 /* ModuleBlock */: - case 311 /* SourceFile */: - case 240 /* Block */: - case 295 /* CaseClause */: - case 296 /* DefaultClause */: - if (modifierFlag & 256 /* Abstract */ && isClassDeclaration(declaration)) { + case 268 /* ModuleBlock */: + case 312 /* SourceFile */: + case 241 /* Block */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: + if (modifierFlag & 64 /* Abstract */ && isClassDeclaration(declaration)) { return [...declaration.members, declaration]; } else { return container.statements; } - case 175 /* Constructor */: - case 173 /* MethodDeclaration */: - case 261 /* FunctionDeclaration */: + case 176 /* Constructor */: + case 174 /* MethodDeclaration */: + case 262 /* FunctionDeclaration */: return [...container.parameters, ...isClassLike(container.parent) ? container.parent.members : []]; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 186 /* TypeLiteral */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 187 /* TypeLiteral */: const nodes = container.members; - if (modifierFlag & (28 /* AccessibilityModifier */ | 64 /* Readonly */)) { + if (modifierFlag & (7 /* AccessibilityModifier */ | 8 /* Readonly */)) { const constructor = find(container.members, isConstructorDeclaration); if (constructor) { return [...nodes, ...constructor.parameters]; } - } else if (modifierFlag & 256 /* Abstract */) { + } else if (modifierFlag & 64 /* Abstract */) { return [...nodes, container]; } return nodes; - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return void 0; default: Debug.assertNever(container, "Invalid container kind."); @@ -400992,7 +405879,7 @@ ${lanes.join("\n")} function getLoopBreakContinueOccurrences(loopNode) { const keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 99 /* ForKeyword */, 117 /* WhileKeyword */, 92 /* DoKeyword */)) { - if (loopNode.kind === 245 /* DoStatement */) { + if (loopNode.kind === 246 /* DoStatement */) { const loopTokens = loopNode.getChildren(); for (let i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 117 /* WhileKeyword */)) { @@ -401012,13 +405899,13 @@ ${lanes.join("\n")} const owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 245 /* DoStatement */: - case 246 /* WhileStatement */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -401179,12 +406066,12 @@ ${lanes.join("\n")} function isDocumentRegistryEntry(entry) { return !!entry.sourceFile; } - function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) { - return createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory); + function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode) { + return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode); } - function createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory = "", externalCache) { + function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", jsDocParsingMode, externalCache) { const buckets = /* @__PURE__ */ new Map(); - const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); + const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2); function reportStats() { const bucketInfoArray = arrayFrom(buckets.keys()).filter((name) => name && name.charAt(0) === "_").map((name) => { const entries = buckets.get(name); @@ -401266,9 +406153,11 @@ ${lanes.join("\n")} const sourceFileOptions = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: scriptTarget, impliedNodeFormat: host && getImpliedNodeFormatForFile(path, (_d = (_c = (_b = (_a = host.getCompilerHost) == null ? void 0 : _a.call(host)) == null ? void 0 : _b.getModuleResolutionCache) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d.getPackageJsonInfoCache(), host, compilationSettings), - setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings) + setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings), + jsDocParsingMode }; sourceFileOptions.languageVersion = scriptTarget; + Debug.assertEqual(jsDocParsingMode, sourceFileOptions.jsDocParsingMode); const oldBucketCount = buckets.size; const keyWithMode = getDocumentRegistryBucketKeyWithMode(key, sourceFileOptions.impliedNodeFormat); const bucket = getOrUpdate(buckets, keyWithMode, () => /* @__PURE__ */ new Map()); @@ -401314,12 +406203,7 @@ ${lanes.join("\n")} setBucketEntry(); } else { if (entry.sourceFile.version !== version2) { - entry.sourceFile = updateLanguageServiceSourceFile( - entry.sourceFile, - scriptSnapshot, - version2, - scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot) - ); + entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version2, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); if (externalCache) { externalCache.setDocument(keyWithMode, path, entry.sourceFile); } @@ -401365,13 +406249,6 @@ ${lanes.join("\n")} } } } - function getLanguageServiceRefCounts(path, scriptKind) { - return arrayFrom(buckets.entries(), ([key, bucket]) => { - const bucketEntry = bucket.get(path); - const entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind); - return [key, entry && entry.languageServiceRefCount]; - }); - } return { acquireDocument, acquireDocumentWithKey, @@ -401379,9 +406256,10 @@ ${lanes.join("\n")} updateDocumentWithKey, releaseDocument, releaseDocumentWithKey, - getLanguageServiceRefCounts, + getKeyForCompilationSettings, + getDocumentRegistryBucketKeyWithMode, reportStats, - getKeyForCompilationSettings + getBuckets: () => buckets }; } function getKeyForCompilationSettings(settings) { @@ -401399,12 +406277,12 @@ ${lanes.join("\n")} // src/services/getEditsForFileRename.ts function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) { - const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host); - const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); + const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host); + const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); const oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper); const newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper); return ts_textChanges_exports.ChangeTracker.with({ host, formatContext, preferences }, (changeTracker) => { - updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames); + updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames2); updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName); }); } @@ -401426,7 +406304,7 @@ ${lanes.join("\n")} const rel = getRelativePathFromFile(a0, b0, getCanonicalFileName); return combinePathsSafe(getDirectoryPath(a1), rel); } - function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames) { + function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames2) { const { configFile } = program.getCompilerOptions(); if (!configFile) return; @@ -401450,10 +406328,10 @@ ${lanes.join("\n")} /*excludes*/ [], includes, - useCaseSensitiveFileNames, + useCaseSensitiveFileNames2, currentDirectory ); - if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(newFileOrDirPath)) { + if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(newFileOrDirPath)) { changeTracker.insertNodeAfter(configFile, last(property.initializer.elements), factory.createStringLiteral(relativePath(newFileOrDirPath))); } return; @@ -401501,7 +406379,7 @@ ${lanes.join("\n")} configDir, path, /*ignoreCase*/ - !useCaseSensitiveFileNames + !useCaseSensitiveFileNames2 ); } } @@ -401515,29 +406393,19 @@ ${lanes.join("\n")} const oldImportFromPath = oldFromNew || sourceFile.fileName; const oldImportFromDirectory = getDirectoryPath(oldImportFromPath); const importingSourceFileMoved = newFromOld !== void 0 || oldFromNew !== void 0; - updateImportsWorker( - sourceFile, - changeTracker, - (referenceText) => { - if (!pathIsRelative(referenceText)) - return void 0; - const oldAbsolute = combinePathsSafe(oldImportFromDirectory, referenceText); - const newAbsolute = oldToNew(oldAbsolute); - return newAbsolute === void 0 ? void 0 : ensurePathIsNonModuleName(getRelativePathFromDirectory(newImportFromDirectory, newAbsolute, getCanonicalFileName)); - }, - (importLiteral) => { - const importedModuleSymbol = program.getTypeChecker().getSymbolAtLocation(importLiteral); - 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; - } - ); + updateImportsWorker(sourceFile, changeTracker, (referenceText) => { + if (!pathIsRelative(referenceText)) + return void 0; + const oldAbsolute = combinePathsSafe(oldImportFromDirectory, referenceText); + const newAbsolute = oldToNew(oldAbsolute); + return newAbsolute === void 0 ? void 0 : ensurePathIsNonModuleName(getRelativePathFromDirectory(newImportFromDirectory, newAbsolute, getCanonicalFileName)); + }, (importLiteral) => { + const importedModuleSymbol = program.getTypeChecker().getSymbolAtLocation(importLiteral); + 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, newImportFromPath, toImport.newFileName, createModuleSpecifierResolutionHost(program, host), importLiteral.text) : void 0; + }); } } function combineNormal(pathA, pathB) { @@ -401547,14 +406415,13 @@ ${lanes.join("\n")} return ensurePathIsNonModuleName(combineNormal(pathA, pathB)); } function getSourceFileToImport(importedModuleSymbol, importLiteral, importingSourceFile, program, host, oldToNew) { - var _a; if (importedModuleSymbol) { const oldFileName = find(importedModuleSymbol.declarations, isSourceFile).fileName; 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 ? (_a = importingSourceFile.resolvedModules) == null ? void 0 : _a.get(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()); } } @@ -401623,6 +406490,21 @@ ${lanes.join("\n")} function createPatternMatcher(pattern) { const stringToWordSpans = /* @__PURE__ */ new Map(); const dotSeparatedSegments = pattern.trim().split(".").map((p) => createSegment(p.trim())); + if (dotSeparatedSegments.length === 1 && dotSeparatedSegments[0].totalTextChunk.text === "") { + return { + getMatchForLastSegmentOfPattern: () => createPatternMatch( + 2 /* substring */, + /*isCaseSensitive*/ + true + ), + getFullMatch: () => createPatternMatch( + 2 /* substring */, + /*isCaseSensitive*/ + true + ), + patternContainsDots: false + }; + } if (dotSeparatedSegments.some((segment) => !segment.subWordTextChunks.length)) return void 0; return { @@ -402048,7 +406930,7 @@ ${lanes.join("\n")} if (token === 156 /* TypeKeyword */) { const skipTypeKeyword = scanner.lookAhead(() => { const token2 = scanner.scan(); - return token2 !== 160 /* FromKeyword */ && (token2 === 42 /* AsteriskToken */ || token2 === 19 /* OpenBraceToken */ || token2 === 80 /* Identifier */ || isKeyword(token2)); + return token2 !== 161 /* FromKeyword */ && (token2 === 42 /* AsteriskToken */ || token2 === 19 /* OpenBraceToken */ || token2 === 80 /* Identifier */ || isKeyword(token2)); }); if (skipTypeKeyword) { token = nextToken(); @@ -402056,7 +406938,7 @@ ${lanes.join("\n")} } if (token === 80 /* Identifier */ || isKeyword(token)) { token = nextToken(); - if (token === 160 /* FromKeyword */) { + if (token === 161 /* FromKeyword */) { token = nextToken(); if (token === 11 /* StringLiteral */) { recordModuleName(); @@ -402082,7 +406964,7 @@ ${lanes.join("\n")} } if (token === 20 /* CloseBraceToken */) { token = nextToken(); - if (token === 160 /* FromKeyword */) { + if (token === 161 /* FromKeyword */) { token = nextToken(); if (token === 11 /* StringLiteral */) { recordModuleName(); @@ -402095,7 +406977,7 @@ ${lanes.join("\n")} token = nextToken(); if (token === 80 /* Identifier */ || isKeyword(token)) { token = nextToken(); - if (token === 160 /* FromKeyword */) { + if (token === 161 /* FromKeyword */) { token = nextToken(); if (token === 11 /* StringLiteral */) { recordModuleName(); @@ -402130,7 +407012,7 @@ ${lanes.join("\n")} } if (token === 20 /* CloseBraceToken */) { token = nextToken(); - if (token === 160 /* FromKeyword */) { + if (token === 161 /* FromKeyword */) { token = nextToken(); if (token === 11 /* StringLiteral */) { recordModuleName(); @@ -402139,7 +407021,7 @@ ${lanes.join("\n")} } } else if (token === 42 /* AsteriskToken */) { token = nextToken(); - if (token === 160 /* FromKeyword */) { + if (token === 161 /* FromKeyword */) { token = nextToken(); if (token === 11 /* StringLiteral */) { recordModuleName(); @@ -402379,11 +407261,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; @@ -402453,12 +407335,13 @@ ${lanes.join("\n")} "src/services/sourcemaps.ts"() { "use strict"; init_ts4(); - base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/; + base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+/=]+)$)?/; } }); // src/services/suggestionDiagnostics.ts function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { + var _a; program.getSemanticDiagnostics(sourceFile, cancellationToken); const diags = []; const checker = program.getTypeChecker(); @@ -402475,7 +407358,7 @@ ${lanes.join("\n")} const name = importNameForConvertToDefaultImport(importNode); if (!name) continue; - const module2 = getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier)); + 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)); @@ -402501,8 +407384,8 @@ ${lanes.join("\n")} diags.push(createDiagnosticForNode(init, Diagnostics.require_call_may_be_converted_to_an_import)); } } - const jsdocTypedefNode = ts_codefix_exports.getJSDocTypedefNode(node); - if (jsdocTypedefNode) { + const jsdocTypedefNodes = ts_codefix_exports.getJSDocTypedefNodes(node); + for (const jsdocTypedefNode of jsdocTypedefNodes) { diags.push(createDiagnosticForNode(jsdocTypedefNode, Diagnostics.JSDoc_typedef_may_be_converted_to_TypeScript_type)); } if (ts_codefix_exports.parameterShouldGetTypeFromJSDoc(node)) { @@ -402518,13 +407401,13 @@ ${lanes.join("\n")} function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some((statement) => { switch (statement.kind) { - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return statement.declarationList.declarations.some((decl) => !!decl.initializer && isRequireCall( propertyAccessLeftHandSide(decl.initializer), /*requireStringLiteralLikeArgument*/ true )); - case 243 /* ExpressionStatement */: { + case 244 /* ExpressionStatement */: { const { expression } = statement; if (!isBinaryExpression(expression)) return isRequireCall( @@ -402545,10 +407428,10 @@ ${lanes.join("\n")} } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: const { importClause, moduleSpecifier } = node; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 273 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0; - case 270 /* ImportEqualsDeclaration */: + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 274 /* NamespaceImport */ && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0; + case 271 /* ImportEqualsDeclaration */: return node.name; default: return void 0; @@ -402612,18 +407495,18 @@ ${lanes.join("\n")} } function isFixablePromiseArgument(arg, checker) { switch (arg.kind) { - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: const functionFlags = getFunctionFlags(arg); if (functionFlags & 1 /* Generator */) { return false; } - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); case 106 /* NullKeyword */: return true; case 80 /* Identifier */: - case 210 /* PropertyAccessExpression */: { + case 211 /* PropertyAccessExpression */: { const symbol = checker.getSymbolAtLocation(arg); if (!symbol) { return false; @@ -402657,10 +407540,10 @@ ${lanes.join("\n")} } function canBeConvertedToAsync(node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 173 /* MethodDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return true; default: return false; @@ -402728,7 +407611,8 @@ ${lanes.join("\n")} compilerHost, options ), - setExternalModuleIndicator: getSetExternalModuleIndicator(options) + setExternalModuleIndicator: getSetExternalModuleIndicator(options), + jsDocParsingMode: transpileOptions.jsDocParsingMode ?? 0 /* ParseAll */ } ); if (transpileOptions.moduleName) { @@ -402806,30 +407690,37 @@ ${lanes.join("\n")} }); // src/services/navigateTo.ts - function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) { + function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles, excludeLibFiles) { const patternMatcher = createPatternMatcher(searchValue); if (!patternMatcher) return emptyArray; const rawItems = []; + const singleCurrentFile = sourceFiles.length === 1 ? sourceFiles[0] : void 0; for (const sourceFile of sourceFiles) { cancellationToken.throwIfCancellationRequested(); if (excludeDtsFiles && sourceFile.isDeclarationFile) { continue; } + if (shouldExcludeFile(sourceFile, !!excludeLibFiles, singleCurrentFile)) { + continue; + } sourceFile.getNamedDeclarations().forEach((declarations, name) => { - getItemsFromNamedDeclaration(patternMatcher, name, declarations, checker, sourceFile.fileName, rawItems); + getItemsFromNamedDeclaration(patternMatcher, name, declarations, checker, sourceFile.fileName, !!excludeLibFiles, singleCurrentFile, rawItems); }); } rawItems.sort(compareNavigateToItems); return (maxResultCount === void 0 ? rawItems : rawItems.slice(0, maxResultCount)).map(createNavigateToItem); } - function getItemsFromNamedDeclaration(patternMatcher, name, declarations, checker, fileName, rawItems) { + function shouldExcludeFile(file, excludeLibFiles, singleCurrentFile) { + return file !== singleCurrentFile && excludeLibFiles && (isInsideNodeModules(file.path) || file.hasNoDefaultLib); + } + function getItemsFromNamedDeclaration(patternMatcher, name, declarations, checker, fileName, excludeLibFiles, singleCurrentFile, rawItems) { const match = patternMatcher.getMatchForLastSegmentOfPattern(name); if (!match) { return; } for (const declaration of declarations) { - if (!shouldKeepItem(declaration, checker)) + if (!shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile)) continue; if (patternMatcher.patternContainsDots) { const fullMatch = patternMatcher.getFullMatch(getContainers(declaration), name); @@ -402841,21 +407732,22 @@ ${lanes.join("\n")} } } } - function shouldKeepItem(declaration, checker) { + function shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile) { + var _a; switch (declaration.kind) { - case 272 /* ImportClause */: - case 275 /* ImportSpecifier */: - case 270 /* ImportEqualsDeclaration */: + case 273 /* ImportClause */: + case 276 /* ImportSpecifier */: + case 271 /* ImportEqualsDeclaration */: const importer = checker.getSymbolAtLocation(declaration.name); const imported = checker.getAliasedSymbol(importer); - return importer.escapedName !== imported.escapedName; + return importer.escapedName !== imported.escapedName && !((_a = imported.declarations) == null ? void 0 : _a.every((d) => shouldExcludeFile(d.getSourceFile(), excludeLibFiles, singleCurrentFile))); default: return true; } } function tryAddSingleDeclarationName(declaration, containers) { const name = getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 166 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 167 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } function tryAddComputedPropertyName(expression, containers) { return pushLiteral(expression, containers) || isPropertyAccessExpression(expression) && (containers.push(expression.name.text), true) && tryAddComputedPropertyName(expression.expression, containers); @@ -402866,7 +407758,7 @@ ${lanes.join("\n")} function getContainers(declaration) { const containers = []; const name = getNameOfDeclaration(declaration); - if (name && name.kind === 166 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 167 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return emptyArray; } containers.shift(); @@ -403039,7 +407931,14 @@ ${lanes.join("\n")} } } function hasNavigationBarName(node) { - return !hasDynamicName(node) || node.kind !== 225 /* BinaryExpression */ && isPropertyAccessExpression(node.name.expression) && isIdentifier(node.name.expression.expression) && idText(node.name.expression.expression) === "Symbol"; + const name = getNameOfDeclaration(node); + if (name === void 0) + return false; + if (isComputedPropertyName(name)) { + const expression = name.expression; + return isEntityNameExpression(expression) || isNumericLiteral(expression) || isStringOrNumericLiteralLike(expression); + } + return !!name; } function addChildrenRecursively(node) { curCancellationToken.throwIfCancellationRequested(); @@ -403047,7 +407946,7 @@ ${lanes.join("\n")} return; } switch (node.kind) { - case 175 /* Constructor */: + case 176 /* Constructor */: const ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); for (const param of ctr.parameters) { @@ -403056,32 +407955,32 @@ ${lanes.join("\n")} } } break; - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 172 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 173 /* MethodSignature */: if (hasNavigationBarName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: if (hasNavigationBarName(node)) { addNodeWithRecursiveInitializer(node); } break; - case 170 /* PropertySignature */: + case 171 /* PropertySignature */: if (hasNavigationBarName(node)) { addLeafNode(node); } break; - case 272 /* ImportClause */: + case 273 /* ImportClause */: const importClause = node; if (importClause.name) { addLeafNode(importClause.name); } const { namedBindings } = importClause; if (namedBindings) { - if (namedBindings.kind === 273 /* NamespaceImport */) { + if (namedBindings.kind === 274 /* NamespaceImport */) { addLeafNode(namedBindings); } else { for (const element of namedBindings.elements) { @@ -403090,16 +407989,16 @@ ${lanes.join("\n")} } } break; - case 303 /* ShorthandPropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 304 /* SpreadAssignment */: + case 305 /* SpreadAssignment */: const { expression } = node; isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 207 /* BindingElement */: - case 302 /* PropertyAssignment */: - case 259 /* VariableDeclaration */: { + case 208 /* BindingElement */: + case 303 /* PropertyAssignment */: + case 260 /* VariableDeclaration */: { const child = node; if (isBindingPattern(child.name)) { addChildrenRecursively(child.name); @@ -403108,18 +408007,18 @@ ${lanes.join("\n")} } break; } - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: const nameNode = node.name; if (nameNode && isIdentifier(nameNode)) { addTrackedEs5Class(nameNode.text); } addNodeWithRecursiveChild(node, node.body); break; - case 218 /* ArrowFunction */: - case 217 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 218 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: startNode(node); for (const member of node.members) { if (!isComputedProperty(member)) { @@ -403128,19 +408027,19 @@ ${lanes.join("\n")} } endNode(); break; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: startNode(node); for (const member of node.members) { addChildrenRecursively(member); } endNode(); break; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 276 /* ExportAssignment */: { + case 277 /* ExportAssignment */: { const expression2 = node.expression; const child = isObjectLiteralExpression(expression2) || isCallExpression(expression2) ? expression2 : isArrowFunction(expression2) || isFunctionExpression(expression2) ? expression2.body : void 0; if (child) { @@ -403152,16 +408051,16 @@ ${lanes.join("\n")} } break; } - case 280 /* ExportSpecifier */: - case 270 /* ImportEqualsDeclaration */: - case 180 /* IndexSignature */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 264 /* TypeAliasDeclaration */: + case 281 /* ExportSpecifier */: + case 271 /* ImportEqualsDeclaration */: + case 181 /* IndexSignature */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 265 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 212 /* CallExpression */: - case 225 /* BinaryExpression */: { + case 213 /* CallExpression */: + case 226 /* BinaryExpression */: { const special = getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -403190,11 +408089,7 @@ ${lanes.join("\n")} } } } else if (isFunctionExpression(binaryExpression.right) || isArrowFunction(binaryExpression.right)) { - addNodeWithRecursiveChild( - node, - binaryExpression.right, - className - ); + addNodeWithRecursiveChild(node, binaryExpression.right, className); } else { startNode(binaryExpression, className); addNodeWithRecursiveChild(node, binaryExpression.right, assignmentTarget.name); @@ -403319,16 +408214,19 @@ ${lanes.join("\n")} } } } - lastANode = a.node = setTextRange(factory.createClassDeclaration( - /*modifiers*/ - void 0, - a.name || factory.createIdentifier("__class__"), - /*typeParameters*/ - void 0, - /*heritageClauses*/ - void 0, - [] - ), a.node); + lastANode = a.node = setTextRange( + factory.createClassDeclaration( + /*modifiers*/ + void 0, + a.name || factory.createIdentifier("__class__"), + /*typeParameters*/ + void 0, + /*heritageClauses*/ + void 0, + [] + ), + a.node + ); } else { a.children = concatenate(a.children, b.children); if (a.children) { @@ -403341,16 +408239,19 @@ ${lanes.join("\n")} } else { if (!a.additionalNodes) a.additionalNodes = []; - a.additionalNodes.push(setTextRange(factory.createClassDeclaration( - /*modifiers*/ - void 0, - a.name || factory.createIdentifier("__class__"), - /*typeParameters*/ - void 0, - /*heritageClauses*/ - void 0, - [] - ), b.node)); + a.additionalNodes.push(setTextRange( + factory.createClassDeclaration( + /*modifiers*/ + void 0, + a.name || factory.createIdentifier("__class__"), + /*typeParameters*/ + void 0, + /*heritageClauses*/ + void 0, + [] + ), + b.node + )); } return true; } @@ -403371,19 +408272,19 @@ ${lanes.join("\n")} return false; } switch (a.kind) { - case 171 /* PropertyDeclaration */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 172 /* PropertyDeclaration */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return isStatic(a) === isStatic(b); - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return areSameModule(a, b) && getFullyQualifiedModuleName(a) === getFullyQualifiedModuleName(b); default: return true; } } function isSynthesized(node) { - return !!(node.flags & 8 /* Synthesized */); + return !!(node.flags & 16 /* Synthesized */); } function isOwnChild(n, parent2) { const par = isModuleBlock(n.parent) ? n.parent.parent : n.parent; @@ -403393,7 +408294,7 @@ ${lanes.join("\n")} if (!a.body || !b.body) { return a.body === b.body; } - return a.body.kind === b.body.kind && (a.body.kind !== 266 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 267 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } function merge(target, source) { target.additionalNodes = target.additionalNodes || []; @@ -403414,7 +408315,7 @@ ${lanes.join("\n")} return compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) || compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2)); } function tryGetName(node) { - if (node.kind === 266 /* ModuleDeclaration */) { + if (node.kind === 267 /* ModuleDeclaration */) { return getModuleName(node); } const declName = getNameOfDeclaration(node); @@ -403423,16 +408324,16 @@ ${lanes.join("\n")} return propertyName && unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 230 /* ClassExpression */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 231 /* ClassExpression */: return getFunctionOrClassName(node); default: return void 0; } } function getItemName(node, name) { - if (node.kind === 266 /* ModuleDeclaration */) { + if (node.kind === 267 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -403442,27 +408343,27 @@ ${lanes.join("\n")} } } switch (node.kind) { - case 311 /* SourceFile */: + case 312 /* SourceFile */: const sourceFile = node; return isExternalModule(sourceFile) ? `"${escapeString(getBaseFileName(removeFileExtension(normalizePath(sourceFile.fileName))))}"` : ""; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 218 /* ArrowFunction */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - if (getSyntacticModifierFlags(node) & 1024 /* Default */) { + case 219 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + if (getSyntacticModifierFlags(node) & 2048 /* Default */) { return "default"; } return getFunctionOrClassName(node); - case 175 /* Constructor */: + case 176 /* Constructor */: return "constructor"; - case 179 /* ConstructSignature */: + case 180 /* ConstructSignature */: return "new()"; - case 178 /* CallSignature */: + case 179 /* CallSignature */: return "()"; - case 180 /* IndexSignature */: + case 181 /* IndexSignature */: return "[]"; default: return ""; @@ -403487,19 +408388,19 @@ ${lanes.join("\n")} return true; } switch (navigationBarNodeKind(item)) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 265 /* EnumDeclaration */: - case 263 /* InterfaceDeclaration */: - case 266 /* ModuleDeclaration */: - case 311 /* SourceFile */: - case 264 /* TypeAliasDeclaration */: - case 352 /* JSDocTypedefTag */: - case 344 /* JSDocCallbackTag */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 266 /* EnumDeclaration */: + case 264 /* InterfaceDeclaration */: + case 267 /* ModuleDeclaration */: + case 312 /* SourceFile */: + case 265 /* TypeAliasDeclaration */: + case 353 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: return true; - case 218 /* ArrowFunction */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -403509,10 +408410,10 @@ ${lanes.join("\n")} return false; } switch (navigationBarNodeKind(item2.parent)) { - case 267 /* ModuleBlock */: - case 311 /* SourceFile */: - case 173 /* MethodDeclaration */: - case 175 /* Constructor */: + case 268 /* ModuleBlock */: + case 312 /* SourceFile */: + case 174 /* MethodDeclaration */: + case 176 /* Constructor */: return true; default: return false; @@ -403571,7 +408472,7 @@ ${lanes.join("\n")} } function getFullyQualifiedModuleName(moduleDeclaration) { const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; - while (moduleDeclaration.body && moduleDeclaration.body.kind === 266 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 267 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -403581,13 +408482,13 @@ ${lanes.join("\n")} return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 166 /* ComputedPropertyName */; + return !member.name || member.name.kind === 167 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 311 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile); + return node.kind === 312 /* SourceFile */ ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile); } function getModifiers2(node) { - if (node.parent && node.parent.kind === 259 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 260 /* VariableDeclaration */) { node = node.parent; } return getNodeModifiers(node); @@ -403602,7 +408503,7 @@ ${lanes.join("\n")} return nodeText(parent2.left).replace(whiteSpaceRegex, ""); } else if (isPropertyAssignment(parent2)) { return nodeText(parent2.name); - } else if (getSyntacticModifierFlags(node) & 1024 /* Default */) { + } else if (getSyntacticModifierFlags(node) & 2048 /* Default */) { return "default"; } else if (isClassLike(node)) { return ""; @@ -403613,7 +408514,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`; } } @@ -403632,9 +408533,9 @@ ${lanes.join("\n")} } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 218 /* ArrowFunction */: - case 217 /* FunctionExpression */: - case 230 /* ClassExpression */: + case 219 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 231 /* ClassExpression */: return true; default: return false; @@ -403692,8 +408593,8 @@ ${lanes.join("\n")} return context.cancellationToken && context.cancellationToken.isCancellationRequested() || !((_a = refactor.kinds) == null ? void 0 : _a.some((kind) => refactorKindBeginsWith(kind, context.kind))) ? void 0 : refactor.getAvailableActions(context, includeInteractiveActions); })); } - function getEditsForRefactor(context, refactorName13, actionName2, interactiveRefactorArguments) { - const refactor = refactors.get(refactorName13); + function getEditsForRefactor(context, refactorName14, actionName2, interactiveRefactorArguments) { + const refactor = refactors.get(refactorName14); return refactor && refactor.getEditsForAction(context, actionName2, interactiveRefactorArguments); } var refactors; @@ -403711,31 +408612,31 @@ ${lanes.join("\n")} const { file, program } = context; const span = getRefactorContextSpan(context); const token = getTokenAtPosition(file, span.start); - const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) & 1 /* Export */) && considerPartialSpans ? token.parent : getParentNodeInSpan(token, file, span); + const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) & 32 /* Export */) && considerPartialSpans ? token.parent : getParentNodeInSpan(token, file, span); if (!exportNode || !isSourceFile(exportNode.parent) && !(isModuleBlock(exportNode.parent) && isAmbientModule(exportNode.parent.parent))) { return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_export_statement) }; } const checker = program.getTypeChecker(); const exportingModuleSymbol = getExportingModuleSymbol(exportNode.parent, checker); - const flags = getSyntacticModifierFlags(exportNode) || (isExportAssignment(exportNode) && !exportNode.isExportEquals ? 1025 /* ExportDefault */ : 0 /* None */); - const wasDefault = !!(flags & 1024 /* Default */); - if (!(flags & 1 /* Export */) || !wasDefault && exportingModuleSymbol.exports.has("default" /* Default */)) { + const flags = getSyntacticModifierFlags(exportNode) || (isExportAssignment(exportNode) && !exportNode.isExportEquals ? 2080 /* ExportDefault */ : 0 /* None */); + const wasDefault = !!(flags & 2048 /* Default */); + if (!(flags & 32 /* Export */) || !wasDefault && exportingModuleSymbol.exports.has("default" /* Default */)) { return { error: getLocaleSpecificMessage(Diagnostics.This_file_already_has_a_default_export) }; } const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) }; switch (exportNode.kind) { - case 261 /* FunctionDeclaration */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 266 /* ModuleDeclaration */: { + case 262 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 267 /* ModuleDeclaration */: { const node = exportNode; if (!node.name) return void 0; return noSymbolError(node.name) || { exportNode: node, exportName: node.name, wasDefault, exportingModuleSymbol }; } - case 242 /* VariableStatement */: { + case 243 /* VariableStatement */: { const vs = exportNode; if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { return void 0; @@ -403746,7 +408647,7 @@ ${lanes.join("\n")} Debug.assert(!wasDefault, "Can't have a default flag here"); return noSymbolError(decl.name) || { exportNode: vs, exportName: decl.name, wasDefault, exportingModuleSymbol }; } - case 276 /* ExportAssignment */: { + case 277 /* ExportAssignment */: { const node = exportNode; if (node.isExportEquals) return void 0; @@ -403778,20 +408679,20 @@ ${lanes.join("\n")} } else { const exportKeyword = Debug.checkDefined(findModifier(exportNode, 95 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 261 /* FunctionDeclaration */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: + case 262 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, factory.createToken(90 /* DefaultKeyword */)); break; - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: const decl = first(exportNode.declarationList.declarations); if (!ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) { changes.replaceNode(exportingSourceFile, exportNode, factory.createExportDefault(Debug.checkDefined(decl.initializer, "Initializer was previously known to be present"))); break; } - case 265 /* EnumDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 266 /* ModuleDeclaration */: + case 266 /* EnumDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 267 /* ModuleDeclaration */: changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, factory.createExportDefault(factory.createIdentifier(exportName.text))); break; @@ -403817,23 +408718,23 @@ ${lanes.join("\n")} function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { const { parent: parent2 } = ref; switch (parent2.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: changes.replaceNode(importingSourceFile, ref, factory.createIdentifier(exportName)); break; - case 275 /* ImportSpecifier */: - case 280 /* ExportSpecifier */: { + case 276 /* ImportSpecifier */: + case 281 /* ExportSpecifier */: { const spec = parent2; changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 272 /* ImportClause */: { + case 273 /* ImportClause */: { const clause = parent2; Debug.assert(clause.name === ref, "Import clause name should match provided ref"); const spec = makeImportSpecifier(exportName, ref.text); const { namedBindings } = clause; if (!namedBindings) { changes.replaceNode(importingSourceFile, ref, factory.createNamedImports([spec])); - } else if (namedBindings.kind === 273 /* NamespaceImport */) { + } else if (namedBindings.kind === 274 /* NamespaceImport */) { changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); const quotePreference = isStringLiteral(clause.parent.moduleSpecifier) ? quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; const newImport = makeImport( @@ -403850,9 +408751,9 @@ ${lanes.join("\n")} } break; } - case 204 /* ImportType */: + case 205 /* ImportType */: const importTypeNode = parent2; - changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.assertions, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf)); + changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf)); break; default: Debug.failBadSyntaxKind(parent2); @@ -403861,10 +408762,10 @@ ${lanes.join("\n")} function changeNamedToDefaultImport(importingSourceFile, ref, changes) { const parent2 = ref.parent; switch (parent2.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: changes.replaceNode(importingSourceFile, ref, factory.createIdentifier("default")); break; - case 275 /* ImportSpecifier */: { + case 276 /* ImportSpecifier */: { const defaultImport = factory.createIdentifier(parent2.name.text); if (parent2.parent.elements.length === 1) { changes.replaceNode(importingSourceFile, parent2.parent, defaultImport); @@ -403874,7 +408775,7 @@ ${lanes.join("\n")} } break; } - case 280 /* ExportSpecifier */: { + case 281 /* ExportSpecifier */: { changes.replaceNode(importingSourceFile, parent2, makeExportSpecifier("default", parent2.name.text)); break; } @@ -403917,12 +408818,12 @@ ${lanes.join("\n")} refactorName = "Convert export"; defaultToNamedAction = { name: "Convert default export to named export", - description: Diagnostics.Convert_default_export_to_named_export.message, + description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), kind: "refactor.rewrite.export.named" }; namedToDefaultAction = { name: "Convert named export to default export", - description: Diagnostics.Convert_named_export_to_default_export.message, + description: getLocaleSpecificMessage(Diagnostics.Convert_named_export_to_default_export), kind: "refactor.rewrite.export.default" }; registerRefactor(refactorName, { @@ -403940,10 +408841,14 @@ ${lanes.join("\n")} } if (context.preferences.provideRefactorNotApplicableReason) { return [ - { name: refactorName, description: Diagnostics.Convert_default_export_to_named_export.message, actions: [ - { ...defaultToNamedAction, notApplicableReason: info.error }, - { ...namedToDefaultAction, notApplicableReason: info.error } - ] } + { + name: refactorName, + description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), + actions: [ + { ...defaultToNamedAction, notApplicableReason: info.error }, + { ...namedToDefaultAction, notApplicableReason: info.error } + ] + } ]; } return emptyArray; @@ -403978,7 +408883,7 @@ ${lanes.join("\n")} if (!importClause.namedBindings) { return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_namespace_import_or_named_imports) }; } - if (importClause.namedBindings.kind === 273 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 274 /* NamespaceImport */) { return { convertTo: 0 /* Named */, import: importClause.namedBindings }; } const shouldUseDefault = getShouldUseDefault(context.program, importClause); @@ -404007,7 +408912,7 @@ ${lanes.join("\n")} if (checker.resolveName( exportName, id, - 67108863 /* All */, + -1 /* All */, /*excludeGlobals*/ true )) { @@ -404070,7 +408975,7 @@ ${lanes.join("\n")} const symbol = checker.resolveName( preferredName, id, - 67108863 /* All */, + -1 /* All */, /*excludeGlobals*/ true ); @@ -404099,7 +409004,11 @@ ${lanes.join("\n")} } }); } - changes.replaceNode(sourceFile, toConvert, shouldUseDefault ? factory.createIdentifier(namespaceImportName) : factory.createNamespaceImport(factory.createIdentifier(namespaceImportName))); + changes.replaceNode( + sourceFile, + toConvert, + shouldUseDefault ? factory.createIdentifier(namespaceImportName) : factory.createNamespaceImport(factory.createIdentifier(namespaceImportName)) + ); if (neededNamedImports.size) { const newNamedImports = arrayFrom(neededNamedImports.values(), (element) => factory.createImportSpecifier(element.isTypeOnly, element.propertyName && factory.createIdentifier(element.propertyName.text), factory.createIdentifier(element.name.text))); changes.insertNodeAfter(sourceFile, toConvert.parent.parent, updateImport( @@ -404128,7 +409037,7 @@ ${lanes.join("\n")} elements && elements.length ? factory.createNamedImports(elements) : void 0 ), old.moduleSpecifier, - /*assertClause*/ + /*attributes*/ void 0 ); } @@ -404142,17 +409051,17 @@ ${lanes.join("\n")} actions = { [0 /* Named */]: { name: "Convert namespace import to named imports", - description: Diagnostics.Convert_namespace_import_to_named_imports.message, + description: getLocaleSpecificMessage(Diagnostics.Convert_namespace_import_to_named_imports), kind: "refactor.rewrite.import.named" }, [2 /* Namespace */]: { name: "Convert named imports to namespace import", - description: Diagnostics.Convert_named_imports_to_namespace_import.message, + description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_namespace_import), kind: "refactor.rewrite.import.namespace" }, [1 /* Default */]: { name: "Convert named imports to default import", - description: Diagnostics.Convert_named_imports_to_default_import.message, + description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_default_import), kind: "refactor.rewrite.import.default" } }; @@ -404190,29 +409099,66 @@ ${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 selection = findAncestor(current, (node) => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range, node.parent, file) && (cursorRequest || nodeOverlapsWithStartEnd(current, file, range.pos, range.end))); - if (!selection || !isTypeNode(selection)) + 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(); - const enclosingNode = getEnclosingNode(selection, isJS); + const enclosingNode = getEnclosingNode(firstType, isJS); if (enclosingNode === void 0) return { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) }; + const expandedFirstType = getExpandedSelectionNode(firstType, enclosingNode); + if (!isTypeNode(expandedFirstType)) + return { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) }; + const typeList = []; + if ((isUnionTypeNode(expandedFirstType.parent) || isIntersectionTypeNode(expandedFirstType.parent)) && range.end > firstType.end) { + addRange( + typeList, + expandedFirstType.parent.types.filter((type) => { + return nodeOverlapsWithStartEnd(type, file, range.pos, range.end); + }) + ); + } + const selection = typeList.length > 1 ? typeList : expandedFirstType; const typeParameters = collectTypeParameters(checker, selection, enclosingNode, file); if (!typeParameters) return { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) }; const typeElements = flattenTypeLiteralNodeReference(checker, selection); return { isJS, selection, enclosingNode, typeParameters, typeElements }; } - function flattenTypeLiteralNodeReference(checker, node) { - if (!node) + 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; - if (isIntersectionTypeNode(node)) { + if (isArray(selection)) { + const result = []; + for (const type of selection) { + const flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type); + if (!flattenedTypeMembers) + return void 0; + addRange(result, flattenedTypeMembers); + } + return result; + } + if (isIntersectionTypeNode(selection)) { const result = []; const seen = /* @__PURE__ */ new Map(); - for (const type of node.types) { + for (const type of selection.types) { const flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type); if (!flattenedTypeMembers || !flattenedTypeMembers.every((type2) => type2.name && addToSeen(seen, getNameFromPropertyName(type2.name)))) { return void 0; @@ -404220,10 +409166,10 @@ ${lanes.join("\n")} addRange(result, flattenedTypeMembers); } return result; - } else if (isParenthesizedTypeNode(node)) { - return flattenTypeLiteralNodeReference(checker, node.type); - } else if (isTypeLiteralNode(node)) { - return node.members; + } else if (isParenthesizedTypeNode(selection)) { + return flattenTypeLiteralNodeReference(checker, selection.type); + } else if (isTypeLiteralNode(selection)) { + return selection.members; } return void 0; } @@ -404232,7 +409178,13 @@ ${lanes.join("\n")} } function collectTypeParameters(checker, selection, enclosingNode, file) { const result = []; - return visitor(selection) ? void 0 : result; + const selectionArray = toArray(selection); + const selectionRange = { pos: selectionArray[0].pos, end: selectionArray[selectionArray.length - 1].end }; + for (const t of selectionArray) { + if (visitor(t)) + return void 0; + } + return result; function visitor(node) { if (isTypeReferenceNode(node)) { if (isIdentifier(node.typeName)) { @@ -404246,10 +409198,10 @@ ${lanes.join("\n")} ); for (const decl of (symbol == null ? void 0 : symbol.declarations) || emptyArray) { if (isTypeParameterDeclaration(decl) && decl.getSourceFile() === file) { - if (decl.name.escapedText === typeName.escapedText && rangeContainsSkipTrivia(decl, selection, file)) { + if (decl.name.escapedText === typeName.escapedText && rangeContainsSkipTrivia(decl, selectionRange, file)) { return true; } - if (rangeContainsSkipTrivia(enclosingNode, decl, file) && !rangeContainsSkipTrivia(selection, decl, file)) { + if (rangeContainsSkipTrivia(enclosingNode, decl, file) && !rangeContainsSkipTrivia(selectionRange, decl, file)) { pushIfUnique(result, decl); break; } @@ -404258,12 +409210,12 @@ ${lanes.join("\n")} } } else if (isInferTypeNode(node)) { const conditionalTypeNode = findAncestor(node, (n) => isConditionalTypeNode(n) && rangeContainsSkipTrivia(n.extendsType, node, file)); - if (!conditionalTypeNode || !rangeContainsSkipTrivia(selection, conditionalTypeNode, file)) { + if (!conditionalTypeNode || !rangeContainsSkipTrivia(selectionRange, conditionalTypeNode, file)) { return true; } } else if (isTypePredicateNode(node) || isThisTypeNode(node)) { const functionLikeNode = findAncestor(node.parent, isFunctionLike); - if (functionLikeNode && functionLikeNode.type && rangeContainsSkipTrivia(functionLikeNode.type, node, file) && !rangeContainsSkipTrivia(selection, functionLikeNode, file)) { + if (functionLikeNode && functionLikeNode.type && rangeContainsSkipTrivia(functionLikeNode.type, node, file) && !rangeContainsSkipTrivia(selectionRange, functionLikeNode, file)) { return true; } } else if (isTypeQueryNode(node)) { @@ -404275,11 +409227,11 @@ ${lanes.join("\n")} /*excludeGlobals*/ false ); - if ((symbol == null ? void 0 : symbol.valueDeclaration) && rangeContainsSkipTrivia(enclosingNode, symbol.valueDeclaration, file) && !rangeContainsSkipTrivia(selection, symbol.valueDeclaration, file)) { + if ((symbol == null ? void 0 : symbol.valueDeclaration) && rangeContainsSkipTrivia(enclosingNode, symbol.valueDeclaration, file) && !rangeContainsSkipTrivia(selectionRange, symbol.valueDeclaration, file)) { return true; } } else { - if (isThisIdentifier(node.exprName.left) && !rangeContainsSkipTrivia(selection, node.parent, file)) { + if (isThisIdentifier(node.exprName.left) && !rangeContainsSkipTrivia(selectionRange, node.parent, file)) { return true; } } @@ -404291,8 +409243,9 @@ ${lanes.join("\n")} } } function doTypeAliasChange(changes, file, name, info) { - const { enclosingNode, selection, typeParameters } = info; - const newTypeNode = factory.createTypeAliasDeclaration( + const { enclosingNode, typeParameters } = info; + const { firstTypeNode, lastTypeNode, newTypeNode } = getNodesToEdit(info); + const newTypeDeclaration = factory.createTypeAliasDeclaration( /*modifiers*/ void 0, name, @@ -404304,16 +409257,16 @@ ${lanes.join("\n")} /*defaultType*/ void 0 )), - selection + newTypeNode ); changes.insertNodeBefore( file, enclosingNode, - ignoreSourceNewlines(newTypeNode), + ignoreSourceNewlines(newTypeDeclaration), /*blankLineBetween*/ true ); - changes.replaceNode(file, selection, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode( + changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode( id.name, /*typeArguments*/ void 0 @@ -404321,7 +409274,7 @@ ${lanes.join("\n")} } function doInterfaceChange(changes, file, name, info) { var _a; - const { enclosingNode, selection, typeParameters, typeElements } = info; + const { enclosingNode, typeParameters, typeElements } = info; const newTypeNode = factory.createInterfaceDeclaration( /*modifiers*/ void 0, @@ -404339,7 +409292,8 @@ ${lanes.join("\n")} /*blankLineBetween*/ true ); - changes.replaceNode(file, selection, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode( + const { firstTypeNode, lastTypeNode } = getNodesToEdit(info); + changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode( id.name, /*typeArguments*/ void 0 @@ -404347,11 +409301,14 @@ ${lanes.join("\n")} } function doTypedefChange(changes, context, file, name, info) { var _a; - const { enclosingNode, selection, typeParameters } = info; - setEmitFlags(selection, 3072 /* NoComments */ | 4096 /* NoNestedComments */); + toArray(info.selection).forEach((typeNode) => { + setEmitFlags(typeNode, 3072 /* NoComments */ | 4096 /* NoNestedComments */); + }); + const { enclosingNode, typeParameters } = info; + const { firstTypeNode, lastTypeNode, newTypeNode } = getNodesToEdit(info); const node = factory.createJSDocTypedefTag( factory.createIdentifier("typedef"), - factory.createJSDocTypeExpression(selection), + factory.createJSDocTypeExpression(newTypeNode), factory.createIdentifier(name) ); const templates = []; @@ -404389,15 +409346,39 @@ ${lanes.join("\n")} true ); } - changes.replaceNode(file, selection, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode( + changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode( id.name, /*typeArguments*/ void 0 )))); } + function getNodesToEdit(info) { + if (isArray(info.selection)) { + return { + firstTypeNode: info.selection[0], + lastTypeNode: info.selection[info.selection.length - 1], + newTypeNode: isUnionTypeNode(info.selection[0].parent) ? factory.createUnionTypeNode(info.selection) : factory.createIntersectionTypeNode(info.selection) + }; + } + return { + firstTypeNode: info.selection, + lastTypeNode: info.selection, + newTypeNode: info.selection + }; + } function getEnclosingNode(node, isJS) { return findAncestor(node, isStatement) || (isJS ? findAncestor(node, isJSDoc) : void 0); } + function getExpandedSelectionNode(firstType, enclosingNode) { + return findAncestor(firstType, (node) => { + if (node === enclosingNode) + return "quit"; + if (isUnionTypeNode(node.parent) || isIntersectionTypeNode(node.parent)) { + return true; + } + return false; + }) ?? firstType; + } var refactorName3, extractToTypeAliasAction, extractToInterfaceAction, extractToTypeDefAction; var init_extractType = __esm({ "src/services/refactors/extractType.ts"() { @@ -404499,11 +409480,166 @@ ${lanes.join("\n")} } }); + // src/services/refactors/inlineVariable.ts + function getInliningInfo(file, startPosition, tryWithReferenceToken, program) { + var _a, _b; + const checker = program.getTypeChecker(); + const token = getTouchingPropertyName(file, startPosition); + const parent2 = token.parent; + if (!isIdentifier(token)) { + return void 0; + } + if (isInitializedVariable(parent2) && isVariableDeclarationInVariableStatement(parent2) && isIdentifier(parent2.name)) { + if (((_a = checker.getMergedSymbol(parent2.symbol).declarations) == null ? void 0 : _a.length) !== 1) { + return { error: getLocaleSpecificMessage(Diagnostics.Variables_with_multiple_declarations_cannot_be_inlined) }; + } + if (isDeclarationExported(parent2)) { + return void 0; + } + const references = getReferenceNodes(parent2, checker, file); + return references && { references, declaration: parent2, replacement: parent2.initializer }; + } + if (tryWithReferenceToken) { + let definition = checker.resolveName( + token.text, + token, + 111551 /* Value */, + /*excludeGlobals*/ + false + ); + definition = definition && checker.getMergedSymbol(definition); + if (((_b = definition == null ? void 0 : definition.declarations) == null ? void 0 : _b.length) !== 1) { + return { error: getLocaleSpecificMessage(Diagnostics.Variables_with_multiple_declarations_cannot_be_inlined) }; + } + const declaration = definition.declarations[0]; + if (!isInitializedVariable(declaration) || !isVariableDeclarationInVariableStatement(declaration) || !isIdentifier(declaration.name)) { + return void 0; + } + if (isDeclarationExported(declaration)) { + return void 0; + } + const references = getReferenceNodes(declaration, checker, file); + return references && { references, declaration, replacement: declaration.initializer }; + } + return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_variable_to_inline) }; + } + function isDeclarationExported(declaration) { + const variableStatement = cast(declaration.parent.parent, isVariableStatement); + return some(variableStatement.modifiers, isExportModifier); + } + 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) && !isShorthandPropertyAssignment(ref.parent)) { + return true; + } + if (isExportSpecifier(ref.parent) || isExportAssignment(ref.parent)) { + return true; + } + if (isTypeQueryNode(ref.parent)) { + return true; + } + if (textRangeContainsPositionInclusive(declaration, ref.pos)) { + return true; + } + references.push(ref); + }); + return references.length === 0 || cannotInline ? void 0 : references; + } + function getReplacementExpression(reference, replacement) { + replacement = getSynthesizedDeepClone(replacement); + const { parent: parent2 } = reference; + if (isExpression(parent2) && (getExpressionPrecedence(replacement) < getExpressionPrecedence(parent2) || needsParentheses(parent2))) { + return factory.createParenthesizedExpression(replacement); + } + if (isFunctionLike(replacement) && (isCallLikeExpression(parent2) || isPropertyAccessExpression(parent2))) { + return factory.createParenthesizedExpression(replacement); + } + 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; + var init_inlineVariable = __esm({ + "src/services/refactors/inlineVariable.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName4 = "Inline variable"; + refactorDescription = getLocaleSpecificMessage(Diagnostics.Inline_variable); + inlineVariableAction = { + name: refactorName4, + description: refactorDescription, + kind: "refactor.inline.variable" + }; + registerRefactor(refactorName4, { + kinds: [inlineVariableAction.kind], + getAvailableActions(context) { + const { + file, + program, + preferences, + startPosition, + triggerReason + } = context; + const info = getInliningInfo(file, startPosition, triggerReason === "invoked", program); + if (!info) { + return emptyArray; + } + if (!ts_refactor_exports.isRefactorErrorInfo(info)) { + return [{ + name: refactorName4, + description: refactorDescription, + actions: [inlineVariableAction] + }]; + } + if (preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName4, + description: refactorDescription, + actions: [{ + ...inlineVariableAction, + notApplicableReason: info.error + }] + }]; + } + return emptyArray; + }, + getEditsForAction(context, actionName2) { + Debug.assert(actionName2 === refactorName4, "Unexpected refactor invoked"); + const { file, program, startPosition } = context; + const info = getInliningInfo( + file, + startPosition, + /*tryWithReferenceToken*/ + true, + program + ); + if (!info || ts_refactor_exports.isRefactorErrorInfo(info)) { + return void 0; + } + const { references, declaration, replacement } = info; + const edits = ts_textChanges_exports.ChangeTracker.with(context, (tracker) => { + for (const node of references) { + tracker.replaceNode(file, node, getReplacementExpression(node, replacement)); + } + tracker.delete(file, declaration); + }); + return { edits }; + } + }); + } + }); + // 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)); } @@ -404570,7 +409706,7 @@ ${lanes.join("\n")} if (markSeenTop(top)) { addExportToChanges(oldFile, top, name, changes, useEsModuleSyntax); } - if (hasSyntacticModifier(decl, 1024 /* Default */)) { + if (hasSyntacticModifier(decl, 2048 /* Default */)) { oldFileDefault = name; } else { oldFileNamedImports.push(name.text); @@ -404580,39 +409716,35 @@ ${lanes.join("\n")} append(copiedOldImports, makeImportOrRequire(oldFile, oldFileDefault, oldFileNamedImports, getBaseFileName(oldFile.fileName), program, host, useEsModuleSyntax, quotePreference)); return copiedOldImports; } - var refactorName4, description, moveToNewFileAction; + var refactorName5, description, moveToNewFileAction; var init_moveToNewFile = __esm({ "src/services/refactors/moveToNewFile.ts"() { "use strict"; init_ts4(); init_ts_refactor(); - refactorName4 = "Move to a new file"; + refactorName5 = "Move to a new file"; description = getLocaleSpecificMessage(Diagnostics.Move_to_a_new_file); moveToNewFileAction = { - name: refactorName4, + name: refactorName5, description, kind: "refactor.move.newFile" }; - registerRefactor(refactorName4, { + registerRefactor(refactorName5, { kinds: [moveToNewFileAction.kind], getAvailableActions: function getRefactorActionsToMoveToNewFile(context) { const statements = getStatementsToMove(context); if (context.preferences.allowTextChangesInNewFiles && statements) { - return [{ name: refactorName4, description, actions: [moveToNewFileAction] }]; + return [{ name: refactorName5, description, actions: [moveToNewFileAction] }]; } if (context.preferences.provideRefactorNotApplicableReason) { - return [{ - name: refactorName4, - description, - actions: [{ ...moveToNewFileAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_statement_or_statements) }] - }]; + return [{ name: refactorName5, description, actions: [{ ...moveToNewFileAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_statement_or_statements) }] }]; } return emptyArray; }, getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) { - Debug.assert(actionName2 === refactorName4, "Wrong refactor invoked"); + 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 }; } }); @@ -404620,16 +409752,18 @@ ${lanes.join("\n")} }); // src/services/refactors/moveToFile.ts + function error(notApplicableReason) { + return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason }; + } function doChange4(context, oldFile, targetFile, program, toMove, changes, host, preferences) { const checker = program.getTypeChecker(); - const usage = getUsageInfo(oldFile, toMove.all, checker); if (!host.fileExists(targetFile)) { - changes.createNewFile(oldFile, targetFile, getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, usage, changes, toMove, program, host, preferences)); + changes.createNewFile(oldFile, targetFile, getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, getUsageInfo(oldFile, toMove.all, checker), changes, toMove, program, host, preferences)); addNewFileToTsconfig(program, changes, oldFile.fileName, targetFile, hostGetCanonicalFileName(host)); } else { const targetSourceFile = Debug.checkDefined(program.getSourceFile(targetFile)); const importAdder = ts_codefix_exports.createImportAdder(targetSourceFile, context.program, context.preferences, context.host); - getNewStatementsAndRemoveFromOldFile2(oldFile, targetSourceFile, usage, 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) { @@ -404660,7 +409794,7 @@ ${lanes.join("\n")} const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromTargetFile, useEsModuleSyntax); if (typeof targetFile !== "string") { if (targetFile.statements.length > 0) { - changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], body); + moveStatementsToTargetFile(changes, program, body, targetFile, toMove); } else { changes.insertNodesAtEndOfFile( targetFile, @@ -404681,7 +409815,7 @@ ${lanes.join("\n")} } } if (importAdder) { - importAdder.writeFixes(changes); + importAdder.writeFixes(changes, quotePreference); } if (imports.length && body.length) { return [ @@ -404715,12 +409849,13 @@ ${lanes.join("\n")} const targetSourceFile = program.getSourceFile(targetFile); for (const oldStatement of oldFile.statements) { forEachImportInStatement(oldStatement, (i) => { - var _a, _b; + var _a; const moduleSpecifier = moduleSpecifierFromImport(i); - const resolved = (_a = oldFile.resolvedModules) == null ? void 0 : _a.get(moduleSpecifier.text, getModeForUsageLocation(oldFile, moduleSpecifier)); - const fileName = (_b = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _b.resolvedFileName; + 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)))); @@ -404749,7 +409884,7 @@ ${lanes.join("\n")} if (importAdder && checker.isUnknownSymbol(symbol)) { importAdder.addImportFromExportedSymbol(skipAlias(symbol, checker)); } else { - if (hasSyntacticModifier(decl, 1024 /* Default */)) { + if (hasSyntacticModifier(decl, 2048 /* Default */)) { oldFileDefault = name; } else { oldFileNamedImports.push(name.text); @@ -404798,7 +409933,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); @@ -404811,11 +409946,11 @@ ${lanes.join("\n")} } function getNamespaceLikeImport(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 273 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0; - case 270 /* ImportEqualsDeclaration */: + case 272 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 274 /* NamespaceImport */ ? node.importClause.namedBindings.name : void 0; + case 271 /* ImportEqualsDeclaration */: return node.name; - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return tryCast(node.name, isIdentifier); default: return Debug.assertNever(node, `Unexpected node kind ${node.kind}`); @@ -404831,7 +409966,7 @@ ${lanes.join("\n")} needUniqueName = needUniqueName || !!checker.resolveName( preferredNewNamespaceName, ref, - 67108863 /* All */, + -1 /* All */, /*excludeGlobals*/ true ); @@ -404851,7 +409986,7 @@ ${lanes.join("\n")} const newNamespaceId = factory.createIdentifier(newNamespaceName); const newModuleString = makeStringLiteral(newModuleSpecifier, quotePreference); switch (node.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return factory.createImportDeclaration( /*modifiers*/ void 0, @@ -404863,10 +409998,10 @@ ${lanes.join("\n")} factory.createNamespaceImport(newNamespaceId) ), newModuleString, - /*assertClause*/ + /*attributes*/ void 0 ); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return factory.createImportEqualsDeclaration( /*modifiers*/ void 0, @@ -404875,7 +410010,7 @@ ${lanes.join("\n")} newNamespaceId, factory.createExternalModuleReference(newModuleString) ); - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return factory.createVariableDeclaration( newNamespaceId, /*exclamationToken*/ @@ -404897,7 +410032,7 @@ ${lanes.join("\n")} ); } function moduleSpecifierFromImport(i) { - return i.kind === 271 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 270 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]; + return i.kind === 272 /* ImportDeclaration */ ? i.moduleSpecifier : i.kind === 271 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]; } function forEachImportInStatement(statement, cb) { if (isImportDeclaration(statement)) { @@ -404933,7 +410068,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*/ @@ -404989,21 +410124,21 @@ ${lanes.join("\n")} function isExported(sourceFile, decl, useEs6Exports, name) { var _a; if (useEs6Exports) { - return !isExpressionStatement(decl) && hasSyntacticModifier(decl, 1 /* Export */) || !!(name && sourceFile.symbol && ((_a = sourceFile.symbol.exports) == null ? void 0 : _a.has(name.escapedText))); + return !isExpressionStatement(decl) && hasSyntacticModifier(decl, 32 /* Export */) || !!(name && sourceFile.symbol && ((_a = sourceFile.symbol.exports) == null ? void 0 : _a.has(name.escapedText))); } return !!sourceFile.symbol && !!sourceFile.symbol.exports && getNamesToExportInCommonJS(decl).some((name2) => sourceFile.symbol.exports.has(escapeLeadingUnderscores(name2))); } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -405015,7 +410150,7 @@ ${lanes.join("\n")} return; const { name, namedBindings } = importDecl.importClause; const defaultUnused = !name || isUnused(name); - const namedBindingsUnused = !namedBindings || (namedBindings.kind === 273 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name))); + const namedBindingsUnused = !namedBindings || (namedBindings.kind === 274 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every((e) => isUnused(e.name))); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } else { @@ -405035,7 +410170,7 @@ ${lanes.join("\n")} void 0 ) ); - } else if (namedBindings.kind === 274 /* NamedImports */) { + } else if (namedBindings.kind === 275 /* NamedImports */) { for (const element of namedBindings.elements) { if (isUnused(element.name)) changes.delete(sourceFile, element); @@ -405054,23 +410189,17 @@ ${lanes.join("\n")} /*requireStringLiteralLikeArgument*/ true )) { - changes.delete( - sourceFile, - isVariableDeclarationList(varDecl.parent) && length(varDecl.parent.declarations) === 1 ? varDecl.parent.parent : varDecl - ); + changes.delete(sourceFile, isVariableDeclarationList(varDecl.parent) && length(varDecl.parent.declarations) === 1 ? varDecl.parent.parent : varDecl); } else { changes.delete(sourceFile, name); } } break; - case 206 /* ArrayBindingPattern */: + case 207 /* ArrayBindingPattern */: break; - case 205 /* ObjectBindingPattern */: + case 206 /* ObjectBindingPattern */: if (name.elements.every((e) => isIdentifier(e.name) && isUnused(e.name))) { - changes.delete( - sourceFile, - isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl - ); + changes.delete(sourceFile, isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } else { for (const element of name.elements) { if (isIdentifier(element.name) && isUnused(element.name)) { @@ -405091,24 +410220,24 @@ ${lanes.join("\n")} function addEs6Export(d) { const modifiers = canHaveModifiers(d) ? concatenate([factory.createModifier(95 /* ExportKeyword */)], getModifiers(d)) : void 0; switch (d.kind) { - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return factory.updateFunctionDeclaration(d, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: const decorators = canHaveDecorators(d) ? getDecorators(d) : void 0; return factory.updateClassDeclaration(d, concatenate(decorators, modifiers), d.name, d.typeParameters, d.heritageClauses, d.members); - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return factory.updateVariableStatement(d, modifiers, d.declarationList); - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: return factory.updateModuleDeclaration(d, modifiers, d.name, d.body); - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: return factory.updateEnumDeclaration(d, modifiers, d.name, d.members); - case 264 /* TypeAliasDeclaration */: + case 265 /* TypeAliasDeclaration */: return factory.updateTypeAliasDeclaration(d, modifiers, d.name, d.typeParameters, d.type); - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: return factory.updateInterfaceDeclaration(d, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return factory.updateImportEqualsDeclaration(d, modifiers, d.isTypeOnly, d.name, d.moduleReference); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return Debug.fail(); default: return Debug.assertNever(d, `Unexpected declaration kind ${d.kind}`); @@ -405128,18 +410257,18 @@ ${lanes.join("\n")} } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 261 /* FunctionDeclaration */: - case 262 /* ClassDeclaration */: + case 262 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: return [decl.name.text]; - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return mapDefined(decl.declarationList.declarations, (d) => isIdentifier(d.name) ? d.name.text : void 0); - case 266 /* ModuleDeclaration */: - case 265 /* EnumDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 263 /* InterfaceDeclaration */: - case 270 /* ImportEqualsDeclaration */: + case 267 /* ModuleDeclaration */: + case 266 /* EnumDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 264 /* InterfaceDeclaration */: + case 271 /* ImportEqualsDeclaration */: return emptyArray; - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return Debug.fail("Can't export an ExpressionStatement"); default: return Debug.assertNever(decl, `Unexpected decl kind ${decl.kind}`); @@ -405147,7 +410276,7 @@ ${lanes.join("\n")} } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 271 /* ImportDeclaration */: { + case 272 /* ImportDeclaration */: { const clause = i.importClause; if (!clause) return void 0; @@ -405158,13 +410287,13 @@ ${lanes.join("\n")} void 0, factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings), getSynthesizedDeepClone(moduleSpecifier), - /*assertClause*/ + /*attributes*/ void 0 ) : void 0; } - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return keep(i.name) ? i : void 0; - case 259 /* VariableDeclaration */: { + case 260 /* VariableDeclaration */: { const name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : void 0; } @@ -405173,7 +410302,7 @@ ${lanes.join("\n")} } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 273 /* NamespaceImport */) { + if (namedBindings.kind === 274 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : void 0; } else { const newElements = namedBindings.elements.filter((e) => keep(e.name)); @@ -405184,9 +410313,9 @@ ${lanes.join("\n")} switch (name.kind) { case 80 /* Identifier */: return keep(name) ? name : void 0; - case 206 /* ArrayBindingPattern */: + case 207 /* ArrayBindingPattern */: return name; - case 205 /* ObjectBindingPattern */: { + case 206 /* ObjectBindingPattern */: { const newElements = name.elements.filter((prop) => prop.propertyName || !isIdentifier(prop.name) || keep(prop.name)); return newElements.length ? factory.createObjectBindingPattern(newElements) : void 0; } @@ -405197,9 +410326,9 @@ ${lanes.join("\n")} } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return d.parent.parent; - case 207 /* BindingElement */: + case 208 /* BindingElement */: return getTopLevelDeclarationStatement( cast(d.parent.parent, (p) => isVariableDeclaration(p) || isBindingElement(p)) ); @@ -405219,12 +410348,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( @@ -405247,21 +410374,25 @@ ${lanes.join("\n")} const { file } = context; const range = createTextRangeFromSpan(getRefactorContextSpan(context)); const { statements } = file; - const startNodeIndex = findIndex(statements, (s) => s.end > range.pos); + let startNodeIndex = findIndex(statements, (s) => s.end > range.pos); if (startNodeIndex === -1) return void 0; const startStatement = statements[startNodeIndex]; - if (isNamedDeclaration(startStatement) && startStatement.name && rangeContainsRange(startStatement.name, range)) { - return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] }; + const overloadRangeToMove = getOverloadRangeToMove(file, startStatement); + if (overloadRangeToMove) { + startNodeIndex = overloadRangeToMove.start; + } + let endNodeIndex = findIndex(statements, (s) => s.end >= range.end, startNodeIndex); + if (endNodeIndex !== -1 && range.end <= statements[endNodeIndex].getStart()) { + endNodeIndex--; + } + const endingOverloadRangeToMove = getOverloadRangeToMove(file, statements[endNodeIndex]); + if (endingOverloadRangeToMove) { + endNodeIndex = endingOverloadRangeToMove.end; } - if (range.pos > startStatement.getStart(file)) - return void 0; - const afterEndNodeIndex = findIndex(statements, (s) => s.end > range.end, startNodeIndex); - if (afterEndNodeIndex !== -1 && (afterEndNodeIndex === 0 || statements[afterEndNodeIndex].getStart(file) < range.end)) - return void 0; return { - toMove: statements.slice(startNodeIndex, afterEndNodeIndex === -1 ? statements.length : afterEndNodeIndex), - afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex] + toMove: statements.slice(startNodeIndex, endNodeIndex === -1 ? statements.length : endNodeIndex + 1), + afterLast: endNodeIndex === -1 ? void 0 : statements[endNodeIndex + 1] }; } function getStatementsToMove(context) { @@ -405278,16 +410409,19 @@ ${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); } function isPureImport(node) { switch (node.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return true; - case 270 /* ImportEqualsDeclaration */: - return !hasSyntacticModifier(node, 1 /* Export */); - case 242 /* VariableStatement */: + case 271 /* ImportEqualsDeclaration */: + return !hasSyntacticModifier(node, 32 /* Export */); + case 243 /* VariableStatement */: return node.declarationList.declarations.every((d) => !!d.initializer && isRequireCall( d.initializer, /*requireStringLiteralLikeArgument*/ @@ -405297,12 +410431,11 @@ ${lanes.join("\n")} return false; } } - function getUsageInfo(oldFile, toMove, checker) { + 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); } @@ -405311,10 +410444,16 @@ ${lanes.join("\n")} movedSymbols.add(Debug.checkDefined(isExpressionStatement(decl) ? checker.getSymbolAtLocation(decl.expression.left) : decl.symbol, "Need a symbol here")); }); } + const unusedImportsFromOldFile = /* @__PURE__ */ new Set(); for (const statement of toMove) { forEachReference(statement, checker, (symbol, isValidTypeOnlyUseSite) => { - if (!symbol.declarations) + if (!symbol.declarations) { return; + } + if (existingTargetLocals.has(skipAlias(symbol, checker))) { + unusedImportsFromOldFile.add(symbol); + return; + } for (const decl of symbol.declarations) { if (isInImport(decl)) { const prevIsTypeOnly = oldImportsNeededByTargetFile.get(symbol); @@ -405325,7 +410464,9 @@ ${lanes.join("\n")} } }); } - const unusedImportsFromOldFile = new Set(oldImportsNeededByTargetFile.keys()); + for (const unusedImport of oldImportsNeededByTargetFile.keys()) { + unusedImportsFromOldFile.add(unusedImport); + } const oldFileImportsFromTargetFile = /* @__PURE__ */ new Set(); for (const statement of oldFile.statements) { if (contains(toMove, statement)) @@ -405380,17 +410521,17 @@ ${lanes.join("\n")} } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 261 /* FunctionDeclaration */: - case 262 /* ClassDeclaration */: - case 266 /* ModuleDeclaration */: - case 265 /* EnumDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 263 /* InterfaceDeclaration */: - case 270 /* ImportEqualsDeclaration */: + case 262 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: + case 267 /* ModuleDeclaration */: + case 266 /* EnumDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 264 /* InterfaceDeclaration */: + case 271 /* ImportEqualsDeclaration */: return cb(statement); - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return firstDefined(statement.declarationList.declarations, (decl) => forEachTopLevelDeclarationInBindingName(decl.name, cb)); - case 243 /* ExpressionStatement */: { + case 244 /* ExpressionStatement */: { const { expression } = statement; return isBinaryExpression(expression) && getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) : void 0; } @@ -405398,14 +410539,14 @@ ${lanes.join("\n")} } function isInImport(decl) { switch (decl.kind) { - case 270 /* ImportEqualsDeclaration */: - case 275 /* ImportSpecifier */: - case 272 /* ImportClause */: - case 273 /* NamespaceImport */: + case 271 /* ImportEqualsDeclaration */: + case 276 /* ImportSpecifier */: + case 273 /* ImportClause */: + case 274 /* NamespaceImport */: return true; - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 207 /* BindingElement */: + case 208 /* BindingElement */: return isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -405428,8 +410569,8 @@ ${lanes.join("\n")} switch (name.kind) { case 80 /* Identifier */: return cb(cast(name.parent, (x) => isVariableDeclaration(x) || isBindingElement(x))); - case 206 /* ArrayBindingPattern */: - case 205 /* ObjectBindingPattern */: + case 207 /* ArrayBindingPattern */: + case 206 /* ObjectBindingPattern */: return firstDefined(name.elements, (em) => isOmittedExpression(em) ? void 0 : forEachTopLevelDeclarationInBindingName(em.name, cb)); default: return Debug.assertNever(name, `Unexpected name kind ${name.kind}`); @@ -405437,18 +410578,111 @@ ${lanes.join("\n")} } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 262 /* ClassDeclaration */: - case 266 /* ModuleDeclaration */: - case 265 /* EnumDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 263 /* InterfaceDeclaration */: - case 270 /* ImportEqualsDeclaration */: + case 262 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: + case 267 /* ModuleDeclaration */: + case 266 /* EnumDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 264 /* InterfaceDeclaration */: + case 271 /* ImportEqualsDeclaration */: return true; default: return false; } } + function moveStatementsToTargetFile(changes, program, statements, targetFile, toMove) { + var _a; + const removedExports = /* @__PURE__ */ new Set(); + const targetExports = (_a = targetFile.symbol) == null ? void 0 : _a.exports; + if (targetExports) { + const checker = program.getTypeChecker(); + const targetToSourceExports = /* @__PURE__ */ new Map(); + for (const node of toMove.all) { + if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node, 32 /* Export */)) { + forEachTopLevelDeclaration(node, (declaration) => { + var _a2; + const targetDeclarations = canHaveSymbol(declaration) ? (_a2 = targetExports.get(declaration.symbol.escapedName)) == null ? void 0 : _a2.declarations : void 0; + const exportDeclaration = firstDefined(targetDeclarations, (d) => isExportDeclaration(d) ? d : isExportSpecifier(d) ? tryCast(d.parent.parent, isExportDeclaration) : void 0); + if (exportDeclaration && exportDeclaration.moduleSpecifier) { + targetToSourceExports.set(exportDeclaration, (targetToSourceExports.get(exportDeclaration) || /* @__PURE__ */ new Set()).add(declaration)); + } + }); + } + } + for (const [exportDeclaration, topLevelDeclarations] of arrayFrom(targetToSourceExports)) { + if (exportDeclaration.exportClause && isNamedExports(exportDeclaration.exportClause) && length(exportDeclaration.exportClause.elements)) { + const elements = exportDeclaration.exportClause.elements; + const updatedElements = filter(elements, (elem) => find(skipAlias(elem.symbol, checker).declarations, (d) => isTopLevelDeclaration(d) && topLevelDeclarations.has(d)) === void 0); + if (length(updatedElements) === 0) { + changes.deleteNode(targetFile, exportDeclaration); + removedExports.add(exportDeclaration); + continue; + } + if (length(updatedElements) < length(elements)) { + changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.attributes)); + } + } + } + } + const lastReExport = findLast(targetFile.statements, (n) => isExportDeclaration(n) && !!n.moduleSpecifier && !removedExports.has(n)); + if (lastReExport) { + changes.insertNodesBefore( + targetFile, + lastReExport, + statements, + /*blankLineBetween*/ + true + ); + } else { + changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], statements); + } + } + function getOverloadRangeToMove(sourceFile, statement) { + if (isFunctionLikeDeclaration(statement)) { + const declarations = statement.symbol.declarations; + if (declarations === void 0 || length(declarations) <= 1 || !contains(declarations, statement)) { + return void 0; + } + const firstDecl = declarations[0]; + const lastDecl = declarations[length(declarations) - 1]; + const statementsToMove = mapDefined(declarations, (d) => getSourceFileOfNode(d) === sourceFile && isStatement(d) ? d : void 0); + const end = findIndex(sourceFile.statements, (s) => s.end >= lastDecl.end); + const start = findIndex(sourceFile.statements, (s) => s.end >= firstDecl.end); + return { toMove: statementsToMove, start, end }; + } + return void 0; + } + 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) { + existingLocals.add(skipAlias(symbol, checker)); + } + } + } + if (isVariableDeclarationInitializedToRequire(declaration.parent) && isObjectBindingPattern(declaration.parent.name)) { + for (const e of declaration.parent.name.elements) { + const symbol = checker.getSymbolAtLocation(e.propertyName || e.name); + if (symbol) { + existingLocals.add(skipAlias(symbol, checker)); + } + } + } + } + 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({ "src/services/refactors/moveToFile.ts"() { @@ -405474,24 +410708,24 @@ ${lanes.join("\n")} return [{ name: refactorNameForMoveToFile, description: description2, actions: [moveToFileAction] }]; } if (context.preferences.provideRefactorNotApplicableReason) { - return [{ - name: refactorNameForMoveToFile, - description: description2, - actions: [{ ...moveToFileAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_statement_or_statements) }] - }]; + return [{ name: refactorNameForMoveToFile, description: description2, actions: [{ ...moveToFileAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_statement_or_statements) }] }]; } return emptyArray; }, getEditsForAction: function getRefactorEditsToMoveToFile(context, actionName2, interactiveRefactorArguments) { Debug.assert(actionName2 === refactorNameForMoveToFile, "Wrong refactor invoked"); const statements = Debug.checkDefined(getStatementsToMove(context)); + const { host, program } = context; Debug.assert(interactiveRefactorArguments, "No interactive refactor arguments available"); const targetFile = interactiveRefactorArguments.targetFile; if (hasJSFileExtension(targetFile) || hasTSFileExtension(targetFile)) { + if (host.fileExists(targetFile) && program.getSourceFile(targetFile) === void 0) { + return error(getLocaleSpecificMessage(Diagnostics.Cannot_move_statements_to_the_selected_file)); + } const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } - return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid) }; + return error(getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid)); } }); } @@ -405504,8 +410738,8 @@ ${lanes.join("\n")} if (!info) return emptyArray; return [{ - name: refactorName5, - description: refactorDescription, + name: refactorName6, + description: refactorDescription2, actions: [functionOverloadAction] }]; } @@ -405518,7 +410752,7 @@ ${lanes.join("\n")} const lastDeclaration = signatureDecls[signatureDecls.length - 1]; let updated = lastDeclaration; switch (lastDeclaration.kind) { - case 172 /* MethodSignature */: { + case 173 /* MethodSignature */: { updated = factory.updateMethodSignature( lastDeclaration, lastDeclaration.modifiers, @@ -405530,7 +410764,7 @@ ${lanes.join("\n")} ); break; } - case 173 /* MethodDeclaration */: { + case 174 /* MethodDeclaration */: { updated = factory.updateMethodDeclaration( lastDeclaration, lastDeclaration.modifiers, @@ -405544,7 +410778,7 @@ ${lanes.join("\n")} ); break; } - case 178 /* CallSignature */: { + case 179 /* CallSignature */: { updated = factory.updateCallSignature( lastDeclaration, lastDeclaration.typeParameters, @@ -405553,7 +410787,7 @@ ${lanes.join("\n")} ); break; } - case 175 /* Constructor */: { + case 176 /* Constructor */: { updated = factory.updateConstructorDeclaration( lastDeclaration, lastDeclaration.modifiers, @@ -405562,7 +410796,7 @@ ${lanes.join("\n")} ); break; } - case 179 /* ConstructSignature */: { + case 180 /* ConstructSignature */: { updated = factory.updateConstructSignature( lastDeclaration, lastDeclaration.typeParameters, @@ -405571,7 +410805,7 @@ ${lanes.join("\n")} ); break; } - case 261 /* FunctionDeclaration */: { + case 262 /* FunctionDeclaration */: { updated = factory.updateFunctionDeclaration( lastDeclaration, lastDeclaration.modifiers, @@ -405617,12 +410851,15 @@ ${lanes.join("\n")} } function convertParameterToNamedTupleMember(p) { Debug.assert(isIdentifier(p.name)); - const result = setTextRange(factory.createNamedTupleMember( - p.dotDotDotToken, - p.name, - p.questionToken, - p.type || factory.createKeywordTypeNode(133 /* AnyKeyword */) - ), p); + const result = setTextRange( + factory.createNamedTupleMember( + p.dotDotDotToken, + p.name, + p.questionToken, + p.type || factory.createKeywordTypeNode(133 /* AnyKeyword */) + ), + p + ); const parameterDocComment = p.symbol && p.symbol.getDocumentationComment(checker); if (parameterDocComment) { const newComment = displayPartsToString(parameterDocComment); @@ -405644,12 +410881,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isConvertableSignatureDeclaration(d) { switch (d.kind) { - case 172 /* MethodSignature */: - case 173 /* MethodDeclaration */: - case 178 /* CallSignature */: - case 175 /* Constructor */: - case 179 /* ConstructSignature */: - case 261 /* FunctionDeclaration */: + case 173 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 179 /* CallSignature */: + case 176 /* Constructor */: + case 180 /* ConstructSignature */: + case 262 /* FunctionDeclaration */: return true; } return false; @@ -405696,20 +410933,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return signatureDecls; } - var refactorName5, refactorDescription, functionOverloadAction; + var refactorName6, refactorDescription2, functionOverloadAction; var init_convertOverloadListToSingleSignature = __esm({ "src/services/refactors/convertOverloadListToSingleSignature.ts"() { "use strict"; init_ts4(); init_ts_refactor(); - refactorName5 = "Convert overload list to single signature"; - refactorDescription = Diagnostics.Convert_overload_list_to_single_signature.message; + refactorName6 = "Convert overload list to single signature"; + refactorDescription2 = getLocaleSpecificMessage(Diagnostics.Convert_overload_list_to_single_signature); functionOverloadAction = { - name: refactorName5, - description: refactorDescription, + name: refactorName6, + description: refactorDescription2, kind: "refactor.rewrite.function.overloadList" }; - registerRefactor(refactorName5, { + registerRefactor(refactorName6, { kinds: [functionOverloadAction.kind], getEditsForAction: getRefactorEditsToConvertOverloadsToOneSignature, getAvailableActions: getRefactorActionsToConvertOverloadsToOneSignature @@ -405725,8 +410962,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return emptyArray; if (!isRefactorErrorInfo(info)) { return [{ - name: refactorName6, - description: refactorDescription2, + name: refactorName7, + description: refactorDescription3, actions: [ info.addBraces ? addBracesAction : removeBracesAction ] @@ -405734,8 +410971,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } if (context.preferences.provideRefactorNotApplicableReason) { return [{ - name: refactorName6, - description: refactorDescription2, + name: refactorName7, + description: refactorDescription3, actions: [ { ...addBracesAction, notApplicableReason: info.error }, { ...removeBracesAction, notApplicableReason: info.error } @@ -405821,30 +411058,35 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } else if (refactorKindBeginsWith(removeBracesAction.kind, kind) && isBlock(func.body) && func.body.statements.length === 1) { const firstStatement = first(func.body.statements); if (isReturnStatement(firstStatement)) { - return { func, addBraces: false, expression: firstStatement.expression, returnStatement: firstStatement }; + const expression = firstStatement.expression && isObjectLiteralExpression(getLeftmostExpression( + firstStatement.expression, + /*stopAtCallExpressions*/ + false + )) ? factory.createParenthesizedExpression(firstStatement.expression) : firstStatement.expression; + return { func, addBraces: false, expression, returnStatement: firstStatement }; } } return void 0; } - var refactorName6, refactorDescription2, addBracesAction, removeBracesAction; + var refactorName7, refactorDescription3, addBracesAction, removeBracesAction; var init_addOrRemoveBracesToArrowFunction = __esm({ "src/services/refactors/addOrRemoveBracesToArrowFunction.ts"() { "use strict"; init_ts4(); init_ts_refactor(); - refactorName6 = "Add or remove braces in an arrow function"; - refactorDescription2 = Diagnostics.Add_or_remove_braces_in_an_arrow_function.message; + refactorName7 = "Add or remove braces in an arrow function"; + refactorDescription3 = getLocaleSpecificMessage(Diagnostics.Add_or_remove_braces_in_an_arrow_function); addBracesAction = { name: "Add braces to arrow function", - description: Diagnostics.Add_braces_to_arrow_function.message, + description: getLocaleSpecificMessage(Diagnostics.Add_braces_to_arrow_function), kind: "refactor.rewrite.arrow.braces.add" }; removeBracesAction = { name: "Remove braces from arrow function", - description: Diagnostics.Remove_braces_from_arrow_function.message, + description: getLocaleSpecificMessage(Diagnostics.Remove_braces_from_arrow_function), kind: "refactor.rewrite.arrow.braces.remove" }; - registerRefactor(refactorName6, { + registerRefactor(refactorName7, { kinds: [removeBracesAction.kind], getEditsForAction: getRefactorEditsToRemoveFunctionBraces, getAvailableActions: getRefactorActionsToRemoveFunctionBraces @@ -405872,32 +411114,32 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const possibleActions = []; const errors = []; if (refactorKindBeginsWith(toNamedFunctionAction.kind, kind)) { - const error = selectedVariableDeclaration || isArrowFunction(func) && isVariableDeclaration(func.parent) ? void 0 : getLocaleSpecificMessage(Diagnostics.Could_not_convert_to_named_function); - if (error) { - errors.push({ ...toNamedFunctionAction, notApplicableReason: error }); + const error2 = selectedVariableDeclaration || isArrowFunction(func) && isVariableDeclaration(func.parent) ? void 0 : getLocaleSpecificMessage(Diagnostics.Could_not_convert_to_named_function); + if (error2) { + errors.push({ ...toNamedFunctionAction, notApplicableReason: error2 }); } else { possibleActions.push(toNamedFunctionAction); } } if (refactorKindBeginsWith(toAnonymousFunctionAction.kind, kind)) { - const error = !selectedVariableDeclaration && isArrowFunction(func) ? void 0 : getLocaleSpecificMessage(Diagnostics.Could_not_convert_to_anonymous_function); - if (error) { - errors.push({ ...toAnonymousFunctionAction, notApplicableReason: error }); + const error2 = !selectedVariableDeclaration && isArrowFunction(func) ? void 0 : getLocaleSpecificMessage(Diagnostics.Could_not_convert_to_anonymous_function); + if (error2) { + errors.push({ ...toAnonymousFunctionAction, notApplicableReason: error2 }); } else { possibleActions.push(toAnonymousFunctionAction); } } if (refactorKindBeginsWith(toArrowFunctionAction.kind, kind)) { - const error = isFunctionExpression(func) ? void 0 : getLocaleSpecificMessage(Diagnostics.Could_not_convert_to_arrow_function); - if (error) { - errors.push({ ...toArrowFunctionAction, notApplicableReason: error }); + const error2 = isFunctionExpression(func) ? void 0 : getLocaleSpecificMessage(Diagnostics.Could_not_convert_to_arrow_function); + if (error2) { + errors.push({ ...toArrowFunctionAction, notApplicableReason: error2 }); } else { possibleActions.push(toArrowFunctionAction); } } return [{ - name: refactorName7, - description: refactorDescription3, + name: refactorName8, + description: refactorDescription4, actions: possibleActions.length === 0 && context.preferences.provideRefactorNotApplicableReason ? errors : possibleActions }]; } @@ -406024,7 +411266,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const body = convertToBlock(func.body); const { variableDeclaration, variableDeclarationList, statement, name } = variableInfo; suppressLeadingTrivia(statement); - const modifiersFlags = getCombinedModifierFlags(variableDeclaration) & 1 /* Export */ | getEffectiveModifierFlags(func); + const modifiersFlags = getCombinedModifierFlags(variableDeclaration) & 32 /* Export */ | getEffectiveModifierFlags(func); const modifiers = factory.createModifiersFromModifierFlags(modifiersFlags); const newNode = factory.createFunctionDeclaration(length(modifiers) ? modifiers : void 0, func.asteriskToken, name, func.typeParameters, func.parameters, func.type, body); if (variableDeclarationList.declarations.length === 1) { @@ -406057,14 +411299,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isFunctionReferencedInFile(sourceFile, typeChecker, node) { return !!node.name && ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(node.name, typeChecker, sourceFile); } - var refactorName7, refactorDescription3, toAnonymousFunctionAction, toNamedFunctionAction, toArrowFunctionAction; + var refactorName8, refactorDescription4, toAnonymousFunctionAction, toNamedFunctionAction, toArrowFunctionAction; var init_convertArrowFunctionOrFunctionExpression = __esm({ "src/services/refactors/convertArrowFunctionOrFunctionExpression.ts"() { "use strict"; init_ts4(); init_ts_refactor(); - refactorName7 = "Convert arrow function or function expression"; - refactorDescription3 = getLocaleSpecificMessage(Diagnostics.Convert_arrow_function_or_function_expression); + refactorName8 = "Convert arrow function or function expression"; + refactorDescription4 = getLocaleSpecificMessage(Diagnostics.Convert_arrow_function_or_function_expression); toAnonymousFunctionAction = { name: "Convert to anonymous function", description: getLocaleSpecificMessage(Diagnostics.Convert_to_anonymous_function), @@ -406080,7 +411322,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} description: getLocaleSpecificMessage(Diagnostics.Convert_to_arrow_function), kind: "refactor.rewrite.function.arrow" }; - registerRefactor(refactorName7, { + registerRefactor(refactorName8, { kinds: [ toAnonymousFunctionAction.kind, toNamedFunctionAction.kind, @@ -406111,13 +411353,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!functionDeclaration) return emptyArray; return [{ - name: refactorName8, - description: refactorDescription4, + name: refactorName9, + description: refactorDescription5, actions: [toDestructuredAction] }]; } function getRefactorEditsToConvertParametersToDestructuredObject(context, actionName2) { - Debug.assert(actionName2 === refactorName8, "Unexpected action name"); + Debug.assert(actionName2 === refactorName9, "Unexpected action name"); const { file, startPosition, program, cancellationToken, host } = context; const functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, program.getTypeChecker()); if (!functionDeclaration || !cancellationToken) @@ -406303,14 +411545,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const functionReference = entry.node; const parent2 = functionReference.parent; switch (parent2.kind) { - case 212 /* CallExpression */: - case 213 /* NewExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: const callOrNewExpression = tryCast(parent2, isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { const callOrNewExpression2 = tryCast(propertyAccessExpression.parent, isCallOrNewExpression); @@ -406319,7 +411561,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } break; - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: const elementAccessExpression = tryCast(parent2, isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { const callOrNewExpression2 = tryCast(elementAccessExpression.parent, isCallOrNewExpression); @@ -406337,13 +411579,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const reference = entry.node; const parent2 = reference.parent; switch (parent2.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: const propertyAccessExpression = tryCast(parent2, isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: const elementAccessExpression = tryCast(parent2, isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -406385,22 +411627,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: if (isObjectLiteralExpression(functionDeclaration.parent)) { const contextualSymbol = getSymbolForContextualType(functionDeclaration.name, checker); return ((_a = contextualSymbol == null ? void 0 : contextualSymbol.declarations) == null ? void 0 : _a.length) === 1 && isSingleImplementation(functionDeclaration, checker); } return isSingleImplementation(functionDeclaration, checker); - case 175 /* Constructor */: + case 176 /* Constructor */: if (isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } else { return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -406577,7 +411819,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: const classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -406586,7 +411828,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} "Nameless class declaration should be a default export" ); return [defaultModifier]; - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: const classExpression = constructorDeclaration.parent; const variableDeclaration = constructorDeclaration.parent.parent; const className = classExpression.name; @@ -406597,7 +411839,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; const defaultModifier = Debug.checkDefined( @@ -406605,21 +411847,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} "Nameless function declaration should be a default export" ); return [defaultModifier]; - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return [functionDeclaration.name]; - case 175 /* Constructor */: + case 176 /* Constructor */: const ctrKeyword = Debug.checkDefined( findChildOfKind(functionDeclaration, 137 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword" ); - if (functionDeclaration.parent.kind === 230 /* ClassExpression */) { + if (functionDeclaration.parent.kind === 231 /* ClassExpression */) { const variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 217 /* FunctionExpression */: + case 218 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -406627,21 +411869,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return Debug.assertNever(functionDeclaration, `Unexpected function declaration kind ${functionDeclaration.kind}`); } } - var refactorName8, minimumParameterLength, refactorDescription4, toDestructuredAction; + var refactorName9, minimumParameterLength, refactorDescription5, toDestructuredAction; var init_convertParamsToDestructuredObject = __esm({ "src/services/refactors/convertParamsToDestructuredObject.ts"() { "use strict"; init_ts4(); init_ts_refactor(); - refactorName8 = "Convert parameters to destructured object"; + refactorName9 = "Convert parameters to destructured object"; minimumParameterLength = 1; - refactorDescription4 = getLocaleSpecificMessage(Diagnostics.Convert_parameters_to_destructured_object); + refactorDescription5 = getLocaleSpecificMessage(Diagnostics.Convert_parameters_to_destructured_object); toDestructuredAction = { - name: refactorName8, - description: refactorDescription4, + name: refactorName9, + description: refactorDescription5, kind: "refactor.rewrite.parameters.toDestructured" }; - registerRefactor(refactorName8, { + registerRefactor(refactorName9, { kinds: [toDestructuredAction.kind], getEditsForAction: getRefactorEditsToConvertParametersToDestructuredObject, getAvailableActions: getRefactorActionsToConvertParametersToDestructuredObject @@ -406663,15 +411905,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const { file, startPosition } = context; const node = getNodeOrParentOfParentheses(file, startPosition); const maybeBinary = getParentBinaryExpression(node); - const refactorInfo = { name: refactorName9, description: refactorDescription5, actions: [] }; - if (isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation) { + const nodeIsStringLiteral = isStringLiteral(maybeBinary); + const refactorInfo = { name: refactorName10, description: refactorDescription6, actions: [] }; + if (nodeIsStringLiteral && context.triggerReason !== "invoked") { + return emptyArray; + } + if (isExpressionNode(maybeBinary) && (nodeIsStringLiteral || isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation)) { refactorInfo.actions.push(convertStringAction); return [refactorInfo]; } else if (context.preferences.provideRefactorNotApplicableReason) { - refactorInfo.actions.push({ - ...convertStringAction, - notApplicableReason: getLocaleSpecificMessage(Diagnostics.Can_only_convert_string_concatenation) - }); + refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Can_only_convert_string_concatenations_and_string_literals) }); return [refactorInfo]; } return emptyArray; @@ -406689,7 +411932,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const { file, startPosition } = context; const node = getNodeOrParentOfParentheses(file, startPosition); switch (actionName2) { - case refactorDescription5: + case refactorDescription6: return { edits: getEditsForToTemplateLiteral(context, node) }; default: return Debug.fail("invalid action"); @@ -406712,16 +411955,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function isNotEqualsOperator(node) { - return node.operatorToken.kind !== 64 /* EqualsToken */; + return !(node.operatorToken.kind === 64 /* EqualsToken */ || node.operatorToken.kind === 65 /* PlusEqualsToken */); } function getParentBinaryExpression(expr) { const container = findAncestor(expr.parent, (n) => { switch (n.kind) { - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: return false; - case 227 /* TemplateExpression */: - case 225 /* BinaryExpression */: + case 228 /* TemplateExpression */: + case 226 /* BinaryExpression */: return !(isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent)); default: return "quit"; @@ -406732,12 +411975,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function treeToArray(current) { const loop = (current2) => { if (!isBinaryExpression(current2)) { - return { - nodes: [current2], - operators: [], - validOperators: true, - hasString: isStringLiteral(current2) || isNoSubstitutionTemplateLiteral(current2) - }; + return { nodes: [current2], operators: [], validOperators: true, hasString: isStringLiteral(current2) || isNoSubstitutionTemplateLiteral(current2) }; } const { nodes: nodes2, operators: operators2, hasString: leftHasString, validOperators: leftOperatorValid } = loop(current2.left); if (!(leftHasString || isStringLiteral(current2.right) || isTemplateExpression(current2.right))) { @@ -406803,7 +412041,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const isLastSpan = index === currentNode.templateSpans.length - 1; const text = span.literal.text + (isLastSpan ? subsequentText : ""); const rawText = getRawTextOfTemplate(span.literal) + (isLastSpan ? rawSubsequentText : ""); - return factory.createTemplateSpan(span.expression, isLast && isLastSpan ? factory.createTemplateTail(text, rawText) : factory.createTemplateMiddle(text, rawText)); + return factory.createTemplateSpan( + span.expression, + isLast && isLastSpan ? factory.createTemplateTail(text, rawText) : factory.createTemplateMiddle(text, rawText) + ); }); templateSpans.push(...spans); } else { @@ -406840,20 +412081,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return node; } - var refactorName9, refactorDescription5, convertStringAction, copyTrailingOperatorComments, copyCommentFromMultiNode; + var refactorName10, refactorDescription6, convertStringAction, copyTrailingOperatorComments, copyCommentFromMultiNode; var init_convertStringOrTemplateLiteral = __esm({ "src/services/refactors/convertStringOrTemplateLiteral.ts"() { "use strict"; init_ts4(); init_ts_refactor(); - refactorName9 = "Convert to template string"; - refactorDescription5 = getLocaleSpecificMessage(Diagnostics.Convert_to_template_string); + refactorName10 = "Convert to template string"; + refactorDescription6 = getLocaleSpecificMessage(Diagnostics.Convert_to_template_string); convertStringAction = { - name: refactorName9, - description: refactorDescription5, + name: refactorName10, + description: refactorDescription6, kind: "refactor.rewrite.string" }; - registerRefactor(refactorName9, { + registerRefactor(refactorName10, { kinds: [convertStringAction.kind], getEditsForAction: getRefactorEditsToConvertToTemplateString, getAvailableActions: getRefactorActionsToConvertToTemplateString @@ -406903,14 +412144,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return emptyArray; if (!isRefactorErrorInfo(info)) { return [{ - name: refactorName10, + name: refactorName11, description: convertToOptionalChainExpressionMessage, actions: [toOptionalChainAction] }]; } if (context.preferences.provideRefactorNotApplicableReason) { return [{ - name: refactorName10, + name: refactorName11, description: convertToOptionalChainExpressionMessage, actions: [{ ...toOptionalChainAction, notApplicableReason: info.error }] }]; @@ -406920,10 +412161,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getRefactorEditsToConvertToOptionalChain(context, actionName2) { const info = getInfo3(context); Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info"); - const edits = ts_textChanges_exports.ChangeTracker.with( - context, - (t) => doChange6(context.file, context.program.getTypeChecker(), t, info, actionName2) - ); + const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange6(context.file, context.program.getTypeChecker(), t, info, actionName2)); return { edits, renameFilename: void 0, renameLocation: void 0 }; } function isValidExpression(node) { @@ -407086,28 +412324,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isBinaryExpression(expression)) { changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain); } else if (isConditionalExpression(expression)) { - changes.replaceNode( - sourceFile, - expression, - factory.createBinaryExpression(convertedChain, factory.createToken(61 /* QuestionQuestionToken */), expression.whenFalse) - ); + changes.replaceNode(sourceFile, expression, factory.createBinaryExpression(convertedChain, factory.createToken(61 /* QuestionQuestionToken */), expression.whenFalse)); } } } - var refactorName10, convertToOptionalChainExpressionMessage, toOptionalChainAction; + var refactorName11, convertToOptionalChainExpressionMessage, toOptionalChainAction; var init_convertToOptionalChainExpression = __esm({ "src/services/refactors/convertToOptionalChainExpression.ts"() { "use strict"; init_ts4(); init_ts_refactor(); - refactorName10 = "Convert to optional chain expression"; + refactorName11 = "Convert to optional chain expression"; convertToOptionalChainExpressionMessage = getLocaleSpecificMessage(Diagnostics.Convert_to_optional_chain_expression); toOptionalChainAction = { - name: refactorName10, + name: refactorName11, description: convertToOptionalChainExpressionMessage, kind: "refactor.rewrite.expression.optionalChain" }; - registerRefactor(refactorName10, { + registerRefactor(refactorName11, { kinds: [toOptionalChainAction.kind], getEditsForAction: getRefactorEditsToConvertToOptionalChain, getAvailableActions: getRefactorActionsToConvertToOptionalChain @@ -407136,14 +412370,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const errors = []; if (refactorKindBeginsWith(extractFunctionAction.kind, requestedRefactor)) { errors.push({ - name: refactorName11, + name: refactorName12, description: extractFunctionAction.description, actions: [{ ...extractFunctionAction, notApplicableReason: getStringError(rangeToExtract.errors) }] }); } if (refactorKindBeginsWith(extractConstantAction.kind, requestedRefactor)) { errors.push({ - name: refactorName11, + name: refactorName12, description: extractConstantAction.description, actions: [{ ...extractConstantAction, notApplicableReason: getStringError(rangeToExtract.errors) }] }); @@ -407207,37 +412441,37 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const infos = []; if (functionActions.length) { infos.push({ - name: refactorName11, + name: refactorName12, description: getLocaleSpecificMessage(Diagnostics.Extract_function), actions: functionActions }); } else if (context.preferences.provideRefactorNotApplicableReason && innermostErrorFunctionAction) { infos.push({ - name: refactorName11, + name: refactorName12, description: getLocaleSpecificMessage(Diagnostics.Extract_function), actions: [innermostErrorFunctionAction] }); } if (constantActions.length) { infos.push({ - name: refactorName11, + name: refactorName12, description: getLocaleSpecificMessage(Diagnostics.Extract_constant), actions: constantActions }); } else if (context.preferences.provideRefactorNotApplicableReason && innermostErrorConstantAction) { infos.push({ - name: refactorName11, + name: refactorName12, description: getLocaleSpecificMessage(Diagnostics.Extract_constant), actions: [innermostErrorConstantAction] }); } return infos.length ? infos : emptyArray; function getStringError(errors) { - let error = errors[0].messageText; - if (typeof error !== "string") { - error = error.messageText; + let error2 = errors[0].messageText; + if (typeof error2 !== "string") { + error2 = error2.messageText; } - return error; + return error2; } } function getRefactorEditsToExtractSymbol(context, actionName2) { @@ -407273,7 +412507,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!start || !end) { return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] }; } - if (start.flags & 8388608 /* JSDoc */) { + if (start.flags & 16777216 /* JSDoc */) { return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractJSDoc)] }; } if (start.parent !== end.parent) { @@ -407344,18 +412578,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function checkForStaticContext(nodeToCheck, containingClass) { let current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 171 /* PropertyDeclaration */) { + if (current.kind === 172 /* PropertyDeclaration */) { if (isStatic(current)) { rangeFacts |= 32 /* InStaticRegion */; } break; - } else if (current.kind === 168 /* Parameter */) { + } else if (current.kind === 169 /* Parameter */) { const ctorOrMethod = getContainingFunction(current); - if (ctorOrMethod.kind === 175 /* Constructor */) { + if (ctorOrMethod.kind === 176 /* Constructor */) { rangeFacts |= 32 /* InStaticRegion */; } break; - } else if (current.kind === 173 /* MethodDeclaration */) { + } else if (current.kind === 174 /* MethodDeclaration */) { if (isStatic(current)) { rangeFacts |= 32 /* InStaticRegion */; } @@ -407376,7 +412610,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!isStatement(nodeToCheck) && !(isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck)) && !isStringLiteralJsxAttribute(nodeToCheck)) { return [createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)]; } - if (nodeToCheck.flags & 16777216 /* Ambient */) { + if (nodeToCheck.flags & 33554432 /* Ambient */) { return [createDiagnosticForNode(nodeToCheck, Messages.cannotExtractAmbientBlock)]; } const containingClass = getContainingClass(nodeToCheck); @@ -407395,7 +412629,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} /*includeClassComputedPropertyName*/ false ); - if (container.kind === 261 /* FunctionDeclaration */ || container.kind === 173 /* MethodDeclaration */ && container.parent.kind === 209 /* ObjectLiteralExpression */ || container.kind === 217 /* FunctionExpression */) { + if (container.kind === 262 /* FunctionDeclaration */ || container.kind === 174 /* MethodDeclaration */ && container.parent.kind === 210 /* ObjectLiteralExpression */ || container.kind === 218 /* FunctionExpression */) { rangeFacts |= 16 /* UsesThisInFunction */; } } @@ -407405,21 +412639,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return true; } if (isDeclaration(node2)) { - const declaringNode = node2.kind === 259 /* VariableDeclaration */ ? node2.parent.parent : node2; - if (hasSyntacticModifier(declaringNode, 1 /* Export */)) { + const declaringNode = node2.kind === 260 /* VariableDeclaration */ ? node2.parent.parent : node2; + if (hasSyntacticModifier(declaringNode, 32 /* Export */)) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity)); return true; } } switch (node2.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractImport)); return true; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractExportedEntity)); return true; case 108 /* SuperKeyword */: - if (node2.parent.kind === 212 /* CallExpression */) { + if (node2.parent.kind === 213 /* CallExpression */) { const containingClass2 = getContainingClass(node2); if (containingClass2 === void 0 || containingClass2.pos < span.start || containingClass2.end >= span.start + span.length) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractSuper)); @@ -407430,7 +412664,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} thisNode = node2; } break; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: forEachChild(node2, function check(n) { if (isThis(n)) { rangeFacts |= 8 /* UsesThis */; @@ -407441,34 +412675,34 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} forEachChild(n, check); } }); - case 262 /* ClassDeclaration */: - case 261 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: + case 262 /* FunctionDeclaration */: if (isSourceFile(node2.parent) && node2.parent.externalModuleIndicator === void 0) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.functionWillNotBeVisibleInTheNewScope)); } - case 230 /* ClassExpression */: - case 217 /* FunctionExpression */: - case 173 /* MethodDeclaration */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 231 /* ClassExpression */: + case 218 /* FunctionExpression */: + case 174 /* MethodDeclaration */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return false; } const savedPermittedJumps = permittedJumps; switch (node2.kind) { - case 244 /* IfStatement */: + case 245 /* IfStatement */: permittedJumps &= ~4 /* Return */; break; - case 257 /* TryStatement */: + case 258 /* TryStatement */: permittedJumps = 0 /* None */; break; - case 240 /* Block */: - if (node2.parent && node2.parent.kind === 257 /* TryStatement */ && node2.parent.finallyBlock === node2) { + case 241 /* Block */: + if (node2.parent && node2.parent.kind === 258 /* TryStatement */ && node2.parent.finallyBlock === node2) { permittedJumps = 4 /* Return */; } break; - case 296 /* DefaultClause */: - case 295 /* CaseClause */: + case 297 /* DefaultClause */: + case 296 /* CaseClause */: permittedJumps |= 1 /* Break */; break; default: @@ -407482,39 +412716,39 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} break; } switch (node2.kind) { - case 196 /* ThisType */: + case 197 /* ThisType */: case 110 /* ThisKeyword */: rangeFacts |= 8 /* UsesThis */; thisNode = node2; break; - case 255 /* LabeledStatement */: { + case 256 /* LabeledStatement */: { const label = node2.label; (seenLabels || (seenLabels = [])).push(label.escapedText); forEachChild(node2, visit); seenLabels.pop(); break; } - case 251 /* BreakStatement */: - case 250 /* ContinueStatement */: { + case 252 /* BreakStatement */: + case 251 /* ContinueStatement */: { const label = node2.label; if (label) { if (!contains(seenLabels, label.escapedText)) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); } } else { - if (!(permittedJumps & (node2.kind === 251 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node2.kind === 252 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 222 /* AwaitExpression */: + case 223 /* AwaitExpression */: rangeFacts |= 4 /* IsAsyncFunction */; break; - case 228 /* YieldExpression */: + case 229 /* YieldExpression */: rangeFacts |= 2 /* IsGenerator */; break; - case 252 /* ReturnStatement */: + case 253 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= 1 /* HasReturn */; } else { @@ -407564,12 +412798,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const scopes = []; while (true) { current = current.parent; - if (current.kind === 168 /* Parameter */) { + if (current.kind === 169 /* Parameter */) { current = findAncestor(current, (parent2) => isFunctionLikeDeclaration(parent2)).parent; } if (isScope(current)) { scopes.push(current); - if (current.kind === 311 /* SourceFile */) { + if (current.kind === 312 /* SourceFile */) { return scopes; } } @@ -407645,28 +412879,28 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 175 /* Constructor */: + case 176 /* Constructor */: return "constructor"; - case 217 /* FunctionExpression */: - case 261 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: return scope.name ? `function '${scope.name.text}'` : ANONYMOUS; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return "arrow function"; - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return `method '${scope.name.getText()}'`; - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return `'get ${scope.name.getText()}'`; - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return `'set ${scope.name.getText()}'`; default: Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 262 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; + return scope.kind === 263 /* ClassDeclaration */ ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 267 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; + return scope.kind === 268 /* ModuleBlock */ ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParameterUsages, substitutions }, exposedVariableDeclarations, range, context) { const checker = context.program.getTypeChecker(); @@ -408043,7 +413277,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); const localReference = factory.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); - } else if (node.parent.kind === 243 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) { + } else if (node.parent.kind === 244 /* ExpressionStatement */ && scope === findAncestor(node, isScope)) { const newVariableStatement = factory.createVariableStatement( /*modifiers*/ void 0, @@ -408073,7 +413307,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} false ); } - if (node.parent.kind === 243 /* ExpressionStatement */) { + if (node.parent.kind === 244 /* ExpressionStatement */) { changeTracker.delete(context.file, node.parent); } else { let localReference = factory.createIdentifier(localNameText); @@ -408118,57 +413352,36 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const paramType = checker.getTypeAtLocation(p); if (paramType === checker.getAnyType()) hasAny = true; - parameters.push(factory.updateParameterDeclaration( - p, - p.modifiers, - p.dotDotDotToken, - p.name, - p.questionToken, - p.type || checker.typeToTypeNode(paramType, scope, 1 /* NoTruncation */), - p.initializer - )); + parameters.push(factory.updateParameterDeclaration(p, p.modifiers, p.dotDotDotToken, p.name, p.questionToken, p.type || checker.typeToTypeNode(paramType, scope, 1 /* NoTruncation */), p.initializer)); } } if (hasAny) return { variableType: variableType2, initializer: initializer2 }; variableType2 = void 0; if (isArrowFunction(initializer2)) { - initializer2 = factory.updateArrowFunction( - initializer2, - canHaveModifiers(node) ? getModifiers(node) : void 0, - initializer2.typeParameters, - parameters, - initializer2.type || checker.typeToTypeNode(functionSignature.getReturnType(), scope, 1 /* NoTruncation */), - initializer2.equalsGreaterThanToken, - initializer2.body - ); + initializer2 = factory.updateArrowFunction(initializer2, canHaveModifiers(node) ? getModifiers(node) : void 0, initializer2.typeParameters, parameters, initializer2.type || checker.typeToTypeNode(functionSignature.getReturnType(), scope, 1 /* NoTruncation */), initializer2.equalsGreaterThanToken, initializer2.body); } else { if (functionSignature && !!functionSignature.thisParameter) { const firstParameter = firstOrUndefined(parameters); if (!firstParameter || isIdentifier(firstParameter.name) && firstParameter.name.escapedText !== "this") { const thisType = checker.getTypeOfSymbolAtLocation(functionSignature.thisParameter, node); - parameters.splice(0, 0, factory.createParameterDeclaration( - /*modifiers*/ - void 0, - /*dotDotDotToken*/ - void 0, - "this", - /*questionToken*/ - void 0, - checker.typeToTypeNode(thisType, scope, 1 /* NoTruncation */) - )); + parameters.splice( + 0, + 0, + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "this", + /*questionToken*/ + void 0, + checker.typeToTypeNode(thisType, scope, 1 /* NoTruncation */) + ) + ); } } - initializer2 = factory.updateFunctionExpression( - initializer2, - canHaveModifiers(node) ? getModifiers(node) : void 0, - initializer2.asteriskToken, - initializer2.name, - initializer2.typeParameters, - parameters, - initializer2.type || checker.typeToTypeNode(functionSignature.getReturnType(), scope, 1 /* NoTruncation */), - initializer2.body - ); + initializer2 = factory.updateFunctionExpression(initializer2, canHaveModifiers(node) ? getModifiers(node) : void 0, initializer2.asteriskToken, initializer2.name, initializer2.typeParameters, parameters, initializer2.type || checker.typeToTypeNode(functionSignature.getReturnType(), scope, 1 /* NoTruncation */), initializer2.body); } return { variableType: variableType2, initializer: initializer2 }; } @@ -408262,7 +413475,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; } @@ -408272,7 +413490,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) { @@ -408435,7 +413658,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} usagesPerScope[i].usages.forEach((value) => { if (value.usage === 2 /* Write */) { hasWrite = true; - if (value.symbol.flags & 106500 /* ClassMember */ && value.symbol.valueDeclaration && hasEffectiveModifier(value.symbol.valueDeclaration, 64 /* Readonly */)) { + if (value.symbol.flags & 106500 /* ClassMember */ && value.symbol.valueDeclaration && hasEffectiveModifier(value.symbol.valueDeclaration, 8 /* Readonly */)) { readonlyClassPropertyWrite = value.symbol.valueDeclaration; } } @@ -408581,7 +413804,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return symbolId; } function checkForUsedDeclarations(node) { - if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node) >= 0) { + if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.includes(node)) { return; } const sym = isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node); @@ -408625,27 +413848,27 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isExtractableExpression(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 305 /* EnumMember */: + case 306 /* EnumMember */: return false; } switch (node.kind) { case 11 /* StringLiteral */: - return parent2.kind !== 271 /* ImportDeclaration */ && parent2.kind !== 275 /* ImportSpecifier */; - case 229 /* SpreadElement */: - case 205 /* ObjectBindingPattern */: - case 207 /* BindingElement */: + return parent2.kind !== 272 /* ImportDeclaration */ && parent2.kind !== 276 /* ImportSpecifier */; + case 230 /* SpreadElement */: + case 206 /* ObjectBindingPattern */: + case 208 /* BindingElement */: return false; case 80 /* Identifier */: - return parent2.kind !== 207 /* BindingElement */ && parent2.kind !== 275 /* ImportSpecifier */ && parent2.kind !== 280 /* ExportSpecifier */; + return parent2.kind !== 208 /* BindingElement */ && parent2.kind !== 276 /* ImportSpecifier */ && parent2.kind !== 281 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 240 /* Block */: - case 311 /* SourceFile */: - case 267 /* ModuleBlock */: - case 295 /* CaseClause */: + case 241 /* Block */: + case 312 /* SourceFile */: + case 268 /* ModuleBlock */: + case 296 /* CaseClause */: return true; default: return false; @@ -408657,13 +413880,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isStringLiteralJsxAttribute(node) { return isStringLiteral(node) && node.parent && isJsxAttribute(node.parent); } - var refactorName11, extractConstantAction, extractFunctionAction, Messages, RangeFacts; + var refactorName12, extractConstantAction, extractFunctionAction, Messages, RangeFacts; var init_extractSymbol = __esm({ "src/services/refactors/extractSymbol.ts"() { "use strict"; init_ts4(); init_ts_refactor(); - refactorName11 = "Extract Symbol"; + refactorName12 = "Extract Symbol"; extractConstantAction = { name: "Extract Constant", description: getLocaleSpecificMessage(Diagnostics.Extract_constant), @@ -408674,7 +413897,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} description: getLocaleSpecificMessage(Diagnostics.Extract_function), kind: "refactor.extract.function" }; - registerRefactor(refactorName11, { + registerRefactor(refactorName12, { kinds: [ extractConstantAction.kind, extractFunctionAction.kind @@ -408747,7 +413970,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} init_ts4(); init_ts_refactor(); actionName = "Generate 'get' and 'set' accessors"; - actionDescription = Diagnostics.Generate_get_and_set_accessors.message; + actionDescription = getLocaleSpecificMessage(Diagnostics.Generate_get_and_set_accessors); generateGetSetAction = { name: actionName, description: actionDescription, @@ -408825,15 +414048,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return emptyArray; if (!isRefactorErrorInfo(info)) { return [{ - name: refactorName12, - description: refactorDescription6, + name: refactorName13, + description: refactorDescription7, actions: [inferReturnTypeAction] }]; } if (context.preferences.provideRefactorNotApplicableReason) { return [{ - name: refactorName12, - description: refactorDescription6, + name: refactorName13, + description: refactorDescription7, actions: [{ ...inferReturnTypeAction, notApplicableReason: info.error }] }]; } @@ -408854,7 +414077,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getInfo4(context) { if (isInJSFile(context.file) || !refactorKindBeginsWith(inferReturnTypeAction.kind, context.kind)) return; - const token = getTokenAtPosition(context.file, context.startPosition); + const token = getTouchingPropertyName(context.file, context.startPosition); const declaration = findAncestor(token, (n) => isBlock(n) || n.parent && isArrowFunction(n.parent) && (n.kind === 39 /* EqualsGreaterThanToken */ || n.parent.body === n) ? "quit" : isConvertibleDeclaration(n)); if (!declaration || !declaration.body || declaration.type) { return { error: getLocaleSpecificMessage(Diagnostics.Return_type_must_be_inferred_from_a_function) }; @@ -408871,10 +414094,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isConvertibleDeclaration(node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: return true; default: return false; @@ -408892,20 +414115,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return typeChecker.getReturnTypeOfSignature(signature); } } - var refactorName12, refactorDescription6, inferReturnTypeAction; + var refactorName13, refactorDescription7, inferReturnTypeAction; var init_inferFunctionReturnType = __esm({ "src/services/refactors/inferFunctionReturnType.ts"() { "use strict"; init_ts4(); init_ts_refactor(); - refactorName12 = "Infer function return type"; - refactorDescription6 = Diagnostics.Infer_function_return_type.message; + refactorName13 = "Infer function return type"; + refactorDescription7 = getLocaleSpecificMessage(Diagnostics.Infer_function_return_type); inferReturnTypeAction = { - name: refactorName12, - description: refactorDescription6, + name: refactorName13, + description: refactorDescription7, kind: "refactor.rewrite.function.returnType" }; - registerRefactor(refactorName12, { + registerRefactor(refactorName13, { kinds: [inferReturnTypeAction.kind], getEditsForAction: getRefactorEditsToInferReturnType, getAvailableActions: getRefactorActionsToInferReturnType @@ -408929,6 +414152,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, @@ -408966,6 +414190,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} init_convertImport(); init_extractType(); init_helpers(); + init_inlineVariable(); init_moveToNewFile(); init_moveToFile(); init_ts_refactor_addOrRemoveBracesToArrowFunction(); @@ -409014,13 +414239,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} let inJSXElement = false; function visit(node) { switch (node.kind) { - case 266 /* ModuleDeclaration */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 261 /* FunctionDeclaration */: - case 230 /* ClassExpression */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 267 /* ModuleDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 262 /* FunctionDeclaration */: + case 231 /* ClassExpression */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { @@ -409056,14 +414281,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (decl) { const modifiers = getCombinedModifierFlags(decl); const nodeFlags = getCombinedNodeFlags(decl); - if (modifiers & 32 /* Static */) { + if (modifiers & 256 /* Static */) { modifierSet |= 1 << 1 /* static */; } - if (modifiers & 512 /* Async */) { + if (modifiers & 1024 /* Async */) { modifierSet |= 1 << 2 /* async */; } if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) { - if (modifiers & 64 /* Readonly */ || nodeFlags & 2 /* Const */ || symbol.getFlags() & 8 /* EnumMember */) { + if (modifiers & 8 /* Readonly */ || nodeFlags & 2 /* Const */ || symbol.getFlags() & 8 /* EnumMember */) { modifierSet |= 1 << 3 /* readonly */; } } @@ -409191,25 +414416,25 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return TokenModifier2; })(TokenModifier || {}); tokenFromDeclarationMapping = /* @__PURE__ */ new Map([ - [259 /* VariableDeclaration */, 7 /* variable */], - [168 /* Parameter */, 6 /* parameter */], - [171 /* PropertyDeclaration */, 9 /* property */], - [266 /* ModuleDeclaration */, 3 /* namespace */], - [265 /* EnumDeclaration */, 1 /* enum */], - [305 /* EnumMember */, 8 /* enumMember */], - [262 /* ClassDeclaration */, 0 /* class */], - [173 /* MethodDeclaration */, 11 /* member */], - [261 /* FunctionDeclaration */, 10 /* function */], - [217 /* FunctionExpression */, 10 /* function */], - [172 /* MethodSignature */, 11 /* member */], - [176 /* GetAccessor */, 9 /* property */], - [177 /* SetAccessor */, 9 /* property */], - [170 /* PropertySignature */, 9 /* property */], - [263 /* InterfaceDeclaration */, 2 /* interface */], - [264 /* TypeAliasDeclaration */, 5 /* type */], - [167 /* TypeParameter */, 4 /* typeParameter */], - [302 /* PropertyAssignment */, 9 /* property */], - [303 /* ShorthandPropertyAssignment */, 9 /* property */] + [260 /* VariableDeclaration */, 7 /* variable */], + [169 /* Parameter */, 6 /* parameter */], + [172 /* PropertyDeclaration */, 9 /* property */], + [267 /* ModuleDeclaration */, 3 /* namespace */], + [266 /* EnumDeclaration */, 1 /* enum */], + [306 /* EnumMember */, 8 /* enumMember */], + [263 /* ClassDeclaration */, 0 /* class */], + [174 /* MethodDeclaration */, 11 /* member */], + [262 /* FunctionDeclaration */, 10 /* function */], + [218 /* FunctionExpression */, 10 /* function */], + [173 /* MethodSignature */, 11 /* member */], + [177 /* GetAccessor */, 9 /* property */], + [178 /* SetAccessor */, 9 /* property */], + [171 /* PropertySignature */, 9 /* property */], + [264 /* InterfaceDeclaration */, 2 /* interface */], + [265 /* TypeAliasDeclaration */, 5 /* type */], + [168 /* TypeParameter */, 4 /* typeParameter */], + [303 /* PropertyAssignment */, 9 /* property */], + [304 /* ShorthandPropertyAssignment */, 9 /* property */] ]); } }); @@ -409218,7 +414443,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function createNode(kind, pos, end, parent2) { const node = isNodeKind(kind) ? new NodeObject(kind, pos, end) : kind === 80 /* Identifier */ ? new IdentifierObject(80 /* Identifier */, pos, end) : kind === 81 /* PrivateIdentifier */ ? new PrivateIdentifierObject(81 /* PrivateIdentifier */, pos, end) : new TokenObject(kind, pos, end); node.parent = parent2; - node.flags = parent2.flags & 50720768 /* ContextFlags */; + node.flags = parent2.flags & 101441536 /* ContextFlags */; return node; } function createChildren(node, sourceFile) { @@ -409272,7 +414497,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function createSyntaxList(nodes, parent2) { - const list = createNode(357 /* SyntaxList */, nodes.pos, nodes.end, parent2); + const list = createNode(358 /* SyntaxList */, nodes.pos, nodes.end, parent2); list._children = []; let pos = nodes.pos; for (const node of nodes) { @@ -409297,7 +414522,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} var _a; if (!seenSymbols.has(symbol)) { seenSymbols.add(symbol); - if (declaration.kind === 176 /* GetAccessor */ || declaration.kind === 177 /* SetAccessor */) { + if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) { return symbol.getContextualJsDocTags(declaration, checker); } return ((_a = symbol.declarations) == null ? void 0 : _a.length) === 1 ? symbol.getJsDocTags() : void 0; @@ -409320,7 +414545,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const inheritedDocs = findBaseOfDeclaration(checker, declaration, (symbol) => { if (!seenSymbols.has(symbol)) { seenSymbols.add(symbol); - if (declaration.kind === 176 /* GetAccessor */ || declaration.kind === 177 /* SetAccessor */) { + if (declaration.kind === 177 /* GetAccessor */ || declaration.kind === 178 /* SetAccessor */) { return symbol.getContextualDocumentationComment(declaration, checker); } return symbol.getDocumentationComment(checker); @@ -409334,7 +414559,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function findBaseOfDeclaration(checker, declaration, cb) { var _a; - const classOrInterfaceDeclaration = ((_a = declaration.parent) == null ? void 0 : _a.kind) === 175 /* Constructor */ ? declaration.parent.parent : declaration.parent; + const classOrInterfaceDeclaration = ((_a = declaration.parent) == null ? void 0 : _a.kind) === 176 /* Constructor */ ? declaration.parent.parent : declaration.parent; if (!classOrInterfaceDeclaration) return; const isStaticMember = hasStaticModifier(declaration); @@ -409432,7 +414657,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const options = { languageVersion: sourceFile.languageVersion, impliedNodeFormat: sourceFile.impliedNodeFormat, - setExternalModuleIndicator: sourceFile.setExternalModuleIndicator + setExternalModuleIndicator: sourceFile.setExternalModuleIndicator, + jsDocParsingMode: sourceFile.jsDocParsingMode }; return createLanguageServiceSourceFile( sourceFile.fileName, @@ -409466,10 +414692,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} host.log(message); } } - const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host); - const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); + const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host); + const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); const sourceMapper = getSourceMapper({ - useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, + useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2, getCurrentDirectory: () => currentDirectory, getProgram, fileExists: maybeBind(host, host.fileExists), @@ -409481,13 +414707,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getValidSourceFile(fileName) { const sourceFile = program.getSourceFile(fileName); if (!sourceFile) { - const error = new Error(`Could not find source file: '${fileName}'.`); - error.ProgramFiles = program.getSourceFiles().map((f) => f.fileName); - throw error; + const error2 = new Error(`Could not find source file: '${fileName}'.`); + error2.ProgramFiles = program.getSourceFiles().map((f) => f.fileName); + throw error2; } 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) { @@ -409517,7 +414750,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} getSourceFileByPath: getOrCreateSourceFileByPath, getCancellationToken: () => cancellationToken, getCanonicalFileName, - useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, + useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2, getNewLine: () => getNewLineCharacter(newSettings), getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2), writeFile: noop, @@ -409550,7 +414783,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} resolveTypeReferenceDirectiveReferences: maybeBind(host, host.resolveTypeReferenceDirectiveReferences), resolveLibrary: maybeBind(host, host.resolveLibrary), useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect), - getParsedCommandLine + getParsedCommandLine, + jsDocParsingMode: host.jsDocParsingMode }; const originalGetSourceFile = compilerHost.getSourceFile; const { getSourceFileWithCache } = changeCompilerHostLikeToUseCache( @@ -409561,9 +414795,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} compilerHost.getSourceFile = getSourceFileWithCache; (_c = host.setCompilerHost) == null ? void 0 : _c.call(host, compilerHost); const parseConfigHost = { - useCaseSensitiveFileNames, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, fileExists: (fileName) => compilerHost.fileExists(fileName), readFile: (fileName) => compilerHost.readFile(fileName), + directoryExists: (f) => compilerHost.directoryExists(f), + getDirectories: (f) => compilerHost.getDirectories(f), + realpath: compilerHost.realpath, readDirectory: (...args) => compilerHost.readDirectory(...args), trace: compilerHost.trace, getCurrentDirectory: compilerHost.getCurrentDirectory, @@ -409716,14 +414953,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function cleanupSemanticCache() { - program = void 0; - } - function dispose() { if (program) { const key = documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()); forEach(program.getSourceFiles(), (f) => documentRegistry.releaseDocumentWithKey(f.resolvedPath, key, f.scriptKind, f.impliedNodeFormat)); program = void 0; } + } + function dispose() { + cleanupSemanticCache(); host = void 0; } function getSyntacticDiagnostics(fileName) { @@ -409810,10 +415047,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} tags: type.symbol ? type.symbol.getJsDocTags(typeChecker) : void 0 }; } - const { symbolKind, displayParts, documentation, tags } = typeChecker.runWithCancellationToken( - cancellationToken, - (typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker2, symbol, sourceFile, getContainerNode(nodeForQuickInfo), nodeForQuickInfo) - ); + const { symbolKind, displayParts, documentation, tags } = typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker2, symbol, sourceFile, getContainerNode(nodeForQuickInfo), nodeForQuickInfo)); return { kind: symbolKind, kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), @@ -409842,15 +415076,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} switch (node.kind) { case 80 /* Identifier */: return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent); - case 210 /* PropertyAccessExpression */: - case 165 /* QualifiedName */: + case 211 /* PropertyAccessExpression */: + case 166 /* QualifiedName */: return !isInComment(sourceFile, position); case 110 /* ThisKeyword */: - case 196 /* ThisType */: + case 197 /* ThisType */: case 108 /* SuperKeyword */: - case 201 /* NamedTupleMember */: + case 202 /* NamedTupleMember */: return true; - case 235 /* MetaProperty */: + case 236 /* MetaProperty */: return isImportMeta(node); default: return false; @@ -409899,19 +415133,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } else { const quotePreference = getQuotePreference(sourceFile, preferences ?? emptyOptions); const providePrefixAndSuffixTextForRename = typeof preferences === "boolean" ? preferences : preferences == null ? void 0 : preferences.providePrefixAndSuffixTextForRename; - return getReferencesWorker( - node, - position, - { findInStrings, findInComments, providePrefixAndSuffixTextForRename, use: ts_FindAllReferences_exports.FindReferencesUse.Rename }, - (entry, originalNode, checker) => ts_FindAllReferences_exports.toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixTextForRename || false, quotePreference) - ); + return getReferencesWorker2(node, position, { findInStrings, findInComments, providePrefixAndSuffixTextForRename, use: ts_FindAllReferences_exports.FindReferencesUse.Rename }, (entry, originalNode, checker) => ts_FindAllReferences_exports.toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixTextForRename || false, quotePreference)); } } function getReferencesAtPosition(fileName, position) { synchronizeHostData(); - return getReferencesWorker(getTouchingPropertyName(getValidSourceFile(fileName), position), position, { use: ts_FindAllReferences_exports.FindReferencesUse.References }, ts_FindAllReferences_exports.toReferenceEntry); + return getReferencesWorker2(getTouchingPropertyName(getValidSourceFile(fileName), position), position, { use: ts_FindAllReferences_exports.FindReferencesUse.References }, ts_FindAllReferences_exports.toReferenceEntry); } - function getReferencesWorker(node, position, options, cb) { + function getReferencesWorker2(node, position, options, cb) { synchronizeHostData(); const sourceFiles = options && options.use === ts_FindAllReferences_exports.FindReferencesUse.Rename ? program.getSourceFiles().filter((sourceFile) => !program.isSourceFileDefaultLibrary(sourceFile)) : program.getSourceFiles(); return ts_FindAllReferences_exports.findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, cb); @@ -409924,10 +415153,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} synchronizeHostData(); return ts_FindAllReferences_exports.Core.getReferencesForFileName(fileName, program, program.getSourceFiles()).map(ts_FindAllReferences_exports.toReferenceEntry); } - function getNavigateToItems2(searchValue, maxResultCount, fileName, excludeDtsFiles = false) { + function getNavigateToItems2(searchValue, maxResultCount, fileName, excludeDtsFiles = false, excludeLibFiles = false) { synchronizeHostData(); const sourceFiles = fileName ? [getValidSourceFile(fileName)] : program.getSourceFiles(); - return getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles); + return getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles, excludeLibFiles); } function getEmitOutput(fileName, emitOnlyDtsFiles, forceDtsEmit) { synchronizeHostData(); @@ -409950,15 +415179,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; } switch (node.kind) { - case 210 /* PropertyAccessExpression */: - case 165 /* QualifiedName */: + case 211 /* PropertyAccessExpression */: + case 166 /* QualifiedName */: case 11 /* StringLiteral */: case 97 /* FalseKeyword */: case 112 /* TrueKeyword */: case 106 /* NullKeyword */: case 108 /* SuperKeyword */: case 110 /* ThisKeyword */: - case 196 /* ThisType */: + case 197 /* ThisType */: case 80 /* Identifier */: break; default: @@ -409969,7 +415198,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 266 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + if (nodeForStartPos.parent.parent.kind === 267 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } else { break; @@ -410066,12 +415295,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 }); }); @@ -410146,7 +415375,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getLinkedEditingRangeAtPosition(fileName, position) { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); const token = findPrecedingToken(position, sourceFile); - if (!token || token.parent.kind === 311 /* SourceFile */) + if (!token || token.parent.kind === 312 /* SourceFile */) return void 0; const jsxTagWordPattern = "[a-zA-Z0-9:\\-\\._$]*"; if (isJsxFragment(token.parent.parent)) { @@ -410163,31 +415392,30 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} wordPattern: jsxTagWordPattern }; } else { - const tag = findAncestor( - token.parent, - (n) => { - if (isJsxOpeningElement(n) || isJsxClosingElement(n)) { - return true; - } - return false; + const tag = findAncestor(token.parent, (n) => { + if (isJsxOpeningElement(n) || isJsxClosingElement(n)) { + return true; } - ); + return false; + }); if (!tag) return void 0; 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 }; } @@ -410227,7 +415455,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const lineTextStart = lineTextStarts.get(i.toString()); if (lineTextStart !== void 0) { if (isJsx) { - textChanges2.push.apply(textChanges2, toggleMultilineComment(fileName, { pos: lineStarts[i] + leftMostPosition, end: sourceFile.getLineEndOfPosition(lineStarts[i]) }, isCommenting, isJsx)); + textChanges2.push(...toggleMultilineComment(fileName, { pos: lineStarts[i] + leftMostPosition, end: sourceFile.getLineEndOfPosition(lineStarts[i]) }, isCommenting, isJsx)); } else if (isCommenting) { textChanges2.push({ newText: openComment, @@ -410370,7 +415598,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (commentRange) { switch (commentRange.kind) { case 2 /* SingleLineCommentTrivia */: - textChanges2.push.apply(textChanges2, toggleLineComment( + textChanges2.push(...toggleLineComment( fileName, { end: commentRange.end, pos: commentRange.pos + 1 }, /*insertComment*/ @@ -410378,7 +415606,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} )); break; case 3 /* MultiLineCommentTrivia */: - textChanges2.push.apply(textChanges2, toggleMultilineComment( + textChanges2.push(...toggleMultilineComment( fileName, { end: commentRange.end, pos: commentRange.pos + 1 }, /*insertComment*/ @@ -410394,7 +415622,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return !tagNamesAreEquivalent(openingElement.tagName, closingElement.tagName) || isJsxElement(parent2) && tagNamesAreEquivalent(openingElement.tagName, parent2.openingElement.tagName) && isUnclosedTag(parent2); } function isUnclosedFragment({ closingFragment, parent: parent2 }) { - return !!(closingFragment.flags & 131072 /* ThisNodeHasError */) || isJsxFragment(parent2) && isUnclosedFragment(parent2); + return !!(closingFragment.flags & 262144 /* ThisNodeHasError */) || isJsxFragment(parent2) && isUnclosedFragment(parent2); } function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); @@ -410436,7 +415664,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return result; function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&"); } function getTodoCommentsRegExp() { const singleLineCommentStart = /(?:\/\/+\s*)/.source; @@ -410454,7 +415682,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return char >= 97 /* a */ && char <= 122 /* z */ || char >= 65 /* A */ && char <= 90 /* Z */ || char >= 48 /* _0 */ && char <= 57 /* _9 */; } function isNodeModulesFile(path) { - return stringContains(path, "/node_modules/"); + return path.includes("/node_modules/"); } } function getRenameInfo2(fileName, position, preferences) { @@ -410500,14 +415728,19 @@ ${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, refactorName13, actionName2, preferences = emptyOptions, interactiveRefactorArguments) { + function getEditsForRefactor2(fileName, formatOptions, positionOrRange, refactorName14, actionName2, preferences = emptyOptions, interactiveRefactorArguments) { synchronizeHostData(); const file = getValidSourceFile(fileName); - return ts_refactor_exports.getEditsForRefactor(getRefactorContext(file, positionOrRange, preferences, formatOptions), refactorName13, actionName2, interactiveRefactorArguments); + return ts_refactor_exports.getEditsForRefactor(getRefactorContext(file, positionOrRange, preferences, formatOptions), refactorName14, actionName2, interactiveRefactorArguments); } function toLineColumnOffset(fileName, position) { if (position === 0) { @@ -410655,7 +415888,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }); } function literalIsName(node) { - return isDeclarationName(node) || node.parent.kind === 282 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node); + return isDeclarationName(node) || node.parent.kind === 283 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node); } function getContainingObjectLiteralElement(node) { const element = getContainingObjectLiteralElementWorker(node); @@ -410666,11 +415899,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case 11 /* StringLiteral */: case 15 /* NoSubstitutionTemplateLiteral */: case 9 /* NumericLiteral */: - if (node.parent.kind === 166 /* ComputedPropertyName */) { + if (node.parent.kind === 167 /* ComputedPropertyName */) { return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0; } case 80 /* Identifier */: - return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 209 /* ObjectLiteralExpression */ || node.parent.parent.kind === 291 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0; + return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.parent.kind === 292 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0; } return void 0; } @@ -410699,19 +415932,20 @@ ${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 === 211 /* ElementAccessExpression */ && node.parent.argumentExpression === node; + return node && node.parent && node.parent.kind === 212 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } function getDefaultLibFilePath(options) { if (sys) { @@ -410797,8 +416031,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!children.length) { return void 0; } - const child = find(children, (kid) => kid.kind < 315 /* FirstJSDocNode */ || kid.kind > 356 /* LastJSDocNode */); - return child.kind < 165 /* FirstNode */ ? child : child.getFirstToken(sourceFile); + const child = find(children, (kid) => kid.kind < 316 /* FirstJSDocNode */ || kid.kind > 357 /* LastJSDocNode */); + return child.kind < 166 /* FirstNode */ ? child : child.getFirstToken(sourceFile); } getLastToken(sourceFile) { this.assertHasRealPosition(); @@ -410807,7 +416041,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!child) { return void 0; } - return child.kind < 165 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 166 /* FirstNode */ ? child : child.getLastToken(sourceFile); } forEachChild(cbNode, cbNodeArray) { return forEachChild(this, cbNode, cbNodeArray); @@ -411108,7 +416342,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} SourceFileObject = class extends NodeObject { constructor(kind, pos, end) { super(kind, pos, end); - this.kind = 311 /* SourceFile */; + this.kind = 312 /* SourceFile */; } update(newText, textChangeRange) { return updateSourceFile(this, newText, textChangeRange); @@ -411164,10 +416398,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function visit(node) { switch (node.kind) { - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: const functionDeclaration = node; const declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -411183,29 +416417,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } forEachChild(node, visit); break; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 265 /* EnumDeclaration */: - case 266 /* ModuleDeclaration */: - case 270 /* ImportEqualsDeclaration */: - case 280 /* ExportSpecifier */: - case 275 /* ImportSpecifier */: - case 272 /* ImportClause */: - case 273 /* NamespaceImport */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 186 /* TypeLiteral */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 266 /* EnumDeclaration */: + case 267 /* ModuleDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 281 /* ExportSpecifier */: + case 276 /* ImportSpecifier */: + case 273 /* ImportClause */: + case 274 /* NamespaceImport */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 187 /* TypeLiteral */: addDeclaration(node); forEachChild(node, visit); break; - case 168 /* Parameter */: - if (!hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */)) { + case 169 /* Parameter */: + if (!hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) { break; } - case 259 /* VariableDeclaration */: - case 207 /* BindingElement */: { + case 260 /* VariableDeclaration */: + case 208 /* BindingElement */: { const decl = node; if (isBindingPattern(decl.name)) { forEachChild(decl.name, visit); @@ -411215,12 +416449,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} visit(decl.initializer); } } - case 305 /* EnumMember */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: + case 306 /* EnumMember */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: addDeclaration(node); break; - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: const exportDeclaration = node; if (exportDeclaration.exportClause) { if (isNamedExports(exportDeclaration.exportClause)) { @@ -411230,14 +416464,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } break; - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: const importClause = node.importClause; if (importClause) { if (importClause.name) { addDeclaration(importClause.name); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 273 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 274 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { forEach(importClause.namedBindings.elements, visit); @@ -411245,7 +416479,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } break; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: if (getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -411287,7 +416521,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} this.host, this.host.getCompilationSettings() ), - setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings()) + setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings()), + // These files are used to produce syntax-based highlighting, which reads JSDoc, so we must use ParseAll. + jsDocParsingMode: 0 /* ParseAll */ }; sourceFile = createLanguageServiceSourceFile( fileName, @@ -411426,947 +416662,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } }); - // src/services/shims.ts - function logInternalError(logger, err) { - if (logger) { - logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); - } - } - function simpleForwardCall(logger, actionDescription2, action, logPerformance) { - let start; - if (logPerformance) { - logger.log(actionDescription2); - start = timestamp(); - } - const result = action(); - if (logPerformance) { - const end = timestamp(); - logger.log(`${actionDescription2} completed in ${end - start} msec`); - if (isString(result)) { - let str = result; - if (str.length > 128) { - str = str.substring(0, 128) + "..."; - } - logger.log(` result.length=${str.length}, result='${JSON.stringify(str)}'`); - } - } - return result; - } - function forwardJSONCall(logger, actionDescription2, action, logPerformance) { - return forwardCall( - logger, - actionDescription2, - /*returnJson*/ - true, - action, - logPerformance - ); - } - function forwardCall(logger, actionDescription2, returnJson, action, logPerformance) { - try { - const result = simpleForwardCall(logger, actionDescription2, action, logPerformance); - return returnJson ? JSON.stringify({ result }) : result; - } catch (err) { - if (err instanceof OperationCanceledException) { - return JSON.stringify({ canceled: true }); - } - logInternalError(logger, err); - err.description = actionDescription2; - return JSON.stringify({ error: err }); - } - } - function realizeDiagnostics(diagnostics, newLine) { - return diagnostics.map((d) => realizeDiagnostic(d, newLine)); - } - function realizeDiagnostic(diagnostic, newLine) { - return { - message: flattenDiagnosticMessageText(diagnostic.messageText, newLine), - start: diagnostic.start, - // TODO: GH#18217 - length: diagnostic.length, - // TODO: GH#18217 - category: diagnosticCategoryName(diagnostic), - code: diagnostic.code, - reportsUnnecessary: diagnostic.reportsUnnecessary, - reportsDeprecated: diagnostic.reportsDeprecated - }; - } - function convertClassifications(classifications) { - return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; - } - var debugObjectHost, ScriptSnapshotShimAdapter, LanguageServiceShimHostAdapter, CoreServicesShimHostAdapter, ShimBase, LanguageServiceShimObject, ClassifierShimObject, CoreServicesShimObject, TypeScriptServicesFactory; - var init_shims = __esm({ - "src/services/shims.ts"() { - "use strict"; - init_ts4(); - debugObjectHost = function() { - return this; - }(); - ScriptSnapshotShimAdapter = class { - constructor(scriptSnapshotShim) { - this.scriptSnapshotShim = scriptSnapshotShim; - } - getText(start, end) { - return this.scriptSnapshotShim.getText(start, end); - } - getLength() { - return this.scriptSnapshotShim.getLength(); - } - getChangeRange(oldSnapshot) { - const oldSnapshotShim = oldSnapshot; - const encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); - if (encoded === null) { - return null; - } - const decoded = JSON.parse(encoded); - return createTextChangeRange( - createTextSpan(decoded.span.start, decoded.span.length), - decoded.newLength - ); - } - dispose() { - if ("dispose" in this.scriptSnapshotShim) { - this.scriptSnapshotShim.dispose(); - } - } - }; - LanguageServiceShimHostAdapter = class { - constructor(shimHost) { - this.shimHost = shimHost; - this.loggingEnabled = false; - this.tracingEnabled = false; - if ("getModuleResolutionsForFile" in this.shimHost) { - this.resolveModuleNames = (moduleNames, containingFile) => { - const resolutionsInFile = JSON.parse(this.shimHost.getModuleResolutionsForFile(containingFile)); - return map(moduleNames, (name) => { - const result = getProperty(resolutionsInFile, name); - return result ? { resolvedFileName: result, extension: extensionFromPath(result), isExternalLibraryImport: false } : void 0; - }); - }; - } - if ("directoryExists" in this.shimHost) { - this.directoryExists = (directoryName) => this.shimHost.directoryExists(directoryName); - } - if ("getTypeReferenceDirectiveResolutionsForFile" in this.shimHost) { - this.resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile) => { - const typeDirectivesForFile = JSON.parse(this.shimHost.getTypeReferenceDirectiveResolutionsForFile(containingFile)); - return map(typeDirectiveNames, (name) => getProperty(typeDirectivesForFile, isString(name) ? name : toFileNameLowerCase(name.fileName))); - }; - } - } - log(s) { - if (this.loggingEnabled) { - this.shimHost.log(s); - } - } - trace(s) { - if (this.tracingEnabled) { - this.shimHost.trace(s); - } - } - error(s) { - this.shimHost.error(s); - } - getProjectVersion() { - if (!this.shimHost.getProjectVersion) { - return void 0; - } - return this.shimHost.getProjectVersion(); - } - getTypeRootsVersion() { - if (!this.shimHost.getTypeRootsVersion) { - return 0; - } - return this.shimHost.getTypeRootsVersion(); - } - useCaseSensitiveFileNames() { - return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false; - } - getCompilationSettings() { - const settingsJson = this.shimHost.getCompilationSettings(); - if (settingsJson === null || settingsJson === "") { - throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); - } - const compilerOptions = JSON.parse(settingsJson); - compilerOptions.allowNonTsExtensions = true; - return compilerOptions; - } - getScriptFileNames() { - const encoded = this.shimHost.getScriptFileNames(); - return JSON.parse(encoded); - } - getScriptSnapshot(fileName) { - const scriptSnapshot = this.shimHost.getScriptSnapshot(fileName); - return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot); - } - getScriptKind(fileName) { - if ("getScriptKind" in this.shimHost) { - return this.shimHost.getScriptKind(fileName); - } else { - return 0 /* Unknown */; - } - } - getScriptVersion(fileName) { - return this.shimHost.getScriptVersion(fileName); - } - getLocalizedDiagnosticMessages() { - const diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); - if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") { - return null; - } - try { - return JSON.parse(diagnosticMessagesJson); - } catch (e) { - this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format"); - return null; - } - } - getCancellationToken() { - const hostCancellationToken = this.shimHost.getCancellationToken(); - return new ThrottledCancellationToken(hostCancellationToken); - } - getCurrentDirectory() { - return this.shimHost.getCurrentDirectory(); - } - getDirectories(path) { - return JSON.parse(this.shimHost.getDirectories(path)); - } - getDefaultLibFileName(options) { - return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); - } - readDirectory(path, extensions, exclude, include, depth) { - const pattern = getFileMatcherPatterns( - path, - exclude, - include, - this.shimHost.useCaseSensitiveFileNames(), - this.shimHost.getCurrentDirectory() - ); - return JSON.parse(this.shimHost.readDirectory( - path, - JSON.stringify(extensions), - JSON.stringify(pattern.basePaths), - pattern.excludePattern, - pattern.includeFilePattern, - pattern.includeDirectoryPattern, - depth - )); - } - readFile(path, encoding) { - return this.shimHost.readFile(path, encoding); - } - fileExists(path) { - return this.shimHost.fileExists(path); - } - }; - CoreServicesShimHostAdapter = class { - constructor(shimHost) { - this.shimHost = shimHost; - this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false; - if ("directoryExists" in this.shimHost) { - this.directoryExists = (directoryName) => this.shimHost.directoryExists(directoryName); - } else { - this.directoryExists = void 0; - } - if ("realpath" in this.shimHost) { - this.realpath = (path) => this.shimHost.realpath(path); - } else { - this.realpath = void 0; - } - } - readDirectory(rootDir, extensions, exclude, include, depth) { - const pattern = getFileMatcherPatterns( - rootDir, - exclude, - include, - this.shimHost.useCaseSensitiveFileNames(), - this.shimHost.getCurrentDirectory() - ); - return JSON.parse(this.shimHost.readDirectory( - rootDir, - JSON.stringify(extensions), - JSON.stringify(pattern.basePaths), - pattern.excludePattern, - pattern.includeFilePattern, - pattern.includeDirectoryPattern, - depth - )); - } - fileExists(fileName) { - return this.shimHost.fileExists(fileName); - } - readFile(fileName) { - return this.shimHost.readFile(fileName); - } - getDirectories(path) { - return JSON.parse(this.shimHost.getDirectories(path)); - } - }; - ShimBase = class { - constructor(factory2) { - this.factory = factory2; - factory2.registerShim(this); - } - dispose(_dummy) { - this.factory.unregisterShim(this); - } - }; - LanguageServiceShimObject = class extends ShimBase { - constructor(factory2, host, languageService) { - super(factory2); - this.host = host; - this.languageService = languageService; - this.logPerformance = false; - this.logger = this.host; - } - forwardJSONCall(actionDescription2, action) { - return forwardJSONCall(this.logger, actionDescription2, action, this.logPerformance); - } - /// DISPOSE - /** - * Ensure (almost) deterministic release of internal Javascript resources when - * some external native objects holds onto us (e.g. Com/Interop). - */ - dispose(dummy) { - this.logger.log("dispose()"); - this.languageService.dispose(); - this.languageService = null; - if (debugObjectHost && debugObjectHost.CollectGarbage) { - debugObjectHost.CollectGarbage(); - this.logger.log("CollectGarbage()"); - } - this.logger = null; - super.dispose(dummy); - } - /// REFRESH - /** - * Update the list of scripts known to the compiler - */ - refresh(throwOnError) { - this.forwardJSONCall( - `refresh(${throwOnError})`, - () => null - // eslint-disable-line no-null/no-null - ); - } - cleanupSemanticCache() { - this.forwardJSONCall( - "cleanupSemanticCache()", - () => { - this.languageService.cleanupSemanticCache(); - return null; - } - ); - } - realizeDiagnostics(diagnostics) { - const newLine = getNewLineOrDefaultFromHost( - this.host, - /*formatSettings*/ - void 0 - ); - return realizeDiagnostics(diagnostics, newLine); - } - getSyntacticClassifications(fileName, start, length2) { - return this.forwardJSONCall( - `getSyntacticClassifications('${fileName}', ${start}, ${length2})`, - () => this.languageService.getSyntacticClassifications(fileName, createTextSpan(start, length2)) - ); - } - getSemanticClassifications(fileName, start, length2) { - return this.forwardJSONCall( - `getSemanticClassifications('${fileName}', ${start}, ${length2})`, - () => this.languageService.getSemanticClassifications(fileName, createTextSpan(start, length2)) - ); - } - getEncodedSyntacticClassifications(fileName, start, length2) { - return this.forwardJSONCall( - `getEncodedSyntacticClassifications('${fileName}', ${start}, ${length2})`, - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - () => convertClassifications(this.languageService.getEncodedSyntacticClassifications(fileName, createTextSpan(start, length2))) - ); - } - getEncodedSemanticClassifications(fileName, start, length2) { - return this.forwardJSONCall( - `getEncodedSemanticClassifications('${fileName}', ${start}, ${length2})`, - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - () => convertClassifications(this.languageService.getEncodedSemanticClassifications(fileName, createTextSpan(start, length2))) - ); - } - getSyntacticDiagnostics(fileName) { - return this.forwardJSONCall( - `getSyntacticDiagnostics('${fileName}')`, - () => { - const diagnostics = this.languageService.getSyntacticDiagnostics(fileName); - return this.realizeDiagnostics(diagnostics); - } - ); - } - getSemanticDiagnostics(fileName) { - return this.forwardJSONCall( - `getSemanticDiagnostics('${fileName}')`, - () => { - const diagnostics = this.languageService.getSemanticDiagnostics(fileName); - return this.realizeDiagnostics(diagnostics); - } - ); - } - getSuggestionDiagnostics(fileName) { - return this.forwardJSONCall(`getSuggestionDiagnostics('${fileName}')`, () => this.realizeDiagnostics(this.languageService.getSuggestionDiagnostics(fileName))); - } - getCompilerOptionsDiagnostics() { - return this.forwardJSONCall( - "getCompilerOptionsDiagnostics()", - () => { - const diagnostics = this.languageService.getCompilerOptionsDiagnostics(); - return this.realizeDiagnostics(diagnostics); - } - ); - } - /// QUICKINFO - /** - * Computes a string representation of the type at the requested position - * in the active file. - */ - getQuickInfoAtPosition(fileName, position) { - return this.forwardJSONCall( - `getQuickInfoAtPosition('${fileName}', ${position})`, - () => this.languageService.getQuickInfoAtPosition(fileName, position) - ); - } - /// NAMEORDOTTEDNAMESPAN - /** - * Computes span information of the name or dotted name at the requested position - * in the active file. - */ - getNameOrDottedNameSpan(fileName, startPos, endPos) { - return this.forwardJSONCall( - `getNameOrDottedNameSpan('${fileName}', ${startPos}, ${endPos})`, - () => this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos) - ); - } - /** - * STATEMENTSPAN - * Computes span information of statement at the requested position in the active file. - */ - getBreakpointStatementAtPosition(fileName, position) { - return this.forwardJSONCall( - `getBreakpointStatementAtPosition('${fileName}', ${position})`, - () => this.languageService.getBreakpointStatementAtPosition(fileName, position) - ); - } - /// SIGNATUREHELP - getSignatureHelpItems(fileName, position, options) { - return this.forwardJSONCall( - `getSignatureHelpItems('${fileName}', ${position})`, - () => this.languageService.getSignatureHelpItems(fileName, position, options) - ); - } - /// GOTO DEFINITION - /** - * Computes the definition location and file for the symbol - * at the requested position. - */ - getDefinitionAtPosition(fileName, position) { - return this.forwardJSONCall( - `getDefinitionAtPosition('${fileName}', ${position})`, - () => this.languageService.getDefinitionAtPosition(fileName, position) - ); - } - /** - * Computes the definition location and file for the symbol - * at the requested position. - */ - getDefinitionAndBoundSpan(fileName, position) { - return this.forwardJSONCall( - `getDefinitionAndBoundSpan('${fileName}', ${position})`, - () => this.languageService.getDefinitionAndBoundSpan(fileName, position) - ); - } - /// GOTO Type - /** - * Computes the definition location of the type of the symbol - * at the requested position. - */ - getTypeDefinitionAtPosition(fileName, position) { - return this.forwardJSONCall( - `getTypeDefinitionAtPosition('${fileName}', ${position})`, - () => this.languageService.getTypeDefinitionAtPosition(fileName, position) - ); - } - /// GOTO Implementation - /** - * Computes the implementation location of the symbol - * at the requested position. - */ - getImplementationAtPosition(fileName, position) { - return this.forwardJSONCall( - `getImplementationAtPosition('${fileName}', ${position})`, - () => this.languageService.getImplementationAtPosition(fileName, position) - ); - } - getRenameInfo(fileName, position, preferences) { - return this.forwardJSONCall( - `getRenameInfo('${fileName}', ${position})`, - () => this.languageService.getRenameInfo(fileName, position, preferences) - ); - } - getSmartSelectionRange(fileName, position) { - return this.forwardJSONCall( - `getSmartSelectionRange('${fileName}', ${position})`, - () => this.languageService.getSmartSelectionRange(fileName, position) - ); - } - findRenameLocations(fileName, position, findInStrings, findInComments, preferences) { - return this.forwardJSONCall( - `findRenameLocations('${fileName}', ${position}, ${findInStrings}, ${findInComments})`, - () => this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, preferences) - ); - } - /// GET BRACE MATCHING - getBraceMatchingAtPosition(fileName, position) { - return this.forwardJSONCall( - `getBraceMatchingAtPosition('${fileName}', ${position})`, - () => this.languageService.getBraceMatchingAtPosition(fileName, position) - ); - } - isValidBraceCompletionAtPosition(fileName, position, openingBrace) { - return this.forwardJSONCall( - `isValidBraceCompletionAtPosition('${fileName}', ${position}, ${openingBrace})`, - () => this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace) - ); - } - getSpanOfEnclosingComment(fileName, position, onlyMultiLine) { - return this.forwardJSONCall( - `getSpanOfEnclosingComment('${fileName}', ${position})`, - () => this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine) - ); - } - /// GET SMART INDENT - getIndentationAtPosition(fileName, position, options) { - return this.forwardJSONCall( - `getIndentationAtPosition('${fileName}', ${position})`, - () => { - const localOptions = JSON.parse(options); - return this.languageService.getIndentationAtPosition(fileName, position, localOptions); - } - ); - } - /// GET REFERENCES - getReferencesAtPosition(fileName, position) { - return this.forwardJSONCall( - `getReferencesAtPosition('${fileName}', ${position})`, - () => this.languageService.getReferencesAtPosition(fileName, position) - ); - } - findReferences(fileName, position) { - return this.forwardJSONCall( - `findReferences('${fileName}', ${position})`, - () => this.languageService.findReferences(fileName, position) - ); - } - getFileReferences(fileName) { - return this.forwardJSONCall( - `getFileReferences('${fileName})`, - () => this.languageService.getFileReferences(fileName) - ); - } - getDocumentHighlights(fileName, position, filesToSearch) { - return this.forwardJSONCall( - `getDocumentHighlights('${fileName}', ${position})`, - () => { - const results = this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); - const normalizedName = toFileNameLowerCase(normalizeSlashes(fileName)); - return filter(results, (r) => toFileNameLowerCase(normalizeSlashes(r.fileName)) === normalizedName); - } - ); - } - /// COMPLETION LISTS - /** - * Get a string based representation of the completions - * to provide at the given source position and providing a member completion - * list if requested. - */ - getCompletionsAtPosition(fileName, position, preferences, formattingSettings) { - return this.forwardJSONCall( - `getCompletionsAtPosition('${fileName}', ${position}, ${preferences}, ${formattingSettings})`, - () => this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings) - ); - } - /** Get a string based representation of a completion list entry details */ - getCompletionEntryDetails(fileName, position, entryName, formatOptions, source, preferences, data) { - return this.forwardJSONCall( - `getCompletionEntryDetails('${fileName}', ${position}, '${entryName}')`, - () => { - const localOptions = formatOptions === void 0 ? void 0 : JSON.parse(formatOptions); - return this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data); - } - ); - } - getFormattingEditsForRange(fileName, start, end, options) { - return this.forwardJSONCall( - `getFormattingEditsForRange('${fileName}', ${start}, ${end})`, - () => { - const localOptions = JSON.parse(options); - return this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); - } - ); - } - getFormattingEditsForDocument(fileName, options) { - return this.forwardJSONCall( - `getFormattingEditsForDocument('${fileName}')`, - () => { - const localOptions = JSON.parse(options); - return this.languageService.getFormattingEditsForDocument(fileName, localOptions); - } - ); - } - getFormattingEditsAfterKeystroke(fileName, position, key, options) { - return this.forwardJSONCall( - `getFormattingEditsAfterKeystroke('${fileName}', ${position}, '${key}')`, - () => { - const localOptions = JSON.parse(options); - return this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); - } - ); - } - getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) { - return this.forwardJSONCall( - `getDocCommentTemplateAtPosition('${fileName}', ${position})`, - () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) - ); - } - /// NAVIGATE TO - /** Return a list of symbols that are interesting to navigate to */ - getNavigateToItems(searchValue, maxResultCount, fileName) { - return this.forwardJSONCall( - `getNavigateToItems('${searchValue}', ${maxResultCount}, ${fileName})`, - () => this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName) - ); - } - getNavigationBarItems(fileName) { - return this.forwardJSONCall( - `getNavigationBarItems('${fileName}')`, - () => this.languageService.getNavigationBarItems(fileName) - ); - } - getNavigationTree(fileName) { - return this.forwardJSONCall( - `getNavigationTree('${fileName}')`, - () => this.languageService.getNavigationTree(fileName) - ); - } - getOutliningSpans(fileName) { - return this.forwardJSONCall( - `getOutliningSpans('${fileName}')`, - () => this.languageService.getOutliningSpans(fileName) - ); - } - getTodoComments(fileName, descriptors) { - return this.forwardJSONCall( - `getTodoComments('${fileName}')`, - () => this.languageService.getTodoComments(fileName, JSON.parse(descriptors)) - ); - } - /// CALL HIERARCHY - prepareCallHierarchy(fileName, position) { - return this.forwardJSONCall( - `prepareCallHierarchy('${fileName}', ${position})`, - () => this.languageService.prepareCallHierarchy(fileName, position) - ); - } - provideCallHierarchyIncomingCalls(fileName, position) { - return this.forwardJSONCall( - `provideCallHierarchyIncomingCalls('${fileName}', ${position})`, - () => this.languageService.provideCallHierarchyIncomingCalls(fileName, position) - ); - } - provideCallHierarchyOutgoingCalls(fileName, position) { - return this.forwardJSONCall( - `provideCallHierarchyOutgoingCalls('${fileName}', ${position})`, - () => this.languageService.provideCallHierarchyOutgoingCalls(fileName, position) - ); - } - provideInlayHints(fileName, span, preference) { - return this.forwardJSONCall( - `provideInlayHints('${fileName}', '${JSON.stringify(span)}', ${JSON.stringify(preference)})`, - () => this.languageService.provideInlayHints(fileName, span, preference) - ); - } - /// Emit - getEmitOutput(fileName) { - return this.forwardJSONCall( - `getEmitOutput('${fileName}')`, - () => { - const { diagnostics, ...rest } = this.languageService.getEmitOutput(fileName); - return { ...rest, diagnostics: this.realizeDiagnostics(diagnostics) }; - } - ); - } - getEmitOutputObject(fileName) { - return forwardCall( - this.logger, - `getEmitOutput('${fileName}')`, - /*returnJson*/ - false, - () => this.languageService.getEmitOutput(fileName), - this.logPerformance - ); - } - toggleLineComment(fileName, textRange) { - return this.forwardJSONCall( - `toggleLineComment('${fileName}', '${JSON.stringify(textRange)}')`, - () => this.languageService.toggleLineComment(fileName, textRange) - ); - } - toggleMultilineComment(fileName, textRange) { - return this.forwardJSONCall( - `toggleMultilineComment('${fileName}', '${JSON.stringify(textRange)}')`, - () => this.languageService.toggleMultilineComment(fileName, textRange) - ); - } - commentSelection(fileName, textRange) { - return this.forwardJSONCall( - `commentSelection('${fileName}', '${JSON.stringify(textRange)}')`, - () => this.languageService.commentSelection(fileName, textRange) - ); - } - uncommentSelection(fileName, textRange) { - return this.forwardJSONCall( - `uncommentSelection('${fileName}', '${JSON.stringify(textRange)}')`, - () => this.languageService.uncommentSelection(fileName, textRange) - ); - } - }; - ClassifierShimObject = class extends ShimBase { - constructor(factory2, logger) { - super(factory2); - this.logger = logger; - this.logPerformance = false; - this.classifier = createClassifier(); - } - getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent = false) { - return forwardJSONCall( - this.logger, - "getEncodedLexicalClassifications", - () => convertClassifications(this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)), - this.logPerformance - ); - } - /// COLORIZATION - getClassificationsForLine(text, lexState, classifyKeywordsInGenerics = false) { - const classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); - let result = ""; - for (const item of classification.entries) { - result += item.length + "\n"; - result += item.classification + "\n"; - } - result += classification.finalLexState; - return result; - } - }; - CoreServicesShimObject = class extends ShimBase { - constructor(factory2, logger, host) { - super(factory2); - this.logger = logger; - this.host = host; - this.logPerformance = false; - } - forwardJSONCall(actionDescription2, action) { - return forwardJSONCall(this.logger, actionDescription2, action, this.logPerformance); - } - resolveModuleName(fileName, moduleName, compilerOptionsJson) { - return this.forwardJSONCall(`resolveModuleName('${fileName}')`, () => { - const compilerOptions = JSON.parse(compilerOptionsJson); - const result = resolveModuleName(moduleName, normalizeSlashes(fileName), compilerOptions, this.host); - let resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : void 0; - if (result.resolvedModule && result.resolvedModule.extension !== ".ts" /* Ts */ && result.resolvedModule.extension !== ".tsx" /* Tsx */ && result.resolvedModule.extension !== ".d.ts" /* Dts */) { - resolvedFileName = void 0; - } - return { - resolvedFileName, - failedLookupLocations: result.failedLookupLocations, - affectingLocations: result.affectingLocations - }; - }); - } - resolveTypeReferenceDirective(fileName, typeReferenceDirective, compilerOptionsJson) { - return this.forwardJSONCall(`resolveTypeReferenceDirective(${fileName})`, () => { - const compilerOptions = JSON.parse(compilerOptionsJson); - const result = resolveTypeReferenceDirective(typeReferenceDirective, normalizeSlashes(fileName), compilerOptions, this.host); - return { - resolvedFileName: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.resolvedFileName : void 0, - primary: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.primary : true, - failedLookupLocations: result.failedLookupLocations - }; - }); - } - getPreProcessedFileInfo(fileName, sourceTextSnapshot) { - return this.forwardJSONCall( - `getPreProcessedFileInfo('${fileName}')`, - () => { - const result = preProcessFile( - getSnapshotText(sourceTextSnapshot), - /*readImportFiles*/ - true, - /*detectJavaScriptImports*/ - true - ); - return { - referencedFiles: this.convertFileReferences(result.referencedFiles), - importedFiles: this.convertFileReferences(result.importedFiles), - ambientExternalModules: result.ambientExternalModules, - isLibFile: result.isLibFile, - typeReferenceDirectives: this.convertFileReferences(result.typeReferenceDirectives), - libReferenceDirectives: this.convertFileReferences(result.libReferenceDirectives) - }; - } - ); - } - getAutomaticTypeDirectiveNames(compilerOptionsJson) { - return this.forwardJSONCall( - `getAutomaticTypeDirectiveNames('${compilerOptionsJson}')`, - () => { - const compilerOptions = JSON.parse(compilerOptionsJson); - return getAutomaticTypeDirectiveNames(compilerOptions, this.host); - } - ); - } - convertFileReferences(refs) { - if (!refs) { - return void 0; - } - const result = []; - for (const ref of refs) { - result.push({ - path: normalizeSlashes(ref.fileName), - position: ref.pos, - length: ref.end - ref.pos - }); - } - return result; - } - getTSConfigFileInfo(fileName, sourceTextSnapshot) { - return this.forwardJSONCall( - `getTSConfigFileInfo('${fileName}')`, - () => { - const result = parseJsonText(fileName, getSnapshotText(sourceTextSnapshot)); - const normalizedFileName = normalizeSlashes(fileName); - const configFile = parseJsonSourceFileConfigFileContent( - result, - this.host, - getDirectoryPath(normalizedFileName), - /*existingOptions*/ - {}, - normalizedFileName - ); - return { - options: configFile.options, - typeAcquisition: configFile.typeAcquisition, - files: configFile.fileNames, - raw: configFile.raw, - errors: realizeDiagnostics([...result.parseDiagnostics, ...configFile.errors], "\r\n") - }; - } - ); - } - getDefaultCompilationSettings() { - return this.forwardJSONCall( - "getDefaultCompilationSettings()", - () => getDefaultCompilerOptions2() - ); - } - discoverTypings(discoverTypingsJson) { - const getCanonicalFileName = createGetCanonicalFileName( - /*useCaseSensitiveFileNames*/ - false - ); - return this.forwardJSONCall("discoverTypings()", () => { - const info = JSON.parse(discoverTypingsJson); - if (this.safeList === void 0) { - this.safeList = ts_JsTyping_exports.loadSafeList(this.host, toPath(info.safeListPath, info.safeListPath, getCanonicalFileName)); - } - return ts_JsTyping_exports.discoverTypings( - this.host, - (msg) => this.logger.log(msg), - info.fileNames, - toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), - this.safeList, - info.packageNameToTypingLocation, - info.typeAcquisition, - info.unresolvedImports, - info.typesRegistry, - emptyOptions - ); - }); - } - }; - TypeScriptServicesFactory = class { - constructor() { - this._shims = []; - } - /* - * Returns script API version. - */ - getServicesVersion() { - return servicesVersion; - } - createLanguageServiceShim(host) { - try { - if (this.documentRegistry === void 0) { - this.documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); - } - const hostAdapter = new LanguageServiceShimHostAdapter(host); - const languageService = createLanguageService( - hostAdapter, - this.documentRegistry, - /*syntaxOnlyOrLanguageServiceMode*/ - false - ); - return new LanguageServiceShimObject(this, host, languageService); - } catch (err) { - logInternalError(host, err); - throw err; - } - } - createClassifierShim(logger) { - try { - return new ClassifierShimObject(this, logger); - } catch (err) { - logInternalError(logger, err); - throw err; - } - } - createCoreServicesShim(host) { - try { - const adapter = new CoreServicesShimHostAdapter(host); - return new CoreServicesShimObject(this, host, adapter); - } catch (err) { - logInternalError(host, err); - throw err; - } - } - close() { - clear(this._shims); - this.documentRegistry = void 0; - } - registerShim(shim) { - this._shims.push(shim); - } - unregisterShim(shim) { - for (let i = 0; i < this._shims.length; i++) { - if (this._shims[i] === shim) { - delete this._shims[i]; - return; - } - } - throw new Error("Invalid operation"); - } - }; - } - }); - // src/services/breakpoints.ts function spanInSourceFileAtLocation(sourceFile, position) { if (sourceFile.isDeclarationFile) { @@ -412381,7 +416676,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } tokenAtLocation = preceding; } - if (tokenAtLocation.flags & 16777216 /* Ambient */) { + if (tokenAtLocation.flags & 33554432 /* Ambient */) { return void 0; } return spanInNode(tokenAtLocation); @@ -412424,89 +416719,89 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (node) { const { parent: parent2 } = node; switch (node.kind) { - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 259 /* VariableDeclaration */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: + case 260 /* VariableDeclaration */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: return spanInVariableDeclaration(node); - case 168 /* Parameter */: + case 169 /* Parameter */: return spanInParameterDeclaration(node); - case 261 /* FunctionDeclaration */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 175 /* Constructor */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 176 /* Constructor */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 240 /* Block */: + case 241 /* Block */: if (isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 267 /* ModuleBlock */: + case 268 /* ModuleBlock */: return spanInBlock(node); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return spanInBlock(node.block); - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: return textSpan(node.expression); - case 252 /* ReturnStatement */: + case 253 /* ReturnStatement */: return textSpan(node.getChildAt(0), node.expression); - case 246 /* WhileStatement */: + case 247 /* WhileStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 245 /* DoStatement */: + case 246 /* DoStatement */: return spanInNode(node.statement); - case 258 /* DebuggerStatement */: + case 259 /* DebuggerStatement */: return textSpan(node.getChildAt(0)); - case 244 /* IfStatement */: + case 245 /* IfStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 255 /* LabeledStatement */: + case 256 /* LabeledStatement */: return spanInNode(node.statement); - case 251 /* BreakStatement */: - case 250 /* ContinueStatement */: + case 252 /* BreakStatement */: + case 251 /* ContinueStatement */: return textSpan(node.getChildAt(0), node.label); - case 247 /* ForStatement */: + case 248 /* ForStatement */: return spanInForStatement(node); - case 248 /* ForInStatement */: + case 249 /* ForInStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 249 /* ForOfStatement */: + case 250 /* ForOfStatement */: return spanInInitializerOfForLike(node); - case 254 /* SwitchStatement */: + case 255 /* SwitchStatement */: return textSpanEndingAtNextToken(node, node.expression); - case 295 /* CaseClause */: - case 296 /* DefaultClause */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: return spanInNode(node.statements[0]); - case 257 /* TryStatement */: + case 258 /* TryStatement */: return spanInBlock(node.tryBlock); - case 256 /* ThrowStatement */: + case 257 /* ThrowStatement */: return textSpan(node, node.expression); - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: return textSpan(node, node.expression); - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return textSpan(node, node.moduleReference); - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return textSpan(node, node.moduleSpecifier); - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: return textSpan(node, node.moduleSpecifier); - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: if (getModuleInstanceState(node) !== 1 /* Instantiated */) { return void 0; } - case 262 /* ClassDeclaration */: - case 265 /* EnumDeclaration */: - case 305 /* EnumMember */: - case 207 /* BindingElement */: + case 263 /* ClassDeclaration */: + case 266 /* EnumDeclaration */: + case 306 /* EnumMember */: + case 208 /* BindingElement */: return textSpan(node); - case 253 /* WithStatement */: + case 254 /* WithStatement */: return spanInNode(node.statement); - case 169 /* Decorator */: + case 170 /* Decorator */: return spanInNodeArray(parent2.modifiers, node, isDecorator); - case 205 /* ObjectBindingPattern */: - case 206 /* ArrayBindingPattern */: + case 206 /* ObjectBindingPattern */: + case 207 /* ArrayBindingPattern */: return spanInBindingPattern(node); - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: return void 0; case 27 /* SemicolonToken */: case 1 /* EndOfFileToken */: @@ -412534,16 +416829,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case 85 /* CatchKeyword */: case 98 /* FinallyKeyword */: return spanInNextNode(node); - case 164 /* OfKeyword */: + case 165 /* OfKeyword */: return spanInOfKeyword(node); default: if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); } - if ((node.kind === 80 /* Identifier */ || node.kind === 229 /* SpreadElement */ || node.kind === 302 /* PropertyAssignment */ || node.kind === 303 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) { + if ((node.kind === 80 /* Identifier */ || node.kind === 230 /* SpreadElement */ || node.kind === 303 /* PropertyAssignment */ || node.kind === 304 /* ShorthandPropertyAssignment */) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) { return textSpan(node); } - if (node.kind === 225 /* BinaryExpression */) { + if (node.kind === 226 /* BinaryExpression */) { const { left, operatorToken } = node; if (isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern( @@ -412559,19 +416854,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } if (isExpressionNode(node)) { switch (parent2.kind) { - case 245 /* DoStatement */: + case 246 /* DoStatement */: return spanInPreviousNode(node); - case 169 /* Decorator */: + case 170 /* Decorator */: return spanInNode(node.parent); - case 247 /* ForStatement */: - case 249 /* ForOfStatement */: + case 248 /* ForStatement */: + case 250 /* ForOfStatement */: return textSpan(node); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: if (node.parent.operatorToken.kind === 28 /* CommaToken */) { return textSpan(node); } break; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: if (node.parent.body === node) { return textSpan(node); } @@ -412579,25 +416874,25 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } switch (node.parent.kind) { - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: if (node.parent.name === node && !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 215 /* TypeAssertionExpression */: + case 216 /* TypeAssertionExpression */: if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: { + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: { const { initializer, type } = node.parent; if (initializer === node || type === node || isAssignmentOperator(node.kind)) { return spanInPreviousNode(node); } break; } - case 225 /* BinaryExpression */: { + case 226 /* BinaryExpression */: { const { left } = node.parent; if (isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { return spanInPreviousNode(node); @@ -412620,14 +416915,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 248 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 249 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } const parent2 = variableDeclaration.parent; if (isBindingPattern(variableDeclaration.name)) { return spanInBindingPattern(variableDeclaration.name); } - if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 1 /* Export */) || parent2.parent.kind === 249 /* ForOfStatement */) { + if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier(variableDeclaration, 32 /* Export */) || parent2.parent.kind === 250 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) { @@ -412635,7 +416930,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function canHaveSpanInParameterDeclaration(parameter) { - return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier(parameter, 4 /* Public */ | 8 /* Private */); + return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier(parameter, 1 /* Public */ | 2 /* Private */); } function spanInParameterDeclaration(parameter) { if (isBindingPattern(parameter.name)) { @@ -412654,7 +416949,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return hasSyntacticModifier(functionDeclaration, 1 /* Export */) || functionDeclaration.parent.kind === 262 /* ClassDeclaration */ && functionDeclaration.kind !== 175 /* Constructor */; + return hasSyntacticModifier(functionDeclaration, 32 /* Export */) || functionDeclaration.parent.kind === 263 /* ClassDeclaration */ && functionDeclaration.kind !== 176 /* Constructor */; } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -412674,22 +416969,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function spanInBlock(block) { switch (block.parent.kind) { - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: if (getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return void 0; } - case 246 /* WhileStatement */: - case 244 /* IfStatement */: - case 248 /* ForInStatement */: + case 247 /* WhileStatement */: + case 245 /* IfStatement */: + case 249 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 247 /* ForStatement */: - case 249 /* ForOfStatement */: + case 248 /* ForStatement */: + case 250 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 260 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 261 /* VariableDeclarationList */) { const variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -412710,66 +417005,60 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function spanInBindingPattern(bindingPattern) { - const firstBindingElement = forEach( - bindingPattern.elements, - (element) => element.kind !== 231 /* OmittedExpression */ ? element : void 0 - ); + const firstBindingElement = forEach(bindingPattern.elements, (element) => element.kind !== 232 /* OmittedExpression */ ? element : void 0); if (firstBindingElement) { return spanInNode(firstBindingElement); } - if (bindingPattern.parent.kind === 207 /* BindingElement */) { + if (bindingPattern.parent.kind === 208 /* BindingElement */) { return textSpan(bindingPattern.parent); } return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node2) { - Debug.assert(node2.kind !== 206 /* ArrayBindingPattern */ && node2.kind !== 205 /* ObjectBindingPattern */); - const elements = node2.kind === 208 /* ArrayLiteralExpression */ ? node2.elements : node2.properties; - const firstBindingElement = forEach( - elements, - (element) => element.kind !== 231 /* OmittedExpression */ ? element : void 0 - ); + Debug.assert(node2.kind !== 207 /* ArrayBindingPattern */ && node2.kind !== 206 /* ObjectBindingPattern */); + const elements = node2.kind === 209 /* ArrayLiteralExpression */ ? node2.elements : node2.properties; + const firstBindingElement = forEach(elements, (element) => element.kind !== 232 /* OmittedExpression */ ? element : void 0); if (firstBindingElement) { return spanInNode(firstBindingElement); } - return textSpan(node2.parent.kind === 225 /* BinaryExpression */ ? node2.parent : node2); + return textSpan(node2.parent.kind === 226 /* BinaryExpression */ ? node2.parent : node2); } function spanInOpenBraceToken(node2) { switch (node2.parent.kind) { - case 265 /* EnumDeclaration */: + case 266 /* EnumDeclaration */: const enumDeclaration = node2.parent; return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: const classDeclaration = node2.parent; return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node2.parent.parent, node2.parent.clauses[0]); } return spanInNode(node2.parent); } function spanInCloseBraceToken(node2) { switch (node2.parent.kind) { - case 267 /* ModuleBlock */: + case 268 /* ModuleBlock */: if (getModuleInstanceState(node2.parent.parent) !== 1 /* Instantiated */) { return void 0; } - case 265 /* EnumDeclaration */: - case 262 /* ClassDeclaration */: + case 266 /* EnumDeclaration */: + case 263 /* ClassDeclaration */: return textSpan(node2); - case 240 /* Block */: + case 241 /* Block */: if (isFunctionBlock(node2.parent)) { return textSpan(node2); } - case 298 /* CatchClause */: + case 299 /* CatchClause */: return spanInNode(lastOrUndefined(node2.parent.statements)); - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: const caseBlock = node2.parent; const lastClause = lastOrUndefined(caseBlock.clauses); if (lastClause) { return spanInNode(lastOrUndefined(lastClause.statements)); } return void 0; - case 205 /* ObjectBindingPattern */: + case 206 /* ObjectBindingPattern */: const bindingPattern = node2.parent; return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -412782,7 +417071,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function spanInCloseBracketToken(node2) { switch (node2.parent.kind) { - case 206 /* ArrayBindingPattern */: + case 207 /* ArrayBindingPattern */: const bindingPattern = node2.parent; return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -412794,57 +417083,57 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function spanInOpenParenToken(node2) { - if (node2.parent.kind === 245 /* DoStatement */ || // Go to while keyword and do action instead - node2.parent.kind === 212 /* CallExpression */ || node2.parent.kind === 213 /* NewExpression */) { + if (node2.parent.kind === 246 /* DoStatement */ || // Go to while keyword and do action instead + node2.parent.kind === 213 /* CallExpression */ || node2.parent.kind === 214 /* NewExpression */) { return spanInPreviousNode(node2); } - if (node2.parent.kind === 216 /* ParenthesizedExpression */) { + if (node2.parent.kind === 217 /* ParenthesizedExpression */) { return spanInNextNode(node2); } return spanInNode(node2.parent); } function spanInCloseParenToken(node2) { switch (node2.parent.kind) { - case 217 /* FunctionExpression */: - case 261 /* FunctionDeclaration */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 175 /* Constructor */: - case 246 /* WhileStatement */: - case 245 /* DoStatement */: - case 247 /* ForStatement */: - case 249 /* ForOfStatement */: - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 216 /* ParenthesizedExpression */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 176 /* Constructor */: + case 247 /* WhileStatement */: + case 246 /* DoStatement */: + case 248 /* ForStatement */: + case 250 /* ForOfStatement */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 217 /* ParenthesizedExpression */: return spanInPreviousNode(node2); default: return spanInNode(node2.parent); } } function spanInColonToken(node2) { - if (isFunctionLike(node2.parent) || node2.parent.kind === 302 /* PropertyAssignment */ || node2.parent.kind === 168 /* Parameter */) { + if (isFunctionLike(node2.parent) || node2.parent.kind === 303 /* PropertyAssignment */ || node2.parent.kind === 169 /* Parameter */) { return spanInPreviousNode(node2); } return spanInNode(node2.parent); } function spanInGreaterThanOrLessThanToken(node2) { - if (node2.parent.kind === 215 /* TypeAssertionExpression */) { + if (node2.parent.kind === 216 /* TypeAssertionExpression */) { return spanInNextNode(node2); } return spanInNode(node2.parent); } function spanInWhileKeyword(node2) { - if (node2.parent.kind === 245 /* DoStatement */) { + if (node2.parent.kind === 246 /* DoStatement */) { return textSpanEndingAtNextToken(node2, node2.parent.expression); } return spanInNode(node2.parent); } function spanInOfKeyword(node2) { - if (node2.parent.kind === 249 /* ForOfStatement */) { + if (node2.parent.kind === 250 /* ForOfStatement */) { return spanInNextNode(node2); } return spanInNode(node2.parent); @@ -412874,21 +417163,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)); } @@ -412918,7 +417210,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(); @@ -412934,24 +417226,27 @@ ${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(); } return; } switch (node.kind) { - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 173 /* MethodDeclaration */: - if (node.parent.kind === 209 /* ObjectLiteralExpression */) { - return (_a = getAssignedName(node.parent)) == null ? void 0 : _a.getText(); - } - return (_b = getNameOfDeclaration(node.parent)) == null ? void 0 : _b.getText(); - case 261 /* FunctionDeclaration */: - case 262 /* ClassDeclaration */: - case 266 /* ModuleDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: + if (node.parent.kind === 210 /* ObjectLiteralExpression */) { + return (_c = getAssignedName(node.parent)) == null ? void 0 : _c.getText(); + } + return (_d = getNameOfDeclaration(node.parent)) == null ? void 0 : _d.getText(); + case 262 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: + case 267 /* ModuleDeclaration */: if (isModuleBlock(node.parent) && isIdentifier(node.parent.parent.name)) { return node.parent.parent.name.getText(); } @@ -413021,7 +417316,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; @@ -413036,7 +417331,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) { @@ -413153,7 +417448,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function collect(node) { if (!node) return; - if (node.flags & 16777216 /* Ambient */) { + if (node.flags & 33554432 /* Ambient */) { return; } if (isValidCallHierarchyDeclaration(node)) { @@ -413168,55 +417463,55 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } switch (node.kind) { case 80 /* Identifier */: - case 270 /* ImportEqualsDeclaration */: - case 271 /* ImportDeclaration */: - case 277 /* ExportDeclaration */: - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 272 /* ImportDeclaration */: + case 278 /* ExportDeclaration */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: return; - case 174 /* ClassStaticBlockDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: recordCallSite(node); return; - case 215 /* TypeAssertionExpression */: - case 233 /* AsExpression */: + case 216 /* TypeAssertionExpression */: + case 234 /* AsExpression */: collect(node.expression); return; - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: collect(node.name); collect(node.initializer); return; - case 212 /* CallExpression */: + case 213 /* CallExpression */: recordCallSite(node); collect(node.expression); forEach(node.arguments, collect); return; - case 213 /* NewExpression */: + case 214 /* NewExpression */: recordCallSite(node); collect(node.expression); forEach(node.arguments, collect); return; - case 214 /* TaggedTemplateExpression */: + case 215 /* TaggedTemplateExpression */: recordCallSite(node); collect(node.tag); collect(node.template); return; - case 285 /* JsxOpeningElement */: - case 284 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 285 /* JsxSelfClosingElement */: recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 169 /* Decorator */: + case 170 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 210 /* PropertyAccessExpression */: - case 211 /* ElementAccessExpression */: + case 211 /* PropertyAccessExpression */: + case 212 /* ElementAccessExpression */: recordCallSite(node); forEachChild(node, collect); break; - case 237 /* SatisfiesExpression */: + case 238 /* SatisfiesExpression */: collect(node.expression); return; } @@ -413231,7 +417526,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} forEach(node.statements, collect); } function collectCallSitesOfModuleDeclaration(node, collect) { - if (!hasSyntacticModifier(node, 2 /* Ambient */) && node.body && isModuleBlock(node.body)) { + if (!hasSyntacticModifier(node, 128 /* Ambient */) && node.body && isModuleBlock(node.body)) { forEach(node.body.statements, collect); } } @@ -413269,25 +417564,25 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const callSites = []; const collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 311 /* SourceFile */: + case 312 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; - case 174 /* ClassStaticBlockDeclaration */: + case 175 /* ClassStaticBlockDeclaration */: collectCallSitesOfClassStaticBlockDeclaration(node, collect); break; default: @@ -413302,7 +417597,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return createCallHierarchyOutgoingCall(createCallHierarchyItem(program, entries[0].declaration), map(entries, (entry) => createTextSpanFromRange(entry.range))); } function getOutgoingCalls(program, declaration) { - if (declaration.flags & 16777216 /* Ambient */ || isMethodSignature(declaration)) { + if (declaration.flags & 33554432 /* Ambient */ || isMethodSignature(declaration)) { return []; } return group(collectCallSites(program, declaration), getCallSiteGroupKey, (entries) => convertCallSiteGroupToOutgoingCall(program, entries)); @@ -413379,9 +417674,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return { fixName: fixName8, description: description3, changes, fixId: fixId52, fixAllDescription, commands: command ? [command] : void 0 }; } function registerCodeFix(reg) { - for (const error of reg.errorCodes) { + for (const error2 of reg.errorCodes) { errorCodeToFixesArray = void 0; - errorCodeToFixes.add(String(error), reg); + errorCodeToFixes.add(String(error2), reg); } if (reg.fixIds) { for (const fixId52 of reg.fixIds) { @@ -413394,10 +417689,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; @@ -413421,14 +417716,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); } } @@ -413497,6 +417792,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} registerCodeFix({ errorCodes: [ Diagnostics.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.code, + Diagnostics.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.code, Diagnostics.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.code ], getCodeActions: function getCodeActionsToAddEmptyExportDeclaration(context) { @@ -413531,13 +417827,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } fixedDeclarations == null ? void 0 : fixedDeclarations.add(getNodeId(insertionSite)); - const cloneWithModifier = factory.updateModifiers( + const cloneWithModifier = factory.replaceModifiers( getSynthesizedDeepClone( insertionSite, /*includeTrivia*/ true ), - factory.createNodeArray(factory.createModifiersFromModifierFlags(getSyntacticModifierFlags(insertionSite) | 512 /* Async */)) + factory.createNodeArray(factory.createModifiersFromModifierFlags(getSyntacticModifierFlags(insertionSite) | 1024 /* Async */)) ); changeTracker.replaceNode( sourceFile, @@ -413648,8 +417944,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration); const variableName = declaration && tryCast(declaration.name, isIdentifier); - const variableStatement = getAncestor(declaration, 242 /* VariableStatement */); - if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 1 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) { + const variableStatement = getAncestor(declaration, 243 /* VariableStatement */); + if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier(variableStatement, 32 /* Export */) || !variableName || !isInsideAwaitableBody(declaration.initializer)) { isCompleteFix = false; continue; } @@ -413707,7 +418003,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} checker.getTypeAtLocation(errorNode).flags & 1 /* Any */; } function isInsideAwaitableBody(node) { - return node.kind & 32768 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 261 /* FunctionDeclaration */ || ancestor.parent.kind === 217 /* FunctionExpression */ || ancestor.parent.kind === 218 /* ArrowFunction */ || ancestor.parent.kind === 173 /* MethodDeclaration */)); + return node.flags & 65536 /* AwaitContext */ || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock(ancestor) && (ancestor.parent.kind === 262 /* FunctionDeclaration */ || ancestor.parent.kind === 218 /* FunctionExpression */ || ancestor.parent.kind === 219 /* ArrowFunction */ || ancestor.parent.kind === 174 /* MethodDeclaration */)); } function makeChange3(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { if (isForOfStatement(insertionSite.parent) && !insertionSite.parent.awaitModifier) { @@ -413836,10 +418132,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} // src/services/codefixes/addMissingConst.ts function makeChange4(changeTracker, sourceFile, pos, program, fixedNodes) { const token = getTokenAtPosition(sourceFile, pos); - const forInitializer = findAncestor( - token, - (node) => isForInOrOfStatement(node.parent) ? node.parent.initializer === node : isPossiblyPartOfDestructuring(node) ? false : "quit" - ); + const forInitializer = findAncestor(token, (node) => isForInOrOfStatement(node.parent) ? node.parent.initializer === node : isPossiblyPartOfDestructuring(node) ? false : "quit"); if (forInitializer) return applyChange(changeTracker, forInitializer, sourceFile, fixedNodes); const parent2 = token.parent; @@ -413853,10 +418146,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return applyChange(changeTracker, parent2, sourceFile, fixedNodes); } - const commaExpression = findAncestor( - token, - (node) => isExpressionStatement(node.parent) ? true : isPossiblyPartOfCommaSeperatedInitializer(node) ? false : "quit" - ); + const commaExpression = findAncestor(token, (node) => isExpressionStatement(node.parent) ? true : isPossiblyPartOfCommaSeperatedInitializer(node) ? false : "quit"); if (commaExpression) { const checker = program.getTypeChecker(); if (!expressionCouldBeVariableDeclaration(commaExpression, checker)) { @@ -413873,10 +418163,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 80 /* Identifier */: - case 208 /* ArrayLiteralExpression */: - case 209 /* ObjectLiteralExpression */: - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: + case 209 /* ArrayLiteralExpression */: + case 210 /* ObjectLiteralExpression */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -413893,7 +418183,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 80 /* Identifier */: - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: case 28 /* CommaToken */: return true; default: @@ -413944,7 +418234,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return; } const declaration = token.parent; - if (declaration.kind === 171 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) { + if (declaration.kind === 172 /* PropertyDeclaration */ && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) { changeTracker.insertModifierBefore(sourceFile, 138 /* DeclareKeyword */, declaration); } } @@ -414010,8 +418300,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }); // src/services/codefixes/addNameToNamelessParameter.ts - function makeChange7(changeTracker, sourceFile, pos) { - const token = getTokenAtPosition(sourceFile, pos); + function makeChange7(changeTracker, sourceFile, start) { + const token = getTokenAtPosition(sourceFile, start); const param = token.parent; if (!isParameter(param)) { return Debug.fail("Tried to add a parameter name to a non-parameter: " + Debug.formatSyntaxKind(token.kind)); @@ -414019,20 +418309,34 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const i = param.parent.parameters.indexOf(param); Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one."); Debug.assert(i > -1, "Parameter not found in parent parameter list."); - const typeNode = factory.createTypeReferenceNode( + let end = param.name.getEnd(); + let typeNode = factory.createTypeReferenceNode( param.name, /*typeArguments*/ void 0 ); + let nextParam = tryGetNextParam(sourceFile, param); + while (nextParam) { + typeNode = factory.createArrayTypeNode(typeNode); + end = nextParam.getEnd(); + nextParam = tryGetNextParam(sourceFile, nextParam); + } const replacement = factory.createParameterDeclaration( param.modifiers, param.dotDotDotToken, "arg" + i, param.questionToken, - param.dotDotDotToken ? factory.createArrayTypeNode(typeNode) : typeNode, + param.dotDotDotToken && !isArrayTypeNode(typeNode) ? factory.createArrayTypeNode(typeNode) : typeNode, param.initializer ); - changeTracker.replaceNode(sourceFile, param, replacement); + changeTracker.replaceRange(sourceFile, createRange(param.getStart(sourceFile), end), replacement); + } + function tryGetNextParam(sourceFile, param) { + const nextToken = findNextToken(param.name, param.parent, sourceFile); + if (nextToken && nextToken.kind === 23 /* OpenBracketToken */ && isArrayBindingPattern(nextToken.parent) && isParameter(nextToken.parent.parent)) { + return nextToken.parent.parent; + } + return void 0; } var fixId7, errorCodes7; var init_addNameToNamelessParameter = __esm({ @@ -414111,7 +418415,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const d = add.valueDeclaration; if (d && (isPropertySignature(d) || isPropertyDeclaration(d)) && d.type) { const t = factory.createUnionTypeNode([ - ...d.type.kind === 191 /* UnionType */ ? d.type.types : [d.type], + ...d.type.kind === 192 /* UnionType */ ? d.type.types : [d.type], factory.createTypeReferenceNode("undefined") ]); changes.replaceNode(d.getSourceFile(), d.type, t); @@ -414188,29 +418492,34 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function isDeclarationWithType(node) { - return isFunctionLikeDeclaration(node) || node.kind === 259 /* VariableDeclaration */ || node.kind === 170 /* PropertySignature */ || node.kind === 171 /* PropertyDeclaration */; + return isFunctionLikeDeclaration(node) || node.kind === 260 /* VariableDeclaration */ || node.kind === 171 /* PropertySignature */ || node.kind === 172 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 318 /* JSDocAllType */: - case 319 /* JSDocUnknownType */: + case 319 /* JSDocAllType */: + case 320 /* JSDocUnknownType */: return factory.createTypeReferenceNode("any", emptyArray); - case 322 /* JSDocOptionalType */: + case 323 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 321 /* JSDocNonNullableType */: + case 322 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 320 /* JSDocNullableType */: + case 321 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 324 /* JSDocVariadicType */: + case 325 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 323 /* JSDocFunctionType */: + case 324 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 182 /* TypeReference */: + case 183 /* TypeReference */: return transformJSDocTypeReference(node); - case 328 /* JSDocTypeLiteral */: + 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; } @@ -414240,7 +418549,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function transformJSDocParameter(node) { const index = node.parent.parameters.indexOf(node); - const isRest = node.type.kind === 324 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; + const isRest = node.type.kind === 325 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; const name = node.name || (isRest ? "rest" : "arg" + index); const dotdotdot = isRest ? factory.createToken(26 /* DotDotDotToken */) : node.dotDotDotToken; return factory.createParameterDeclaration(node.modifiers, dotdotdot, name, node.questionToken, visitNode(node.type, transformJSDocType, isTypeNode), node.initializer); @@ -414422,7 +418731,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} })) { return; } - const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 243 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 244 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentExpr) { members.push(factory.createPropertyDeclaration( @@ -414507,7 +418816,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function createArrowFunctionExpressionMember(members2, arrowFunction, name) { const arrowFunctionBody = arrowFunction.body; let bodyBlock; - if (arrowFunctionBody.kind === 240 /* Block */) { + if (arrowFunctionBody.kind === 241 /* Block */) { bodyBlock = arrowFunctionBody; } else { bodyBlock = factory.createBlock([factory.createReturnStatement(arrowFunctionBody)]); @@ -414892,19 +419201,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} statements.push(factory.createVariableStatement( /*modifiers*/ void 0, - factory.createVariableDeclarationList( - [ - factory.createVariableDeclaration( - getSynthesizedDeepClone(declareSynthBindingPattern(continuationArgName)), - /*exclamationToken*/ - void 0, - /*type*/ - void 0, - varDeclIdentifier - ) - ], - 2 /* Const */ - ) + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + getSynthesizedDeepClone(declareSynthBindingPattern(continuationArgName)), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + varDeclIdentifier + ) + ], 2 /* Const */) )); } return statements; @@ -415040,18 +419346,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} factory.createVariableStatement( /*modifiers*/ void 0, - factory.createVariableDeclarationList( - [ - factory.createVariableDeclaration( - getSynthesizedDeepClone(declareSynthBindingName(variableName)), - /*exclamationToken*/ - void 0, - typeAnnotation, - rightHandSide - ) - ], - 2 /* Const */ - ) + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + getSynthesizedDeepClone(declareSynthBindingName(variableName)), + /*exclamationToken*/ + void 0, + typeAnnotation, + rightHandSide + ) + ], 2 /* Const */) ) ]; } @@ -415070,7 +419373,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} switch (func.kind) { case 106 /* NullKeyword */: break; - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: case 80 /* Identifier */: if (!inputArgName) { break; @@ -415095,8 +419398,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} continuationArgName.types.push(transformer.checker.getAwaitedType(returnType) || returnType); } return varDeclOrAssignment; - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: { + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: { const funcBody = func.body; const returnType2 = (_a = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) == null ? void 0 : _a.getReturnType(); if (isBlock(funcBody)) { @@ -415330,15 +419633,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }); // src/services/codefixes/convertToEsModule.ts - function fixImportOfModuleExports(importingFile, exportingFile, changes, quotePreference) { + function fixImportOfModuleExports(importingFile, exportingFile, program, changes, quotePreference) { + var _a; for (const moduleSpecifier of importingFile.imports) { - const imported = getResolvedModule(importingFile, moduleSpecifier.text, getModeForUsageLocation(importingFile, moduleSpecifier)); + const imported = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a.resolvedModule; if (!imported || imported.resolvedFileName !== exportingFile.fileName) { continue; } const importNode = importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, makeImport( importNode.name, /*namedImports*/ @@ -415347,7 +419651,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} quotePreference )); break; - case 212 /* CallExpression */: + case 213 /* CallExpression */: if (isRequireCall( importNode, /*requireStringLiteralLikeArgument*/ @@ -415416,13 +419720,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference) { switch (statement.kind) { - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 243 /* ExpressionStatement */: { + case 244 /* ExpressionStatement */: { const { expression } = statement; switch (expression.kind) { - case 212 /* CallExpression */: { + case 213 /* CallExpression */: { if (isRequireCall( expression, /*requireStringLiteralLikeArgument*/ @@ -415439,7 +419743,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return false; } - case 225 /* BinaryExpression */: { + case 226 /* BinaryExpression */: { const { operatorToken } = expression; return operatorToken.kind === 64 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports, useSitesToUnqualify); } @@ -415493,8 +419797,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 205 /* ObjectBindingPattern */: - case 206 /* ArrayBindingPattern */: { + case 206 /* ObjectBindingPattern */: + case 207 /* ArrayBindingPattern */: { const tmp = makeUniqueName(propertyName, identifiers); return convertedImports([ makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), @@ -415542,14 +419846,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function tryChangeModuleExportsObject(object, useSitesToUnqualify) { const statements = mapAllOrFail(object.properties, (prop) => { switch (prop.kind) { - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 303 /* ShorthandPropertyAssignment */: - case 304 /* SpreadAssignment */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 304 /* ShorthandPropertyAssignment */: + case 305 /* SpreadAssignment */: return void 0; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return !isIdentifier(prop.name) ? void 0 : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return !isIdentifier(prop.name) ? void 0 : functionExpressionToDeclaration(prop.name.text, [factory.createToken(95 /* ExportKeyword */)], prop, useSitesToUnqualify); default: Debug.assertNever(prop, `Convert to ES6 got invalid prop kind ${prop.kind}`); @@ -415615,27 +419919,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (semi) changes.delete(sourceFile, semi); } else { - changes.replaceNodeRangeWithNodes( - sourceFile, - left.expression, - findChildOfKind(left, 25 /* DotToken */, sourceFile), - [factory.createToken(95 /* ExportKeyword */), factory.createToken(87 /* ConstKeyword */)], - { joiner: " ", suffix: " " } - ); + changes.replaceNodeRangeWithNodes(sourceFile, left.expression, findChildOfKind(left, 25 /* DotToken */, sourceFile), [factory.createToken(95 /* ExportKeyword */), factory.createToken(87 /* ConstKeyword */)], { joiner: " ", suffix: " " }); } } function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) { const modifiers = [factory.createToken(95 /* ExportKeyword */)]; switch (exported.kind) { - case 217 /* FunctionExpression */: { + case 218 /* FunctionExpression */: { const { name: expressionName } = exported; if (expressionName && expressionName.text !== name) { return exportConst(); } } - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); default: return exportConst(); @@ -415660,7 +419958,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} replaceNode ); function replaceNode(original) { - if (original.kind === 210 /* PropertyAccessExpression */) { + if (original.kind === 211 /* PropertyAccessExpression */) { const replacement = useSitesToUnqualify.get(original); useSitesToUnqualify.delete(original); return replacement; @@ -415669,7 +419967,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 205 /* ObjectBindingPattern */: { + case 206 /* ObjectBindingPattern */: { const importSpecifiers = mapAllOrFail(name.elements, (e) => e.dotDotDotToken || e.initializer || e.propertyName && !isIdentifier(e.propertyName) || !isIdentifier(e.name) ? void 0 : makeImportSpecifier2(e.propertyName && e.propertyName.text, e.name.text)); if (importSpecifiers) { return convertedImports([makeImport( @@ -415681,7 +419979,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} )]); } } - case 206 /* ArrayBindingPattern */: { + case 207 /* ArrayBindingPattern */: { const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); return convertedImports([ makeImport( @@ -415768,11 +420066,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isFreeIdentifier(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return parent2.name !== node; - case 207 /* BindingElement */: + case 208 /* BindingElement */: return parent2.propertyName !== node; - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: return parent2.propertyName !== node; default: return true; @@ -415866,7 +420164,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const moduleExportsChangedToDefault = convertFileToEsModule(sourceFile, program.getTypeChecker(), changes2, getEmitScriptTarget(program.getCompilerOptions()), getQuotePreference(sourceFile, preferences)); if (moduleExportsChangedToDefault) { for (const importingFile of program.getSourceFiles()) { - fixImportOfModuleExports(importingFile, sourceFile, changes2, getQuotePreference(importingFile, preferences)); + fixImportOfModuleExports(importingFile, sourceFile, program, changes2, getQuotePreference(importingFile, preferences)); } } }); @@ -415944,7 +420242,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} false, factory.updateNamedExports(exportClause, filter(exportClause.elements, (e) => !contains(typeExportSpecifiers, e))), exportDeclaration.moduleSpecifier, - /*assertClause*/ + /*attributes*/ void 0 ); const typeExportDeclaration = factory.createExportDeclaration( @@ -415954,7 +420252,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} true, factory.createNamedExports(typeExportSpecifiers), exportDeclaration.moduleSpecifier, - /*assertClause*/ + /*attributes*/ void 0 ); changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, { @@ -416013,7 +420311,27 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const { parent: parent2 } = getTokenAtPosition(sourceFile, pos); return isImportSpecifier(parent2) || isImportDeclaration(parent2) && parent2.importClause ? parent2 : void 0; } + function canConvertImportDeclarationForSpecifier(specifier, sourceFile, program) { + if (specifier.parent.parent.name) { + return false; + } + const nonTypeOnlySpecifiers = specifier.parent.elements.filter((e) => !e.isTypeOnly); + if (nonTypeOnlySpecifiers.length === 1) { + return true; + } + const checker = program.getTypeChecker(); + for (const specifier2 of nonTypeOnlySpecifiers) { + const isUsedAsValue = ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(specifier2.name, checker, sourceFile, (usage) => { + return !isValidTypeOnlyAliasUseSite(usage); + }); + if (isUsedAsValue) { + return false; + } + } + return true; + } function doChange11(changes, sourceFile, declaration) { + var _a; if (isImportSpecifier(declaration)) { changes.replaceNode(sourceFile, declaration, factory.updateImportSpecifier( declaration, @@ -416049,7 +420367,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} true ), getSynthesizedDeepClone( - declaration.assertClause, + declaration.attributes, /*includeTrivia*/ true ) @@ -416077,26 +420395,30 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} true ), getSynthesizedDeepClone( - declaration.assertClause, + declaration.attributes, /*includeTrivia*/ true ) ) ]); } else { - const importDeclaration = factory.updateImportDeclaration( - declaration, - declaration.modifiers, - factory.updateImportClause( - importClause, + const newNamedBindings = ((_a = importClause.namedBindings) == null ? void 0 : _a.kind) === 275 /* NamedImports */ ? factory.updateNamedImports( + importClause.namedBindings, + sameMap(importClause.namedBindings.elements, (e) => factory.updateImportSpecifier( + e, /*isTypeOnly*/ - true, - importClause.name, - importClause.namedBindings - ), - declaration.moduleSpecifier, - declaration.assertClause - ); + false, + e.propertyName, + e.name + )) + ) : importClause.namedBindings; + const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, factory.updateImportClause( + importClause, + /*isTypeOnly*/ + true, + importClause.name, + newNamedBindings + ), declaration.moduleSpecifier, declaration.attributes); changes.replaceNode(sourceFile, declaration, importDeclaration); } } @@ -416109,25 +420431,48 @@ ${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({ errorCodes: errorCodes14, getCodeActions: function getCodeActionsToConvertToTypeOnlyImport(context) { + var _a; const declaration = getDeclaration2(context.sourceFile, context.span.start); if (declaration) { const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration)); - return [createCodeFixAction(fixId13, changes, Diagnostics.Convert_to_type_only_import, fixId13, Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)]; + const importDeclarationChanges = declaration.kind === 276 /* ImportSpecifier */ && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0; + const mainAction = createCodeFixAction( + fixId13, + changes, + declaration.kind === 276 /* ImportSpecifier */ ? [Diagnostics.Use_type_0, ((_a = declaration.propertyName) == null ? void 0 : _a.text) ?? declaration.name.text] : Diagnostics.Use_import_type, + fixId13, + Diagnostics.Fix_all_with_type_only_imports + ); + if (some(importDeclarationChanges)) { + return [ + createCodeFixActionWithoutFixAll(fixId13, importDeclarationChanges, Diagnostics.Use_import_type), + mainAction + ]; + } + return [mainAction]; } return void 0; }, fixIds: [fixId13], getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context) { + const fixedImportDeclarations = /* @__PURE__ */ new Set(); return codeFixAll(context, errorCodes14, (changes, diag2) => { - const declaration = getDeclaration2(diag2.file, diag2.start); - if (declaration) { - doChange11(changes, diag2.file, declaration); + const errorDeclaration = getDeclaration2(diag2.file, diag2.start); + if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 272 /* ImportDeclaration */ && !fixedImportDeclarations.has(errorDeclaration)) { + doChange11(changes, diag2.file, errorDeclaration); + fixedImportDeclarations.add(errorDeclaration); + } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */ && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) { + doChange11(changes, diag2.file, errorDeclaration.parent.parent.parent); + fixedImportDeclarations.add(errorDeclaration.parent.parent.parent); + } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */) { + doChange11(changes, diag2.file, errorDeclaration); } }); } @@ -416136,23 +420481,60 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }); // src/services/codefixes/convertTypedefToType.ts - function doChange12(changes, node, sourceFile) { - if (isJSDocTypedefTag(node)) { - fixSingleTypeDef(changes, node, sourceFile); - } - } - function fixSingleTypeDef(changes, typeDefNode, sourceFile) { - if (!typeDefNode) + function doChange12(changes, node, sourceFile, newLine, fixAll = false) { + if (!isJSDocTypedefTag(node)) return; - const declaration = createDeclaration(typeDefNode); + const declaration = createDeclaration(node); if (!declaration) return; - const comment = typeDefNode.parent; - changes.replaceNode( - sourceFile, - comment, - declaration + const commentNode = node.parent; + const { leftSibling, rightSibling } = getLeftAndRightSiblings(node); + let pos = commentNode.getStart(); + let prefix = ""; + if (!leftSibling && commentNode.comment) { + pos = findEndOfTextBetween(commentNode, commentNode.getStart(), node.getStart()); + prefix = `${newLine} */${newLine}`; + } + if (leftSibling) { + if (fixAll && isJSDocTypedefTag(leftSibling)) { + pos = node.getStart(); + prefix = ""; + } else { + pos = findEndOfTextBetween(commentNode, leftSibling.getStart(), node.getStart()); + prefix = `${newLine} */${newLine}`; + } + } + let end = commentNode.getEnd(); + let suffix = ""; + if (rightSibling) { + if (fixAll && isJSDocTypedefTag(rightSibling)) { + end = rightSibling.getStart(); + suffix = `${newLine}${newLine}`; + } else { + end = rightSibling.getStart(); + suffix = `${newLine}/**${newLine} * `; + } + } + changes.replaceRange(sourceFile, { pos, end }, declaration, { prefix, suffix }); + } + function getLeftAndRightSiblings(typedefNode) { + const commentNode = typedefNode.parent; + const maxChildIndex = commentNode.getChildCount() - 1; + const currentNodeIndex = commentNode.getChildren().findIndex( + (n) => n.getStart() === typedefNode.getStart() && n.getEnd() === typedefNode.getEnd() ); + const leftSibling = currentNodeIndex > 0 ? commentNode.getChildAt(currentNodeIndex - 1) : void 0; + const rightSibling = currentNodeIndex < maxChildIndex ? commentNode.getChildAt(currentNodeIndex + 1) : void 0; + return { leftSibling, rightSibling }; + } + function findEndOfTextBetween(jsDocComment, from, to) { + const comment = jsDocComment.getText().substring(from - jsDocComment.getStart(), to - jsDocComment.getStart()); + for (let i = comment.length; i > 0; i--) { + if (!/[*/\s]/g.test(comment.substring(i - 1, i))) { + return from + i; + } + } + return to; } function createDeclaration(tag) { var _a; @@ -416162,10 +420544,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const typeName = (_a = tag.name) == null ? void 0 : _a.getText(); if (!typeName) return; - if (typeExpression.kind === 328 /* JSDocTypeLiteral */) { + if (typeExpression.kind === 329 /* JSDocTypeLiteral */) { return createInterfaceForTypeLiteral(typeName, typeExpression); } - if (typeExpression.kind === 315 /* JSDocTypeExpression */) { + if (typeExpression.kind === 316 /* JSDocTypeExpression */) { return createTypeAliasForTypeExpression(typeName, typeExpression); } } @@ -416173,7 +420555,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const propertySignatures = createSignatureFromTypeLiteral(typeLiteral); if (!some(propertySignatures)) return; - const interfaceDeclaration = factory.createInterfaceDeclaration( + return factory.createInterfaceDeclaration( /*modifiers*/ void 0, typeName, @@ -416183,13 +420565,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} void 0, propertySignatures ); - return interfaceDeclaration; } function createTypeAliasForTypeExpression(typeName, typeExpression) { const typeReference = getSynthesizedDeepClone(typeExpression.type); if (!typeReference) return; - const declaration = factory.createTypeAliasDeclaration( + return factory.createTypeAliasDeclaration( /*modifiers*/ void 0, factory.createIdentifier(typeName), @@ -416197,7 +420578,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} void 0, typeReference ); - return declaration; } function createSignatureFromTypeLiteral(typeLiteral) { const propertyTags = typeLiteral.jsDocPropertyTags; @@ -416217,30 +420597,28 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } if (typeReference && name) { const questionToken = isOptional ? factory.createToken(58 /* QuestionToken */) : void 0; - const prop = factory.createPropertySignature( + return factory.createPropertySignature( /*modifiers*/ void 0, name, questionToken, typeReference ); - return prop; } }; - const props = mapDefined(propertyTags, getSignature); - return props; + return mapDefined(propertyTags, getSignature); } function getPropertyName(tag) { return tag.name.kind === 80 /* Identifier */ ? tag.name.text : tag.name.right.text; } - function getJSDocTypedefNode(node) { + function getJSDocTypedefNodes(node) { if (hasJSDocNodes(node)) { - return forEach(node.jsDoc, (node2) => { + return flatMap(node.jsDoc, (doc) => { var _a; - return (_a = node2.tags) == null ? void 0 : _a.find(isJSDocTypedefTag); + return (_a = doc.tags) == null ? void 0 : _a.filter((tag) => isJSDocTypedefTag(tag)); }); } - return void 0; + return []; } var fixId14, errorCodes15; var init_convertTypedefToType = __esm({ @@ -416254,13 +420632,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} fixIds: [fixId14], errorCodes: errorCodes15, getCodeActions(context) { + const newLineCharacter = getNewLineOrDefaultFromHost(context.host, context.formatContext.options); const node = getTokenAtPosition( context.sourceFile, context.span.start ); if (!node) return; - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange12(t, node, context.sourceFile)); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange12(t, node, context.sourceFile, newLineCharacter)); if (changes.length > 0) { return [ createCodeFixAction( @@ -416273,11 +420652,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ]; } }, - getAllCodeActions: (context) => codeFixAll(context, errorCodes15, (changes, diag2) => { - const node = getTokenAtPosition(diag2.file, diag2.start); - if (node) - doChange12(changes, node, diag2.file); - }) + getAllCodeActions: (context) => codeFixAll( + context, + errorCodes15, + (changes, diag2) => { + const newLineCharacter = getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + const node = getTokenAtPosition(diag2.file, diag2.start); + const fixAll = true; + if (node) + doChange12(changes, node, diag2.file, newLineCharacter, fixAll); + } + ) }); } }); @@ -416298,23 +420683,27 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; } function doChange13(changes, sourceFile, { container, typeNode, constraint, name }) { - changes.replaceNode(sourceFile, container, factory.createMappedTypeNode( - /*readonlyToken*/ - void 0, - factory.createTypeParameterDeclaration( - /*modifiers*/ + changes.replaceNode( + sourceFile, + container, + factory.createMappedTypeNode( + /*readonlyToken*/ void 0, - name, - factory.createTypeReferenceNode(constraint) - ), - /*nameType*/ - void 0, - /*questionToken*/ - void 0, - typeNode, - /*members*/ - void 0 - )); + factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + name, + factory.createTypeReferenceNode(constraint) + ), + /*nameType*/ + void 0, + /*questionToken*/ + void 0, + typeNode, + /*members*/ + void 0 + ) + ); } var fixId15, errorCodes16; var init_convertLiteralTypeToMappedType = __esm({ @@ -416352,7 +420741,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return Debug.checkDefined(getContainingClass(getTokenAtPosition(sourceFile, pos)), "There should be a containing class"); } function symbolPointsToNonPrivateMember(symbol) { - return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) & 8 /* Private */); + return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) & 2 /* Private */); } function addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) { const checker = context.program.getTypeChecker(); @@ -416590,8 +420979,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return `${topLevelTypeOnly ? 1 : 0}|${moduleSpecifier}`; } } - function writeFixes(changeTracker) { - const quotePreference = getQuotePreference(sourceFile, preferences); + function writeFixes(changeTracker, oldFileQuotePreference) { + let quotePreference; + if (sourceFile.imports.length === 0 && oldFileQuotePreference !== void 0) { + quotePreference = oldFileQuotePreference; + } else { + quotePreference = getQuotePreference(sourceFile, preferences); + } for (const fix of addToNamespace) { addNamespaceQualifier(changeTracker, sourceFile, fix); } @@ -416618,7 +421012,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} defaultImport, namedImports && arrayFrom(namedImports.entries(), ([name, addAsTypeOnly]) => ({ addAsTypeOnly, name })), namespaceLikeImport, - compilerOptions + compilerOptions, + preferences ); newDeclarations = combine(newDeclarations, declarations); }); @@ -416660,7 +421055,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { - const compilerOptions = program.getCompilerOptions(); let exportInfos; if (exportMapKey) { exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey); @@ -416681,7 +421075,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} fix, /*includeSymbolNameInDescription*/ false, - compilerOptions, + program, preferences )) }; @@ -416691,7 +421085,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const symbolName2 = single(getSymbolNamesToImport(sourceFile, program.getTypeChecker(), symbolToken, compilerOptions)); const fix = getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName2, program); const includeSymbolNameInDescription = symbolName2 !== symbolToken.text; - return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences)); + return fix && codeFixActionToCodeAction(codeActionForFix( + { host, formatContext, preferences }, + sourceFile, + symbolName2, + fix, + includeSymbolNameInDescription, + program, + preferences + )); } function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); @@ -416779,11 +421181,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return (_a = tryCast(declaration.name, isIdentifier)) == null ? void 0 : _a.text; - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return declaration.name.text; - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return (_c = tryCast((_b = declaration.importClause) == null ? void 0 : _b.namedBindings, isNamespaceImport)) == null ? void 0 : _c.name.text; default: return Debug.assertNever(declaration); @@ -416815,11 +421217,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return best; function getAddToExistingImportFix({ declaration, importKind, symbol, targetFlags }) { - if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 270 /* ImportEqualsDeclaration */) { + if (importKind === 3 /* CommonJS */ || importKind === 2 /* Namespace */ || declaration.kind === 271 /* ImportEqualsDeclaration */) { return void 0; } - if (declaration.kind === 259 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 205 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0; + if (declaration.kind === 260 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 206 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind, moduleSpecifier: declaration.initializer.arguments[0].text, addAsTypeOnly: 4 /* NotAllowed */ } : void 0; } const { importClause } = declaration; if (!importClause || !isStringLiteralLike(declaration.moduleSpecifier)) { @@ -416842,7 +421244,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} addAsTypeOnly === 2 /* Required */ && namedBindings)) { return void 0; } - if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 273 /* NamespaceImport */) { + if (importKind === 0 /* Named */ && (namedBindings == null ? void 0 : namedBindings.kind) === 274 /* NamespaceImport */) { return void 0; } return { @@ -416863,7 +421265,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (moduleSymbol) { (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i.parent); } - } else if (i.kind === 271 /* ImportDeclaration */ || i.kind === 270 /* ImportEqualsDeclaration */) { + } else if (i.kind === 272 /* ImportDeclaration */ || i.kind === 271 /* ImportEqualsDeclaration */) { const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); if (moduleSymbol) { (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i); @@ -416894,6 +421296,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (compilerOptions.configFile) { return getEmitModuleKind(compilerOptions) < 5 /* ES2015 */; } + if (sourceFile.impliedNodeFormat === 1 /* CommonJS */) + return true; + if (sourceFile.impliedNodeFormat === 99 /* ESNext */) + return false; for (const otherFile of program.getSourceFiles()) { if (otherFile === sourceFile || !isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) continue; @@ -416914,7 +421320,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const getChecker = createGetChecker(program, host); const moduleResolution = getEmitModuleResolutionKind(compilerOptions); const rejectNodeModulesRelativePaths = moduleResolutionUsesNodeModules(moduleResolution); - const getModuleSpecifiers2 = fromCacheOnly ? (moduleSymbol) => ({ moduleSpecifiers: ts_moduleSpecifiers_exports.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }) : (moduleSymbol, checker) => ts_moduleSpecifiers_exports.getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, sourceFile, moduleSpecifierResolutionHost, preferences); + const getModuleSpecifiers2 = fromCacheOnly ? (moduleSymbol) => ({ moduleSpecifiers: ts_moduleSpecifiers_exports.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }) : (moduleSymbol, checker) => ts_moduleSpecifiers_exports.getModuleSpecifiersWithCacheInfo( + moduleSymbol, + checker, + compilerOptions, + sourceFile, + moduleSpecifierResolutionHost, + preferences, + /*options*/ + void 0, + /*forAutoImport*/ + true + ); let computedWithoutCacheCount = 0; const fixes = flatMap(exportInfo, (exportInfo2, i) => { const checker = getChecker(exportInfo2.isFromPackageJson); @@ -417040,7 +421457,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); } @@ -417142,6 +421559,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 */: @@ -417257,14 +421675,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return allowSyntheticDefaults ? 1 /* Default */ : 3 /* CommonJS */; } - function codeActionForFix(context, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences) { + function codeActionForFix(context, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences) { let diag2; const changes = ts_textChanges_exports.ChangeTracker.with(context, (tracker) => { - diag2 = codeActionForFixWorker(tracker, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences); + diag2 = codeActionForFixWorker(tracker, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences); }); return createCodeFixAction(importFixName, changes, diag2, importFixId, Diagnostics.Add_all_missing_imports); } - function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences) { + function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences) { const quotePreference = getQuotePreference(sourceFile, preferences); switch (fix.kind) { case 0 /* UseNamespace */: @@ -417301,7 +421719,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} defaultImport, namedImports, namespaceLikeImport, - compilerOptions + program.getCompilerOptions(), + preferences ), /*blankLineBetween*/ true, @@ -417314,8 +421733,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } case 4 /* PromoteTypeOnly */: { const { typeOnlyAliasDeclaration } = fix; - const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile, preferences); - return promotedDeclaration.kind === 275 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; + const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, program, sourceFile, preferences); + return promotedDeclaration.kind === 276 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; } default: return Debug.assertNever(fix, `Unexpected fix kind ${fix.kind}`); @@ -417323,16 +421742,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getModuleSpecifierText(promotedDeclaration) { var _a, _b; - return promotedDeclaration.kind === 270 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; + return promotedDeclaration.kind === 271 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; } - function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile, preferences) { + function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, preferences) { + const compilerOptions = program.getCompilerOptions(); const convertExistingToTypeOnly = importNameElisionDisabled(compilerOptions); switch (aliasDeclaration.kind) { - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: if (aliasDeclaration.isTypeOnly) { const sortKind = ts_OrganizeImports_exports.detectImportSpecifierSorting(aliasDeclaration.parent.elements, preferences); if (aliasDeclaration.parent.elements.length > 1 && sortKind) { - changes.delete(sourceFile, aliasDeclaration); const newSpecifier = factory.updateImportSpecifier( aliasDeclaration, /*isTypeOnly*/ @@ -417341,35 +421760,47 @@ ${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); - changes.insertImportSpecifierAtIndex(sourceFile, newSpecifier, aliasDeclaration.parent, insertionIndex); - } else { - changes.deleteRange(sourceFile, aliasDeclaration.getFirstToken()); + 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, { pos: getTokenPosOfNode(aliasDeclaration.getFirstToken()), end: getTokenPosOfNode(aliasDeclaration.propertyName ?? aliasDeclaration.name) }); return aliasDeclaration; } else { Debug.assert(aliasDeclaration.parent.parent.isTypeOnly); promoteImportClause(aliasDeclaration.parent.parent); return aliasDeclaration.parent.parent; } - case 272 /* ImportClause */: + case 273 /* ImportClause */: promoteImportClause(aliasDeclaration); return aliasDeclaration; - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: promoteImportClause(aliasDeclaration.parent); return aliasDeclaration.parent; - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: changes.deleteRange(sourceFile, aliasDeclaration.getChildAt(1)); return aliasDeclaration; default: Debug.failBadSyntaxKind(aliasDeclaration); } function promoteImportClause(importClause) { + var _a; changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(importClause, sourceFile)); + if (!compilerOptions.allowImportingTsExtensions) { + const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(importClause.parent); + 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)); + } + } if (convertExistingToTypeOnly) { const namedImports = tryCast(importClause.namedBindings, isNamedImports); if (namedImports && namedImports.elements.length > 1) { - if (ts_OrganizeImports_exports.detectImportSpecifierSorting(namedImports.elements, preferences) && aliasDeclaration.kind === 275 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { + if (ts_OrganizeImports_exports.detectImportSpecifierSorting(namedImports.elements, preferences) && aliasDeclaration.kind === 276 /* ImportSpecifier */ && namedImports.elements.indexOf(aliasDeclaration) !== 0) { changes.delete(sourceFile, aliasDeclaration); changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0); } @@ -417384,7 +421815,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, preferences) { var _a; - if (clause.kind === 205 /* ObjectBindingPattern */) { + if (clause.kind === 206 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport.name, "default"); } @@ -417419,18 +421850,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, ignoreCaseForSorting); const newSpecifiers = stableSort( - namedImports.map((namedImport) => factory.createImportSpecifier( - (!clause.isTypeOnly || promoteFromTypeOnly2) && needsTypeOnly(namedImport), - /*propertyName*/ - void 0, - factory.createIdentifier(namedImport.name) - )), + namedImports.map( + (namedImport) => factory.createImportSpecifier( + (!clause.isTypeOnly || promoteFromTypeOnly2) && shouldUseTypeOnly(namedImport, preferences), + /*propertyName*/ + void 0, + factory.createIdentifier(namedImport.name) + ) + ), (s1, s2) => ts_OrganizeImports_exports.compareImportOrExportSpecifiers(s1, s2, comparer) ); 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) { @@ -417483,42 +421916,50 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function needsTypeOnly({ addAsTypeOnly }) { return addAsTypeOnly === 2 /* Required */; } - function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, compilerOptions) { + function shouldUseTypeOnly(info, preferences) { + return needsTypeOnly(info) || !!preferences.preferTypeOnlyAutoImports && info.addAsTypeOnly !== 4 /* NotAllowed */; + } + function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, compilerOptions, preferences) { const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference); let statements; if (defaultImport !== void 0 || (namedImports == null ? void 0 : namedImports.length)) { - const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || compilerOptions.verbatimModuleSyntax && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */); - statements = combine(statements, makeImport( - defaultImport && factory.createIdentifier(defaultImport.name), - namedImports == null ? void 0 : namedImports.map(({ addAsTypeOnly, name }) => factory.createImportSpecifier( - !topLevelTypeOnly && addAsTypeOnly === 2 /* Required */, - /*propertyName*/ - void 0, - factory.createIdentifier(name) - )), - moduleSpecifier, - quotePreference, - topLevelTypeOnly - )); + const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || (compilerOptions.verbatimModuleSyntax || preferences.preferTypeOnlyAutoImports) && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */); + statements = combine( + statements, + makeImport( + defaultImport && factory.createIdentifier(defaultImport.name), + namedImports == null ? void 0 : namedImports.map( + (namedImport) => factory.createImportSpecifier( + !topLevelTypeOnly && shouldUseTypeOnly(namedImport, preferences), + /*propertyName*/ + void 0, + factory.createIdentifier(namedImport.name) + ) + ), + moduleSpecifier, + quotePreference, + topLevelTypeOnly + ) + ); } if (namespaceLikeImport) { const declaration = namespaceLikeImport.importKind === 3 /* CommonJS */ ? factory.createImportEqualsDeclaration( /*modifiers*/ void 0, - needsTypeOnly(namespaceLikeImport), + shouldUseTypeOnly(namespaceLikeImport, preferences), factory.createIdentifier(namespaceLikeImport.name), factory.createExternalModuleReference(quotedModuleSpecifier) ) : factory.createImportDeclaration( /*modifiers*/ void 0, factory.createImportClause( - needsTypeOnly(namespaceLikeImport), + shouldUseTypeOnly(namespaceLikeImport, preferences), /*name*/ void 0, factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name)) ), quotedModuleSpecifier, - /*assertClause*/ + /*attributes*/ void 0 ); statements = combine(statements, declaration); @@ -417557,24 +421998,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return factory.createVariableStatement( /*modifiers*/ void 0, - factory.createVariableDeclarationList( - [ - factory.createVariableDeclaration( - typeof name === "string" ? factory.createIdentifier(name) : name, - /*exclamationToken*/ - void 0, - /*type*/ + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + typeof name === "string" ? factory.createIdentifier(name) : name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createCallExpression( + factory.createIdentifier("require"), + /*typeArguments*/ void 0, - factory.createCallExpression( - factory.createIdentifier("require"), - /*typeArguments*/ - void 0, - [quotedModuleSpecifier] - ) + [quotedModuleSpecifier] ) - ], - 2 /* Const */ - ) + ) + ], 2 /* Const */) ); } function symbolHasMeaning({ declarations }, meaning) { @@ -417627,7 +422065,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, @@ -417642,16 +422090,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ); if (!info) return void 0; - return info.map(({ fix, symbolName: symbolName2, errorIdentifierText }) => codeActionForFix( - context, - sourceFile, - symbolName2, - fix, - /*includeSymbolNameInDescription*/ - symbolName2 !== errorIdentifierText, - program.getCompilerOptions(), - preferences - )); + return info.map( + ({ fix, symbolName: symbolName2, errorIdentifierText }) => codeActionForFix( + context, + sourceFile, + symbolName2, + fix, + /*includeSymbolNameInDescription*/ + symbolName2 !== errorIdentifierText, + program, + preferences + ) + ); }, fixIds: [importFixId], getAllCodeActions: (context) => { @@ -417730,7 +422180,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) { @@ -417820,7 +422270,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const lastDecorator = findLast(modifiers, isDecorator); const modifierPos = abstractModifier ? abstractModifier.end : staticModifier ? staticModifier.end : accessibilityModifier ? accessibilityModifier.end : lastDecorator ? skipTrivia(sourceFile.text, lastDecorator.end) : classElement.getStart(sourceFile); const options = accessibilityModifier || staticModifier || abstractModifier ? { prefix: " " } : { suffix: " " }; - changeTracker.insertModifierAt(sourceFile, modifierPos, 163 /* OverrideKeyword */, options); + changeTracker.insertModifierAt(sourceFile, modifierPos, 164 /* OverrideKeyword */, options); } function doRemoveOverrideModifierChange(changeTracker, sourceFile, pos) { const classElement = findContainerClassElementLike(sourceFile, pos); @@ -417834,13 +422284,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isClassElementLikeHasJSDoc(node) { switch (node.kind) { - case 175 /* Constructor */: - case 171 /* PropertyDeclaration */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 176 /* Constructor */: + case 172 /* PropertyDeclaration */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return true; - case 168 /* Parameter */: + case 169 /* Parameter */: return isParameterPropertyDeclaration(node, node.parent); default: return false; @@ -418061,28 +422511,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} // src/services/codefixes/fixImportNonExportedMember.ts function getInfo7(sourceFile, pos, program) { - var _a; + var _a, _b; const token = getTokenAtPosition(sourceFile, pos); if (isIdentifier(token)) { 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 = getResolvedModule( - sourceFile, - moduleSpecifier, - /*mode*/ - void 0 - ); + const resolvedModule = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a.resolvedModule; if (resolvedModule === void 0) return void 0; const moduleSourceFile = program.getSourceFile(resolvedModule.resolvedFileName); if (moduleSourceFile === void 0 || isSourceFileFromLibrary(program, moduleSourceFile)) return void 0; const moduleSymbol = moduleSourceFile.symbol; - const locals = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals; + const locals = (_b = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _b.locals; if (locals === void 0) return void 0; const localSymbol = locals.get(token.escapedText); @@ -418092,7 +422537,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; } @@ -418137,30 +422582,26 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ) ), node.moduleSpecifier, - node.assertClause + node.attributes ) ); } function createExport(changes, program, sourceFile, names) { - changes.insertNodeAtEndOfScope( - sourceFile, - sourceFile, - factory.createExportDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - factory.createNamedExports(createExportSpecifiers( - names, - /*allowTypeModifier*/ - getIsolatedModules(program.getCompilerOptions()) - )), - /*moduleSpecifier*/ - void 0, - /*assertClause*/ - void 0 - ) - ); + changes.insertNodeAtEndOfScope(sourceFile, sourceFile, factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports(createExportSpecifiers( + names, + /*allowTypeModifier*/ + getIsolatedModules(program.getCompilerOptions()) + )), + /*moduleSpecifier*/ + void 0, + /*attributes*/ + void 0 + )); } function createExportSpecifiers(names, allowTypeModifier) { return factory.createNodeArray(map(names, (n) => factory.createExportSpecifier( @@ -418246,7 +422687,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} // src/services/codefixes/fixIncorrectNamedTupleSyntax.ts function getNamedTupleMember(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); - return findAncestor(token, (t) => t.kind === 201 /* NamedTupleMember */); + return findAncestor(token, (t) => t.kind === 202 /* NamedTupleMember */); } function doChange17(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { @@ -418255,10 +422696,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} let unwrappedType = namedTupleMember.type; let sawOptional = false; let sawRest = false; - while (unwrappedType.kind === 189 /* OptionalType */ || unwrappedType.kind === 190 /* RestType */ || unwrappedType.kind === 195 /* ParenthesizedType */) { - if (unwrappedType.kind === 189 /* OptionalType */) { + while (unwrappedType.kind === 190 /* OptionalType */ || unwrappedType.kind === 191 /* RestType */ || unwrappedType.kind === 196 /* ParenthesizedType */) { + if (unwrappedType.kind === 190 /* OptionalType */) { sawOptional = true; - } else if (unwrappedType.kind === 190 /* RestType */) { + } else if (unwrappedType.kind === 191 /* RestType */) { sawRest = true; } unwrappedType = unwrappedType.type; @@ -418310,7 +422751,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isPropertyAccessExpression(parent2) && parent2.name === node) { Debug.assert(isMemberName(node), "Expected an identifier for spelling (property access)"); let containingType = checker.getTypeAtLocation(parent2.expression); - if (parent2.flags & 32 /* OptionalChain */) { + if (parent2.flags & 64 /* OptionalChain */) { containingType = checker.getNonNullableType(containingType); } suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, containingType); @@ -418325,7 +422766,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); } @@ -418334,7 +422775,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const tag = findAncestor(node, isJsxOpeningLikeElement); const props = checker.getContextualTypeForArgumentAtIndex(tag, 0); suggestedSymbol = checker.getSuggestedSymbolForNonexistentJSXAttribute(node, props); - } else if (hasSyntacticModifier(parent2, 16384 /* Override */) && isClassElement(parent2) && parent2.name === node) { + } else if (hasOverrideModifier(parent2) && isClassElement(parent2) && parent2.name === node) { const baseDeclaration = findAncestor(node, isClassLike); const baseTypeNode = baseDeclaration ? getEffectiveBaseTypeNode(baseDeclaration) : void 0; const baseType = baseTypeNode ? checker.getTypeAtLocation(baseTypeNode) : void 0; @@ -418375,10 +422816,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 = getResolvedModule(sourceFile, importDeclaration.moduleSpecifier.text, getModeForUsageLocation(sourceFile, importDeclaration.moduleSpecifier)); + const resolvedModule = (_a = context.program.getResolvedModuleFromModuleSpecifier(importDeclaration.moduleSpecifier)) == null ? void 0 : _a.resolvedModule; if (!resolvedModule) return void 0; return context.program.getSourceFile(resolvedModule.resolvedFileName); @@ -418495,7 +422937,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isFunctionType) { const sig = checker.getSignatureFromDeclaration(declaration); if (sig) { - if (hasSyntacticModifier(declaration, 512 /* Async */)) { + if (hasSyntacticModifier(declaration, 1024 /* Async */)) { exprType = checker.createPromiseType(exprType); } const newSig = checker.createSignature( @@ -418543,6 +422985,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!declaration || !isCallExpression(declaration.parent) || !declaration.body) return void 0; const pos = declaration.parent.arguments.indexOf(declaration); + if (pos === -1) + return void 0; const type = checker.getContextualTypeForArgumentAtIndex(declaration.parent, pos); if (!type) return void 0; @@ -418571,19 +423015,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getVariableLikeInitializer(declaration) { switch (declaration.kind) { - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: - case 207 /* BindingElement */: - case 171 /* PropertyDeclaration */: - case 302 /* PropertyAssignment */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: + case 208 /* BindingElement */: + case 172 /* PropertyDeclaration */: + case 303 /* PropertyAssignment */: return declaration.initializer; - case 290 /* JsxAttribute */: + case 291 /* JsxAttribute */: return declaration.initializer && (isJsxExpression(declaration.initializer) ? declaration.initializer.expression : void 0); - case 303 /* ShorthandPropertyAssignment */: - case 170 /* PropertySignature */: - case 305 /* EnumMember */: - case 354 /* JSDocPropertyTag */: - case 347 /* JSDocParameterTag */: + case 304 /* ShorthandPropertyAssignment */: + case 171 /* PropertySignature */: + case 306 /* EnumMember */: + case 355 /* JSDocPropertyTag */: + case 348 /* JSDocParameterTag */: return void 0; } } @@ -418718,7 +423162,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; @@ -418734,7 +423193,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()); @@ -418765,13 +423224,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const moduleDeclaration = find(symbol.declarations, isModuleDeclaration); const moduleDeclarationSourceFile = moduleDeclaration == null ? void 0 : moduleDeclaration.getSourceFile(); if (moduleDeclaration && moduleDeclarationSourceFile && !isSourceFileFromLibrary(program, moduleDeclarationSourceFile)) { - return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile, modifierFlags: 1 /* Export */, parentDeclaration: moduleDeclaration }; + return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleDeclaration }; } const moduleSourceFile = find(symbol.declarations, isSourceFile); if (sourceFile.commonJsModuleIndicator) return void 0; if (moduleSourceFile && !isSourceFileFromLibrary(program, moduleSourceFile)) { - return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile: moduleSourceFile, modifierFlags: 1 /* Export */, parentDeclaration: moduleSourceFile }; + return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile: moduleSourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleSourceFile }; } } const classDeclaration = find(symbol.declarations, isClassLike); @@ -418783,7 +423242,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (makeStatic && (isPrivateIdentifier(token) || isInterfaceDeclaration(declaration))) return void 0; const declSourceFile = declaration.getSourceFile(); - const modifierFlags = isTypeLiteralNode(declaration) ? 0 /* None */ : (makeStatic ? 32 /* Static */ : 0 /* None */) | (startsWithUnderscore(token.text) ? 8 /* Private */ : 0 /* None */); + const modifierFlags = isTypeLiteralNode(declaration) ? 0 /* None */ : (makeStatic ? 256 /* Static */ : 0 /* None */) | (startsWithUnderscore(token.text) ? 2 /* Private */ : 0 /* None */); const isJSFile = isSourceFileJS(declSourceFile); const call = tryCast(parent2.parent, isCallExpression); return { kind: 0 /* TypeLikeDeclaration */, token, call, modifierFlags, parentDeclaration: declaration, declSourceFile, isJSFile }; @@ -418801,17 +423260,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isInterfaceDeclaration(parentDeclaration) || isTypeLiteralNode(parentDeclaration)) { return void 0; } - const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingMemberInJs(t, declSourceFile, parentDeclaration, token, !!(modifierFlags & 32 /* Static */))); + const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addMissingMemberInJs(t, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256 /* Static */))); if (changes.length === 0) { return void 0; } - const diagnostic = modifierFlags & 32 /* Static */ ? Diagnostics.Initialize_static_property_0 : isPrivateIdentifier(token) ? Diagnostics.Declare_a_private_field_named_0 : Diagnostics.Initialize_property_0_in_the_constructor; + const diagnostic = modifierFlags & 256 /* Static */ ? Diagnostics.Initialize_static_property_0 : isPrivateIdentifier(token) ? Diagnostics.Declare_a_private_field_named_0 : Diagnostics.Initialize_property_0_in_the_constructor; return createCodeFixAction(fixMissingMember, changes, [diagnostic, token.text], fixMissingMember, Diagnostics.Add_all_missing_members); } function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) { const tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 230 /* ClassExpression */) { + if (classDeclaration.kind === 231 /* ClassExpression */) { return; } const className = classDeclaration.name.getText(); @@ -418849,22 +423308,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function createActionsForAddMissingMemberInTypeScriptFile(context, { parentDeclaration, declSourceFile, modifierFlags, token }) { const memberName = token.text; - const isStatic2 = modifierFlags & 32 /* Static */; + const isStatic2 = modifierFlags & 256 /* Static */; const typeNode = getTypeNode2(context.program.getTypeChecker(), parentDeclaration, token); const addPropertyDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addPropertyDeclaration(t, declSourceFile, parentDeclaration, memberName, typeNode, modifierFlags2)); - const actions2 = [createCodeFixAction(fixMissingMember, addPropertyDeclarationChanges(modifierFlags & 32 /* Static */), [isStatic2 ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0, memberName], fixMissingMember, Diagnostics.Add_all_missing_members)]; + const actions2 = [createCodeFixAction(fixMissingMember, addPropertyDeclarationChanges(modifierFlags & 256 /* Static */), [isStatic2 ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0, memberName], fixMissingMember, Diagnostics.Add_all_missing_members)]; if (isStatic2 || isPrivateIdentifier(token)) { return actions2; } - if (modifierFlags & 8 /* Private */) { - actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges(8 /* Private */), [Diagnostics.Declare_private_property_0, memberName])); + if (modifierFlags & 2 /* Private */) { + actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges(2 /* Private */), [Diagnostics.Declare_private_property_0, memberName])); } actions2.push(createAddIndexSignatureAction(context, declSourceFile, parentDeclaration, token.text, typeNode)); return actions2; } function getTypeNode2(checker, node, token) { let typeNode; - if (token.parent.parent.kind === 225 /* BinaryExpression */) { + if (token.parent.parent.kind === 226 /* BinaryExpression */) { const binaryExpression = token.parent.parent; const otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; const widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -418942,20 +423401,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (call === void 0) { return void 0; } - if (isPrivateIdentifier(token)) { - return void 0; - } const methodName = token.text; const addMethodDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addMethodDeclaration(context, t, call, token, modifierFlags2, parentDeclaration, declSourceFile)); - const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags & 32 /* Static */), [modifierFlags & 32 /* Static */ ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, methodName], fixMissingMember, Diagnostics.Add_all_missing_members)]; - if (modifierFlags & 8 /* Private */) { - actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges(8 /* Private */), [Diagnostics.Declare_private_method_0, methodName])); + const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags & 256 /* Static */), [modifierFlags & 256 /* Static */ ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, methodName], fixMissingMember, Diagnostics.Add_all_missing_members)]; + if (modifierFlags & 2 /* Private */) { + actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges(2 /* Private */), [Diagnostics.Declare_private_method_0, methodName])); } return actions2; } function addMethodDeclaration(context, changes, callExpression, name, modifierFlags, parentDeclaration, sourceFile) { const importAdder = createImportAdder(sourceFile, context.program, context.preferences, context.host); - const kind = isClassLike(parentDeclaration) ? 173 /* MethodDeclaration */ : 172 /* MethodSignature */; + const kind = isClassLike(parentDeclaration) ? 174 /* MethodDeclaration */ : 173 /* MethodSignature */; const signatureDeclaration = createSignatureDeclarationFromCallExpression(kind, context, importAdder, callExpression, name, modifierFlags, parentDeclaration); const containingMethodDeclaration = tryGetContainingMethodDeclaration(parentDeclaration, callExpression); if (containingMethodDeclaration) { @@ -418970,22 +423426,20 @@ ${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); const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host); - const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(261 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature( - 261 /* FunctionDeclaration */, + const functionDeclaration = info.kind === 2 /* Function */ ? createSignatureDeclarationFromCallExpression(262 /* FunctionDeclaration */, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) : createSignatureDeclarationFromSignature( + 262 /* FunctionDeclaration */, context, quotePreference, info.signature, @@ -419082,7 +423536,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)); } @@ -419134,7 +423588,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (signature === void 0) return createUndefined(); const func = createSignatureDeclarationFromSignature( - 217 /* FunctionExpression */, + 218 /* FunctionExpression */, context, quotePreference, signature[0], @@ -419214,7 +423668,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (prop && isComputedPropertyName(prop)) return prop; } - return createPropertyNameNodeForIdentifierOrLiteral(symbol.name, target, quotePreference === 0 /* Single */); + return createPropertyNameNodeForIdentifierOrLiteral( + symbol.name, + target, + quotePreference === 0 /* Single */, + /*stringNamed*/ + false, + /*isMethod*/ + false + ); } function findScope(node) { if (findAncestor(node, isJsxExpression)) { @@ -419278,7 +423740,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 */)) { @@ -419310,13 +423772,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} continue; const { parentDeclaration, declSourceFile, modifierFlags, token, call, isJSFile } = info; if (call && !isPrivateIdentifier(token)) { - addMethodDeclaration(context, changes, call, token, modifierFlags & 32 /* Static */, parentDeclaration, declSourceFile); + addMethodDeclaration(context, changes, call, token, modifierFlags & 256 /* Static */, parentDeclaration, declSourceFile); } else { if (isJSFile && !isInterfaceDeclaration(parentDeclaration) && !isTypeLiteralNode(parentDeclaration)) { - addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags & 32 /* Static */)); + addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256 /* Static */)); } else { const typeNode = getTypeNode2(checker, parentDeclaration, token); - addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags & 32 /* Static */); + addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags & 256 /* Static */); } } } @@ -419362,6 +423824,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 }; @@ -419378,7 +424074,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"; @@ -419387,12 +424083,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); @@ -419411,7 +424107,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; @@ -419448,20 +424144,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function symbolPointsToNonPrivateAndAbstractMember(symbol) { const flags = getSyntacticModifierFlags(first(symbol.getDeclarations())); - return !(flags & 8 /* Private */) && !!(flags & 256 /* Abstract */); + 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)); @@ -419470,7 +424166,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); @@ -419482,7 +424178,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); } @@ -419497,36 +424193,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); } }); } @@ -419540,7 +424236,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*/ @@ -419550,69 +424246,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; @@ -419627,7 +424320,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*/ @@ -419642,36 +424335,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); } }); } @@ -419687,8 +424380,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_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(); @@ -419727,32 +424421,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))) }); } }); @@ -419778,16 +424472,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); @@ -419798,7 +424492,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); @@ -419808,17 +424502,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"; @@ -419826,27 +424520,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); }) }); } @@ -419856,7 +424550,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; @@ -419864,7 +424558,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"; @@ -419872,16 +424566,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, @@ -419889,7 +424583,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, @@ -419903,7 +424597,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 = { @@ -419950,7 +424644,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; @@ -419962,7 +424656,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"; @@ -419970,16 +424664,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)); @@ -419990,8 +424684,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)); } @@ -420011,18 +424705,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} // src/services/codefixes/fixUnreferenceableDecoratorMetadata.ts function getImportDeclaration(sourceFile, program, start) { const identifier = tryCast(getTokenAtPosition(sourceFile, start), isIdentifier); - if (!identifier || identifier.parent.kind !== 182 /* TypeReference */) + if (!identifier || identifier.parent.kind !== 183 /* TypeReference */) return; const checker = program.getTypeChecker(); const symbol = checker.getSymbolAtLocation(identifier); return find((symbol == null ? void 0 : symbol.declarations) || emptyArray, or(isImportClause, isImportSpecifier, isImportEqualsDeclaration)); } function doTypeOnlyImportChange(changes, sourceFile, importDeclaration, program) { - if (importDeclaration.kind === 270 /* ImportEqualsDeclaration */) { + if (importDeclaration.kind === 271 /* ImportEqualsDeclaration */) { changes.insertModifierBefore(sourceFile, 156 /* TypeKeyword */, importDeclaration.name); return; } - const importClause = importDeclaration.kind === 272 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent; + const importClause = importDeclaration.kind === 273 /* ImportClause */ ? importDeclaration : importDeclaration.parent.parent; if (importClause.name && importClause.namedBindings) { return; } @@ -420039,28 +424733,28 @@ ${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) return; - const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 275 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program)); + const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => importDeclaration.kind === 276 /* ImportSpecifier */ && doNamespaceImportChange(t, context.sourceFile, importDeclaration, context.program)); const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context, (t) => doTypeOnlyImportChange(t, context.sourceFile, importDeclaration, context.program)); let actions2; if (namespaceChanges.length) { actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, namespaceChanges, Diagnostics.Convert_named_imports_to_namespace_import)); } if (typeOnlyChanges.length) { - actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, typeOnlyChanges, Diagnostics.Convert_to_type_only_import)); + actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, typeOnlyChanges, Diagnostics.Use_import_type)); } return actions2; }, @@ -420080,7 +424774,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} changes.delete(sourceFile, Debug.checkDefined(cast(token.parent, isDeclarationWithTypeParameterChildren).typeParameters, "The type parameter to delete should exist")); } function isImport(token) { - return token.kind === 102 /* ImportKeyword */ || token.kind === 80 /* Identifier */ && (token.parent.kind === 275 /* ImportSpecifier */ || token.parent.kind === 272 /* ImportClause */); + return token.kind === 102 /* ImportKeyword */ || token.kind === 80 /* Identifier */ && (token.parent.kind === 276 /* ImportSpecifier */ || token.parent.kind === 273 /* ImportClause */); } function tryGetFullImport(token) { return token.kind === 102 /* ImportKeyword */ ? tryCast(token.parent, isImportDeclaration) : void 0; @@ -420089,7 +424783,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return isVariableDeclarationList(token.parent) && first(token.parent.getChildren(sourceFile)) === token; } function deleteEntireVariableStatement(changes, sourceFile, node) { - changes.delete(sourceFile, node.parent.kind === 242 /* VariableStatement */ ? node.parent : node); + changes.delete(sourceFile, node.parent.kind === 243 /* VariableStatement */ ? node.parent : node); } function deleteDestructuringElements(changes, sourceFile, node) { forEach(node.elements, (n) => changes.delete(sourceFile, n)); @@ -420131,14 +424825,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function canPrefix(token) { switch (token.parent.kind) { - case 168 /* Parameter */: - case 167 /* TypeParameter */: + case 169 /* Parameter */: + case 168 /* TypeParameter */: return true; - case 259 /* VariableDeclaration */: { + case 260 /* VariableDeclaration */: { const varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 249 /* ForOfStatement */: - case 248 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 249 /* ForInStatement */: return true; } } @@ -420187,8 +424881,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) { const { parent: parent2 } = parameter; switch (parent2.kind) { - case 173 /* MethodDeclaration */: - case 175 /* Constructor */: + case 174 /* MethodDeclaration */: + case 176 /* Constructor */: const index = parent2.parameters.indexOf(parameter); const referent = isMethodDeclaration(parent2) ? parent2.name : parent2; const entries = ts_FindAllReferences_exports.Core.getReferencedSymbolsForNode(parent2.pos, referent, program, sourceFiles, cancellationToken); @@ -420206,25 +424900,25 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } return true; - case 261 /* FunctionDeclaration */: { + case 262 /* FunctionDeclaration */: { if (parent2.name && isCallbackLike(checker, sourceFile, parent2.name)) { return isLastParameter(parent2, parameter, isFixAll); } return true; } - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return isLastParameter(parent2, parameter, isFixAll); - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return false; - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return true; default: return Debug.failBadSyntaxKind(parent2); } } function isCallbackLike(checker, sourceFile, name) { - return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.indexOf(reference) >= 0); + return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.includes(reference)); } function isLastParameter(func, parameter, isFixAll) { const parameters = func.parameters; @@ -420235,7 +424929,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"; @@ -420246,7 +424940,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, @@ -420256,7 +424950,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(); @@ -420342,7 +425036,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: @@ -420414,7 +425108,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)) { @@ -420430,7 +425124,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const container = (isBlock(statement.parent) ? statement.parent : statement).parent; if (!isBlock(statement.parent) || statement === first(statement.parent.statements)) { switch (container.kind) { - case 244 /* IfStatement */: + case 245 /* IfStatement */: if (container.elseStatement) { if (isBlock(statement.parent)) { break; @@ -420439,8 +425133,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return; } - case 246 /* WhileStatement */: - case 247 /* ForStatement */: + case 247 /* WhileStatement */: + case 248 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -420462,31 +425156,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); @@ -420499,28 +425193,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*/ @@ -420529,29 +425223,29 @@ ${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) }; } function isTypeContainer(node) { switch (node.kind) { - case 233 /* AsExpression */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 261 /* FunctionDeclaration */: - case 176 /* GetAccessor */: - case 180 /* IndexSignature */: - case 199 /* MappedType */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 168 /* Parameter */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 177 /* SetAccessor */: - case 264 /* TypeAliasDeclaration */: - case 215 /* TypeAssertionExpression */: - case 259 /* VariableDeclaration */: + case 234 /* AsExpression */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 262 /* FunctionDeclaration */: + case 177 /* GetAccessor */: + case 181 /* IndexSignature */: + case 200 /* MappedType */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 169 /* Parameter */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 178 /* SetAccessor */: + case 265 /* TypeAliasDeclaration */: + case 216 /* TypeAssertionExpression */: + case 260 /* VariableDeclaration */: return true; default: return false; @@ -420569,7 +425263,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"; @@ -420577,28 +425271,28 @@ ${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; const original = typeNode.getText(sourceFile); const actions2 = [fix(type, fixIdPlain, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 320 /* JSDocNullableType */) { + if (typeNode.kind === 321 /* JSDocNullableType */) { actions2.push(fix(type, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); } 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); } }, @@ -420606,13 +425300,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 === 320 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; - doChange28(changes, sourceFile, typeNode, fixedType, checker); + const fixedType = typeNode.kind === 321 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + doChange29(changes, sourceFile, typeNode, fixedType, checker); }); } }); @@ -420620,7 +425314,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) { @@ -420637,31 +425331,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); }) }); } @@ -420684,14 +425378,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } let insertBefore; switch (containingFunction.kind) { - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: insertBefore = findChildOfKind(containingFunction, 100 /* FunctionKeyword */, sourceFile); break; - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: const kind = containingFunction.typeParameters ? 30 /* LessThanToken */ : 21 /* OpenParenToken */; insertBefore = findChildOfKind(containingFunction, kind, sourceFile) || first(containingFunction.parameters); break; @@ -420703,7 +425397,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") { @@ -420712,36 +425406,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); }); } }); @@ -420749,7 +425444,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) { @@ -420776,28 +425471,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); @@ -420844,7 +425539,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; } @@ -420998,7 +425693,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { const typeNode = getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (isInJSFile(sourceFile) && declaration.kind !== 170 /* PropertySignature */) { + if (isInJSFile(sourceFile) && declaration.kind !== 171 /* PropertySignature */) { const parent2 = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : declaration; if (!parent2) { return; @@ -421109,17 +425804,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { let searchToken; switch (containingFunction.kind) { - case 175 /* Constructor */: + case 176 /* Constructor */: searchToken = findChildOfKind(containingFunction, 137 /* ConstructorKeyword */, sourceFile); break; - case 218 /* ArrowFunction */: - case 217 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 218 /* FunctionExpression */: const parent2 = containingFunction.parent; searchToken = (isVariableDeclaration(parent2) || isPropertyDeclaration(parent2)) && isIdentifier(parent2.name) ? parent2.name : containingFunction.name; break; - case 261 /* FunctionDeclaration */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 262 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: searchToken = containingFunction.name; break; } @@ -421255,44 +425950,44 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} node = node.parent; } switch (node.parent.kind) { - case 243 /* ExpressionStatement */: + case 244 /* ExpressionStatement */: inferTypeFromExpressionStatement(node, usage); break; - case 224 /* PostfixUnaryExpression */: + case 225 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 223 /* PrefixUnaryExpression */: + case 224 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 295 /* CaseClause */: - case 296 /* DefaultClause */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 212 /* CallExpression */: - case 213 /* NewExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } else { inferTypeFromContextualType(node, usage); } break; - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 211 /* ElementAccessExpression */: + case 212 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 259 /* VariableDeclaration */: { + case 260 /* VariableDeclaration */: { const { name, initializer } = node.parent; if (node === name) { if (initializer) { @@ -421392,7 +426087,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} break; case 57 /* BarBarToken */: case 61 /* QuestionQuestionToken */: - if (node === parent2.left && (node.parent.parent.kind === 259 /* VariableDeclaration */ || isAssignmentExpression( + if (node === parent2.left && (node.parent.parent.kind === 260 /* VariableDeclaration */ || isAssignmentExpression( node.parent.parent, /*excludeCompoundAssignment*/ true @@ -421420,7 +426115,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } calculateUsageOfNode(parent2, call.return_); - if (parent2.kind === 212 /* CallExpression */) { + if (parent2.kind === 213 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { (usage.constructs || (usage.constructs = [])).push(call); @@ -421741,14 +426436,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 @@ -421782,13 +426477,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, @@ -421808,8 +426503,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); }); } }); @@ -421817,7 +426512,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; } @@ -421840,47 +426535,43 @@ ${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, - [ - Diagnostics.Replace_0_with_Promise_1, - checker.typeToString(returnType), - checker.typeToString(promisedType) - ], + [Diagnostics.Replace_0_with_Promise_1, checker.typeToString(returnType), checker.typeToString(promisedType)], fixId39, 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); } }) }); @@ -421894,7 +426585,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"; @@ -421902,12 +426593,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())) { @@ -421919,7 +426610,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} createCodeFixActionWithoutFixAll( fixName4, [createFileTextChanges(sourceFile.fileName, [ - createTextChange(sourceFile.checkJsDirective ? createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) : createTextSpan(0, 0), `// @ts-nocheck${newLineCharacter}`) + createTextChange( + sourceFile.checkJsDirective ? createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) : createTextSpan(0, 0), + `// @ts-nocheck${newLineCharacter}` + ) ])], Diagnostics.Disable_checking_for_this_file ) @@ -421932,7 +426626,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); } @@ -421969,28 +426663,25 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, context, preferences, importAdder, addClassElement, body, preserveOptional = 3 /* All */, isAmbient = false) { const declarations = symbol.getDeclarations(); - const declaration = declarations == null ? void 0 : declarations[0]; + const declaration = firstOrUndefined(declarations); const checker = context.program.getTypeChecker(); const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions()); - const kind = (declaration == null ? void 0 : declaration.kind) ?? 170 /* PropertySignature */; - const declarationName = getSynthesizedDeepClone( - getNameOfDeclaration(declaration), - /*includeTrivia*/ - false - ); + const kind = (declaration == null ? void 0 : declaration.kind) ?? 171 /* PropertySignature */; + const declarationName = createDeclarationName(symbol, declaration); const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */; - let modifierFlags = effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */; + let modifierFlags = effectiveModifierFlags & 256 /* Static */; + modifierFlags |= effectiveModifierFlags & 1 /* Public */ ? 1 /* Public */ : effectiveModifierFlags & 4 /* Protected */ ? 4 /* Protected */ : 0 /* None */; if (declaration && isAutoAccessorPropertyDeclaration(declaration)) { - modifierFlags |= 128 /* Accessor */; + modifierFlags |= 512 /* Accessor */; } const modifiers = createModifiers(); const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); const optional = !!(symbol.flags & 16777216 /* Optional */); - const ambient = !!(enclosingDeclaration.flags & 16777216 /* Ambient */) || isAmbient; + const ambient = !!(enclosingDeclaration.flags & 33554432 /* Ambient */) || isAmbient; const quotePreference = getQuotePreference(sourceFile, preferences); switch (kind) { - case 170 /* PropertySignature */: - case 171 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 172 /* PropertyDeclaration */: const flags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : void 0; let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -422009,8 +426700,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} void 0 )); break; - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: { + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: { Debug.assertIsDefined(declarations); let typeNode2 = checker.typeToTypeNode( type, @@ -422058,8 +426749,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } break; } - case 172 /* MethodSignature */: - case 173 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 174 /* MethodDeclaration */: Debug.assertIsDefined(declarations); const signatures = type.isUnion() ? flatMap(type.types, (t) => t.getCallSignatures()) : type.getCallSignatures(); if (!some(signatures)) { @@ -422086,7 +426777,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} break; } function outputMethod(quotePreference2, signature, modifiers2, name, body2) { - const method = createSignatureDeclarationFromSignature(173 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder); + const method = createSignatureDeclarationFromSignature(174 /* MethodDeclaration */, context, quotePreference2, signature, body2, name, modifiers2, optional && !!(preserveOptional & 1 /* Method */), enclosingDeclaration, importAdder); if (method) addClassElement(method); } @@ -422096,7 +426787,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} modifiers2 = combine(modifiers2, factory.createModifiersFromModifierFlags(modifierFlags)); } if (shouldAddOverrideKeyword()) { - modifiers2 = append(modifiers2, factory.createToken(163 /* OverrideKeyword */)); + modifiers2 = append(modifiers2, factory.createToken(164 /* OverrideKeyword */)); } return modifiers2 && factory.createNodeArray(modifiers2); } @@ -422127,6 +426818,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} false ); } + function createDeclarationName(symbol2, declaration2) { + if (getCheckFlags(symbol2) & 262144 /* Mapped */) { + const nameType = symbol2.links.nameType; + if (nameType && isTypeUsableAsPropertyName(nameType)) { + return factory.createIdentifier(unescapeLeadingUnderscores(getPropertyNameFromType(nameType))); + } + } + return getSynthesizedDeepClone( + getNameOfDeclaration(declaration2), + /*includeTrivia*/ + false + ); + } } function createSignatureDeclarationFromSignature(kind, context, quotePreference, signature, body, name, modifiers, optional, enclosingDeclaration, importAdder) { const program = context.program; @@ -422234,8 +426938,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} instanceTypes, contextNode, scriptTarget, - /*flags*/ - void 0, + 1 /* NoTruncation */, tracker ); const modifiers = modifierFlags ? factory.createNodeArray(factory.createModifiersFromModifierFlags(modifierFlags)) : void 0; @@ -422257,7 +426960,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} tracker ); switch (kind) { - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: return factory.createMethodDeclaration( modifiers, asteriskToken, @@ -422269,7 +426972,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} type, createStubbedMethodBody(quotePreference) ); - case 172 /* MethodSignature */: + case 173 /* MethodSignature */: return factory.createMethodSignature( modifiers, name, @@ -422279,7 +426982,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} parameters, type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type ); - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: + Debug.assert(typeof name === "string" || isIdentifier(name), "Unexpected name"); return factory.createFunctionDeclaration( modifiers, asteriskToken, @@ -422501,14 +427205,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; const compilerOptionsProperty = findJsonProperty(tsconfigObjectLiteral, "compilerOptions"); if (compilerOptionsProperty === void 0) { - changeTracker.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, createJsonPropertyAssignment( - "compilerOptions", - factory.createObjectLiteralExpression( - options.map(([optionName, optionValue]) => createJsonPropertyAssignment(optionName, optionValue)), - /*multiLine*/ - true + changeTracker.insertNodeAtObjectStart( + configFile, + tsconfigObjectLiteral, + createJsonPropertyAssignment( + "compilerOptions", + factory.createObjectLiteralExpression( + options.map(([optionName, optionValue]) => createJsonPropertyAssignment(optionName, optionValue)), + /*multiLine*/ + true + ) ) - )); + ); return; } const compilerOptions = compilerOptionsProperty.initializer; @@ -422548,7 +427256,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) { @@ -422643,24 +427356,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return isIdentifier(fieldName) ? factory.createPropertyAccessExpression(leftHead, fieldName) : factory.createElementAccessExpression(leftHead, factory.createStringLiteralFromNode(fieldName)); } function prepareModifierFlagsForAccessor(modifierFlags) { - modifierFlags &= ~64 /* Readonly */; - modifierFlags &= ~8 /* Private */; - if (!(modifierFlags & 16 /* Protected */)) { - modifierFlags |= 4 /* Public */; + modifierFlags &= ~8 /* Readonly */; + modifierFlags &= ~2 /* Private */; + if (!(modifierFlags & 4 /* Protected */)) { + modifierFlags |= 1 /* Public */; } return modifierFlags; } function prepareModifierFlagsForField(modifierFlags) { - modifierFlags &= ~4 /* Public */; - modifierFlags &= ~16 /* Protected */; - modifierFlags |= 8 /* Private */; + modifierFlags &= ~1 /* Public */; + modifierFlags &= ~4 /* Protected */; + modifierFlags |= 2 /* Private */; return modifierFlags; } function getAccessorConvertiblePropertyAtPosition(file, program, start, end, considerEmptySpans = true) { const node = getTokenAtPosition(file, start); const cursorRequest = start === end && considerEmptySpans; const declaration = findAncestor(node.parent, isAcceptedDeclaration); - const meaning = 28 /* AccessibilityModifier */ | 32 /* Static */ | 64 /* Readonly */; + const meaning = 7 /* AccessibilityModifier */ | 256 /* Static */ | 8 /* Readonly */; if (!declaration || !(nodeOverlapsWithStartEnd(declaration.name, file, start, end) || cursorRequest)) { return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_property_for_which_to_generate_accessor) @@ -422671,7 +427384,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} error: getLocaleSpecificMessage(Diagnostics.Name_is_not_valid) }; } - if ((getEffectiveModifierFlags(declaration) & 126975 /* Modifier */ | meaning) !== meaning) { + if ((getEffectiveModifierFlags(declaration) & 98303 /* Modifier */ | meaning) !== meaning) { return { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_property_with_modifier) }; @@ -422684,7 +427397,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} isStatic: hasStaticModifier(declaration), isReadonly: hasEffectiveReadonlyModifier(declaration), type: getDeclarationType(declaration, program), - container: declaration.kind === 168 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 169 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration, fieldName, @@ -422765,11 +427478,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } else if (isPropertyAssignment(declaration)) { updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName); } else { - changeTracker.replaceNode( - file, - declaration, - factory.updateParameterDeclaration(declaration, modifiers, declaration.dotDotDotToken, cast(fieldName, isIdentifier), declaration.questionToken, declaration.type, declaration.initializer) - ); + changeTracker.replaceNode(file, declaration, factory.updateParameterDeclaration(declaration, modifiers, declaration.dotDotDotToken, cast(fieldName, isIdentifier), declaration.questionToken, declaration.type, declaration.initializer)); } } function insertAccessor(changeTracker, file, accessor, declaration, container) { @@ -422839,14 +427548,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} getQuotePreference(sourceFile, context.preferences) ))); if (getEmitModuleKind(opts) === 1 /* CommonJS */) { - variations.push(createAction(context, sourceFile, node, factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - namespace.name, - factory.createExternalModuleReference(node.moduleSpecifier) - ))); + variations.push(createAction( + context, + sourceFile, + node, + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + namespace.name, + factory.createExternalModuleReference(node.moduleSpecifier) + ) + )); } return variations; } @@ -422856,7 +427570,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getActionsForUsageOfInvalidImport(context) { const sourceFile = context.sourceFile; - const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 212 /* CallExpression */ : 213 /* NewExpression */; + const targetKind = Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 213 /* CallExpression */ : 214 /* NewExpression */; const node = findAncestor(getTokenAtPosition(sourceFile, context.span.start), (a) => a.kind === targetKind); if (!node) { return []; @@ -422924,7 +427638,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); @@ -423011,7 +427725,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return firstDefined(type.types, (t) => getDefaultValueFromType(checker, t)); } else if (type.isClass()) { const classDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); - if (!classDeclaration || hasSyntacticModifier(classDeclaration, 256 /* Abstract */)) + if (!classDeclaration || hasSyntacticModifier(classDeclaration, 64 /* Abstract */)) return void 0; const constructorDeclaration = getFirstConstructorWithBody(classDeclaration); if (constructorDeclaration && constructorDeclaration.parameters.length) @@ -423028,7 +427742,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"; @@ -423038,11 +427752,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 = []; @@ -423053,8 +427767,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) { @@ -423081,30 +427795,34 @@ ${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, statement, defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( - /*modifiers*/ - void 0, - /*isTypeOnly*/ - false, - defaultImportName, - factory.createExternalModuleReference(required) - ) : factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.createImportClause( + changes.replaceNode( + sourceFile, + statement, + defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, /*isTypeOnly*/ false, defaultImportName, - namedImports - ), - required, - /*assertClause*/ - void 0 - )); + factory.createExternalModuleReference(required) + ) : factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + defaultImportName, + namedImports + ), + required, + /*attributes*/ + void 0 + ) + ); } - function getInfo17(sourceFile, program, pos) { + function getInfo18(sourceFile, program, pos) { const { parent: parent2 } = getTokenAtPosition(sourceFile, pos); if (!isRequireCall( parent2, @@ -423143,29 +427861,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); } }) }); @@ -423173,7 +427891,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; @@ -423185,7 +427903,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*/ @@ -423194,29 +427912,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); }) }); } @@ -423231,18 +427949,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) { @@ -423251,7 +427969,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)); } }); } @@ -423261,14 +427979,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getImportTypeNode(sourceFile, pos) { const token = getTokenAtPosition(sourceFile, pos); Debug.assert(token.kind === 102 /* ImportKeyword */, "This token should be an ImportKeyword"); - Debug.assert(token.parent.kind === 204 /* ImportType */, "Token parent should be an ImportType"); + 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, - importType.assertions, + importType.attributes, importType.qualifier, importType.typeArguments, /*isTypeOf*/ @@ -423276,7 +427994,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"; @@ -423284,17 +428002,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))) }); } }); @@ -423313,7 +428031,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())); @@ -423336,37 +428054,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) @@ -423379,7 +428097,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); @@ -423406,48 +428124,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) { @@ -423487,18 +428205,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) { @@ -423507,7 +428225,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)); } }); } @@ -423522,43 +428240,51 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return; } const importClause = Debug.checkDefined(importDeclaration.importClause); - changes.replaceNode(context.sourceFile, importDeclaration, factory.updateImportDeclaration( + changes.replaceNode( + context.sourceFile, importDeclaration, - importDeclaration.modifiers, - factory.updateImportClause( - importClause, - importClause.isTypeOnly, - importClause.name, - /*namedBindings*/ - void 0 - ), - importDeclaration.moduleSpecifier, - importDeclaration.assertClause - )); - changes.insertNodeAfter(context.sourceFile, importDeclaration, factory.createImportDeclaration( - /*modifiers*/ - void 0, - factory.updateImportClause( - importClause, - importClause.isTypeOnly, - /*name*/ + factory.updateImportDeclaration( + importDeclaration, + importDeclaration.modifiers, + factory.updateImportClause( + importClause, + importClause.isTypeOnly, + importClause.name, + /*namedBindings*/ + void 0 + ), + importDeclaration.moduleSpecifier, + importDeclaration.attributes + ) + ); + changes.insertNodeAfter( + context.sourceFile, + importDeclaration, + factory.createImportDeclaration( + /*modifiers*/ void 0, - importClause.namedBindings - ), - importDeclaration.moduleSpecifier, - importDeclaration.assertClause - )); + factory.updateImportClause( + importClause, + importClause.isTypeOnly, + /*name*/ + void 0, + importClause.namedBindings + ), + importDeclaration.moduleSpecifier, + importDeclaration.attributes + ) + ); } - 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) => { @@ -423568,15 +428294,15 @@ ${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, error) => { - splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error), context); + getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, error2) => { + splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error2), context); }) }); } }); // 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)); @@ -423590,36 +428316,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; @@ -423632,15 +428358,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"; @@ -423648,15 +428374,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, @@ -423666,10 +428392,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); }) }); } @@ -423725,7 +428451,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"; @@ -423733,12 +428459,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)); @@ -423747,7 +428473,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())); } }); } @@ -423782,7 +428508,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} getFixes: () => getFixes, getImportCompletionAction: () => getImportCompletionAction, getImportKind: () => getImportKind, - getJSDocTypedefNode: () => getJSDocTypedefNode, + getJSDocTypedefNodes: () => getJSDocTypedefNodes, getNoopSymbolTrackerWithResolver: () => getNoopSymbolTrackerWithResolver, getPromoteTypeOnlyCompletionAction: () => getPromoteTypeOnlyCompletionAction, getSupportedErrorCodes: () => getSupportedErrorCodes, @@ -423831,6 +428557,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} init_returnValueCorrect(); init_fixAddMissingMember(); init_fixAddMissingNewOperator(); + init_fixAddMissingParam(); init_fixCannotFindModule(); init_fixClassDoesntImplementInheritedAbstractMember(); init_fixClassSuperMustPrecedeThisAccess(); @@ -424489,7 +429216,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ); if (keywordFilters !== 0 /* None */) { for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) { - if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !uniqueNames.has(keywordEntry.name)) { + if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !isTypeOnlyLocation && isContextualKeywordInAutoImportableExpressionSpace(keywordEntry.name) || !uniqueNames.has(keywordEntry.name)) { uniqueNames.add(keywordEntry.name); insertSorted( entries, @@ -424627,14 +429354,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function typeNodeToExpression(typeNode, languageVersion, quotePreference) { switch (typeNode.kind) { - case 182 /* TypeReference */: + case 183 /* TypeReference */: const typeName = typeNode.typeName; return entityNameToExpression(typeName, languageVersion, quotePreference); - case 198 /* IndexedAccessType */: + case 199 /* IndexedAccessType */: const objectExpression = typeNodeToExpression(typeNode.objectType, languageVersion, quotePreference); const indexExpression = typeNodeToExpression(typeNode.indexType, languageVersion, quotePreference); return objectExpression && indexExpression && factory.createElementAccessExpression(objectExpression, indexExpression); - case 200 /* LiteralType */: + case 201 /* LiteralType */: const literal = typeNode.literal; switch (literal.kind) { case 11 /* StringLiteral */: @@ -424643,12 +429370,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return factory.createNumericLiteral(literal.text, literal.numericLiteralFlags); } return void 0; - case 195 /* ParenthesizedType */: + case 196 /* ParenthesizedType */: const exp = typeNodeToExpression(typeNode.type, languageVersion, quotePreference); return exp && (isIdentifier(exp) ? exp : factory.createParenthesizedExpression(exp)); - case 185 /* TypeQuery */: + case 186 /* TypeQuery */: return entityNameToExpression(typeNode.exprName, languageVersion, quotePreference); - case 204 /* ImportType */: + case 205 /* ImportType */: Debug.fail(`We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.`); } return void 0; @@ -424683,12 +429410,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getJsxClosingTagCompletion(location, sourceFile) { const jsxClosingElement = findAncestor(location, (node) => { switch (node.kind) { - case 286 /* JsxClosingElement */: + case 287 /* JsxClosingElement */: return true; case 44 /* SlashToken */: case 32 /* GreaterThanToken */: case 80 /* Identifier */: - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: return false; default: return "quit"; @@ -424735,7 +429462,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) { + var _a, _b; let insertText; + let filterText; let replacementSpan = getReplacementSpanForContextToken(replacementToken); let data; let isSnippet; @@ -424792,13 +429521,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) { hasAction = true; } + if (completionKind === 0 /* ObjectPropertyDeclaration */ && contextToken && ((_a = findPrecedingToken(contextToken.pos, sourceFile, contextToken)) == null ? void 0 : _a.kind) !== 28 /* CommaToken */) { + if (isMethodDeclaration(contextToken.parent.parent) || isGetAccessorDeclaration(contextToken.parent.parent) || isSetAccessorDeclaration(contextToken.parent.parent) || isSpreadAssignment(contextToken.parent) || ((_b = findAncestor(contextToken.parent, isPropertyAssignment)) == null ? void 0 : _b.getLastToken(sourceFile)) === contextToken || isShorthandPropertyAssignment(contextToken.parent) && getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { + source = "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */; + hasAction = true; + } + } if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) { let importAdder; - ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext)); - sortText = SortText.ClassMemberSnippets; - if (importAdder == null ? void 0 : importAdder.hasFixes()) { - hasAction = true; - source = "ClassMemberSnippet/" /* ClassMemberSnippet */; + const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext); + if (memberCompletionEntry) { + ({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry); + if (importAdder == null ? void 0 : importAdder.hasFixes()) { + hasAction = true; + source = "ClassMemberSnippet/" /* ClassMemberSnippet */; + } + } else { + return void 0; } } if (origin && originIsObjectLiteralMethod(origin)) { @@ -424833,6 +429572,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} data = originToCompletionEntryData(origin); hasAction = !importStatementCompletion; } + const parentNamedImportOrExport = findAncestor(location, isNamedImportsOrExports); + if ((parentNamedImportOrExport == null ? void 0 : parentNamedImportOrExport.kind) === 275 /* NamedImports */) { + const possibleToken = stringToToken(name); + if (parentNamedImportOrExport && possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) { + insertText = `${name} as ${name}_`; + } + } return { name, kind: ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, location), @@ -424842,6 +429588,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} hasAction: hasAction ? true : void 0, isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0, insertText, + filterText, replacementSpan, sourceDisplay, labelDetails, @@ -424862,11 +429609,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) { const classLikeDeclaration = findAncestor(location, isClassLike); if (!classLikeDeclaration) { - return { insertText: name }; + return void 0; } let isSnippet; - let replacementSpan; let insertText = name; + const filterText = name; const checker = program.getTypeChecker(); const sourceFile = location.getSourceFile(); const printer = createSnippetPrinter({ @@ -424895,9 +429642,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ); } let modifiers = 0 /* None */; - const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken, sourceFile, position); - const isAbstract = !!(presentModifiers & 256 /* Abstract */); - const completionNodes = []; + const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position); + const isAbstract = presentModifiers & 64 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 64 /* Abstract */; + let completionNodes = []; ts_codefix_exports.addNewNodeForMemberSymbol( symbol, classLikeDeclaration, @@ -424915,24 +429662,48 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} (node) => { let requiredModifiers = 0 /* None */; if (isAbstract) { - requiredModifiers |= 256 /* Abstract */; + requiredModifiers |= 64 /* Abstract */; } if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) { - requiredModifiers |= 16384 /* Override */; + requiredModifiers |= 16 /* Override */; } if (!completionNodes.length) { - modifiers = node.modifierFlagsCache | requiredModifiers | presentModifiers; + modifiers = node.modifierFlagsCache | requiredModifiers; } - node = factory.updateModifiers(node, modifiers); + node = factory.replaceModifiers(node, modifiers); completionNodes.push(node); }, body, ts_codefix_exports.PreserveOptionalFlags.Property, - isAbstract + !!isAbstract ); if (completionNodes.length) { + const isMethod = symbol.flags & 8192 /* Method */; + let allowedModifiers = modifiers | 16 /* Override */ | 1 /* Public */; + if (!isMethod) { + allowedModifiers |= 128 /* Ambient */ | 8 /* Readonly */; + } else { + allowedModifiers |= 1024 /* Async */; + } + const allowedAndPresent = presentModifiers & allowedModifiers; + if (presentModifiers & ~allowedModifiers) { + return void 0; + } + if (modifiers & 4 /* Protected */ && allowedAndPresent & 1 /* Public */) { + modifiers &= ~4 /* Protected */; + } + if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 1 /* Public */)) { + modifiers &= ~1 /* Public */; + } + modifiers |= allowedAndPresent; + completionNodes = completionNodes.map((node) => factory.replaceModifiers(node, modifiers)); + if (presentDecorators == null ? void 0 : presentDecorators.length) { + const lastNode = completionNodes[completionNodes.length - 1]; + if (canHaveDecorators(lastNode)) { + completionNodes[completionNodes.length - 1] = factory.replaceDecoratorsAndModifiers(lastNode, presentDecorators.concat(getModifiers(lastNode) || [])); + } + } const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */; - replacementSpan = modifiersSpan; if (formatContext) { insertText = printer.printAndFormatSnippetList( format, @@ -424948,24 +429719,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ); } } - return { insertText, isSnippet, importAdder, replacementSpan }; + return { insertText, filterText, isSnippet, importAdder, eraseRange }; } function getPresentModifiers(contextToken, sourceFile, position) { if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) { return { modifiers: 0 /* None */ }; } let modifiers = 0 /* None */; - let span; + let decorators; let contextMod; - if (contextMod = isModifierLike2(contextToken)) { - modifiers |= modifierToFlag(contextMod); - span = createTextSpanFromNode(contextToken); + const range = { pos: position, end: position }; + if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) { + modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */; + decorators = contextToken.parent.modifiers.filter(isDecorator) || []; + range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos); } - if (isPropertyDeclaration(contextToken.parent)) { - modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */; - span = createTextSpanFromNode(contextToken.parent); + if (contextMod = isModifierLike2(contextToken)) { + const contextModifierFlag = modifierToFlag(contextMod); + if (!(modifiers & contextModifierFlag)) { + modifiers |= contextModifierFlag; + range.pos = Math.min(range.pos, contextToken.pos); + } } - return { modifiers, span }; + return { modifiers, decorators, range: range.pos !== position ? range : void 0 }; } function isModifierLike2(node) { if (isModifier(node)) { @@ -425042,10 +429818,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const quotePreference = getQuotePreference(sourceFile, preferences); const builderFlags = 33554432 /* OmitThisParameter */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0 /* None */); switch (declaration.kind) { - case 170 /* PropertySignature */: - case 171 /* PropertyDeclaration */: - case 172 /* MethodSignature */: - case 173 /* MethodDeclaration */: { + case 171 /* PropertySignature */: + case 172 /* PropertyDeclaration */: + case 173 /* MethodSignature */: + case 174 /* MethodDeclaration */: { let effectiveType = type.flags & 1048576 /* Union */ && type.types.length < 10 ? checker.getUnionType(type.types, 2 /* Subtype */) : type; if (effectiveType.flags & 1048576 /* Union */) { const functionTypes = filter(effectiveType.types, (type2) => checker.getSignaturesOfType(type2, 0 /* Call */).length > 0); @@ -425079,17 +429855,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} true ); } - const parameters = typeNode.parameters.map((typedParam) => factory.createParameterDeclaration( - /*modifiers*/ - void 0, - typedParam.dotDotDotToken, - typedParam.name, - /*questionToken*/ - void 0, - /*type*/ - void 0, - typedParam.initializer - )); + const parameters = typeNode.parameters.map( + (typedParam) => factory.createParameterDeclaration( + /*modifiers*/ + void 0, + typedParam.dotDotDotToken, + typedParam.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + typedParam.initializer + ) + ); return factory.createMethodDeclaration( /*modifiers*/ void 0, @@ -425332,6 +430110,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; @@ -425411,6 +430192,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return !!(allFlags & 111551 /* Value */); } + function symbolAppearsToBeTypeOnly(symbol) { + var _a; + return !(symbol.flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(symbol.flags & 788968 /* Type */)); + } } function getLabelCompletionAtPosition(node) { const entries = getLabelStatementCompletions(node); @@ -425488,7 +430273,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return firstDefined(symbols, (symbol, index) => { const origin = symbolToOriginInfoMap[index]; const info = getCompletionEntryDisplayNameForSymbol(symbol, getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected); - return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0; + return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source || entryId.source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0; }) || { type: "none" }; } function getCompletionEntryDetails(program, log, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) { @@ -425497,7 +430282,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) { @@ -425527,7 +430312,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string" /* string */, typeof literal === "string" ? 8 /* stringLiteral */ : 7 /* numericLiteral */); } case "cases": { - const { entry, importAdder } = getExhaustiveCaseSnippets( + const snippets = getExhaustiveCaseSnippets( contextToken.parent, sourceFile, preferences, @@ -425537,7 +430322,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} /*formatContext*/ void 0 ); - if (importAdder.hasFixes()) { + if (snippets == null ? void 0 : snippets.importAdder.hasFixes()) { + const { entry, importAdder } = snippets; const changes = ts_textChanges_exports.ChangeTracker.with( { host, formatContext, preferences }, importAdder.writeFixes @@ -425555,7 +430341,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }; } return { - name: entry.name, + name, kind: "" /* unknown */, kindModifiers: "", displayParts: [], @@ -425572,10 +430358,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]); } function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) { - const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken( - cancellationToken, - (checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */) - ); + const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken(cancellationToken, (checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */)); return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay); } function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) { @@ -425583,12 +430366,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken) { if (data == null ? void 0 : data.moduleSpecifier) { - if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).replacementSpan) { + if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken, sourceFile).replacementSpan) { return { codeActions: void 0, sourceDisplay: [textPart(data.moduleSpecifier)] }; } } if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) { - const { importAdder } = getEntryForMemberCompletion( + const { importAdder, eraseRange } = getEntryForMemberCompletion( host, program, compilerOptions, @@ -425600,10 +430383,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} contextToken, formatContext ); - if (importAdder) { + if (importAdder || eraseRange) { const changes = ts_textChanges_exports.ChangeTracker.with( { host, formatContext, preferences }, - importAdder.writeFixes + (tracker) => { + if (importAdder) { + importAdder.writeFixes(tracker); + } + if (eraseRange) { + tracker.deleteRange(sourceFile, eraseRange); + } + } ); return { sourceDisplay: void 0, @@ -425626,6 +430416,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} Debug.assertIsDefined(codeAction2, "Expected to have a code action for promoting type-only alias"); return { codeActions: [codeAction2], sourceDisplay: void 0 }; } + if (source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */ && contextToken) { + const changes = ts_textChanges_exports.ChangeTracker.with( + { host, formatContext, preferences }, + (tracker) => tracker.insertText(sourceFile, contextToken.end, ",") + ); + if (changes) { + return { + sourceDisplay: void 0, + codeActions: [{ + changes, + description: diagnosticToString([Diagnostics.Add_missing_comma_for_object_member_completion_0, name]) + }] + }; + } + } if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) { return { codeActions: void 0, sourceDisplay: void 0 }; } @@ -425667,11 +430472,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return getContextualTypeFromParent(previousToken, checker); case 64 /* EqualsToken */: switch (parent2.kind) { - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return checker.getContextualType(parent2.initializer); - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return checker.getTypeAtLocation(parent2.left); - case 290 /* JsxAttribute */: + case 291 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent2); default: return void 0; @@ -425684,7 +430489,7 @@ ${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); + const argInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(previousToken, position, sourceFile, checker); return argInfo ? ( // At `,`, treat this as the next argument after the comma. checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (previousToken.kind === 28 /* CommaToken */ ? 1 : 0)) @@ -425699,7 +430504,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} symbol, enclosingDeclaration, /*meaning*/ - 67108863 /* All */, + -1 /* All */, /*useOnlyExternalAliasing*/ false ); @@ -425709,7 +430514,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isModuleSymbol(symbol) { var _a; - return !!((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d.kind === 311 /* SourceFile */)); + return !!((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d.kind === 312 /* SourceFile */)); } function getCompletionData(program, log, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) { const typeChecker = program.getTypeChecker(); @@ -425728,7 +430533,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return { kind: 1 /* JsDocTagName */ }; } else { const lineStart = getLineStartPositionForPosition(position, sourceFile); - if (!/[^\*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) { + if (!/[^*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) { return { kind: 2 /* JsDocTag */ }; } } @@ -425741,7 +430546,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const typeExpression = tryGetTypeExpressionFromTag(tag); if (typeExpression) { currentToken = getTokenAtPosition(sourceFile, position); - if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 354 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) { + if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 355 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) { insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression); } } @@ -425774,7 +430579,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} let isNewIdentifierLocation = false; let flags = 0 /* None */; if (contextToken) { - const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken); + const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken, sourceFile); if (importStatementCompletionInfo.keywordCompletion) { if (importStatementCompletionInfo.isKeywordOnlyCompletion) { return { @@ -425799,7 +430604,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} isRightOfDot = contextToken.kind === 25 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 29 /* QuestionDotToken */; switch (parent2.kind) { - case 210 /* PropertyAccessExpression */: + case 211 /* PropertyAccessExpression */: propertyAccessToConvert = parent2; node = propertyAccessToConvert.expression; const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert); @@ -425807,16 +430612,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; } break; - case 165 /* QualifiedName */: + case 166 /* QualifiedName */: node = parent2.left; break; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: node = parent2.name; break; - case 204 /* ImportType */: + case 205 /* ImportType */: node = parent2; break; - case 235 /* MetaProperty */: + case 236 /* MetaProperty */: node = parent2.getFirstToken(sourceFile); Debug.assert(node.kind === 102 /* ImportKeyword */ || node.kind === 105 /* NewKeyword */); break; @@ -425824,51 +430629,51 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; } } else if (!importStatementCompletion) { - if (parent2 && parent2.kind === 210 /* PropertyAccessExpression */) { + if (parent2 && parent2.kind === 211 /* PropertyAccessExpression */) { contextToken = parent2; parent2 = parent2.parent; } if (currentToken.parent === location) { switch (currentToken.kind) { case 32 /* GreaterThanToken */: - if (currentToken.parent.kind === 283 /* JsxElement */ || currentToken.parent.kind === 285 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 284 /* JsxElement */ || currentToken.parent.kind === 286 /* JsxOpeningElement */) { location = currentToken; } break; case 44 /* SlashToken */: - if (currentToken.parent.kind === 284 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 285 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent2.kind) { - case 286 /* JsxClosingElement */: + case 287 /* JsxClosingElement */: if (contextToken.kind === 44 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent2)) { break; } - case 284 /* JsxSelfClosingElement */: - case 283 /* JsxElement */: - case 285 /* JsxOpeningElement */: + case 285 /* JsxSelfClosingElement */: + case 284 /* JsxElement */: + case 286 /* JsxOpeningElement */: isJsxIdentifierExpected = true; if (contextToken.kind === 30 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 293 /* JsxExpression */: - case 292 /* JsxSpreadAttribute */: - if (previousToken.kind === 20 /* CloseBraceToken */ || previousToken.kind === 80 /* Identifier */ && previousToken.parent.kind === 290 /* JsxAttribute */) { + case 294 /* JsxExpression */: + case 293 /* JsxSpreadAttribute */: + if (previousToken.kind === 20 /* CloseBraceToken */ || previousToken.kind === 80 /* Identifier */ && previousToken.parent.kind === 291 /* JsxAttribute */) { isJsxIdentifierExpected = true; } break; - case 290 /* JsxAttribute */: + case 291 /* JsxAttribute */: if (parent2.initializer === previousToken && previousToken.end < position) { isJsxIdentifierExpected = true; break; @@ -425889,7 +430694,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; @@ -425956,15 +430760,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 347 /* JSDocParameterTag */: - case 354 /* JSDocPropertyTag */: - case 348 /* JSDocReturnTag */: - case 350 /* JSDocTypeTag */: - case 352 /* JSDocTypedefTag */: - case 355 /* JSDocThrowsTag */: - case 356 /* JSDocSatisfiesTag */: + case 348 /* JSDocParameterTag */: + case 355 /* JSDocPropertyTag */: + case 349 /* JSDocReturnTag */: + case 351 /* JSDocTypeTag */: + case 353 /* JSDocTypedefTag */: + case 356 /* JSDocThrowsTag */: + case 357 /* JSDocSatisfiesTag */: return true; - case 351 /* JSDocTemplateTag */: + case 352 /* JSDocTemplateTag */: return !!tag.constraint; default: return false; @@ -425973,7 +430777,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function tryGetTypeExpressionFromTag(tag) { if (isTagWithTypeExpression(tag)) { const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression; - return typeExpression && typeExpression.kind === 315 /* JSDocTypeExpression */ ? typeExpression : void 0; + return typeExpression && typeExpression.kind === 316 /* JSDocTypeExpression */ ? typeExpression : void 0; } if (isJSDocAugmentsTag(tag) || isJSDocImplementsTag(tag)) { return tag.class; @@ -426009,7 +430813,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} symbols.push(exportedSymbol); } } - if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some((d) => d.kind !== 311 /* SourceFile */ && d.kind !== 266 /* ModuleDeclaration */ && d.kind !== 265 /* EnumDeclaration */)) { + if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some((d) => d.kind !== 312 /* SourceFile */ && d.kind !== 267 /* ModuleDeclaration */ && d.kind !== 266 /* EnumDeclaration */)) { let type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); let insertQuestionDot = false; if (type.isNullableType()) { @@ -426021,30 +430825,40 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } } - addTypeProperties(type, !!(node.flags & 32768 /* AwaitContext */), insertQuestionDot); + addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot); } return; } } } - if (!isTypeLocation) { + if (!isTypeLocation || isInTypeQuery(node)) { typeChecker.tryGetThisTypeAt( node, /*includeGlobalThis*/ false ); let type = typeChecker.getTypeAtLocation(node).getNonOptionalType(); - let insertQuestionDot = false; - if (type.isNullableType()) { - const canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false; - if (canCorrectToQuestionDot || isRightOfQuestionDot) { - type = type.getNonNullableType(); - if (canCorrectToQuestionDot) { - insertQuestionDot = true; + if (!isTypeLocation) { + let insertQuestionDot = false; + if (type.isNullableType()) { + const canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false; + if (canCorrectToQuestionDot || isRightOfQuestionDot) { + type = type.getNonNullableType(); + if (canCorrectToQuestionDot) { + insertQuestionDot = true; + } } } + addTypeProperties(type, !!(node.flags & 65536 /* AwaitContext */), insertQuestionDot); + } else { + addTypeProperties( + type.getNonNullableType(), + /*insertAwait*/ + false, + /*insertQuestionDot*/ + false + ); } - addTypeProperties(type, !!(node.flags & 32768 /* AwaitContext */), insertQuestionDot); } } function addTypeProperties(type, insertAwait, insertQuestionDot) { @@ -426052,7 +430866,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isRightOfQuestionDot && some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - const propertyAccess = node.kind === 204 /* ImportType */ ? node : node.parent; + const propertyAccess = node.kind === 205 /* ImportType */ ? node : node.parent; if (inCheckedFile) { for (const symbol of type.getApparentProperties()) { if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, symbol)) { @@ -426090,7 +430904,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const leftMostName = getLeftMostName(computedPropertyName.expression); const nameSymbol = leftMostName && typeChecker.getSymbolAtLocation(leftMostName); const firstAccessibleSymbol = nameSymbol && getFirstSymbolInChain(nameSymbol, contextToken, typeChecker); - if (firstAccessibleSymbol && addToSeen(seenPropertySymbols, getSymbolId(firstAccessibleSymbol))) { + const firstAccessibleSymbolId = firstAccessibleSymbol && getSymbolId(firstAccessibleSymbol); + if (firstAccessibleSymbolId && addToSeen(seenPropertySymbols, firstAccessibleSymbolId)) { const index = symbols.length; symbols.push(firstAccessibleSymbol); const moduleSymbol = firstAccessibleSymbol.parent; @@ -426098,14 +430913,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} symbolToOriginInfoMap[index] = { kind: getNullableSymbolOriginInfoKind(2 /* SymbolMemberNoExport */) }; } else { const fileName = isExternalModuleNameRelative(stripQuotes(moduleSymbol.name)) ? (_a = getSourceFileOfModule(moduleSymbol)) == null ? void 0 : _a.fileName : void 0; - const { moduleSpecifier } = (importSpecifierResolver || (importSpecifierResolver = ts_codefix_exports.createImportSpecifierResolver(sourceFile, program, host, preferences))).getModuleSpecifierForBestExportInfo([{ - exportKind: 0 /* Named */, - moduleFileName: fileName, - isFromPackageJson: false, - moduleSymbol, - symbol: firstAccessibleSymbol, - targetFlags: skipAlias(firstAccessibleSymbol, typeChecker).flags - }], position, isValidTypeOnlyAliasUseSite(location)) || {}; + const { moduleSpecifier } = (importSpecifierResolver || (importSpecifierResolver = ts_codefix_exports.createImportSpecifierResolver(sourceFile, program, host, preferences))).getModuleSpecifierForBestExportInfo( + [{ + exportKind: 0 /* Named */, + moduleFileName: fileName, + isFromPackageJson: false, + moduleSymbol, + symbol: firstAccessibleSymbol, + targetFlags: skipAlias(firstAccessibleSymbol, typeChecker).flags + }], + position, + isValidTypeOnlyAliasUseSite(location) + ) || {}; if (moduleSpecifier) { const origin = { kind: getNullableSymbolOriginInfoKind(6 /* SymbolMemberExport */), @@ -426120,6 +430939,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } } else if (preferences.includeCompletionsWithInsertText) { + if (firstAccessibleSymbolId && seenPropertySymbols.has(firstAccessibleSymbolId)) { + return; + } addSymbolOriginInfo(symbol); addSymbolSortInfo(symbol); symbols.push(symbol); @@ -426151,7 +430973,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() { @@ -426208,7 +431030,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } } - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 311 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 312 /* SourceFile */) { const thisType = typeChecker.tryGetThisTypeAt( scopeNode, /*includeGlobalThis*/ @@ -426231,8 +431053,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) @@ -426243,10 +431063,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 311 /* SourceFile */: - case 227 /* TemplateExpression */: - case 293 /* JsxExpression */: - case 240 /* Block */: + case 312 /* SourceFile */: + case 228 /* TemplateExpression */: + case 294 /* JsxExpression */: + case 241 /* Block */: return true; default: return isStatement(scopeNode); @@ -426256,24 +431076,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return insideJsDocTagTypeExpression || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); } function isContextTokenValueLocation(contextToken2) { - return contextToken2 && (contextToken2.kind === 114 /* TypeOfKeyword */ && (contextToken2.parent.kind === 185 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 181 /* TypePredicate */); + return contextToken2 && (contextToken2.kind === 114 /* TypeOfKeyword */ && (contextToken2.parent.kind === 186 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 182 /* TypePredicate */); } function isContextTokenTypeLocation(contextToken2) { if (contextToken2) { const parentKind = contextToken2.parent.kind; switch (contextToken2.kind) { case 59 /* ColonToken */: - return parentKind === 171 /* PropertyDeclaration */ || parentKind === 170 /* PropertySignature */ || parentKind === 168 /* Parameter */ || parentKind === 259 /* VariableDeclaration */ || isFunctionLikeKind(parentKind); + return parentKind === 172 /* PropertyDeclaration */ || parentKind === 171 /* PropertySignature */ || parentKind === 169 /* Parameter */ || parentKind === 260 /* VariableDeclaration */ || isFunctionLikeKind(parentKind); case 64 /* EqualsToken */: - return parentKind === 264 /* TypeAliasDeclaration */; + return parentKind === 265 /* TypeAliasDeclaration */ || parentKind === 168 /* TypeParameter */; case 130 /* AsKeyword */: - return parentKind === 233 /* AsExpression */; + return parentKind === 234 /* AsExpression */; case 30 /* LessThanToken */: - return parentKind === 182 /* TypeReference */ || parentKind === 215 /* TypeAssertionExpression */; + return parentKind === 183 /* TypeReference */ || parentKind === 216 /* TypeAssertionExpression */; case 96 /* ExtendsKeyword */: - return parentKind === 167 /* TypeParameter */; + return parentKind === 168 /* TypeParameter */; case 152 /* SatisfiesKeyword */: - return parentKind === 237 /* SatisfiesExpression */; + return parentKind === 238 /* SatisfiesExpression */; } } return false; @@ -426451,14 +431271,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return true; } if (contextToken2.kind === 32 /* GreaterThanToken */ && contextToken2.parent) { - if (location === contextToken2.parent && (location.kind === 285 /* JsxOpeningElement */ || location.kind === 284 /* JsxSelfClosingElement */)) { + if (location === contextToken2.parent && (location.kind === 286 /* JsxOpeningElement */ || location.kind === 285 /* JsxSelfClosingElement */)) { return false; } - if (contextToken2.parent.kind === 285 /* JsxOpeningElement */) { - return location.parent.kind !== 285 /* JsxOpeningElement */; + if (contextToken2.parent.kind === 286 /* JsxOpeningElement */) { + return location.parent.kind !== 286 /* JsxOpeningElement */; } - if (contextToken2.parent.kind === 286 /* JsxClosingElement */ || contextToken2.parent.kind === 284 /* JsxSelfClosingElement */) { - return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 283 /* JsxElement */; + if (contextToken2.parent.kind === 287 /* JsxClosingElement */ || contextToken2.parent.kind === 285 /* JsxSelfClosingElement */) { + return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 284 /* JsxElement */; } } return false; @@ -426469,29 +431289,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const tokenKind = keywordForNode(contextToken); switch (tokenKind) { case 28 /* CommaToken */: - return containingNodeKind === 212 /* CallExpression */ || containingNodeKind === 175 /* Constructor */ || containingNodeKind === 213 /* NewExpression */ || containingNodeKind === 208 /* ArrayLiteralExpression */ || containingNodeKind === 225 /* BinaryExpression */ || containingNodeKind === 183 /* FunctionType */ || containingNodeKind === 209 /* ObjectLiteralExpression */; + return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 226 /* BinaryExpression */ || containingNodeKind === 184 /* FunctionType */ || containingNodeKind === 210 /* ObjectLiteralExpression */; case 21 /* OpenParenToken */: - return containingNodeKind === 212 /* CallExpression */ || containingNodeKind === 175 /* Constructor */ || containingNodeKind === 213 /* NewExpression */ || containingNodeKind === 216 /* ParenthesizedExpression */ || containingNodeKind === 195 /* ParenthesizedType */; + return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 217 /* ParenthesizedExpression */ || containingNodeKind === 196 /* ParenthesizedType */; case 23 /* OpenBracketToken */: - return containingNodeKind === 208 /* ArrayLiteralExpression */ || containingNodeKind === 180 /* IndexSignature */ || containingNodeKind === 166 /* ComputedPropertyName */; + return containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 181 /* IndexSignature */ || containingNodeKind === 167 /* ComputedPropertyName */; case 144 /* ModuleKeyword */: case 145 /* NamespaceKeyword */: case 102 /* ImportKeyword */: return true; case 25 /* DotToken */: - return containingNodeKind === 266 /* ModuleDeclaration */; + return containingNodeKind === 267 /* ModuleDeclaration */; case 19 /* OpenBraceToken */: - return containingNodeKind === 262 /* ClassDeclaration */ || containingNodeKind === 209 /* ObjectLiteralExpression */; + return containingNodeKind === 263 /* ClassDeclaration */ || containingNodeKind === 210 /* ObjectLiteralExpression */; case 64 /* EqualsToken */: - return containingNodeKind === 259 /* VariableDeclaration */ || containingNodeKind === 225 /* BinaryExpression */; + return containingNodeKind === 260 /* VariableDeclaration */ || containingNodeKind === 226 /* BinaryExpression */; case 16 /* TemplateHead */: - return containingNodeKind === 227 /* TemplateExpression */; + return containingNodeKind === 228 /* TemplateExpression */; case 17 /* TemplateMiddle */: - return containingNodeKind === 238 /* TemplateSpan */; + return containingNodeKind === 239 /* TemplateSpan */; case 134 /* AsyncKeyword */: - return containingNodeKind === 173 /* MethodDeclaration */ || containingNodeKind === 303 /* ShorthandPropertyAssignment */; + return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 304 /* ShorthandPropertyAssignment */; case 42 /* AsteriskToken */: - return containingNodeKind === 173 /* MethodDeclaration */; + return containingNodeKind === 174 /* MethodDeclaration */; } if (isClassMemberCompletionKeyword(tokenKind)) { return true; @@ -426523,19 +431343,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function tryGetObjectLikeCompletionSymbols() { const symbolsStartIndex = symbols.length; - const objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken); + const objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken, position, sourceFile); if (!objectLikeContainer) return 0 /* Continue */; completionKind = 0 /* ObjectPropertyDeclaration */; let typeMembers; let existingMembers; - if (objectLikeContainer.kind === 209 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */) { const instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); if (instantiatedType === void 0) { - if (objectLikeContainer.flags & 33554432 /* InWithStatement */) { + if (objectLikeContainer.flags & 67108864 /* InWithStatement */) { return 2 /* Fail */; } - isNonContextualObjectLiteral = true; return 0 /* Continue */; } const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); @@ -426546,21 +431365,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} existingMembers = objectLikeContainer.properties; if (typeMembers.length === 0) { if (!hasNumberIndextype) { - isNonContextualObjectLiteral = true; return 0 /* Continue */; } } } else { - Debug.assert(objectLikeContainer.kind === 205 /* ObjectBindingPattern */); + Debug.assert(objectLikeContainer.kind === 206 /* ObjectBindingPattern */); isNewIdentifierLocation = false; const rootDeclaration = getRootDeclaration(objectLikeContainer.parent); if (!isVariableLike(rootDeclaration)) return Debug.fail("Root declaration is not variable-like."); - let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 249 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 168 /* Parameter */) { + let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 250 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 169 /* Parameter */) { if (isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); - } else if (rootDeclaration.parent.kind === 173 /* MethodDeclaration */ || rootDeclaration.parent.kind === 177 /* SetAccessor */) { + } else if (rootDeclaration.parent.kind === 174 /* MethodDeclaration */ || rootDeclaration.parent.kind === 178 /* SetAccessor */) { canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -426586,7 +431404,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const filteredMembers = filterObjectMembersList(typeMembers, Debug.checkDefined(existingMembers)); symbols = concatenate(symbols, filteredMembers); setSortTextToOptionalMember(); - if (objectLikeContainer.kind === 209 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) { + if (objectLikeContainer.kind === 210 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) { transformObjectLiteralMembersSortText(symbolsStartIndex); collectObjectLiteralMethodSymbols(filteredMembers, objectLikeContainer); } @@ -426602,10 +431420,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!isTypeKeywordTokenOrIdentifier(contextToken)) { keywordFilters = 8 /* TypeKeyword */; } - const { moduleSpecifier } = namedImportsOrExports.kind === 274 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; + const { moduleSpecifier } = namedImportsOrExports.kind === 275 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; if (!moduleSpecifier) { isNewIdentifierLocation = true; - return namedImportsOrExports.kind === 274 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; + return namedImportsOrExports.kind === 275 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; } const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); if (!moduleSpecifierSymbol) { @@ -426623,6 +431441,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; @@ -426655,24 +431483,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (contextToken.kind === 80 /* Identifier */ && !isCurrentlyEditingNode(contextToken)) { switch (contextToken.getText()) { case "private": - classElementModifierFlags = classElementModifierFlags | 8 /* Private */; + classElementModifierFlags = classElementModifierFlags | 2 /* Private */; break; case "static": - classElementModifierFlags = classElementModifierFlags | 32 /* Static */; + classElementModifierFlags = classElementModifierFlags | 256 /* Static */; break; case "override": - classElementModifierFlags = classElementModifierFlags | 16384 /* Override */; + classElementModifierFlags = classElementModifierFlags | 16 /* Override */; break; } } if (isClassStaticBlockDeclaration(classElement)) { - classElementModifierFlags |= 32 /* Static */; + classElementModifierFlags |= 256 /* Static */; } - if (!(classElementModifierFlags & 8 /* Private */)) { - const baseTypeNodes = isClassLike(decl) && classElementModifierFlags & 16384 /* Override */ ? singleElementArray(getEffectiveBaseTypeNode(decl)) : getAllSuperTypeNodes(decl); + if (!(classElementModifierFlags & 2 /* Private */)) { + const baseTypeNodes = isClassLike(decl) && classElementModifierFlags & 16 /* Override */ ? singleElementArray(getEffectiveBaseTypeNode(decl)) : getAllSuperTypeNodes(decl); const baseSymbols = flatMap(baseTypeNodes, (baseTypeNode) => { const type = typeChecker.getTypeAtLocation(baseTypeNode); - return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type); + return classElementModifierFlags & 256 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type); }); symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags)); forEach(symbols, (symbol, index) => { @@ -426730,11 +431558,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case 31 /* LessThanSlashToken */: case 44 /* SlashToken */: case 80 /* Identifier */: - case 210 /* PropertyAccessExpression */: - case 291 /* JsxAttributes */: - case 290 /* JsxAttribute */: - case 292 /* JsxSpreadAttribute */: - if (parent2 && (parent2.kind === 284 /* JsxSelfClosingElement */ || parent2.kind === 285 /* JsxOpeningElement */)) { + case 211 /* PropertyAccessExpression */: + case 292 /* JsxAttributes */: + case 291 /* JsxAttribute */: + case 293 /* JsxSpreadAttribute */: + if (parent2 && (parent2.kind === 285 /* JsxSelfClosingElement */ || parent2.kind === 286 /* JsxOpeningElement */)) { if (contextToken2.kind === 32 /* GreaterThanToken */) { const precedingToken = findPrecedingToken( contextToken2.pos, @@ -426746,20 +431574,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} break; } return parent2; - } else if (parent2.kind === 290 /* JsxAttribute */) { + } else if (parent2.kind === 291 /* JsxAttribute */) { return parent2.parent.parent; } break; case 11 /* StringLiteral */: - if (parent2 && (parent2.kind === 290 /* JsxAttribute */ || parent2.kind === 292 /* JsxSpreadAttribute */)) { + if (parent2 && (parent2.kind === 291 /* JsxAttribute */ || parent2.kind === 293 /* JsxSpreadAttribute */)) { return parent2.parent.parent; } break; case 20 /* CloseBraceToken */: - if (parent2 && parent2.kind === 293 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 290 /* JsxAttribute */) { + if (parent2 && parent2.kind === 294 /* JsxExpression */ && parent2.parent && parent2.parent.kind === 291 /* JsxAttribute */) { return parent2.parent.parent.parent; } - if (parent2 && parent2.kind === 292 /* JsxSpreadAttribute */) { + if (parent2 && parent2.kind === 293 /* JsxSpreadAttribute */) { return parent2.parent.parent; } break; @@ -426767,52 +431595,63 @@ ${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; switch (contextToken2.kind) { case 28 /* CommaToken */: - return containingNodeKind === 259 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 242 /* VariableStatement */ || containingNodeKind === 265 /* EnumDeclaration */ || // enum a { foo, | - isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 263 /* InterfaceDeclaration */ || // interface A= contextToken2.pos; case 25 /* DotToken */: - return containingNodeKind === 206 /* ArrayBindingPattern */; + return containingNodeKind === 207 /* ArrayBindingPattern */; case 59 /* ColonToken */: - return containingNodeKind === 207 /* BindingElement */; + return containingNodeKind === 208 /* BindingElement */; case 23 /* OpenBracketToken */: - return containingNodeKind === 206 /* ArrayBindingPattern */; + return containingNodeKind === 207 /* ArrayBindingPattern */; case 21 /* OpenParenToken */: - return containingNodeKind === 298 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); + return containingNodeKind === 299 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 19 /* OpenBraceToken */: - return containingNodeKind === 265 /* EnumDeclaration */; + return containingNodeKind === 266 /* EnumDeclaration */; case 30 /* LessThanToken */: - return containingNodeKind === 262 /* ClassDeclaration */ || // class A< | - containingNodeKind === 230 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 263 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 264 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 263 /* ClassDeclaration */ || // class A< | + containingNodeKind === 231 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 264 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 265 /* TypeAliasDeclaration */ || // type List< | isFunctionLikeKind(containingNodeKind); case 126 /* StaticKeyword */: - return containingNodeKind === 171 /* PropertyDeclaration */ && !isClassLike(parent2.parent); + return containingNodeKind === 172 /* PropertyDeclaration */ && !isClassLike(parent2.parent); case 26 /* DotDotDotToken */: - return containingNodeKind === 168 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 206 /* ArrayBindingPattern */; + return containingNodeKind === 169 /* Parameter */ || !!parent2.parent && parent2.parent.kind === 207 /* ArrayBindingPattern */; case 125 /* PublicKeyword */: case 123 /* PrivateKeyword */: case 124 /* ProtectedKeyword */: - return containingNodeKind === 168 /* Parameter */ && !isConstructorDeclaration(parent2.parent); + return containingNodeKind === 169 /* Parameter */ && !isConstructorDeclaration(parent2.parent); case 130 /* AsKeyword */: - return containingNodeKind === 275 /* ImportSpecifier */ || containingNodeKind === 280 /* ExportSpecifier */ || containingNodeKind === 273 /* NamespaceImport */; + return containingNodeKind === 276 /* ImportSpecifier */ || containingNodeKind === 281 /* ExportSpecifier */ || containingNodeKind === 274 /* NamespaceImport */; case 139 /* GetKeyword */: case 153 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken2); - case 80 /* Identifier */: - if (containingNodeKind === 275 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") { + 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 */: @@ -426824,7 +431663,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case 140 /* InferKeyword */: return true; case 156 /* TypeKeyword */: - return containingNodeKind !== 275 /* ImportSpecifier */; + return containingNodeKind !== 276 /* ImportSpecifier */; case 42 /* AsteriskToken */: return isFunctionLike(contextToken2.parent) && !isMethodDeclaration(contextToken2.parent); } @@ -426858,7 +431697,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (ancestorClassLike && contextToken2 === previousToken && isPreviousPropertyDeclarationTerminated(contextToken2, position)) { return false; } - const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 171 /* PropertyDeclaration */); + const ancestorPropertyDeclaraion = getAncestor(contextToken2.parent, 172 /* PropertyDeclaration */); if (ancestorPropertyDeclaraion && contextToken2 !== previousToken && isClassLike(previousToken.parent.parent) && position <= previousToken.end) { if (isPreviousPropertyDeclarationTerminated(contextToken2, previousToken.end)) { return false; @@ -426872,7 +431711,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return contextToken2.kind !== 64 /* EqualsToken */ && (contextToken2.kind === 27 /* SemicolonToken */ || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile)); } function isFunctionLikeButNotConstructor(kind) { - return isFunctionLikeKind(kind) && kind !== 175 /* Constructor */; + return isFunctionLikeKind(kind) && kind !== 176 /* Constructor */; } function isDotOfNumericLiteral(contextToken2) { if (contextToken2.kind === 9 /* NumericLiteral */) { @@ -426882,7 +431721,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return false; } function isVariableDeclarationListButNotTypeArgument(node2) { - return node2.parent.kind === 260 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker); + return node2.parent.kind === 261 /* VariableDeclarationList */ && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker); } function filterObjectMembersList(contextualMemberSymbols, existingMembers) { if (existingMembers.length === 0) { @@ -426891,7 +431730,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const membersDeclaredBySpreadAssignment = /* @__PURE__ */ new Set(); const existingMemberNames = /* @__PURE__ */ new Set(); for (const m of existingMembers) { - if (m.kind !== 302 /* PropertyAssignment */ && m.kind !== 303 /* ShorthandPropertyAssignment */ && m.kind !== 207 /* BindingElement */ && m.kind !== 173 /* MethodDeclaration */ && m.kind !== 176 /* GetAccessor */ && m.kind !== 177 /* SetAccessor */ && m.kind !== 304 /* SpreadAssignment */) { + if (m.kind !== 303 /* PropertyAssignment */ && m.kind !== 304 /* ShorthandPropertyAssignment */ && m.kind !== 208 /* BindingElement */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */ && m.kind !== 305 /* SpreadAssignment */) { continue; } if (isCurrentlyEditingNode(m)) { @@ -426969,16 +431808,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) { const existingMemberNames = /* @__PURE__ */ new Set(); for (const m of existingMembers) { - if (m.kind !== 171 /* PropertyDeclaration */ && m.kind !== 173 /* MethodDeclaration */ && m.kind !== 176 /* GetAccessor */ && m.kind !== 177 /* SetAccessor */) { + if (m.kind !== 172 /* PropertyDeclaration */ && m.kind !== 174 /* MethodDeclaration */ && m.kind !== 177 /* GetAccessor */ && m.kind !== 178 /* SetAccessor */) { continue; } if (isCurrentlyEditingNode(m)) { continue; } - if (hasEffectiveModifier(m, 8 /* Private */)) { + if (hasEffectiveModifier(m, 2 /* Private */)) { continue; } - if (isStatic(m) !== !!(currentClassElementModifierFlags & 32 /* Static */)) { + if (isStatic(m) !== !!(currentClassElementModifierFlags & 256 /* Static */)) { continue; } const existingName = getPropertyNameForPropertyNameNode(m.name); @@ -426986,7 +431825,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} existingMemberNames.add(existingName); } } - return baseSymbols.filter((propertySymbol) => !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(getDeclarationModifierFlagsFromSymbol(propertySymbol) & 8 /* Private */) && !(propertySymbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(propertySymbol.valueDeclaration))); + return baseSymbols.filter( + (propertySymbol) => !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(getDeclarationModifierFlagsFromSymbol(propertySymbol) & 2 /* Private */) && !(propertySymbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(propertySymbol.valueDeclaration)) + ); } function filterJsxAttributes(symbols2, attributes) { const seenNames = /* @__PURE__ */ new Set(); @@ -426995,7 +431836,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 290 /* JsxAttribute */) { + if (attr.kind === 291 /* JsxAttribute */) { seenNames.add(getEscapedTextOfJsxAttributeName(attr.name)); } else if (isJsxSpreadAttribute(attr)) { setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment); @@ -427009,7 +431850,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return node2.getStart(sourceFile) <= position && position <= node2.getEnd(); } } - function tryGetObjectLikeCompletionContainer(contextToken) { + function tryGetObjectLikeCompletionContainer(contextToken, position, sourceFile) { + var _a; if (contextToken) { const { parent: parent2 } = contextToken; switch (contextToken.kind) { @@ -427024,7 +431866,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case 134 /* AsyncKeyword */: return tryCast(parent2.parent, isObjectLiteralExpression); case 80 /* Identifier */: - return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0; + if (contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent)) { + return contextToken.parent.parent; + } else { + if (isObjectLiteralExpression(contextToken.parent.parent) && (isSpreadAssignment(contextToken.parent) || isShorthandPropertyAssignment(contextToken.parent) && getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line)) { + return contextToken.parent.parent; + } + const ancestorNode2 = findAncestor(parent2, isPropertyAssignment); + if ((ancestorNode2 == null ? void 0 : ancestorNode2.getLastToken(sourceFile)) === contextToken && isObjectLiteralExpression(ancestorNode2.parent)) { + return ancestorNode2.parent; + } + } + break; + default: + if (((_a = parent2.parent) == null ? void 0 : _a.parent) && (isMethodDeclaration(parent2.parent) || isGetAccessorDeclaration(parent2.parent) || isSetAccessorDeclaration(parent2.parent)) && isObjectLiteralExpression(parent2.parent.parent)) { + return parent2.parent.parent; + } + if (isSpreadAssignment(parent2) && isObjectLiteralExpression(parent2.parent)) { + return parent2.parent; + } + const ancestorNode = findAncestor(parent2, isPropertyAssignment); + if (contextToken.kind !== 59 /* ColonToken */ && (ancestorNode == null ? void 0 : ancestorNode.getLastToken(sourceFile)) === contextToken && isObjectLiteralExpression(ancestorNode.parent)) { + return ancestorNode.parent; + } } } return void 0; @@ -427119,11 +431983,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} switch (kind) { case 128 /* AbstractKeyword */: case 133 /* AnyKeyword */: - case 162 /* BigIntKeyword */: + case 163 /* BigIntKeyword */: case 136 /* BooleanKeyword */: case 138 /* DeclareKeyword */: case 94 /* EnumKeyword */: - case 161 /* GlobalKeyword */: + case 162 /* GlobalKeyword */: case 119 /* ImplementsKeyword */: case 140 /* InferKeyword */: case 120 /* InterfaceKeyword */: @@ -427134,7 +431998,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case 146 /* NeverKeyword */: case 150 /* NumberKeyword */: case 151 /* ObjectKeyword */: - case 163 /* OverrideKeyword */: + case 164 /* OverrideKeyword */: case 123 /* PrivateKeyword */: case 124 /* ProtectedKeyword */: case 125 /* PublicKeyword */: @@ -427161,14 +432025,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case 153 /* SetKeyword */: case 134 /* AsyncKeyword */: case 138 /* DeclareKeyword */: - case 163 /* OverrideKeyword */: + case 164 /* OverrideKeyword */: return true; default: return isClassMemberModifier(kind); } } 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; @@ -427211,14 +432075,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 402784252 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || checker.typeHasCallOrConstructSignatures(memberType) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties())))); } function containsNonPublicProperties(props) { - return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 24 /* NonPublicAccessibilityModifier */)); + return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */)); } function getPropertiesForCompletion(type, checker) { return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { switch (location.kind) { - case 357 /* SyntaxList */: + case 358 /* SyntaxList */: return tryCast(location.parent, isObjectTypeDeclaration); case 1 /* EndOfFileToken */: const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration); @@ -427226,6 +432090,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return cls; } break; + case 81 /* PrivateIdentifier */: + if (tryCast(location.parent, isPropertyDeclaration)) { + return findAncestor(location, isClassLike); + } + break; case 80 /* Identifier */: { const originalKeywordKind = identifierToKeywordKind(location); if (originalKeywordKind) { @@ -427277,7 +432146,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case 27 /* SemicolonToken */: case 28 /* CommaToken */: case 80 /* Identifier */: - if (parent2.kind === 170 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) { + if (parent2.kind === 171 /* PropertySignature */ && isTypeLiteralNode(parent2.parent)) { return parent2.parent; } break; @@ -427294,11 +432163,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!t) return void 0; switch (node.kind) { - case 170 /* PropertySignature */: + case 171 /* PropertySignature */: return checker.getTypeOfPropertyOfContextualType(t, node.symbol.escapedName); - case 192 /* IntersectionType */: - case 186 /* TypeLiteral */: - case 191 /* UnionType */: + case 193 /* IntersectionType */: + case 187 /* TypeLiteral */: + case 192 /* UnionType */: return t; } } @@ -427321,7 +432190,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case "/": return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 44 /* SlashToken */ && isJsxClosingElement(contextToken.parent)); case " ": - return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 311 /* SourceFile */; + return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 312 /* SourceFile */; default: return Debug.assertNever(triggerCharacter); } @@ -427366,7 +432235,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return false; } function isStaticProperty(symbol) { - return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) & 32 /* Static */ && isClassLike(symbol.valueDeclaration.parent)); + return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) & 256 /* Static */ && isClassLike(symbol.valueDeclaration.parent)); } function tryGetObjectLiteralContextualType(node, typeChecker) { const type = typeChecker.getContextualType(node); @@ -427382,7 +432251,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return void 0; } - function getImportStatementCompletionInfo(contextToken) { + function getImportStatementCompletionInfo(contextToken, sourceFile) { var _a, _b, _c; let keywordCompletion; let isKeywordOnlyCompletion = false; @@ -427398,6 +432267,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getCandidate() { const parent2 = contextToken.parent; if (isImportEqualsDeclaration(parent2)) { + const lastToken = parent2.getLastToken(sourceFile); + if (isIdentifier(contextToken) && lastToken !== contextToken) { + keywordCompletion = 161 /* FromKeyword */; + isKeywordOnlyCompletion = true; + return void 0; + } keywordCompletion = contextToken.kind === 156 /* TypeKeyword */ ? void 0 : 156 /* TypeKeyword */; return isModuleSpecifierMissingOrEmpty(parent2.moduleReference) ? parent2 : void 0; } @@ -427411,13 +432286,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (canCompleteFromNamedBindings(parent2)) { if (contextToken.kind === 20 /* CloseBraceToken */ || contextToken.kind === 80 /* Identifier */) { isKeywordOnlyCompletion = true; - keywordCompletion = 160 /* FromKeyword */; + keywordCompletion = 161 /* FromKeyword */; } else { return parent2.parent.parent; } } 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; @@ -427438,8 +432318,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (rangeIsOnSingleLine(top, sourceFile)) { return createTextSpanFromNode(top, sourceFile); } - Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 275 /* ImportSpecifier */); - const potentialSplitPoint = top.kind === 271 /* ImportDeclaration */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference; + Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 276 /* ImportSpecifier */); + const potentialSplitPoint = top.kind === 272 /* ImportDeclaration */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference; const withoutModuleSpecifier = { pos: top.getFirstToken().getStart(), end: potentialSplitPoint.pos @@ -427531,6 +432411,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return charCode; } + function isContextualKeywordInAutoImportableExpressionSpace(keyword) { + return keyword === "abstract" || keyword === "async" || keyword === "await" || keyword === "declare" || keyword === "module" || keyword === "namespace" || keyword === "type"; + } var moduleSpecifierResolutionLimit, moduleSpecifierResolutionCacheAttemptLimit, SortText, CompletionSource, SymbolOriginInfoKind, CompletionKind, _keywordCompletions, allKeywordsCompletions; var init_completions = __esm({ "src/services/completions.ts"() { @@ -427567,6 +432450,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/"; CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/"; CompletionSource2["SwitchCases"] = "SwitchCases/"; + CompletionSource2["ObjectLiteralMemberWithComma"] = "ObjectLiteralMemberWithComma/"; return CompletionSource2; })(CompletionSource || {}); SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => { @@ -427596,7 +432480,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} _keywordCompletions = []; allKeywordsCompletions = memoize(() => { const res = []; - for (let i = 83 /* FirstKeyword */; i <= 164 /* LastKeyword */; i++) { + for (let i = 83 /* FirstKeyword */; i <= 165 /* LastKeyword */; i++) { res.push({ name: tokenToString(i), kind: "keyword" /* keyword */, @@ -427632,7 +432516,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); } } @@ -427688,8 +432572,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries }; } case 2 /* Types */: { + const quoteChar = contextToken.kind === 15 /* NoSubstitutionTemplateLiteral */ ? 96 /* backtick */ : startsWith(getTextOfNode(contextToken), "'") ? 39 /* singleQuote */ : 34 /* doubleQuote */; const entries = completion.types.map((type) => ({ - name: type.value, + name: escapeString(type.value, quoteChar), kindModifiers: "" /* none */, kind: "string" /* string */, sortText: SortText.LocationPriority, @@ -427701,11 +432586,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) { @@ -427763,40 +432648,41 @@ ${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 200 /* LiteralType */: { + case 201 /* LiteralType */: { const grandParent = walkUpParentheses(parent2.parent); - if (grandParent.kind === 204 /* ImportType */) { - return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) }; + if (grandParent.kind === 205 /* ImportType */) { + return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; } return fromUnionableLiteralType(grandParent); } - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) { return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent); } return fromContextualType() || fromContextualType(0 /* None */); - case 211 /* ElementAccessExpression */: { + case 212 /* ElementAccessExpression */: { const { expression, argumentExpression } = parent2; if (node === skipParentheses(argumentExpression)) { return stringLiteralCompletionsFromProperties(typeChecker.getTypeAtLocation(expression)); } return void 0; } - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 290 /* JsxAttribute */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 291 /* JsxAttribute */: if (!isRequireCallArgument(node) && !isImportCall(parent2)) { - const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* 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 271 /* ImportDeclaration */: - case 277 /* ExportDeclaration */: - case 282 /* ExternalModuleReference */: - return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) }; - case 295 /* CaseClause */: + case 272 /* ImportDeclaration */: + case 278 /* ExportDeclaration */: + case 283 /* ExternalModuleReference */: + return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; + case 296 /* CaseClause */: const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses); const contextualTypes = fromContextualType(); if (!contextualTypes) { @@ -427809,21 +432695,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function fromUnionableLiteralType(grandParent) { switch (grandParent.kind) { - case 232 /* ExpressionWithTypeArguments */: - case 182 /* TypeReference */: { + case 233 /* ExpressionWithTypeArguments */: + case 183 /* TypeReference */: { const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent); if (typeArgument) { return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false }; } return void 0; } - case 198 /* IndexedAccessType */: + case 199 /* IndexedAccessType */: const { indexType, objectType } = grandParent; if (!rangeContainsPosition(indexType, position)) { return void 0; } return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType)); - case 191 /* UnionType */: { + case 192 /* UnionType */: { const result = fromUnionableLiteralType(walkUpParentheses(grandParent.parent)); if (!result) { return void 0; @@ -427848,9 +432734,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function walkUpParentheses(node) { switch (node.kind) { - case 195 /* ParenthesizedType */: + case 196 /* ParenthesizedType */: return walkUpParenthesizedTypes(node); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return walkUpParenthesizedExpressions(node); default: return node; @@ -427862,9 +432748,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) { let isNewIdentifier = false; const uniques = /* @__PURE__ */ new Map(); - const candidates = []; const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg; - checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates); + const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument); const types = flatMap(candidates, (candidate) => { if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length) return; @@ -427924,16 +432809,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function addReplacementSpans(text, textStart, names) { const span = getDirectoryFragmentTextSpan(text, textStart); const wholeSpan = text.length === 0 ? void 0 : createTextSpan(textStart, text.length); - return names.map(({ name, kind, extension }) => Math.max(name.indexOf(directorySeparator), name.indexOf(altDirectorySeparator)) !== -1 ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span }); + 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); } @@ -427964,30 +432851,27 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} extensionOptions, host, /*moduleSpecifierIsRelative*/ - false, + true, scriptPath ).values()); } } function getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker) { - const ambientModulesExtensions = !typeChecker ? [] : mapDefined( - typeChecker.getAmbientModules(), - (module2) => { - const name = module2.name.slice(1, -1); - if (!name.startsWith("*.") || name.includes("/")) - return; - return name.slice(1); - } - ); + const ambientModulesExtensions = !typeChecker ? [] : mapDefined(typeChecker.getAmbientModules(), (module2) => { + const name = module2.name.slice(1, -1); + if (!name.startsWith("*.") || name.includes("/")) + return; + return name.slice(1); + }); const extensions = [...getSupportedExtensions(compilerOptions), ambientModulesExtensions]; const moduleResolution = getEmitModuleResolutionKind(compilerOptions); return moduleResolutionUsesNodeModules(moduleResolution) ? getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) : extensions; } function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) { - rootDirs = rootDirs.map((rootDirectory) => normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory))); + rootDirs = rootDirs.map((rootDirectory) => ensureTrailingDirectorySeparator(normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory)))); const relativeDirectory = firstDefined(rootDirs, (rootDirectory) => containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : void 0); return deduplicate( - [...rootDirs.map((rootDirectory) => combinePaths(rootDirectory, relativeDirectory)), scriptDirectory], + [...rootDirs.map((rootDirectory) => combinePaths(rootDirectory, relativeDirectory)), scriptDirectory].map((baseDir) => removeTrailingDirectorySeparator(baseDir)), equateStringsCaseSensitive, compareStringsCaseSensitive ); @@ -427996,15 +432880,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; @@ -428056,7 +432943,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)); } } @@ -428071,7 +432964,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) }; @@ -428079,15 +432972,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); @@ -428102,9 +433002,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) { @@ -428125,7 +433036,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)) }); } } @@ -428225,9 +433136,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } const keys = getOwnKeys(exports); const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : ""); - const conditions = mode === 99 /* ESNext */ ? ["node", "import", "types"] : ["node", "require", "types"]; + const conditions = getConditions(compilerOptions, mode); addCompletionEntriesFromPathsOrExports( result, + /*isExports*/ + true, fragmentSubpath, packageDirectory, extensionOptions, @@ -428253,7 +433166,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } if (target && typeof target === "object" && !isArray(target)) { for (const condition in target) { - if (condition === "default" || conditions.indexOf(condition) > -1 || isApplicableVersionedTypesKey(conditions, condition)) { + if (condition === "default" || conditions.includes(condition) || isApplicableVersionedTypesKey(conditions, condition)) { const pattern = target[condition]; return getPatternFromFirstMatchingCondition(pattern, conditions); } @@ -428263,9 +433176,9 @@ ${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 !stringContains(path, "*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray; + return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray; } const pathPrefix = path.slice(0, path.length - 1); const remainingFragment = tryRemovePrefix(fragment, pathPrefix); @@ -428273,15 +433186,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; } @@ -428296,31 +433209,35 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const fragmentDirectory = fragmentHasPath ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0; const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory; const normalizedSuffix = normalizePath(parsed.suffix); + const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix); + const matchingSuffixes = declarationExtension ? [changeExtension(normalizedSuffix, declarationExtension), normalizedSuffix] : [normalizedSuffix]; const baseDirectory = normalizePath(combinePaths(packageDirectory, expandedPrefixDirectory)); const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; - const includeGlob = normalizedSuffix ? "**/*" + normalizedSuffix : "./*"; + const includeGlobs = normalizedSuffix ? matchingSuffixes.map((suffix) => "**/*" + suffix) : ["./*"]; const matches = mapDefined(tryReadDirectory( host, baseDirectory, extensionOptions.extensionsToSearch, /*exclude*/ void 0, - [includeGlob] + includeGlobs ), (match) => { const trimmedWithPattern = trimPrefixAndSuffix(match); if (trimmedWithPattern) { 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); } }); const directories = normalizedSuffix ? emptyArray : mapDefined(tryGetDirectories(host, baseDirectory), (dir) => dir === "node_modules" ? void 0 : directoryResult(dir)); return [...matches, ...directories]; function trimPrefixAndSuffix(path) { - const inner = withoutStartAndEnd(normalizePath(path), completePrefix, normalizedSuffix); - return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner); + return firstDefined(matchingSuffixes, (suffix) => { + const inner = withoutStartAndEnd(normalizePath(path), completePrefix, suffix); + return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner); + }); } } function withoutStartAndEnd(s, start, end) { @@ -428331,7 +433248,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) { const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name)); - const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.indexOf("*") < 0); + const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && !moduleName.includes("*")); if (fragmentDirectory !== void 0) { const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory); return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator)); @@ -428445,7 +433362,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return false; } function containsSlash(fragment) { - return stringContains(fragment, directorySeparator); + return fragment.includes(directorySeparator); } function isRequireCallArgument(node) { return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require"; @@ -428454,6 +433371,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} var init_stringCompletions = __esm({ "src/services/stringCompletions.ts"() { "use strict"; + init_moduleSpecifiers(); init_ts4(); init_ts_Completions(); kindPrecedence = { @@ -428544,14 +433462,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 212 /* CallExpression */: + case 213 /* CallExpression */: if (isImportCall(direct)) { handleImportCall(direct); break; } if (!isAvailableThroughGlobal) { const parent2 = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent2.kind === 259 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent2.kind === 260 /* VariableDeclaration */) { const { name } = parent2; if (name.kind === 80 /* Identifier */) { directImports.push(name); @@ -428562,19 +433480,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} break; case 80 /* Identifier */: break; - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: handleNamespaceImport( direct, direct.name, - hasSyntacticModifier(direct, 1 /* Export */), + hasSyntacticModifier(direct, 32 /* Export */), /*alreadyAddedDirect*/ false ); break; - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: directImports.push(direct); const namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 273 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 274 /* NamespaceImport */) { handleNamespaceImport( direct, namedBindings.name, @@ -428587,10 +433505,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); } break; - case 277 /* ExportDeclaration */: + case 278 /* ExportDeclaration */: if (!direct.exportClause) { handleDirectImports(getContainingModuleSymbol(direct, checker)); - } else if (direct.exportClause.kind === 279 /* NamespaceExport */) { + } else if (direct.exportClause.kind === 280 /* NamespaceExport */) { addIndirectUser( getSourceFileLikeForImportDeclaration(direct), /*addTransitiveDependencies*/ @@ -428600,7 +433518,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} directImports.push(direct); } break; - case 204 /* ImportType */: + case 205 /* ImportType */: if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported2(direct)) { addIndirectUser( direct.getSourceFile(), @@ -428641,7 +433559,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} directImports.push(importDeclaration); } else if (!isAvailableThroughGlobal) { const sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - Debug.assert(sourceFileLike.kind === 311 /* SourceFile */ || sourceFileLike.kind === 266 /* ModuleDeclaration */); + Debug.assert(sourceFileLike.kind === 312 /* SourceFile */ || sourceFileLike.kind === 267 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUser( sourceFileLike, @@ -428695,7 +433613,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return { importSearches, singleReferences }; function handleImport(decl) { - if (decl.kind === 270 /* ImportEqualsDeclaration */) { + if (decl.kind === 271 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -428705,7 +433623,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} handleNamespaceImportLike(decl); return; } - if (decl.kind === 204 /* ImportType */) { + if (decl.kind === 205 /* ImportType */) { if (decl.qualifier) { const firstIdentifier = getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === symbolName(exportSymbol)) { @@ -428719,7 +433637,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (decl.moduleSpecifier.kind !== 11 /* StringLiteral */) { return; } - if (decl.kind === 277 /* ExportDeclaration */) { + if (decl.kind === 278 /* ExportDeclaration */) { if (decl.exportClause && isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -428728,10 +433646,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const { name, namedBindings } = decl.importClause || { name: void 0, namedBindings: void 0 }; if (namedBindings) { switch (namedBindings.kind) { - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 274 /* NamedImports */: + case 275 /* NamedImports */: if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); } @@ -428765,7 +433683,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} addSearch(name, checker.getSymbolAtLocation(name)); } } else { - const localSymbol = element.kind === 280 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name); + const localSymbol = element.kind === 281 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); } } @@ -428789,7 +433707,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const checker = program.getTypeChecker(); for (const referencingFile of sourceFiles) { const searchSourceFile = searchModuleSymbol.valueDeclaration; - if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 311 /* SourceFile */) { + if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 312 /* SourceFile */) { for (const ref of referencingFile.referencedFiles) { if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { refs.push({ kind: "reference", referencingFile, ref }); @@ -428831,7 +433749,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return map2; } function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return forEach(sourceFileLike.kind === 311 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => ( + return forEach(sourceFileLike.kind === 312 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => ( // TODO: GH#18217 action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action) )); @@ -428844,15 +433762,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } else { forEachPossibleImportOrExportStatement(sourceFile, (statement) => { switch (statement.kind) { - case 277 /* ExportDeclaration */: - case 271 /* ImportDeclaration */: { + case 278 /* ExportDeclaration */: + case 272 /* ImportDeclaration */: { const decl = statement; if (decl.moduleSpecifier && isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 270 /* ImportEqualsDeclaration */: { + case 271 /* ImportEqualsDeclaration */: { const decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -428870,7 +433788,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const { parent: parent2 } = node; const grandparent = parent2.parent; if (symbol.exportSymbol) { - if (parent2.kind === 210 /* PropertyAccessExpression */) { + if (parent2.kind === 211 /* PropertyAccessExpression */) { return ((_a = symbol.declarations) == null ? void 0 : _a.some((d) => d === parent2)) && isBinaryExpression(grandparent) ? getSpecialPropertyExport( grandparent, /*useLhsSymbol*/ @@ -428881,7 +433799,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } else { const exportNode = getExportNode(parent2, node); - if (exportNode && hasSyntacticModifier(exportNode, 1 /* Export */)) { + if (exportNode && hasSyntacticModifier(exportNode, 32 /* Export */)) { if (isImportEqualsDeclaration(exportNode) && exportNode.moduleReference === node) { if (comingFromExport) { return void 0; @@ -428958,7 +433876,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return exportInfo2 && { kind: 1 /* Export */, symbol: symbol2, exportInfo: exportInfo2 }; } function getExportKindForDeclaration(node2) { - return hasSyntacticModifier(node2, 1024 /* Default */) ? 1 /* Default */ : 0 /* Named */; + return hasSyntacticModifier(node2, 2048 /* Default */) ? 1 /* Default */ : 0 /* Named */; } } function getExportEqualsLocalSymbol(importedSymbol, checker) { @@ -428987,15 +433905,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isNodeImport(node) { const { parent: parent2 } = node; switch (parent2.kind) { - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return parent2.name === node && isExternalModuleImportEquals(parent2); - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: return !parent2.propertyName; - case 272 /* ImportClause */: - case 273 /* NamespaceImport */: + case 273 /* ImportClause */: + case 274 /* NamespaceImport */: Debug.assert(parent2.name === node); return true; - case 207 /* BindingElement */: + case 208 /* BindingElement */: return isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(parent2.parent.parent); default: return false; @@ -429026,21 +433944,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 212 /* CallExpression */) { + if (node.kind === 213 /* CallExpression */) { return node.getSourceFile(); } const { parent: parent2 } = node; - if (parent2.kind === 311 /* SourceFile */) { + if (parent2.kind === 312 /* SourceFile */) { return parent2; } - Debug.assert(parent2.kind === 267 /* ModuleBlock */); + Debug.assert(parent2.kind === 268 /* ModuleBlock */); return cast(parent2.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 266 /* ModuleDeclaration */ && node.name.kind === 11 /* StringLiteral */; + return node.kind === 267 /* ModuleDeclaration */ && node.name.kind === 11 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 282 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 11 /* StringLiteral */; + return eq.moduleReference.kind === 283 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 11 /* StringLiteral */; } var ExportKind2, ImportExport; var init_importTracker = __esm({ @@ -429092,10 +434010,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } else if (isStringLiteralLike(node)) { const validImport = tryGetImportFromModuleSpecifier(node); if (validImport) { - const declOrStatement = findAncestor( - validImport, - (node2) => isDeclaration(node2) || isStatement(node2) || isJSDocTag(node2) - ); + const declOrStatement = findAncestor(validImport, (node2) => isDeclaration(node2) || isStatement(node2) || isJSDocTag(node2)); return isDeclaration(declOrStatement) ? getContextNode(declOrStatement) : declOrStatement; } } @@ -429105,7 +434020,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (node.parent.name === node || // node is name of declaration, use parent isConstructorDeclaration(node.parent) || isExportAssignment(node.parent) || // Property name of the import export specifier or binding pattern, use parent (isImportOrExportSpecifier(node.parent) || isBindingElement(node.parent)) && node.parent.propertyName === node || // Is default export - node.kind === 90 /* DefaultKeyword */ && hasSyntacticModifier(node.parent, 1025 /* ExportDefault */)) { + node.kind === 90 /* DefaultKeyword */ && hasSyntacticModifier(node.parent, 2080 /* ExportDefault */)) { return getContextNode(node.parent); } return void 0; @@ -429114,34 +434029,36 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!node) return void 0; switch (node.kind) { - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: return !isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : isVariableStatement(node.parent.parent) ? node.parent.parent : isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 207 /* BindingElement */: + case 208 /* BindingElement */: return getContextNode(node.parent.parent); - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: return node.parent.parent.parent; - case 280 /* ExportSpecifier */: - case 273 /* NamespaceImport */: + case 281 /* ExportSpecifier */: + case 274 /* NamespaceImport */: return node.parent.parent; - case 272 /* ImportClause */: - case 279 /* NamespaceExport */: + case 273 /* ImportClause */: + case 280 /* NamespaceExport */: return node.parent; - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return isExpressionStatement(node.parent) ? node.parent : node; - case 249 /* ForOfStatement */: - case 248 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 249 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode( - findAncestor( - node.parent, - (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2) - ) + 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; } @@ -429174,7 +434091,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const node = getTouchingPropertyName(sourceFile, position); let referenceEntries; const entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); - if (node.parent.kind === 210 /* PropertyAccessExpression */ || node.parent.kind === 207 /* BindingElement */ || node.parent.kind === 211 /* ElementAccessExpression */ || node.kind === 108 /* SuperKeyword */) { + if (node.parent.kind === 211 /* PropertyAccessExpression */ || node.parent.kind === 208 /* BindingElement */ || node.parent.kind === 212 /* ElementAccessExpression */ || node.kind === 108 /* SuperKeyword */) { referenceEntries = entries && [...entries]; } else if (entries) { const queue = createQueue(entries); @@ -429195,11 +434112,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return map(referenceEntries, (entry) => toImplementationLocation(entry, checker)); } function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 311 /* SourceFile */) { + if (node.kind === 312 /* SourceFile */) { return void 0; } const checker = program.getTypeChecker(); - if (node.parent.kind === 303 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) { const result = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, (node2) => result.push(nodeEntry(node2))); return result; @@ -429394,12 +434311,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node); if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); - } else if (node.kind === 209 /* ObjectLiteralExpression */) { + } else if (node.kind === 210 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [punctuationPart(21 /* OpenParenToken */), textPart("object literal"), punctuationPart(22 /* CloseParenToken */)] }; - } else if (node.kind === 230 /* ClassExpression */) { + } else if (node.kind === 231 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [punctuationPart(21 /* OpenParenToken */), textPart("anonymous local class"), punctuationPart(22 /* CloseParenToken */)] @@ -429436,6 +434353,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) { @@ -429454,49 +434374,49 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return !!(source && ((_a = target.declarations) == null ? void 0 : _a.some((d) => d === source || d === commonjsSource))); } function declarationIsWriteAccess(decl) { - if (!!(decl.flags & 16777216 /* Ambient */)) + if (!!(decl.flags & 33554432 /* Ambient */)) return true; switch (decl.kind) { - case 225 /* BinaryExpression */: - case 207 /* BindingElement */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: + case 226 /* BinaryExpression */: + case 208 /* BindingElement */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: case 90 /* DefaultKeyword */: - case 265 /* EnumDeclaration */: - case 305 /* EnumMember */: - case 280 /* ExportSpecifier */: - case 272 /* ImportClause */: - case 270 /* ImportEqualsDeclaration */: - case 275 /* ImportSpecifier */: - case 263 /* InterfaceDeclaration */: - case 344 /* JSDocCallbackTag */: - case 352 /* JSDocTypedefTag */: - case 290 /* JsxAttribute */: - case 266 /* ModuleDeclaration */: - case 269 /* NamespaceExportDeclaration */: - case 273 /* NamespaceImport */: - case 279 /* NamespaceExport */: - case 168 /* Parameter */: - case 303 /* ShorthandPropertyAssignment */: - case 264 /* TypeAliasDeclaration */: - case 167 /* TypeParameter */: + case 266 /* EnumDeclaration */: + case 306 /* EnumMember */: + case 281 /* ExportSpecifier */: + case 273 /* ImportClause */: + case 271 /* ImportEqualsDeclaration */: + case 276 /* ImportSpecifier */: + case 264 /* InterfaceDeclaration */: + case 345 /* JSDocCallbackTag */: + case 353 /* JSDocTypedefTag */: + case 291 /* JsxAttribute */: + case 267 /* ModuleDeclaration */: + case 270 /* NamespaceExportDeclaration */: + case 274 /* NamespaceImport */: + case 280 /* NamespaceExport */: + case 169 /* Parameter */: + case 304 /* ShorthandPropertyAssignment */: + case 265 /* TypeAliasDeclaration */: + case 168 /* TypeParameter */: return true; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return !isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 175 /* Constructor */: - case 173 /* MethodDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 176 /* Constructor */: + case 174 /* MethodDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: return !!decl.body; - case 259 /* VariableDeclaration */: - case 171 /* PropertyDeclaration */: + case 260 /* VariableDeclaration */: + case 172 /* PropertyDeclaration */: return !!decl.initializer || isCatchClause(decl.parent); - case 172 /* MethodSignature */: - case 170 /* PropertySignature */: - case 354 /* JSDocPropertyTag */: - case 347 /* JSDocParameterTag */: + case 173 /* MethodSignature */: + case 171 /* PropertySignature */: + case 355 /* JSDocPropertyTag */: + case 348 /* JSDocParameterTag */: return false; default: return Debug.failBadSyntaxKind(decl); @@ -429533,7 +434453,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} })(FindReferencesUse || {}); ((Core2) => { function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) { - var _a, _b, _c; + var _a, _b; node = getAdjustedNode2(node, options); if (isSourceFile(node)) { const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program); @@ -429572,7 +434492,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!options.implementations && isStringLiteralLike(node)) { if (isModuleSpecifierLike(node)) { const fileIncludeReasons = program.getFileIncludeReasons(); - const referencedFileName = (_c = (_b = (_a = node.getSourceFile().resolvedModules) == null ? void 0 : _a.get(node.text, getModeForUsageLocation(node.getSourceFile(), node))) == null ? void 0 : _b.resolvedModule) == null ? void 0 : _c.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 }]; @@ -429635,7 +434555,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} for (const ref of references) { if (isReferencedFile(ref)) { const referencingFile = program.getSourceFileByPath(ref.file); - const location = getReferencedFileLocation(program.getSourceFileByPath, ref); + const location = getReferencedFileLocation(program, ref); if (isReferenceFileLocation(location)) { entries = append(entries, { kind: 0 /* Span */, @@ -429749,9 +434669,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (symbol.declarations) { for (const decl of symbol.declarations) { switch (decl.kind) { - case 311 /* SourceFile */: + case 312 /* SourceFile */: break; - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -429875,7 +434795,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getSpecialSearchKind(node) { switch (node.kind) { - case 175 /* Constructor */: + case 176 /* Constructor */: case 137 /* ConstructorKeyword */: return 1 /* Constructor */; case 80 /* Identifier */: @@ -430084,16 +435004,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getSymbolScope(symbol) { const { declarations, flags, parent: parent2, valueDeclaration } = symbol; - if (valueDeclaration && (valueDeclaration.kind === 217 /* FunctionExpression */ || valueDeclaration.kind === 230 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 218 /* FunctionExpression */ || valueDeclaration.kind === 231 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { return void 0; } if (flags & (4 /* Property */ | 8192 /* Method */)) { - const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 8 /* Private */) || isPrivateIdentifierClassElementDeclaration(d)); + const privateDeclaration = find(declarations, (d) => hasEffectiveModifier(d, 2 /* Private */) || isPrivateIdentifierClassElementDeclaration(d)); if (privateDeclaration) { - return getAncestor(privateDeclaration, 262 /* ClassDeclaration */); + return getAncestor(privateDeclaration, 263 /* ClassDeclaration */); } return void 0; } @@ -430110,7 +435030,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (scope && scope !== container) { return void 0; } - if (!container || container.kind === 311 /* SourceFile */ && !isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 312 /* SourceFile */ && !isExternalOrCommonJsModule(container)) { return void 0; } scope = container; @@ -430188,7 +435108,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } Core2.someSignatureUsage = someSignatureUsage; function getPossibleSymbolReferenceNodes(sourceFile, symbolName2, container = sourceFile) { - return getPossibleSymbolReferencePositions(sourceFile, symbolName2, container).map((pos) => getTouchingPropertyName(sourceFile, pos)); + return mapDefined(getPossibleSymbolReferencePositions(sourceFile, symbolName2, container), (pos) => { + const referenceLocation = getTouchingPropertyName(sourceFile, pos); + return referenceLocation === sourceFile ? void 0 : referenceLocation; + }); } function getPossibleSymbolReferencePositions(sourceFile, symbolName2, container = sourceFile) { const positions = []; @@ -430301,6 +435224,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); @@ -430327,6 +435254,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; @@ -430457,14 +435393,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (constructorSymbol && constructorSymbol.declarations) { for (const decl of constructorSymbol.declarations) { const ctrKeyword = findChildOfKind(decl, 137 /* ConstructorKeyword */, sourceFile); - Debug.assert(decl.kind === 175 /* Constructor */ && !!ctrKeyword); + Debug.assert(decl.kind === 176 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach((member) => { const decl = member.valueDeclaration; - if (decl && decl.kind === 173 /* MethodDeclaration */) { + if (decl && decl.kind === 174 /* MethodDeclaration */) { const body = decl.body; if (body) { forEachDescendantOfKind(body, 110 /* ThisKeyword */, (thisKeyword) => { @@ -430486,7 +435422,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return; } for (const decl of constructor.declarations) { - Debug.assert(decl.kind === 175 /* Constructor */); + Debug.assert(decl.kind === 176 /* Constructor */); const body = decl.body; if (body) { forEachDescendantOfKind(body, 108 /* SuperKeyword */, (node) => { @@ -430521,12 +435457,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (refNode.kind !== 80 /* Identifier */) { return; } - if (refNode.parent.kind === 303 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 304 /* ShorthandPropertyAssignment */) { getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2); } - const containingClass = getContainingClassIfInHeritageClause(refNode); - if (containingClass) { - addReference2(containingClass); + const containingNode = getContainingNodeIfInHeritageClause(refNode); + if (containingNode) { + addReference2(containingNode); return; } const typeNode = findAncestor(refNode, (a) => !isQualifiedName(a.parent) && !isTypeNode(a.parent) && !isTypeElement(a.parent)); @@ -430536,7 +435472,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} addIfImplementation(typeHavingNode.initializer); } else if (isFunctionLike(typeHavingNode) && typeHavingNode.body) { const body = typeHavingNode.body; - if (body.kind === 240 /* Block */) { + if (body.kind === 241 /* Block */) { forEachReturnStatement(body, (returnStatement) => { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -430553,18 +435489,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} addReference2(e); } } - function getContainingClassIfInHeritageClause(node) { - return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingClassIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, isClassLike) : void 0; + function getContainingNodeIfInHeritageClause(node) { + return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingNodeIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, or(isClassLike, isInterfaceDeclaration)) : void 0; } function isImplementationExpression(node) { switch (node.kind) { - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 218 /* ArrowFunction */: - case 217 /* FunctionExpression */: - case 209 /* ObjectLiteralExpression */: - case 230 /* ClassExpression */: - case 208 /* ArrayLiteralExpression */: + case 219 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 210 /* ObjectLiteralExpression */: + case 231 /* ClassExpression */: + case 209 /* ArrayLiteralExpression */: return true; default: return false; @@ -430580,10 +435516,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return cached; } cachedResults.set(key, false); - const inherits = !!symbol.declarations && symbol.declarations.some((declaration) => getAllSuperTypeNodes(declaration).some((typeReference) => { - const type = checker.getTypeAtLocation(typeReference); - return !!type && !!type.symbol && explicitlyInheritsFrom(type.symbol, parent2, cachedResults, checker); - })); + const inherits = !!symbol.declarations && symbol.declarations.some( + (declaration) => getAllSuperTypeNodes(declaration).some((typeReference) => { + const type = checker.getTypeAtLocation(typeReference); + return !!type && !!type.symbol && explicitlyInheritsFrom(type.symbol, parent2, cachedResults, checker); + }) + ); cachedResults.set(key, inherits); return inherits; } @@ -430596,15 +435534,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!searchSpaceNode) { return void 0; } - let staticFlag = 32 /* Static */; + let staticFlag = 256 /* Static */; switch (searchSpaceNode.kind) { - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: staticFlag &= getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; @@ -430626,7 +435564,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references }]; } function isParameterName(node) { - return node.kind === 80 /* Identifier */ && node.parent.kind === 168 /* Parameter */ && node.parent.name === node; + return node.kind === 80 /* Identifier */ && node.parent.kind === 169 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { let searchSpaceNode = getThisContainer( @@ -430636,34 +435574,34 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} /*includeClassComputedPropertyName*/ false ); - let staticFlag = 32 /* Static */; + let staticFlag = 256 /* Static */; switch (searchSpaceNode.kind) { - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: if (isObjectLiteralMethod(searchSpaceNode)) { staticFlag &= getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; } - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: staticFlag &= getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; - case 311 /* SourceFile */: + case 312 /* SourceFile */: if (isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return void 0; } - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: break; default: return void 0; } - const references = flatMap(searchSpaceNode.kind === 311 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => { + const references = flatMap(searchSpaceNode.kind === 312 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter((node) => { if (!isThis(node)) { @@ -430679,18 +435617,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!canHaveSymbol(container)) return false; switch (searchSpaceNode.kind) { - case 217 /* FunctionExpression */: - case 261 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 262 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: return isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 230 /* ClassExpression */: - case 262 /* ClassDeclaration */: - case 209 /* ObjectLiteralExpression */: + case 231 /* ClassExpression */: + case 263 /* ClassDeclaration */: + case 210 /* ObjectLiteralExpression */: return container.parent && canHaveSymbol(container.parent) && searchSpaceNode.symbol === container.parent.symbol && isStatic(container) === !!staticFlag; - case 311 /* SourceFile */: - return container.kind === 311 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node); + case 312 /* SourceFile */: + return container.kind === 312 /* SourceFile */ && !isExternalModule(container) && !isParameterName(node); } }); }).map((n) => nodeEntry(n)); @@ -430708,7 +435646,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 { @@ -430722,6 +435660,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( @@ -430814,7 +435757,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - const exportSpecifier = getDeclarationOfKind(symbol, 280 /* ExportSpecifier */); + const exportSpecifier = getDeclarationOfKind(symbol, 281 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { const localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -430855,7 +435798,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ) || (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */) && allowBaseTypes(rootSymbol) ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, (base) => cbSymbol(sym, rootSymbol, base, kind)) : void 0)); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol2, checker2) { - const bindingElement = getDeclarationOfKind(symbol2, 207 /* BindingElement */); + const bindingElement = getDeclarationOfKind(symbol2, 208 /* BindingElement */); if (bindingElement && isObjectBindingElementWithoutPropertyName(bindingElement)) { return getPropertySymbolFromBindingElement(checker2, bindingElement); } @@ -430878,7 +435821,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!symbol.valueDeclaration) return false; const modifierFlags = getEffectiveModifierFlags(symbol.valueDeclaration); - return !!(modifierFlags & 32 /* Static */); + return !!(modifierFlags & 256 /* Static */); } function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { const { checker } = state; @@ -430921,7 +435864,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } Core2.getIntersectingMeaningFromDeclarations = getIntersectingMeaningFromDeclarations; function isImplementation(node) { - return !!(node.flags & 16777216 /* Ambient */) ? !(isInterfaceDeclaration(node) || isTypeAliasDeclaration(node)) : isVariableLike(node) ? hasInitializer(node) : isFunctionLikeDeclaration(node) ? !!node.body : isClassLike(node) || isModuleOrEnumDeclaration(node); + return !!(node.flags & 33554432 /* Ambient */) ? !(isInterfaceDeclaration(node) || isTypeAliasDeclaration(node)) : isVariableLike(node) ? hasInitializer(node) : isFunctionLikeDeclaration(node) ? !!node.body : isClassLike(node) || isModuleOrEnumDeclaration(node); } function getReferenceEntriesForShorthandPropertyAssignment(node, checker, addReference2) { const refSymbol = checker.getSymbolAtLocation(node); @@ -430980,6 +435923,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} getTextSpanOfEntry: () => getTextSpanOfEntry, isContextWithStartAndEndNode: () => isContextWithStartAndEndNode, isDeclarationOfSymbol: () => isDeclarationOfSymbol, + isWriteAccessForReference: () => isWriteAccessForReference, nodeEntry: () => nodeEntry, toContextSpan: () => toContextSpan, toHighlightSpan: () => toHighlightSpan, @@ -430996,7 +435940,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} // src/services/goToDefinition.ts function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly, stopAtAlias) { - var _a, _b; + var _a; const resolvedRef = getReferenceAtPosition(sourceFile, position, program); const fileReferenceDefinition = resolvedRef && [getDefinitionInfoForFileReference(resolvedRef.reference.fileName, resolvedRef.fileName, resolvedRef.unverified)] || emptyArray; if (resolvedRef == null ? void 0 : resolvedRef.file) { @@ -431008,7 +435952,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } const { parent: parent2 } = node; const typeChecker = program.getTypeChecker(); - if (node.kind === 163 /* OverrideKeyword */ || isIdentifier(node) && isJSDocOverrideTag(parent2) && parent2.tagName === node) { + if (node.kind === 164 /* OverrideKeyword */ || isIdentifier(node) && isJSDocOverrideTag(parent2) && parent2.tagName === node) { return getDefinitionFromOverriddenMember(typeChecker, node) || emptyArray; } if (isJumpStatementTarget(node)) { @@ -431022,9 +435966,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)); @@ -431069,7 +436024,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } if (!symbol && isModuleSpecifierLike(fallbackNode)) { - const ref = (_b = (_a = sourceFile.resolvedModules) == null ? void 0 : _a.get(fallbackNode.text, getModeForUsageLocation(sourceFile, fallbackNode))) == null ? void 0 : _b.resolvedModule; + const ref = (_a = program.getResolvedModuleFromModuleSpecifier(fallbackNode)) == null ? void 0 : _a.resolvedModule; if (ref) { return [{ name: fallbackNode.text, @@ -431099,7 +436054,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return node.kind === 108 /* SuperKeyword */ ? [sigInfo, ...defs] : [...defs, sigInfo]; } } - if (node.parent.kind === 303 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) { const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); const definitions = (shorthandSymbol == null ? void 0 : shorthandSymbol.declarations) ? shorthandSymbol.declarations.map((decl) => createDefinitionInfo( decl, @@ -431164,7 +436119,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return getDefinitionFromSymbol(typeChecker, symbol, node); } function getReferenceAtPosition(sourceFile, position, program) { - var _a, _b, _c, _d; + var _a, _b; const referencePath = findReferenceInPosition(sourceFile.referencedFiles, position); if (referencePath) { const file = program.getSourceFileFromReference(sourceFile, referencePath); @@ -431181,10 +436136,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const file = program.getLibFileFromReference(libReferenceDirective); return file && { reference: libReferenceDirective, fileName: file.fileName, file, unverified: false }; } - if ((_b = sourceFile.resolvedModules) == null ? void 0 : _b.size()) { + if (sourceFile.imports.length || sourceFile.moduleAugmentations.length) { const node = getTouchingToken(sourceFile, position); - if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && sourceFile.resolvedModules.has(node.text, getModeForUsageLocation(sourceFile, node))) { - const verifiedFileName = (_d = (_c = sourceFile.resolvedModules.get(node.text, getModeForUsageLocation(sourceFile, node))) == null ? void 0 : _c.resolvedModule) == null ? void 0 : _d.resolvedFileName; + let resolution; + 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 { file: program.getSourceFile(fileName), @@ -431200,6 +436156,55 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return void 0; } + function shouldUnwrapFirstTypeArgumentTypeDefinitionFromTypeReference(typeChecker, type) { + const referenceName = type.symbol.name; + if (!typesWithUnwrappedTypeArguments.has(referenceName)) { + return false; + } + const globalType = typeChecker.resolveName( + referenceName, + /*location*/ + void 0, + 788968 /* Type */, + /*excludeGlobals*/ + false + ); + return !!globalType && globalType === type.target.symbol; + } + function shouldUnwrapFirstTypeArgumentTypeDefinitionFromAlias(typeChecker, type) { + if (!type.aliasSymbol) { + return false; + } + const referenceName = type.aliasSymbol.name; + if (!typesWithUnwrappedTypeArguments.has(referenceName)) { + return false; + } + const globalType = typeChecker.resolveName( + referenceName, + /*location*/ + void 0, + 788968 /* Type */, + /*excludeGlobals*/ + false + ); + return !!globalType && globalType === type.aliasSymbol; + } + function getFirstTypeArgumentDefinitions(typeChecker, type, node, failedAliasResolution) { + var _a, _b; + if (!!(getObjectFlags(type) & 4 /* Reference */) && shouldUnwrapFirstTypeArgumentTypeDefinitionFromTypeReference(typeChecker, type)) { + return definitionFromType(typeChecker.getTypeArguments(type)[0], typeChecker, node, failedAliasResolution); + } + if (shouldUnwrapFirstTypeArgumentTypeDefinitionFromAlias(typeChecker, type) && type.aliasTypeArguments) { + return definitionFromType(type.aliasTypeArguments[0], typeChecker, node, failedAliasResolution); + } + if (getObjectFlags(type) & 32 /* Mapped */ && type.target && shouldUnwrapFirstTypeArgumentTypeDefinitionFromAlias(typeChecker, type.target)) { + const declaration = (_b = (_a = type.aliasSymbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b[0]; + if (declaration && isTypeAliasDeclaration(declaration) && isTypeReferenceNode(declaration.type) && declaration.type.typeArguments) { + return definitionFromType(typeChecker.getTypeAtLocation(declaration.type.typeArguments[0]), typeChecker, node, failedAliasResolution); + } + } + return []; + } function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) { const node = getTouchingPropertyName(sourceFile, position); if (node === sourceFile) { @@ -431225,8 +436230,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node); const returnType = tryGetReturnTypeOfFunction(symbol, typeAtLocation, typeChecker); const fromReturnType = returnType && definitionFromType(returnType, typeChecker, node, failedAliasResolution); - const typeDefinitions = fromReturnType && fromReturnType.length !== 0 ? fromReturnType : definitionFromType(typeAtLocation, typeChecker, node, failedAliasResolution); - return typeDefinitions.length ? typeDefinitions : !(symbol.flags & 111551 /* Value */) && symbol.flags & 788968 /* Type */ ? getDefinitionFromSymbol(typeChecker, skipAlias(symbol, typeChecker), node, failedAliasResolution) : void 0; + const [resolvedType, typeDefinitions] = fromReturnType && fromReturnType.length !== 0 ? [returnType, fromReturnType] : [typeAtLocation, definitionFromType(typeAtLocation, typeChecker, node, failedAliasResolution)]; + return typeDefinitions.length ? [...getFirstTypeArgumentDefinitions(typeChecker, resolvedType, node, failedAliasResolution), ...typeDefinitions] : !(symbol.flags & 111551 /* Value */) && symbol.flags & 788968 /* Type */ ? getDefinitionFromSymbol(typeChecker, skipAlias(symbol, typeChecker), node, failedAliasResolution) : void 0; } function definitionFromType(type, checker, node, failedAliasResolution) { return flatMap(type.isUnion() && !(type.flags & 32 /* Enum */) ? type.types : [type], (t) => t.symbol && getDefinitionFromSymbol(checker, t.symbol, node, failedAliasResolution)); @@ -431276,7 +436281,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (node.parent === declaration) { return true; } - if (declaration.kind === 273 /* NamespaceImport */) { + if (declaration.kind === 274 /* NamespaceImport */) { return false; } return true; @@ -431366,11 +436371,28 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ts_FindAllReferences_exports.getContextNode(declaration) ), isLocal: !isDefinitionVisible(checker, declaration), - isAmbient: !!(declaration.flags & 16777216 /* Ambient */), + isAmbient: !!(declaration.flags & 33554432 /* Ambient */), unverified, 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; @@ -431379,19 +436401,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (hasInitializer(declaration.parent) && declaration.parent.initializer === declaration) return isDefinitionVisible(checker, declaration.parent); switch (declaration.kind) { - case 171 /* PropertyDeclaration */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 173 /* MethodDeclaration */: - if (hasEffectiveModifier(declaration, 8 /* Private */)) + case 172 /* PropertyDeclaration */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 174 /* MethodDeclaration */: + if (hasEffectiveModifier(declaration, 2 /* Private */)) return false; - case 175 /* Constructor */: - case 302 /* PropertyAssignment */: - case 303 /* ShorthandPropertyAssignment */: - case 209 /* ObjectLiteralExpression */: - case 230 /* ClassExpression */: - case 218 /* ArrowFunction */: - case 217 /* FunctionExpression */: + case 176 /* Constructor */: + case 303 /* PropertyAssignment */: + case 304 /* ShorthandPropertyAssignment */: + case 210 /* ObjectLiteralExpression */: + case 231 /* ClassExpression */: + case 219 /* ArrowFunction */: + case 218 /* FunctionExpression */: return isDefinitionVisible(checker, declaration.parent); default: return false; @@ -431435,18 +436457,41 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isConstructorLike(node) { switch (node.kind) { - case 175 /* Constructor */: - case 184 /* ConstructorType */: - case 179 /* ConstructSignature */: + case 176 /* Constructor */: + case 185 /* ConstructorType */: + case 180 /* ConstructSignature */: return true; default: return false; } } + var typesWithUnwrappedTypeArguments; var init_goToDefinition = __esm({ "src/services/goToDefinition.ts"() { "use strict"; init_ts4(); + init_ts_FindAllReferences(); + typesWithUnwrappedTypeArguments = /* @__PURE__ */ new Set([ + "Array", + "ArrayLike", + "ReadonlyArray", + "Promise", + "PromiseLike", + "Iterable", + "IterableIterator", + "AsyncIterable", + "Set", + "WeakSet", + "ReadonlySet", + "Map", + "WeakMap", + "ReadonlyMap", + "Partial", + "Required", + "Readonly", + "Pick", + "Omit" + ]); } }); @@ -431474,10 +436519,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function shouldShowLiteralParameterNameHintsOnly(preferences) { return preferences.includeInlayParameterNameHints === "literals"; } + function shouldUseInteractiveInlayHints(preferences) { + return preferences.interactiveInlayHints === true; + } function provideInlayHints(context) { const { file, program, span, cancellationToken, preferences } = context; const sourceFileText = file.text; const compilerOptions = program.getCompilerOptions(); + const quotePreference = getQuotePreference(file, preferences); const checker = program.getTypeChecker(); const result = []; visitor(file); @@ -431487,14 +436536,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return; } switch (node.kind) { - case 266 /* ModuleDeclaration */: - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 261 /* FunctionDeclaration */: - case 230 /* ClassExpression */: - case 217 /* FunctionExpression */: - case 173 /* MethodDeclaration */: - case 218 /* ArrowFunction */: + case 267 /* ModuleDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 262 /* FunctionDeclaration */: + case 231 /* ClassExpression */: + case 218 /* FunctionExpression */: + case 174 /* MethodDeclaration */: + case 219 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } if (!textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { @@ -431524,17 +436573,27 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function isSignatureSupportingReturnAnnotation(node) { return isArrowFunction(node) || isFunctionExpression(node) || isFunctionDeclaration(node) || isMethodDeclaration(node) || isGetAccessorDeclaration(node); } - function addParameterHints(text, position, isFirstVariadicArgument) { + function addParameterHints(text, parameter, position, isFirstVariadicArgument) { + let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`; + let displayParts; + if (shouldUseInteractiveInlayHints(preferences)) { + displayParts = [getNodeDisplayPart(hintText, parameter), { text: ":" }]; + hintText = ""; + } else { + hintText += ":"; + } result.push({ - text: `${isFirstVariadicArgument ? "..." : ""}${truncation(text, maxHintsLength)}:`, + text: hintText, position, kind: "Parameter" /* Parameter */, - whitespaceAfter: true + whitespaceAfter: true, + displayParts }); } - function addTypeHints(text, position) { + function addTypeHints(hintText, position) { result.push({ - text: `: ${truncation(text, maxHintsLength)}`, + text: typeof hintText === "string" ? `: ${hintText}` : "", + displayParts: typeof hintText === "string" ? void 0 : [{ text: ": " }, ...hintText], position, kind: "Type" /* Type */, whitespaceBefore: true @@ -431542,7 +436601,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function addEnumMemberValueHints(text, position) { result.push({ - text: `= ${truncation(text, maxHintsLength)}`, + text: `= ${text}`, position, kind: "Enum" /* Enum */, whitespaceBefore: true @@ -431572,13 +436631,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isModuleReferenceType(declarationType)) { return; } - const typeDisplayString = printTypeInSingleLine(declarationType); - if (typeDisplayString) { - const isVariableNameMatchesType = preferences.includeInlayVariableTypeHintsWhenTypeMatchesName === false && equateStringsCaseInsensitive(decl.name.getText(), typeDisplayString); + const hintParts = typeToInlayHintParts(declarationType); + if (hintParts) { + const hintText = typeof hintParts === "string" ? hintParts : hintParts.map((part) => part.text).join(""); + const isVariableNameMatchesType = preferences.includeInlayVariableTypeHintsWhenTypeMatchesName === false && equateStringsCaseInsensitive(decl.name.getText(), hintText); if (isVariableNameMatchesType) { return; } - addTypeHints(typeDisplayString, decl.name.end); + addTypeHints(hintParts, decl.name.end); } } function visitCallOrNewExpression(expr) { @@ -431591,15 +436651,32 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (!signature || !candidates.length) { return; } - for (let i = 0; i < args.length; ++i) { - const originalArg = args[i]; + let signatureParamPos = 0; + for (const originalArg of args) { const arg = skipParentheses(originalArg); if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) { + signatureParamPos++; continue; } - const identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i); - if (identifierNameInfo) { - const [parameterName, isFirstVariadicArgument] = identifierNameInfo; + let spreadArgs = 0; + if (isSpreadElement(arg)) { + const spreadType = checker.getTypeAtLocation(arg.expression); + if (checker.isTupleType(spreadType)) { + const { elementFlags, fixedLength } = spreadType.target; + if (fixedLength === 0) { + continue; + } + const firstOptionalIndex = findIndex(elementFlags, (f) => !(f & 1 /* Required */)); + const requiredArgs = firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex; + if (requiredArgs > 0) { + spreadArgs = firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex; + } + } + } + const identifierInfo = checker.getParameterIdentifierInfoAtPosition(signature, signatureParamPos); + signatureParamPos = signatureParamPos + (spreadArgs || 1); + if (identifierInfo) { + const { parameter, parameterName, isRestParameter: isFirstVariadicArgument } = identifierInfo; const isParameterNameNotSameAsArgument = preferences.includeInlayParameterNameHintsWhenArgumentMatchesName || !identifierOrAccessExpressionPostfixMatchesParameterName(arg, parameterName); if (!isParameterNameNotSameAsArgument && !isFirstVariadicArgument) { continue; @@ -431608,7 +436685,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (leadingCommentsContainsParameterName(arg, name)) { continue; } - addParameterHints(name, originalArg.getStart(), isFirstVariadicArgument); + addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument); } } } @@ -431634,7 +436711,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isHintableLiteral(node) { switch (node.kind) { - case 223 /* PrefixUnaryExpression */: { + case 224 /* PrefixUnaryExpression */: { const operand = node.operand; return isLiteralExpression(operand) || isIdentifier(operand) && isInfinityOrNaNString(operand.escapedText); } @@ -431642,7 +436719,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case 97 /* FalseKeyword */: case 106 /* NullKeyword */: case 15 /* NoSubstitutionTemplateLiteral */: - case 227 /* TemplateExpression */: + case 228 /* TemplateExpression */: return true; case 80 /* Identifier */: { const name = node.escapedText; @@ -431669,11 +436746,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isModuleReferenceType(returnType)) { return; } - const typeDisplayString = printTypeInSingleLine(returnType); - if (!typeDisplayString) { - return; + const hintParts = typeToInlayHintParts(returnType); + if (hintParts) { + addTypeHints(hintParts, getTypeAnnotationPosition(decl)); } - addTypeHints(typeDisplayString, getTypeAnnotationPosition(decl)); } function getTypeAnnotationPosition(decl) { const closeParenToken = findChildOfKind(decl, 22 /* CloseParenToken */, file); @@ -431696,14 +436772,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (effectiveTypeAnnotation) { continue; } - const typeDisplayString = getParameterDeclarationTypeDisplayString(signature.parameters[i]); - if (!typeDisplayString) { + const typeHints = getParameterDeclarationTypeHints(signature.parameters[i]); + if (!typeHints) { continue; } - addTypeHints(typeDisplayString, param.questionToken ? param.questionToken.end : param.name.end); + addTypeHints(typeHints, param.questionToken ? param.questionToken.end : param.name.end); } } - function getParameterDeclarationTypeDisplayString(symbol) { + function getParameterDeclarationTypeHints(symbol) { const valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || !isParameter(valueDeclaration)) { return void 0; @@ -431712,13 +436788,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isModuleReferenceType(signatureParamType)) { return void 0; } - return printTypeInSingleLine(signatureParamType); - } - function truncation(text, maxLength2) { - if (text.length > maxLength2) { - return text.substr(0, maxLength2 - "...".length) + "..."; - } - return text; + return typeToInlayHintParts(signatureParamType); } function printTypeInSingleLine(type) { const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; @@ -431740,6 +436810,413 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ); }); } + function typeToInlayHintParts(type) { + if (!shouldUseInteractiveInlayHints(preferences)) { + return printTypeInSingleLine(type); + } + const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; + const typeNode = checker.typeToTypeNode( + type, + /*enclosingDeclaration*/ + void 0, + flags + ); + Debug.assertIsDefined(typeNode, "should always get typenode"); + const parts = []; + visitForDisplayParts(typeNode); + return parts; + function visitForDisplayParts(node) { + var _a, _b; + if (!node) { + return; + } + const tokenString = tokenToString(node.kind); + if (tokenString) { + parts.push({ text: tokenString }); + return; + } + if (isLiteralExpression(node)) { + parts.push({ text: getLiteralText2(node) }); + return; + } + switch (node.kind) { + case 80 /* Identifier */: + 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 { + parts.push({ text: identifierText }); + } + break; + case 166 /* QualifiedName */: + Debug.assertNode(node, isQualifiedName); + visitForDisplayParts(node.left); + parts.push({ text: "." }); + visitForDisplayParts(node.right); + break; + case 182 /* TypePredicate */: + Debug.assertNode(node, isTypePredicateNode); + if (node.assertsModifier) { + parts.push({ text: "asserts " }); + } + visitForDisplayParts(node.parameterName); + if (node.type) { + parts.push({ text: " is " }); + visitForDisplayParts(node.type); + } + break; + case 183 /* TypeReference */: + Debug.assertNode(node, isTypeReferenceNode); + visitForDisplayParts(node.typeName); + if (node.typeArguments) { + parts.push({ text: "<" }); + visitDisplayPartList(node.typeArguments, ", "); + parts.push({ text: ">" }); + } + break; + case 168 /* TypeParameter */: + Debug.assertNode(node, isTypeParameterDeclaration); + if (node.modifiers) { + visitDisplayPartList(node.modifiers, " "); + } + visitForDisplayParts(node.name); + if (node.constraint) { + parts.push({ text: " extends " }); + visitForDisplayParts(node.constraint); + } + if (node.default) { + parts.push({ text: " = " }); + visitForDisplayParts(node.default); + } + break; + case 169 /* Parameter */: + Debug.assertNode(node, isParameter); + if (node.modifiers) { + visitDisplayPartList(node.modifiers, " "); + } + if (node.dotDotDotToken) { + parts.push({ text: "..." }); + } + visitForDisplayParts(node.name); + if (node.questionToken) { + parts.push({ text: "?" }); + } + if (node.type) { + parts.push({ text: ": " }); + visitForDisplayParts(node.type); + } + break; + case 185 /* ConstructorType */: + Debug.assertNode(node, isConstructorTypeNode); + parts.push({ text: "new " }); + visitParametersAndTypeParameters(node); + parts.push({ text: " => " }); + visitForDisplayParts(node.type); + break; + case 186 /* TypeQuery */: + Debug.assertNode(node, isTypeQueryNode); + parts.push({ text: "typeof " }); + visitForDisplayParts(node.exprName); + if (node.typeArguments) { + parts.push({ text: "<" }); + visitDisplayPartList(node.typeArguments, ", "); + parts.push({ text: ">" }); + } + break; + case 187 /* TypeLiteral */: + Debug.assertNode(node, isTypeLiteralNode); + parts.push({ text: "{" }); + if (node.members.length) { + parts.push({ text: " " }); + 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 */: + Debug.assertNode(node, isNamedTupleMember); + if (node.dotDotDotToken) { + parts.push({ text: "..." }); + } + visitForDisplayParts(node.name); + if (node.questionToken) { + parts.push({ text: "?" }); + } + parts.push({ text: ": " }); + 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 */: + Debug.assertNode(node, isConditionalTypeNode); + visitForDisplayParts(node.checkType); + parts.push({ text: " extends " }); + visitForDisplayParts(node.extendsType); + parts.push({ text: " ? " }); + visitForDisplayParts(node.trueType); + parts.push({ text: " : " }); + 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 */: + Debug.assertNode(node, isTypeOperatorNode); + parts.push({ text: `${tokenToString(node.operator)} ` }); + visitForDisplayParts(node.type); + break; + case 199 /* IndexedAccessType */: + Debug.assertNode(node, isIndexedAccessTypeNode); + visitForDisplayParts(node.objectType); + parts.push({ text: "[" }); + visitForDisplayParts(node.indexType); + parts.push({ text: "]" }); + break; + case 200 /* MappedType */: + Debug.assertNode(node, isMappedTypeNode); + parts.push({ text: "{ " }); + if (node.readonlyToken) { + if (node.readonlyToken.kind === 40 /* PlusToken */) { + parts.push({ text: "+" }); + } else if (node.readonlyToken.kind === 41 /* MinusToken */) { + parts.push({ text: "-" }); + } + parts.push({ text: "readonly " }); + } + parts.push({ text: "[" }); + visitForDisplayParts(node.typeParameter); + if (node.nameType) { + parts.push({ text: " as " }); + visitForDisplayParts(node.nameType); + } + parts.push({ text: "]" }); + if (node.questionToken) { + if (node.questionToken.kind === 40 /* PlusToken */) { + parts.push({ text: "+" }); + } else if (node.questionToken.kind === 41 /* MinusToken */) { + parts.push({ text: "-" }); + } + parts.push({ text: "?" }); + } + parts.push({ text: ": " }); + if (node.type) { + visitForDisplayParts(node.type); + } + parts.push({ text: "; }" }); + break; + case 201 /* LiteralType */: + Debug.assertNode(node, isLiteralTypeNode); + visitForDisplayParts(node.literal); + break; + case 184 /* FunctionType */: + Debug.assertNode(node, isFunctionTypeNode); + visitParametersAndTypeParameters(node); + parts.push({ text: " => " }); + visitForDisplayParts(node.type); + break; + case 205 /* ImportType */: + Debug.assertNode(node, isImportTypeNode); + if (node.isTypeOf) { + parts.push({ text: "typeof " }); + } + parts.push({ text: "import(" }); + visitForDisplayParts(node.argument); + if (node.assertions) { + parts.push({ text: ", { assert: " }); + visitDisplayPartList(node.assertions.assertClause.elements, ", "); + parts.push({ text: " }" }); + } + parts.push({ text: ")" }); + if (node.qualifier) { + parts.push({ text: "." }); + visitForDisplayParts(node.qualifier); + } + if (node.typeArguments) { + parts.push({ text: "<" }); + visitDisplayPartList(node.typeArguments, ", "); + parts.push({ text: ">" }); + } + break; + case 171 /* PropertySignature */: + 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); + } + 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: "?" }); + } + visitParametersAndTypeParameters(node); + if (node.type) { + parts.push({ text: ": " }); + 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) { + parts.push({ text: separator }); + } + visitForDisplayParts(node); + }); + } + function getLiteralText2(node) { + 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; + } + } function isUndefined(name) { return name === "undefined"; } @@ -431750,13 +437227,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return true; } + function getNodeDisplayPart(text, node) { + const sourceFile = node.getSourceFile(); + return { + text, + span: createTextSpanFromNode(node, sourceFile), + file: sourceFile.fileName + }; + } } - var maxHintsLength, leadingParameterNameCommentRegexFactory; + var leadingParameterNameCommentRegexFactory; var init_inlayHints = __esm({ "src/services/inlayHints.ts"() { "use strict"; init_ts4(); - maxHintsLength = 30; leadingParameterNameCommentRegexFactory = (name) => { return new RegExp(`^\\s?/\\*\\*?\\s?${name}\\s?\\*\\/\\s?$`); }; @@ -431780,8 +437264,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const parts = []; forEachUnique(declarations, (declaration) => { for (const jsdoc of getCommentHavingNodes(declaration)) { - const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 333 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc")); - if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 352 /* JSDocTypedefTag */ && declaration.kind !== 344 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 352 /* JSDocTypedefTag */ || t.kind === 344 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 347 /* JSDocParameterTag */ || t.kind === 348 /* JSDocReturnTag */)) { + const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, (t) => t.kind === 334 /* JSDocTag */ && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc")); + if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 353 /* JSDocTypedefTag */ && declaration.kind !== 345 /* JSDocCallbackTag */ && jsdoc.tags && jsdoc.tags.some((t) => t.kind === 353 /* JSDocTypedefTag */ || t.kind === 345 /* JSDocCallbackTag */) && !jsdoc.tags.some((t) => t.kind === 348 /* JSDocParameterTag */ || t.kind === 349 /* JSDocReturnTag */)) { continue; } let newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : []; @@ -431800,12 +437284,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 347 /* JSDocParameterTag */: - case 354 /* JSDocPropertyTag */: + case 348 /* JSDocParameterTag */: + case 355 /* JSDocPropertyTag */: return [declaration]; - case 344 /* JSDocCallbackTag */: - case 352 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: + case 353 /* JSDocTypedefTag */: return [declaration, declaration.parent]; + case 330 /* JSDocSignature */: + if (isJSDocOverloadTag(declaration.parent)) { + return [declaration.parent.parent]; + } default: return getJSDocCommentsAndTags(declaration); } @@ -431814,36 +437302,43 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const infos = []; forEachUnique(declarations, (declaration) => { const tags = getJSDocTags(declaration); - if (tags.some((t) => t.kind === 352 /* JSDocTypedefTag */ || t.kind === 344 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 347 /* JSDocParameterTag */ || t.kind === 348 /* JSDocReturnTag */)) { + if (tags.some((t) => t.kind === 353 /* JSDocTypedefTag */ || t.kind === 345 /* JSDocCallbackTag */) && !tags.some((t) => t.kind === 348 /* JSDocParameterTag */ || t.kind === 349 /* JSDocReturnTag */)) { return; } for (const tag of tags) { infos.push({ name: tag.tagName.text, text: getCommentDisplayParts(tag, 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)]; } return flatMap( comment, - (node) => node.kind === 327 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker) + (node) => node.kind === 328 /* JSDocText */ ? [textPart(node.text)] : buildLinkParts(node, checker) ); } function getCommentDisplayParts(tag, checker) { const { comment, kind } = tag; const namePart = getTagNameDisplayPart(kind); switch (kind) { - case 355 /* JSDocThrowsTag */: + case 356 /* JSDocThrowsTag */: const typeExpression = tag.typeExpression; return typeExpression ? withNode(typeExpression) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); - case 335 /* JSDocImplementsTag */: + case 336 /* JSDocImplementsTag */: return withNode(tag.class); - case 334 /* JSDocAugmentsTag */: + case 335 /* JSDocAugmentsTag */: return withNode(tag.class); - case 351 /* JSDocTemplateTag */: + case 352 /* JSDocTemplateTag */: const templateTag = tag; const displayParts = []; if (templateTag.constraint) { @@ -431865,14 +437360,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} displayParts.push(...[spacePart(), ...getDisplayPartsFromComment(comment, checker)]); } return displayParts; - case 350 /* JSDocTypeTag */: - case 356 /* JSDocSatisfiesTag */: + case 351 /* JSDocTypeTag */: + case 357 /* JSDocSatisfiesTag */: return withNode(tag.typeExpression); - case 352 /* JSDocTypedefTag */: - case 344 /* JSDocCallbackTag */: - case 354 /* JSDocPropertyTag */: - case 347 /* JSDocParameterTag */: - case 353 /* JSDocSeeTag */: + case 353 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: + case 355 /* JSDocPropertyTag */: + case 348 /* JSDocParameterTag */: + case 354 /* JSDocSeeTag */: const { name } = tag; return name ? withNode(name) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); default: @@ -431895,14 +437390,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getTagNameDisplayPart(kind) { switch (kind) { - case 347 /* JSDocParameterTag */: + case 348 /* JSDocParameterTag */: return parameterNamePart; - case 354 /* JSDocPropertyTag */: + case 355 /* JSDocPropertyTag */: return propertyNamePart; - case 351 /* JSDocTemplateTag */: + case 352 /* JSDocTemplateTag */: return typeParameterNamePart; - case 352 /* JSDocTypedefTag */: - case 344 /* JSDocCallbackTag */: + case 353 /* JSDocTypedefTag */: + case 345 /* JSDocCallbackTag */: return typeAliasNamePart; default: return textPart; @@ -431995,7 +437490,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const tags = (parameters ? parameterDocComments(parameters || [], isJavaScriptFile, indentationStr, newLine) : "") + (hasReturn2 ? returnsDocComment(indentationStr, newLine) : ""); const openComment = "/**"; const closeComment = " */"; - const hasTag = (commentOwnerJsDoc || []).some((jsDoc) => !!jsDoc.tags); + const hasTag = length(getJSDocTags(commentOwner)) > 0; if (tags && !hasTag) { const preamble = openComment + newLine + indentationStr + " * "; const endLine = tokenStart === position ? newLine + indentationStr : ""; @@ -432027,46 +437522,46 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getCommentOwnerInfoWorker(commentOwner, options) { switch (commentOwner.kind) { - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 173 /* MethodDeclaration */: - case 175 /* Constructor */: - case 172 /* MethodSignature */: - case 218 /* ArrowFunction */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 174 /* MethodDeclaration */: + case 176 /* Constructor */: + case 173 /* MethodSignature */: + case 219 /* ArrowFunction */: const host = commentOwner; return { commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) }; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer, options); - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: - case 305 /* EnumMember */: - case 264 /* TypeAliasDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: + case 306 /* EnumMember */: + case 265 /* TypeAliasDeclaration */: return { commentOwner }; - case 170 /* PropertySignature */: { + case 171 /* PropertySignature */: { const host2 = commentOwner; return host2.type && isFunctionTypeNode(host2.type) ? { commentOwner, parameters: host2.type.parameters, hasReturn: hasReturn(host2.type, options) } : { commentOwner }; } - case 242 /* VariableStatement */: { + case 243 /* VariableStatement */: { const varStatement = commentOwner; const varDeclarations = varStatement.declarationList.declarations; const host2 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getRightHandSideOfAssignment(varDeclarations[0].initializer) : void 0; return host2 ? { commentOwner, parameters: host2.parameters, hasReturn: hasReturn(host2, options) } : { commentOwner }; } - case 311 /* SourceFile */: + case 312 /* SourceFile */: return "quit"; - case 266 /* ModuleDeclaration */: - return commentOwner.parent.kind === 266 /* ModuleDeclaration */ ? void 0 : { commentOwner }; - case 243 /* ExpressionStatement */: + case 267 /* ModuleDeclaration */: + return commentOwner.parent.kind === 267 /* ModuleDeclaration */ ? void 0 : { commentOwner }; + case 244 /* ExpressionStatement */: return getCommentOwnerInfoWorker(commentOwner.expression, options); - case 225 /* BinaryExpression */: { + case 226 /* BinaryExpression */: { const be = commentOwner; if (getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; } return isFunctionLike(be.right) ? { commentOwner, parameters: be.right.parameters, hasReturn: hasReturn(be.right, options) } : { commentOwner }; } - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: const init = commentOwner.initializer; if (init && (isFunctionExpression(init) || isArrowFunction(init))) { return { commentOwner, parameters: init.parameters, hasReturn: hasReturn(init, options) }; @@ -432077,14 +437572,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return !!(options == null ? void 0 : options.generateReturnInDocTemplate) && (isFunctionTypeNode(node) || isArrowFunction(node) && isExpression(node.body) || isFunctionLikeDeclaration(node) && node.body && isBlock(node.body) && !!forEachReturnStatement(node.body, (n) => n)); } function getRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 216 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 217 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: return rightHandSide; - case 230 /* ClassExpression */: + case 231 /* ClassExpression */: return find(rightHandSide.members, isConstructorDeclaration); } } @@ -432214,14 +437709,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) @@ -432230,7 +437725,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(); @@ -432238,7 +437733,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (length(oldImportDecls) === 0) { return; } - suppressLeadingTrivia(oldImportDecls[0]); + setEmitFlags(oldImportDecls[0], 1024 /* NoLeadingComments */); const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls]; const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer)) : oldImportGroups; const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) || importGroup[0].moduleSpecifier === void 0 ? coalesce(importGroup) : importGroup); @@ -432342,7 +437837,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} /*importClause*/ void 0, moduleSpecifier, - /*assertClause*/ + /*attributes*/ void 0 )); } else { @@ -432362,92 +437857,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; @@ -432480,11 +437989,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; } @@ -432499,7 +438008,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( @@ -432508,7 +438017,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} exportDecl.isTypeOnly, exportDecl.exportClause && (isNamedExports(exportDecl.exportClause) ? factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)), exportDecl.moduleSpecifier, - exportDecl.assertClause + exportDecl.attributes ) ); } @@ -432540,14 +438049,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings), // TODO: GH#18217 importDeclaration.moduleSpecifier, - importDeclaration.assertClause + 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); @@ -432561,11 +438077,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getModuleSpecifierExpression(declaration) { var _a; switch (declaration.kind) { - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return (_a = tryCast(declaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression; - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: return declaration.moduleSpecifier; - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return declaration.declarationList.declarations[0].initializer.arguments[0]; } } @@ -432652,8 +438168,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) { @@ -432665,36 +438181,30 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getImportKindOrder(s1) { var _a; switch (s1.kind) { - case 271 /* ImportDeclaration */: + case 272 /* ImportDeclaration */: if (!s1.importClause) return 0; if (s1.importClause.isTypeOnly) return 1; - if (((_a = s1.importClause.namedBindings) == null ? void 0 : _a.kind) === 273 /* NamespaceImport */) + if (((_a = s1.importClause.namedBindings) == null ? void 0 : _a.kind) === 274 /* NamespaceImport */) return 2; if (s1.importClause.name) return 3; return 4; - case 270 /* ImportEqualsDeclaration */: + case 271 /* ImportEqualsDeclaration */: return 5; - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: return 6; } } function getNewImportSpecifiers(namedImports) { - return flatMap( - namedImports, - (namedImport) => map( - tryGetNamedBindingElements(namedImport), - (importSpecifier) => importSpecifier.name && importSpecifier.propertyName && importSpecifier.name.escapedText === importSpecifier.propertyName.escapedText ? factory.updateImportSpecifier( - importSpecifier, - importSpecifier.isTypeOnly, - /*propertyName*/ - void 0, - importSpecifier.name - ) : importSpecifier - ) - ); + return flatMap(namedImports, (namedImport) => map(tryGetNamedBindingElements(namedImport), (importSpecifier) => importSpecifier.name && importSpecifier.propertyName && importSpecifier.name.escapedText === importSpecifier.propertyName.escapedText ? factory.updateImportSpecifier( + importSpecifier, + importSpecifier.isTypeOnly, + /*propertyName*/ + void 0, + importSpecifier.name + ) : importSpecifier)); } function tryGetNamedBindingElements(namedImport) { var _a; @@ -432788,8 +438298,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, @@ -432801,6 +438329,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()); } @@ -432928,11 +438471,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } function isRegionDelimiter(lineText) { - lineText = trimStringStart(lineText); + lineText = lineText.trimStart(); if (!startsWith(lineText, "//")) { return null; } - lineText = trimString(lineText.slice(2)); + lineText = lineText.slice(2).trim(); return regionDelimiterRegExp.exec(lineText); } function addOutliningForLeadingCommentsForPos(pos, sourceFile, cancellationToken, out) { @@ -432985,21 +438528,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 240 /* Block */: + case 241 /* Block */: if (isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } switch (n.parent.kind) { - case 245 /* DoStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 247 /* ForStatement */: - case 244 /* IfStatement */: - case 246 /* WhileStatement */: - case 253 /* WithStatement */: - case 298 /* CatchClause */: + case 246 /* DoStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 248 /* ForStatement */: + case 245 /* IfStatement */: + case 247 /* WhileStatement */: + case 254 /* WithStatement */: + case 299 /* CatchClause */: return spanForNode(n.parent); - case 257 /* TryStatement */: + case 258 /* TryStatement */: const tryStatement = n.parent; if (tryStatement.tryBlock === n) { return spanForNode(n.parent); @@ -433011,17 +438554,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} default: return createOutliningSpan(createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 267 /* ModuleBlock */: + case 268 /* ModuleBlock */: return spanForNode(n.parent); - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: - case 268 /* CaseBlock */: - case 186 /* TypeLiteral */: - case 205 /* ObjectBindingPattern */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: + case 269 /* CaseBlock */: + case 187 /* TypeLiteral */: + case 206 /* ObjectBindingPattern */: return spanForNode(n); - case 188 /* TupleType */: + case 189 /* TupleType */: return spanForNode( n, /*autoCollapse*/ @@ -433030,24 +438573,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} !isTupleTypeNode(n.parent), 23 /* OpenBracketToken */ ); - case 295 /* CaseClause */: - case 296 /* DefaultClause */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: return spanForNodeArray(n.statements); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 23 /* OpenBracketToken */); - case 283 /* JsxElement */: + case 284 /* JsxElement */: return spanForJSXElement(n); - case 287 /* JsxFragment */: + case 288 /* JsxFragment */: return spanForJSXFragment(n); - case 284 /* JsxSelfClosingElement */: - case 285 /* JsxOpeningElement */: + case 285 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 227 /* TemplateExpression */: + case 228 /* TemplateExpression */: case 15 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); - case 206 /* ArrayBindingPattern */: + case 207 /* ArrayBindingPattern */: return spanForNode( n, /*autoCollapse*/ @@ -433056,18 +438599,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} !isBindingElement(n.parent), 23 /* OpenBracketToken */ ); - case 218 /* ArrowFunction */: + case 219 /* ArrowFunction */: return spanForArrowFunction(n); - case 212 /* CallExpression */: + case 213 /* CallExpression */: return spanForCallExpression(n); - case 216 /* ParenthesizedExpression */: + case 217 /* ParenthesizedExpression */: return spanForParenthesizedExpression(n); - case 274 /* NamedImports */: - case 278 /* NamedExports */: - case 299 /* AssertClause */: - return spanForNamedImportsOrExportsOrAssertClause(n); + case 275 /* NamedImports */: + case 279 /* NamedExports */: + case 300 /* ImportAttributes */: + return spanForImportExportElements(n); } - function spanForNamedImportsOrExportsOrAssertClause(node) { + function spanForImportExportElements(node) { if (!node.elements.length) { return void 0; } @@ -433185,7 +438728,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} node, sourceFile, /*autoCollapse*/ - node.kind !== 218 /* ArrowFunction */ + node.kind !== 219 /* ArrowFunction */ ); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse = false, useFullStart = true) { @@ -433267,7 +438810,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return getRenameInfoError(wouldRenameNodeModules); } const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, node); - const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 166 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0; + const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 167 /* ComputedPropertyName */ ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0; const displayName = specifierName || typeChecker.symbolToString(symbol); const fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol); return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), node, sourceFile); @@ -433324,16 +438867,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 }; @@ -433505,19 +439048,20 @@ ${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) + isInString(sourceFile, position, node), + checker ); if (argumentIndex !== 0) { Debug.assertLessThan(argumentIndex, argumentCount); @@ -433525,19 +439069,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} 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(list, node, checker) }; } } - 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; @@ -433553,10 +439097,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} ); } return void 0; - } else if (isTemplateHead(node) && parent2.parent.kind === 214 /* TaggedTemplateExpression */) { + } else if (isTemplateHead(node) && parent2.parent.kind === 215 /* TaggedTemplateExpression */) { const templateExpression = parent2; const tagExpression = templateExpression.parent; - Debug.assert(templateExpression.kind === 227 /* TemplateExpression */); + Debug.assert(templateExpression.kind === 228 /* TemplateExpression */); const argumentIndex = isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } else if (isTemplateSpan(parent2) && isTaggedTemplateExpression(parent2.parent.parent)) { @@ -433595,7 +439139,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; @@ -433633,17 +439177,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getContextualSignatureLocationInfo(node, sourceFile, position, checker) { const { parent: parent2 } = node; switch (parent2.kind) { - case 216 /* ParenthesizedExpression */: - case 173 /* MethodDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - const info = getArgumentOrParameterListInfo(node, position, sourceFile); + case 217 /* ParenthesizedExpression */: + case 174 /* MethodDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + const info = getArgumentOrParameterListInfo(node, position, sourceFile, checker); if (!info) return void 0; const { argumentIndex, argumentCount, argumentsSpan } = info; const contextualType = isMethodDeclaration(parent2) ? checker.getContextualTypeForObjectLiteralElement(parent2) : checker.getContextualType(parent2); return contextualType && { contextualType, argumentIndex, argumentCount, argumentsSpan }; - case 225 /* BinaryExpression */: { + case 226 /* BinaryExpression */: { const highestBinary = getHighestBinary(parent2); const contextualType2 = checker.getContextualType(highestBinary); const argumentIndex2 = node.kind === 21 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1; @@ -433660,21 +439204,45 @@ ${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 getArgumentIndex(argumentsList, node, checker) { + const args = argumentsList.getChildren(); let argumentIndex = 0; - for (const child of argumentsList.getChildren()) { + for (let pos = 0; pos < length(args); pos++) { + const child = args[pos]; if (child === node) { break; } - if (child.kind !== 28 /* CommaToken */) { - argumentIndex++; + if (isSpreadElement(child)) { + argumentIndex = argumentIndex + getSpreadElementCount(child, checker) + (pos > 0 ? pos : 0); + } else { + if (child.kind !== 28 /* CommaToken */) { + argumentIndex++; + } } } return argumentIndex; } - function getArgumentCount(argumentsList, ignoreTrailingComma) { + 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 getArgumentCount(argumentsList, ignoreTrailingComma, checker) { const listChildren = argumentsList.getChildren(); - let argumentCount = countWhere(listChildren, (arg) => arg.kind !== 28 /* CommaToken */); + let argumentCount = 0; + for (const child of listChildren) { + if (isSpreadElement(child)) { + argumentCount = argumentCount + getSpreadElementCount(child, checker); + } + } + argumentCount = argumentCount + countWhere(listChildren, (arg) => arg.kind !== 28 /* CommaToken */); if (!ignoreTrailingComma && listChildren.length > 0 && last(listChildren).kind === 28 /* CommaToken */) { argumentCount++; } @@ -433717,7 +439285,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const template = taggedTemplate.template; const applicableSpanStart = template.getStart(); let applicableSpanEnd = template.getEnd(); - if (template.kind === 227 /* TemplateExpression */) { + if (template.kind === 228 /* TemplateExpression */) { const lastSpan = last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = skipTrivia( @@ -434028,10 +439596,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} Debug.assertEqual(openBraceToken.kind, 19 /* OpenBraceToken */); Debug.assertEqual(closeBraceToken.kind, 20 /* CloseBraceToken */); const groupedWithPlusMinusTokens = groupChildren(children, (child) => child === node.readonlyToken || child.kind === 148 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 58 /* QuestionToken */); - const groupedWithBrackets = groupChildren( - groupedWithPlusMinusTokens, - ({ kind }) => kind === 23 /* OpenBracketToken */ || kind === 167 /* TypeParameter */ || kind === 24 /* CloseBracketToken */ - ); + const groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, ({ kind }) => kind === 23 /* OpenBracketToken */ || kind === 168 /* TypeParameter */ || kind === 24 /* CloseBracketToken */); return [ openBraceToken, // Pivot on `:` @@ -434041,7 +439606,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } if (isPropertySignature(node)) { const children = groupChildren(node.getChildren(), (child) => child === node.name || contains(node.modifiers, child)); - const firstJSDocChild = ((_a = children[0]) == null ? void 0 : _a.kind) === 326 /* JSDoc */ ? children[0] : void 0; + const firstJSDocChild = ((_a = children[0]) == null ? void 0 : _a.kind) === 327 /* JSDoc */ ? children[0] : void 0; const withJSDocSeparated = firstJSDocChild ? children.slice(1) : children; const splittedChildren = splitChildren(withJSDocSeparated, ({ kind }) => kind === 59 /* ColonToken */); return firstJSDocChild ? [firstJSDocChild, createSyntaxList2(splittedChildren)] : splittedChildren; @@ -434102,19 +439667,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } function isListOpener(token) { const kind = token && token.kind; - return kind === 19 /* OpenBraceToken */ || kind === 23 /* OpenBracketToken */ || kind === 21 /* OpenParenToken */ || kind === 285 /* JsxOpeningElement */; + return kind === 19 /* OpenBraceToken */ || kind === 23 /* OpenBracketToken */ || kind === 21 /* OpenParenToken */ || kind === 286 /* JsxOpeningElement */; } function isListCloser(token) { const kind = token && token.kind; - return kind === 20 /* CloseBraceToken */ || kind === 24 /* CloseBracketToken */ || kind === 22 /* CloseParenToken */ || kind === 286 /* JsxClosingElement */; + return kind === 20 /* CloseBraceToken */ || kind === 24 /* CloseBracketToken */ || kind === 22 /* CloseParenToken */ || kind === 287 /* JsxClosingElement */; } function getEndPos(sourceFile, node) { switch (node.kind) { - case 347 /* JSDocParameterTag */: - case 344 /* JSDocCallbackTag */: - case 354 /* JSDocPropertyTag */: - case 352 /* JSDocTypedefTag */: - case 349 /* JSDocThisTag */: + case 348 /* JSDocParameterTag */: + case 345 /* JSDocCallbackTag */: + case 355 /* JSDocPropertyTag */: + case 353 /* JSDocTypedefTag */: + case 350 /* JSDocThisTag */: return sourceFile.getLineEndOfPosition(node.getStart()); default: return node.getEnd(); @@ -434149,7 +439714,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } const flags = getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return getDeclarationOfKind(symbol, 230 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; + return getDeclarationOfKind(symbol, 231 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) return "enum" /* enumElement */; @@ -434187,6 +439752,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return "parameter" /* parameterElement */; } else if (symbol.valueDeclaration && isVarConst(symbol.valueDeclaration)) { return "const" /* constElement */; + } else if (symbol.valueDeclaration && isVarUsing(symbol.valueDeclaration)) { + return "using" /* variableUsingElement */; + } else if (symbol.valueDeclaration && isVarAwaitUsing(symbol.valueDeclaration)) { + return "await using" /* variableAwaitUsingElement */; } else if (forEach(symbol.declarations, isLet)) { return "let" /* letElement */; } @@ -434228,7 +439797,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} function getNormalizedSymbolModifiers(symbol) { if (symbol.declarations && symbol.declarations.length) { const [declaration, ...declarations] = symbol.declarations; - const excludeFlags = length(declarations) && isDeprecatedDeclaration(declaration) && some(declarations, (d) => !isDeprecatedDeclaration(d)) ? 8192 /* Deprecated */ : 0 /* None */; + const excludeFlags = length(declarations) && isDeprecatedDeclaration(declaration) && some(declarations, (d) => !isDeprecatedDeclaration(d)) ? 65536 /* Deprecated */ : 0 /* None */; const modifiers = getNodeModifiers(declaration, excludeFlags); if (modifiers) { return modifiers.split(","); @@ -434254,7 +439823,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } return modifiers.size > 0 ? arrayFrom(modifiers.values()).join(",") : "" /* none */; } - function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias) { + function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location, type, semanticMeaning, alias) { var _a; const displayParts = []; let documentation = []; @@ -434263,7 +439832,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} let symbolKind = semanticMeaning & 1 /* Value */ ? getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) : "" /* unknown */; let hasAddedSymbolInfo = false; const isThisExpression = location.kind === 110 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location); - let type; let documentationFromAlias; let tagsFromAlias; let hasMultipleSignatures = false; @@ -434275,13 +439843,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const declaration = find(symbol.declarations, (declaration2) => declaration2.name === location); if (declaration) { switch (declaration.kind) { - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: symbolKind = "getter" /* memberGetAccessorElement */; break; - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: symbolKind = "setter" /* memberSetAccessorElement */; break; - case 171 /* PropertyDeclaration */: + case 172 /* PropertyDeclaration */: symbolKind = "accessor" /* memberAccessorVariableElement */; break; default: @@ -434292,8 +439860,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } let signature; - type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location); - if (location.parent && location.parent.kind === 210 /* PropertyAccessExpression */) { + type ?? (type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location)); + if (location.parent && location.parent.kind === 211 /* PropertyAccessExpression */) { const right = location.parent.name; if (right === location || right && right.getFullWidth() === 0) { location = location.parent; @@ -434309,7 +439877,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); - const useConstructSignatures = callExpressionLike.kind === 213 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 108 /* SuperKeyword */; + const useConstructSignatures = callExpressionLike.kind === 214 /* NewExpression */ || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 108 /* SuperKeyword */; const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (signature && !contains(allSignatures, signature.target) && !contains(allSignatures, signature)) { signature = allSignatures.length ? allSignatures[0] : void 0; @@ -434372,21 +439940,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} hasMultipleSignatures = allSignatures.length > 1; } } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || // name of function declaration - location.kind === 137 /* ConstructorKeyword */ && location.parent.kind === 175 /* Constructor */) { + location.kind === 137 /* ConstructorKeyword */ && location.parent.kind === 176 /* Constructor */) { const functionDeclaration = location.parent; const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, (declaration) => declaration === (location.kind === 137 /* ConstructorKeyword */ ? functionDeclaration.parent : functionDeclaration)); if (locationIsSymbolDeclaration) { - const allSignatures = functionDeclaration.kind === 175 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + const allSignatures = functionDeclaration.kind === 176 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 175 /* Constructor */) { + if (functionDeclaration.kind === 176 /* Constructor */) { symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 178 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); + addPrefixForAnyFunctionOrVar( + functionDeclaration.kind === 179 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, + symbolKind + ); } if (signature) { addSignatureDisplayParts(signature, allSignatures); @@ -434398,7 +439969,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (getDeclarationOfKind(symbol, 230 /* ClassExpression */)) { + if (getDeclarationOfKind(symbol, 231 /* ClassExpression */)) { pushSymbolKind("local class" /* localClassElement */); } else { displayParts.push(keywordPart(86 /* ClassKeyword */)); @@ -434437,7 +440008,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - const declaration = getDeclarationOfKind(symbol, 266 /* ModuleDeclaration */); + const declaration = getDeclarationOfKind(symbol, 267 /* ModuleDeclaration */); const isNamespace = declaration && declaration.name && declaration.name.kind === 80 /* Identifier */; displayParts.push(keywordPart(isNamespace ? 145 /* NamespaceKeyword */ : 144 /* ModuleKeyword */)); displayParts.push(spacePart()); @@ -434455,7 +440026,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - const decl = getDeclarationOfKind(symbol, 167 /* TypeParameter */); + const decl = getDeclarationOfKind(symbol, 168 /* TypeParameter */); if (decl === void 0) return Debug.fail(); const declaration = decl.parent; @@ -434463,10 +440034,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (isFunctionLike(declaration)) { addInPrefix(); const signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 179 /* ConstructSignature */) { + if (declaration.kind === 180 /* ConstructSignature */) { displayParts.push(keywordPart(105 /* NewKeyword */)); displayParts.push(spacePart()); - } else if (declaration.kind !== 178 /* CallSignature */ && declaration.name) { + } else if (declaration.kind !== 179 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } addRange(displayParts, signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); @@ -434484,16 +440055,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); const declaration = (_a = symbol.declarations) == null ? void 0 : _a[0]; - if ((declaration == null ? void 0 : declaration.kind) === 305 /* EnumMember */) { + if ((declaration == null ? void 0 : declaration.kind) === 306 /* EnumMember */) { const constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== void 0) { displayParts.push(spacePart()); displayParts.push(operatorPart(64 /* EqualsToken */)); displayParts.push(spacePart()); - displayParts.push(displayPart( - getTextOfConstantValue(constantValue), - typeof constantValue === "number" ? 7 /* numericLiteral */ : 8 /* stringLiteral */ - )); + displayParts.push(displayPart(getTextOfConstantValue(constantValue), typeof constantValue === "number" ? 7 /* numericLiteral */ : 8 /* stringLiteral */)); } } } @@ -434505,14 +440073,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const resolvedNode = resolvedSymbol.declarations[0]; const declarationName = getNameOfDeclaration(resolvedNode); if (declarationName && !hasAddedSymbolInfo) { - const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode, 2 /* Ambient */); + const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode, 128 /* Ambient */); const shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration; - const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind( + const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKindWorker( typeChecker, resolvedSymbol, getSourceFileOfNode(resolvedNode), resolvedNode, declarationName, + type, semanticMeaning, shouldUseAliasName ? symbol : resolvedSymbol ); @@ -434528,17 +440097,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } if (symbol.declarations) { switch (symbol.declarations[0].kind) { - case 269 /* NamespaceExportDeclaration */: + case 270 /* NamespaceExportDeclaration */: displayParts.push(keywordPart(95 /* ExportKeyword */)); displayParts.push(spacePart()); displayParts.push(keywordPart(145 /* NamespaceKeyword */)); break; - case 276 /* ExportAssignment */: + case 277 /* ExportAssignment */: displayParts.push(keywordPart(95 /* ExportKeyword */)); displayParts.push(spacePart()); displayParts.push(keywordPart(symbol.declarations[0].isExportEquals ? 64 /* EqualsToken */ : 90 /* DefaultKeyword */)); break; - case 280 /* ExportSpecifier */: + case 281 /* ExportSpecifier */: displayParts.push(keywordPart(95 /* ExportKeyword */)); break; default: @@ -434548,7 +440117,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} displayParts.push(spacePart()); addFullSymbolName(symbol); forEach(symbol.declarations, (declaration) => { - if (declaration.kind === 270 /* ImportEqualsDeclaration */) { + if (declaration.kind === 271 /* ImportEqualsDeclaration */) { const importEqualsDeclaration = declaration; if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(spacePart()); @@ -434580,7 +440149,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } else { addPrefixForAnyFunctionOrVar(symbol, symbolKind); } - if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || isThisExpression) { + if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || symbolKind === "using" /* variableUsingElement */ || symbolKind === "await using" /* variableAwaitUsingElement */ || isThisExpression) { displayParts.push(punctuationPart(59 /* ColonToken */)); displayParts.push(spacePart()); if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) { @@ -434616,9 +440185,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker); } if (documentation.length === 0 && symbolFlags & 4 /* Property */) { - if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 311 /* SourceFile */)) { + if (symbol.parent && symbol.declarations && forEach(symbol.parent.declarations, (declaration) => declaration.kind === 312 /* SourceFile */)) { for (const declaration of symbol.declarations) { - if (!declaration.parent || declaration.parent.kind !== 225 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 226 /* BinaryExpression */) { continue; } const rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -434636,11 +440205,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} if (documentation.length === 0 && isIdentifier(location) && symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration)) { const declaration = symbol.valueDeclaration; const parent2 = declaration.parent; - if (isIdentifier(declaration.name) && isObjectBindingPattern(parent2)) { - const name = getTextOfIdentifierOrLiteral(declaration.name); + const name = declaration.propertyName || declaration.name; + if (isIdentifier(name) && isObjectBindingPattern(parent2)) { + const propertyName = getTextOfIdentifierOrLiteral(name); const objectType = typeChecker.getTypeAtLocation(parent2); documentation = firstDefined(objectType.isUnion() ? objectType.types : [objectType], (t) => { - const prop = t.getProperty(name); + const prop = t.getProperty(propertyName); return prop ? prop.getDocumentationComment(typeChecker) : void 0; }) || emptyArray; } @@ -434730,6 +440300,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} case "let" /* letElement */: case "const" /* constElement */: case "constructor" /* constructorImplementationElement */: + case "using" /* variableUsingElement */: + case "await using" /* variableAwaitUsingElement */: displayParts.push(textOrKeywordPart(symbolKind2)); return; default: @@ -434765,19 +440337,32 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} addRange(displayParts, typeParameterParts); } } + function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias) { + return getSymbolDisplayPartsDocumentationAndSymbolKindWorker( + typeChecker, + symbol, + sourceFile, + enclosingDeclaration, + location, + /*type*/ + void 0, + semanticMeaning, + alias + ); + } function isLocalVariableOrFunction(symbol) { if (symbol.parent) { return false; } return forEach(symbol.declarations, (declaration) => { - if (declaration.kind === 217 /* FunctionExpression */) { + if (declaration.kind === 218 /* FunctionExpression */) { return true; } - if (declaration.kind !== 259 /* VariableDeclaration */ && declaration.kind !== 261 /* FunctionDeclaration */) { + if (declaration.kind !== 260 /* VariableDeclaration */ && declaration.kind !== 262 /* FunctionDeclaration */) { return false; } for (let parent2 = declaration.parent; !isFunctionBlock(parent2); parent2 = parent2.parent) { - if (parent2.kind === 311 /* SourceFile */ || parent2.kind === 267 /* ModuleBlock */) { + if (parent2.kind === 312 /* SourceFile */ || parent2.kind === 268 /* ModuleBlock */) { return false; } } @@ -434951,16 +440536,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return newEnd !== end && (trailingTriviaOption === 2 /* Include */ || isLineBreak(sourceFile.text.charCodeAt(newEnd - 1))) ? newEnd : end; } function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 28 /* CommaToken */ || candidate.kind === 27 /* SemicolonToken */ && node.parent.kind === 209 /* ObjectLiteralExpression */); + return !!candidate && !!node.parent && (candidate.kind === 28 /* CommaToken */ || candidate.kind === 27 /* SemicolonToken */ && node.parent.kind === 210 /* ObjectLiteralExpression */); } function isThisTypeAnnotatable(containingFunction) { return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction); } function updateJSDocHost(parent2) { - if (parent2.kind !== 218 /* ArrowFunction */) { + if (parent2.kind !== 219 /* ArrowFunction */) { return parent2; } - const jsDocNode = parent2.parent.kind === 171 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; + const jsDocNode = parent2.parent.kind === 172 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent; jsDocNode.jsDoc = parent2.jsDoc; return jsDocNode; } @@ -434969,7 +440554,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return void 0; } switch (oldTag.kind) { - case 347 /* JSDocParameterTag */: { + case 348 /* JSDocParameterTag */: { const oldParam = oldTag; const newParam = newTag; return isIdentifier(oldParam.name) && isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? factory.createJSDocParameterTag( @@ -434983,14 +440568,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} oldParam.comment ) : void 0; } - case 348 /* JSDocReturnTag */: + case 349 /* JSDocReturnTag */: return factory.createJSDocReturnTag( /*tagName*/ void 0, newTag.typeExpression, oldTag.comment ); - case 350 /* JSDocTypeTag */: + case 351 /* JSDocTypeTag */: return factory.createJSDocTypeTag( /*tagName*/ void 0, @@ -435351,7 +440936,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} return !isInComment(sourceFile, position) && !isInString(sourceFile, position) && !isInTemplateString(sourceFile, position) && !isInJSXText(sourceFile, position); } function needSemicolonBetween(a, b) { - return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 166 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b); + return (isPropertySignature(a) || isPropertyDeclaration(a)) && isClassOrTypeElement(b) && b.name.kind === 167 /* ComputedPropertyName */ || isStatementButNotDeclaration(a) && isStatementButNotDeclaration(b); } function deleteNode(changes, sourceFile, node, options = { leadingTriviaOption: 1 /* IncludeAll */ }) { const startPosition = getAdjustedStartPosition(sourceFile, node, options); @@ -435395,7 +440980,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} leadingTriviaOption: 0 /* Exclude */, trailingTriviaOption: 0 /* Exclude */ }; - ChangeTracker = class { + ChangeTracker = class _ChangeTracker { /** Public for tests only. Other callers should use `ChangeTracker.with`. */ constructor(newLineCharacter, formatContext) { this.newLineCharacter = newLineCharacter; @@ -435406,10 +440991,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} this.deletedNodes = []; } static fromContext(context) { - return new ChangeTracker(getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); + return new _ChangeTracker(getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); } static with(context, cb) { - const tracker = ChangeTracker.fromContext(context); + const tracker = _ChangeTracker.fromContext(context); cb(tracker); return tracker.getChanges(); } @@ -435544,6 +441129,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} insertNodeBefore(sourceFile, before, newNode, blankLineBetween = false, options = {}) { this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)); } + insertNodesBefore(sourceFile, before, newNodes, blankLineBetween = false, options = {}) { + this.insertNodesAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNodes, this.getOptionsForInsertNodeBefore(before, first(newNodes), blankLineBetween)); + } insertModifierAt(sourceFile, pos, modifier, options = {}) { this.insertNodeAt(sourceFile, pos, factory.createToken(modifier), options); } @@ -435555,8 +441143,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} const startPosition = getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); const insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition); const token = getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position); - const indent2 = sourceFile.text.slice(lineStartPosition, startPosition); - const text = `${insertAtLineStart ? "" : this.newLineCharacter}//${commentText}${this.newLineCharacter}${indent2}`; + const indent3 = sourceFile.text.slice(lineStartPosition, startPosition); + const text = `${insertAtLineStart ? "" : this.newLineCharacter}//${commentText}${this.newLineCharacter}${indent3}`; this.insertText(sourceFile, token.getStart(sourceFile), text); } insertJsdocCommentBefore(sourceFile, node, tag) { @@ -435575,8 +441163,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } } const startPosition = getPrecedingNonSpaceCharacterPosition(sourceFile.text, fnStart - 1); - const indent2 = sourceFile.text.slice(startPosition, fnStart); - this.insertNodeAt(sourceFile, fnStart, tag, { suffix: this.newLineCharacter + indent2 }); + const indent3 = sourceFile.text.slice(startPosition, fnStart); + this.insertNodeAt(sourceFile, fnStart, tag, { suffix: this.newLineCharacter + indent3 }); } createJSDocText(sourceFile, node) { const comments = flatMap(node.jsDoc, (jsDoc2) => isString(jsDoc2.comment) ? factory.createJSDocText(jsDoc2.comment) : jsDoc2.comment); @@ -435588,12 +441176,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} } addJSDocTags(sourceFile, parent2, newTags) { const oldTags = flatMapToMutable(parent2.jsDoc, (j) => j.tags); - const unmergedNewTags = newTags.filter((newTag) => !oldTags.some((tag, i) => { - const merged = tryMergeJsdocTags(tag, newTag); - if (merged) - oldTags[i] = merged; - return !!merged; - })); + const unmergedNewTags = newTags.filter( + (newTag) => !oldTags.some((tag, i) => { + const merged = tryMergeJsdocTags(tag, newTag); + if (merged) + oldTags[i] = merged; + return !!merged; + }) + ); this.replaceJSDocComment(sourceFile, parent2, [...oldTags, ...unmergedNewTags]); } filterJSDocTags(sourceFile, parent2, predicate) { @@ -435616,7 +441206,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")} endNode2 = first(node.parameters); } } else { - endNode2 = (node.kind === 259 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) ?? node.name; + endNode2 = (node.kind === 260 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) ?? node.name; } this.insertNodeAt(sourceFile, endNode2.end, type, { prefix: ": " }); return true; @@ -435764,18 +441354,18 @@ ${options.prefix}` : "\n" : options.prefix } getInsertNodeAfterOptionsWorker(node) { switch (node.kind) { - case 262 /* ClassDeclaration */: - case 266 /* ModuleDeclaration */: + case 263 /* ClassDeclaration */: + case 267 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: case 11 /* StringLiteral */: case 80 /* Identifier */: return { prefix: ", " }; - case 302 /* PropertyAssignment */: + case 303 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 95 /* ExportKeyword */: return { prefix: " " }; - case 168 /* Parameter */: + case 169 /* Parameter */: return {}; default: Debug.assert(isStatement(node) || isClassOrTypeElement(node)); @@ -435784,7 +441374,7 @@ ${options.prefix}` : "\n" : options.prefix } insertName(sourceFile, node, name) { Debug.assert(!node.name); - if (node.kind === 218 /* ArrowFunction */) { + if (node.kind === 219 /* ArrowFunction */) { const arrow = findChildOfKind(node, 39 /* EqualsGreaterThanToken */, sourceFile); const lparen = findChildOfKind(node, 21 /* OpenParenToken */, sourceFile); if (lparen) { @@ -435794,12 +441384,12 @@ ${options.prefix}` : "\n" : options.prefix this.insertText(sourceFile, first(node.parameters).getStart(sourceFile), `function ${name}(`); this.replaceRange(sourceFile, arrow, factory.createToken(22 /* CloseParenToken */)); } - if (node.body.kind !== 240 /* Block */) { + if (node.body.kind !== 241 /* Block */) { this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [factory.createToken(19 /* OpenBraceToken */), factory.createToken(107 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [factory.createToken(27 /* SemicolonToken */), factory.createToken(20 /* CloseBraceToken */)], { joiner: " " }); } } else { - const pos = findChildOfKind(node, node.kind === 217 /* FunctionExpression */ ? 100 /* FunctionKeyword */ : 86 /* ClassKeyword */, sourceFile).end; + const pos = findChildOfKind(node, node.kind === 218 /* FunctionExpression */ ? 100 /* FunctionKeyword */ : 86 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, factory.createIdentifier(name), { prefix: " " }); } } @@ -435855,7 +441445,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) { @@ -435970,7 +441560,7 @@ ${options.prefix}` : "\n" : options.prefix const sourceFile = createSourceFile( "any file name", nonFormattedText, - 99 /* ESNext */, + { languageVersion: 99 /* ESNext */, jsDocParsingMode: 1 /* ParseNone */ }, /*setParentNodes*/ true, scriptKind @@ -436034,7 +441624,7 @@ ${options.prefix}` : "\n" : options.prefix ((_deleteDeclaration) => { function deleteDeclaration2(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 168 /* Parameter */: { + case 169 /* Parameter */: { const oldFunction = node.parent; if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && !findChildOfKind(oldFunction, 21 /* OpenParenToken */, sourceFile)) { changes.replaceNodeWithText(sourceFile, node, "()"); @@ -436043,29 +441633,29 @@ ${options.prefix}` : "\n" : options.prefix } break; } - case 271 /* ImportDeclaration */: - case 270 /* ImportEqualsDeclaration */: + case 272 /* ImportDeclaration */: + case 271 /* ImportEqualsDeclaration */: const isFirstImport = sourceFile.imports.length && node === first(sourceFile.imports).parent || node === find(sourceFile.statements, isAnyImportSyntax); deleteNode(changes, sourceFile, node, { leadingTriviaOption: isFirstImport ? 0 /* Exclude */ : hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ }); break; - case 207 /* BindingElement */: + case 208 /* BindingElement */: const pattern = node.parent; - const preserveComma = pattern.kind === 206 /* ArrayBindingPattern */ && node !== last(pattern.elements); + const preserveComma = pattern.kind === 207 /* ArrayBindingPattern */ && node !== last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } else { deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 259 /* VariableDeclaration */: + case 260 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 167 /* TypeParameter */: + case 168 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 275 /* ImportSpecifier */: + case 276 /* ImportSpecifier */: const namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -436073,7 +441663,7 @@ ${options.prefix}` : "\n" : options.prefix deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 273 /* NamespaceImport */: + case 274 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 27 /* SemicolonToken */: @@ -436082,8 +441672,8 @@ ${options.prefix}` : "\n" : options.prefix case 100 /* FunctionKeyword */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: 0 /* Exclude */ }); break; - case 262 /* ClassDeclaration */: - case 261 /* FunctionDeclaration */: + case 263 /* ClassDeclaration */: + case 262 /* FunctionDeclaration */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: hasJSDocNodes(node) ? 2 /* JSDoc */ : 3 /* StartLine */ }); break; default: @@ -436125,13 +441715,13 @@ ${options.prefix}` : "\n" : options.prefix const previousToken = Debug.checkDefined(getTokenAtPosition(sourceFile, node.pos - 1)); changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end }); } else { - const importDecl = getAncestor(node, 271 /* ImportDeclaration */); + const importDecl = getAncestor(node, 272 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { const { parent: parent2 } = node; - if (parent2.kind === 298 /* CatchClause */) { + if (parent2.kind === 299 /* CatchClause */) { changes.deleteNodeRange(sourceFile, findChildOfKind(parent2, 21 /* OpenParenToken */, sourceFile), findChildOfKind(parent2, 22 /* CloseParenToken */, sourceFile)); return; } @@ -436141,14 +441731,14 @@ ${options.prefix}` : "\n" : options.prefix } const gp = parent2.parent; switch (gp.kind) { - case 249 /* ForOfStatement */: - case 248 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 249 /* ForInStatement */: changes.replaceNode(sourceFile, node, factory.createObjectLiteralExpression()); break; - case 247 /* ForStatement */: + case 248 /* ForStatement */: deleteNode(changes, sourceFile, parent2); break; - case 242 /* VariableStatement */: + case 243 /* VariableStatement */: deleteNode(changes, sourceFile, gp, { leadingTriviaOption: hasJSDocNodes(gp) ? 2 /* JSDoc */ : 3 /* StartLine */ }); break; default: @@ -436331,10 +441921,10 @@ ${options.prefix}` : "\n" : options.prefix function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 290 /* JsxAttribute */: - case 285 /* JsxOpeningElement */: - case 286 /* JsxClosingElement */: - case 284 /* JsxSelfClosingElement */: + case 291 /* JsxAttribute */: + case 286 /* JsxOpeningElement */: + case 287 /* JsxClosingElement */: + case 285 /* JsxSelfClosingElement */: return isKeyword(node.kind) || node.kind === 80 /* Identifier */; } } @@ -436535,7 +442125,7 @@ ${options.prefix}` : "\n" : options.prefix // src/services/formatting/rules.ts function getAllRules() { const allTokens = []; - for (let token = 0 /* FirstToken */; token <= 164 /* LastToken */; token++) { + for (let token = 0 /* FirstToken */; token <= 165 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -436546,12 +442136,12 @@ ${options.prefix}` : "\n" : options.prefix const anyToken = { tokens: allTokens, isSpecific: false }; const anyTokenIncludingMultilineComments = tokenRangeFrom([...allTokens, 3 /* MultiLineCommentTrivia */]); const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, 1 /* EndOfFileToken */]); - const keywords = tokenRangeFromRange(83 /* FirstKeyword */, 164 /* LastKeyword */); + const keywords = tokenRangeFromRange(83 /* FirstKeyword */, 165 /* LastKeyword */); const binaryOperators = tokenRangeFromRange(30 /* FirstBinaryOperator */, 79 /* LastBinaryOperator */); const binaryKeywordOperators = [ 103 /* InKeyword */, 104 /* InstanceOfKeyword */, - 164 /* OfKeyword */, + 165 /* OfKeyword */, 130 /* AsKeyword */, 142 /* IsKeyword */, 152 /* SatisfiesKeyword */ @@ -436574,19 +442164,19 @@ ${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 */), rule("IgnoreAfterLineComment", 2 /* SingleLineCommentTrivia */, anyToken, anyContext, 1 /* StopProcessingSpaceActions */), rule("NotSpaceBeforeColon", anyToken, 59 /* ColonToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], 16 /* DeleteSpace */), - rule("SpaceAfterColon", 59 /* ColonToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 4 /* InsertSpace */), + rule("SpaceAfterColon", 59 /* ColonToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNextTokenParentNotJsxNamespacedName], 4 /* InsertSpace */), rule("NoSpaceBeforeQuestionMark", anyToken, 58 /* QuestionToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], 16 /* DeleteSpace */), // insert space after '?' only when it is used in conditional operator rule("SpaceAfterQuestionMarkInConditionalOperator", 58 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext, isConditionalOperatorContext], 4 /* InsertSpace */), // in other cases there should be no space between '?' and next token - rule("NoSpaceAfterQuestionMark", 58 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterQuestionMark", 58 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext, isNonOptionalPropertyContext], 16 /* DeleteSpace */), rule("NoSpaceBeforeDot", anyToken, [25 /* DotToken */, 29 /* QuestionDotToken */], [isNonJsxSameLineTokenContext, isNotPropertyAccessOnIntegerLiteral], 16 /* DeleteSpace */), rule("NoSpaceAfterDot", [25 /* DotToken */, 29 /* QuestionDotToken */], anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("NoSpaceBetweenImportParenInImportType", 102 /* ImportKeyword */, 21 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isImportTypeContext], 16 /* DeleteSpace */), @@ -436652,6 +442242,8 @@ ${options.prefix}` : "\n" : options.prefix rule("NoSpaceBeforeGreaterThanTokenInJsxOpeningElement", 44 /* SlashToken */, 32 /* GreaterThanToken */, [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("NoSpaceBeforeEqualInJsxAttribute", anyToken, 64 /* EqualsToken */, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), rule("NoSpaceAfterEqualInJsxAttribute", 64 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceBeforeJsxNamespaceColon", 80 /* Identifier */, 59 /* ColonToken */, [isNextTokenParentJsxNamespacedName], 16 /* DeleteSpace */), + rule("NoSpaceAfterJsxNamespaceColon", 59 /* ColonToken */, 80 /* Identifier */, [isNextTokenParentJsxNamespacedName], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); rule("NoSpaceAfterModuleImport", [144 /* ModuleKeyword */, 149 /* RequireKeyword */], 21 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -436680,7 +442272,7 @@ ${options.prefix}` : "\n" : options.prefix 153 /* SetKeyword */, 126 /* StaticKeyword */, 156 /* TypeKeyword */, - 160 /* FromKeyword */, + 161 /* FromKeyword */, 143 /* KeyOfKeyword */, 140 /* InferKeyword */ ], @@ -436691,7 +442283,7 @@ ${options.prefix}` : "\n" : options.prefix rule( "SpaceBeforeCertainTypeScriptKeywords", anyToken, - [96 /* ExtendsKeyword */, 119 /* ImplementsKeyword */, 160 /* FromKeyword */], + [96 /* ExtendsKeyword */, 119 /* ImplementsKeyword */, 161 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */ ), @@ -436714,6 +442306,7 @@ ${options.prefix}` : "\n" : options.prefix isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext, isNotFunctionDeclContext, + /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/ isNonTypeAssertionContext ], 16 /* DeleteSpace */), // decorators @@ -436881,40 +442474,40 @@ ${options.prefix}` : "\n" : options.prefix return (context) => !context.options || !hasProperty(context.options, optionName) || !!context.options[optionName]; } function isForContext(context) { - return context.contextNode.kind === 247 /* ForStatement */; + return context.contextNode.kind === 248 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 225 /* BinaryExpression */: + case 226 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 28 /* CommaToken */; - case 226 /* ConditionalExpression */: - case 193 /* ConditionalType */: - case 233 /* AsExpression */: - case 280 /* ExportSpecifier */: - case 275 /* ImportSpecifier */: - case 181 /* TypePredicate */: - case 191 /* UnionType */: - case 192 /* IntersectionType */: - case 237 /* SatisfiesExpression */: + case 227 /* ConditionalExpression */: + case 194 /* ConditionalType */: + case 234 /* AsExpression */: + case 281 /* ExportSpecifier */: + case 276 /* ImportSpecifier */: + case 182 /* TypePredicate */: + case 192 /* UnionType */: + case 193 /* IntersectionType */: + case 238 /* SatisfiesExpression */: return true; - case 207 /* BindingElement */: - case 264 /* TypeAliasDeclaration */: - case 270 /* ImportEqualsDeclaration */: - case 276 /* ExportAssignment */: - case 259 /* VariableDeclaration */: - case 168 /* Parameter */: - case 305 /* EnumMember */: - case 171 /* PropertyDeclaration */: - case 170 /* PropertySignature */: + case 208 /* BindingElement */: + case 265 /* TypeAliasDeclaration */: + case 271 /* ImportEqualsDeclaration */: + case 277 /* ExportAssignment */: + case 260 /* VariableDeclaration */: + case 169 /* Parameter */: + case 306 /* EnumMember */: + case 172 /* PropertyDeclaration */: + case 171 /* PropertySignature */: return context.currentTokenSpan.kind === 64 /* EqualsToken */ || context.nextTokenSpan.kind === 64 /* EqualsToken */; - case 248 /* ForInStatement */: - case 167 /* TypeParameter */: + case 249 /* ForInStatement */: + case 168 /* TypeParameter */: return context.currentTokenSpan.kind === 103 /* InKeyword */ || context.nextTokenSpan.kind === 103 /* InKeyword */ || context.currentTokenSpan.kind === 64 /* EqualsToken */ || context.nextTokenSpan.kind === 64 /* EqualsToken */; - case 249 /* ForOfStatement */: - return context.currentTokenSpan.kind === 164 /* OfKeyword */ || context.nextTokenSpan.kind === 164 /* OfKeyword */; + case 250 /* ForOfStatement */: + return context.currentTokenSpan.kind === 165 /* OfKeyword */ || context.nextTokenSpan.kind === 165 /* OfKeyword */; } return false; } @@ -436926,16 +442519,22 @@ ${options.prefix}` : "\n" : options.prefix } function isTypeAnnotationContext(context) { const contextKind = context.contextNode.kind; - return contextKind === 171 /* PropertyDeclaration */ || contextKind === 170 /* PropertySignature */ || contextKind === 168 /* Parameter */ || contextKind === 259 /* VariableDeclaration */ || isFunctionLikeKind(contextKind); + return contextKind === 172 /* PropertyDeclaration */ || contextKind === 171 /* PropertySignature */ || contextKind === 169 /* Parameter */ || contextKind === 260 /* VariableDeclaration */ || isFunctionLikeKind(contextKind); + } + function isOptionalPropertyContext(context) { + return isPropertyDeclaration(context.contextNode) && context.contextNode.questionToken; + } + function isNonOptionalPropertyContext(context) { + return !isOptionalPropertyContext(context); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 226 /* ConditionalExpression */ || context.contextNode.kind === 193 /* ConditionalType */; + return context.contextNode.kind === 227 /* ConditionalExpression */ || context.contextNode.kind === 194 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 205 /* ObjectBindingPattern */ || context.contextNode.kind === 199 /* MappedType */ || isSingleLineBlockContext(context); + return context.contextNode.kind === 206 /* ObjectBindingPattern */ || context.contextNode.kind === 200 /* MappedType */ || isSingleLineBlockContext(context); } function isBeforeMultilineBlockContext(context) { return isBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); @@ -436957,26 +442556,26 @@ ${options.prefix}` : "\n" : options.prefix return true; } switch (node.kind) { - case 240 /* Block */: - case 268 /* CaseBlock */: - case 209 /* ObjectLiteralExpression */: - case 267 /* ModuleBlock */: + case 241 /* Block */: + case 269 /* CaseBlock */: + case 210 /* ObjectLiteralExpression */: + case 268 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 261 /* FunctionDeclaration */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - case 178 /* CallSignature */: - case 217 /* FunctionExpression */: - case 175 /* Constructor */: - case 218 /* ArrowFunction */: - case 263 /* InterfaceDeclaration */: + case 262 /* FunctionDeclaration */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + case 179 /* CallSignature */: + case 218 /* FunctionExpression */: + case 176 /* Constructor */: + case 219 /* ArrowFunction */: + case 264 /* InterfaceDeclaration */: return true; } return false; @@ -436985,39 +442584,39 @@ ${options.prefix}` : "\n" : options.prefix return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 261 /* FunctionDeclaration */ || context.contextNode.kind === 217 /* FunctionExpression */; + return context.contextNode.kind === 262 /* FunctionDeclaration */ || context.contextNode.kind === 218 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: - case 186 /* TypeLiteral */: - case 266 /* ModuleDeclaration */: - case 277 /* ExportDeclaration */: - case 278 /* NamedExports */: - case 271 /* ImportDeclaration */: - case 274 /* NamedImports */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: + case 187 /* TypeLiteral */: + case 267 /* ModuleDeclaration */: + case 278 /* ExportDeclaration */: + case 279 /* NamedExports */: + case 272 /* ImportDeclaration */: + case 275 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 262 /* ClassDeclaration */: - case 266 /* ModuleDeclaration */: - case 265 /* EnumDeclaration */: - case 298 /* CatchClause */: - case 267 /* ModuleBlock */: - case 254 /* SwitchStatement */: + case 263 /* ClassDeclaration */: + case 267 /* ModuleDeclaration */: + case 266 /* EnumDeclaration */: + case 299 /* CatchClause */: + case 268 /* ModuleBlock */: + case 255 /* SwitchStatement */: return true; - case 240 /* Block */: { + case 241 /* Block */: { const blockParent = context.currentTokenParent.parent; - if (!blockParent || blockParent.kind !== 218 /* ArrowFunction */ && blockParent.kind !== 217 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 219 /* ArrowFunction */ && blockParent.kind !== 218 /* FunctionExpression */) { return true; } } @@ -437026,29 +442625,29 @@ ${options.prefix}` : "\n" : options.prefix } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 244 /* IfStatement */: - case 254 /* SwitchStatement */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 246 /* WhileStatement */: - case 257 /* TryStatement */: - case 245 /* DoStatement */: - case 253 /* WithStatement */: - case 298 /* CatchClause */: + case 245 /* IfStatement */: + case 255 /* SwitchStatement */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 247 /* WhileStatement */: + case 258 /* TryStatement */: + case 246 /* DoStatement */: + case 254 /* WithStatement */: + case 299 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 209 /* ObjectLiteralExpression */; + return context.contextNode.kind === 210 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 212 /* CallExpression */; + return context.contextNode.kind === 213 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 213 /* NewExpression */; + return context.contextNode.kind === 214 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -437063,10 +442662,10 @@ ${options.prefix}` : "\n" : options.prefix return context.nextTokenSpan.kind !== 22 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 218 /* ArrowFunction */; + return context.contextNode.kind === 219 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 204 /* ImportType */; + return context.contextNode.kind === 205 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 12 /* JsxText */; @@ -437075,19 +442674,25 @@ ${options.prefix}` : "\n" : options.prefix return context.contextNode.kind !== 12 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 283 /* JsxElement */ && context.contextNode.kind !== 287 /* JsxFragment */; + return context.contextNode.kind !== 284 /* JsxElement */ && context.contextNode.kind !== 288 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 293 /* JsxExpression */ || context.contextNode.kind === 292 /* JsxSpreadAttribute */; + return context.contextNode.kind === 294 /* JsxExpression */ || context.contextNode.kind === 293 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 290 /* JsxAttribute */; + return context.nextTokenParent.kind === 291 /* JsxAttribute */ || context.nextTokenParent.kind === 295 /* JsxNamespacedName */ && context.nextTokenParent.parent.kind === 291 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 290 /* JsxAttribute */; + return context.contextNode.kind === 291 /* JsxAttribute */; + } + function isNextTokenParentNotJsxNamespacedName(context) { + return context.nextTokenParent.kind !== 295 /* JsxNamespacedName */; + } + function isNextTokenParentJsxNamespacedName(context) { + return context.nextTokenParent.kind === 295 /* JsxNamespacedName */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 284 /* JsxSelfClosingElement */; + return context.contextNode.kind === 285 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -437099,44 +442704,44 @@ ${options.prefix}` : "\n" : options.prefix while (node && isExpression(node)) { node = node.parent; } - return node && node.kind === 169 /* Decorator */; + return node && node.kind === 170 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 260 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; + return context.currentTokenParent.kind === 261 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 266 /* ModuleDeclaration */; + return context.contextNode.kind === 267 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 186 /* TypeLiteral */; + return context.contextNode.kind === 187 /* TypeLiteral */; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 179 /* ConstructSignature */; + return context.contextNode.kind === 180 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent2) { if (token.kind !== 30 /* LessThanToken */ && token.kind !== 32 /* GreaterThanToken */) { return false; } switch (parent2.kind) { - case 182 /* TypeReference */: - case 215 /* TypeAssertionExpression */: - case 264 /* TypeAliasDeclaration */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 232 /* ExpressionWithTypeArguments */: + case 183 /* TypeReference */: + case 216 /* TypeAssertionExpression */: + case 265 /* TypeAliasDeclaration */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 233 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -437146,31 +442751,31 @@ ${options.prefix}` : "\n" : options.prefix return isTypeArgumentOrParameterOrAssertion(context.currentTokenSpan, context.currentTokenParent) || isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 215 /* TypeAssertionExpression */; + return context.contextNode.kind === 216 /* TypeAssertionExpression */; } function isNonTypeAssertionContext(context) { return !isTypeAssertionContext(context); } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 116 /* VoidKeyword */ && context.currentTokenParent.kind === 221 /* VoidExpression */; + return context.currentTokenSpan.kind === 116 /* VoidKeyword */ && context.currentTokenParent.kind === 222 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 228 /* YieldExpression */ && context.contextNode.expression !== void 0; + return context.contextNode.kind === 229 /* YieldExpression */ && context.contextNode.expression !== void 0; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 234 /* NonNullExpression */; + return context.contextNode.kind === 235 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 244 /* IfStatement */: - case 247 /* ForStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 245 /* DoStatement */: - case 246 /* WhileStatement */: + case 245 /* IfStatement */: + case 248 /* ForStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 246 /* DoStatement */: + case 247 /* WhileStatement */: return true; default: return false; @@ -437196,22 +442801,22 @@ ${options.prefix}` : "\n" : options.prefix if (startLine === endLine) { return nextTokenKind === 20 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 239 /* SemicolonClassElement */ || nextTokenKind === 27 /* SemicolonToken */) { + if (nextTokenKind === 240 /* SemicolonClassElement */ || nextTokenKind === 27 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 263 /* InterfaceDeclaration */ || context.contextNode.kind === 264 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 264 /* InterfaceDeclaration */ || context.contextNode.kind === 265 /* TypeAliasDeclaration */) { return !isPropertySignature(context.currentTokenParent) || !!context.currentTokenParent.type || nextTokenKind !== 21 /* OpenParenToken */; } if (isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 247 /* ForStatement */ && context.currentTokenParent.kind !== 241 /* EmptyStatement */ && context.currentTokenParent.kind !== 239 /* SemicolonClassElement */ && nextTokenKind !== 23 /* OpenBracketToken */ && nextTokenKind !== 21 /* OpenParenToken */ && nextTokenKind !== 40 /* PlusToken */ && nextTokenKind !== 41 /* MinusToken */ && nextTokenKind !== 44 /* SlashToken */ && nextTokenKind !== 14 /* RegularExpressionLiteral */ && nextTokenKind !== 28 /* CommaToken */ && nextTokenKind !== 227 /* TemplateExpression */ && nextTokenKind !== 16 /* TemplateHead */ && nextTokenKind !== 15 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 25 /* DotToken */; + return context.currentTokenParent.kind !== 248 /* ForStatement */ && context.currentTokenParent.kind !== 242 /* EmptyStatement */ && context.currentTokenParent.kind !== 240 /* SemicolonClassElement */ && nextTokenKind !== 23 /* OpenBracketToken */ && nextTokenKind !== 21 /* OpenParenToken */ && nextTokenKind !== 40 /* PlusToken */ && nextTokenKind !== 41 /* MinusToken */ && nextTokenKind !== 44 /* SlashToken */ && nextTokenKind !== 14 /* RegularExpressionLiteral */ && nextTokenKind !== 28 /* CommaToken */ && nextTokenKind !== 228 /* TemplateExpression */ && nextTokenKind !== 16 /* TemplateHead */ && nextTokenKind !== 15 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 25 /* DotToken */; } function isSemicolonInsertionContext(context) { return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile); } function isNotPropertyAccessOnIntegerLiteral(context) { - return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().indexOf(".") !== -1; + return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().includes("."); } var init_rules = __esm({ "src/services/formatting/rules.ts"() { @@ -437286,7 +442891,7 @@ ${options.prefix}` : "\n" : options.prefix return map2; } function getRuleBucketIndex(row, column) { - Debug.assert(row <= 164 /* LastKeyword */ && column <= 164 /* LastKeyword */, "Must compute formatting context from tokens"); + Debug.assert(row <= 165 /* LastKeyword */ && column <= 165 /* LastKeyword */, "Must compute formatting context from tokens"); return row * mapRowLength + column; } function addRule(rules, rule2, specificTokens, constructionState, rulesBucketIndex) { @@ -437316,7 +442921,7 @@ ${options.prefix}` : "\n" : options.prefix init_ts_formatting(); maskBitSize = 5; mask = 31; - mapRowLength = 164 /* LastToken */ + 1; + mapRowLength = 165 /* LastToken */ + 1; RulesPosition = ((RulesPosition2) => { RulesPosition2[RulesPosition2["StopRulesSpecific"] = 0] = "StopRulesSpecific"; RulesPosition2[RulesPosition2["StopRulesAny"] = maskBitSize * 1] = "StopRulesAny"; @@ -437408,17 +443013,17 @@ ${options.prefix}` : "\n" : options.prefix } function isListElement(parent2, node) { switch (parent2.kind) { - case 262 /* ClassDeclaration */: - case 263 /* InterfaceDeclaration */: + case 263 /* ClassDeclaration */: + case 264 /* InterfaceDeclaration */: return rangeContainsRange(parent2.members, node); - case 266 /* ModuleDeclaration */: + case 267 /* ModuleDeclaration */: const body = parent2.body; - return !!body && body.kind === 267 /* ModuleBlock */ && rangeContainsRange(body.statements, node); - case 311 /* SourceFile */: - case 240 /* Block */: - case 267 /* ModuleBlock */: + return !!body && body.kind === 268 /* ModuleBlock */ && rangeContainsRange(body.statements, node); + case 312 /* SourceFile */: + case 241 /* Block */: + case 268 /* ModuleBlock */: return rangeContainsRange(parent2.statements, node); - case 298 /* CatchClause */: + case 299 /* CatchClause */: return rangeContainsRange(parent2.block.statements, node); } return false; @@ -437450,11 +443055,11 @@ ${options.prefix}` : "\n" : options.prefix if (index >= sorted.length) { return false; } - const error = sorted[index]; - if (r.end <= error.start) { + const error2 = sorted[index]; + if (r.end <= error2.start) { return false; } - if (startEndOverlapsWithStartEnd(r.pos, r.end, error.start, error.start + error.length)) { + if (startEndOverlapsWithStartEnd(r.pos, r.end, error2.start, error2.start + error2.length)) { return true; } index++; @@ -437559,7 +443164,8 @@ ${options.prefix}` : "\n" : options.prefix } processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } - if (!formattingScanner.isOnToken()) { + const remainingTrivia = formattingScanner.getCurrentLeadingTrivia(); + if (remainingTrivia) { const indentation = SmartIndenter.nodeWillIndentChild( options, enclosingNode, @@ -437569,25 +443175,30 @@ ${options.prefix}` : "\n" : options.prefix /*indentByDefault*/ false ) ? initialIndentation + options.indentSize : initialIndentation; - const leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); - if (leadingTrivia) { - indentTriviaItems( - leadingTrivia, - indentation, - /*indentNextTokenOrTrivia*/ - false, - (item) => processRange( + indentTriviaItems( + remainingTrivia, + indentation, + /*indentNextTokenOrTrivia*/ + true, + (item) => { + processRange( item, sourceFile.getLineAndCharacterOfPosition(item.pos), enclosingNode, enclosingNode, /*dynamicIndentation*/ void 0 - ) - ); - if (options.trimTrailingWhitespace !== false) { - trimTrailingWhitespacesForRemainingRange(leadingTrivia); + ); + insertIndentation( + item.pos, + indentation, + /*lineAdded*/ + false + ); } + ); + if (options.trimTrailingWhitespace !== false) { + trimTrailingWhitespacesForRemainingRange(remainingTrivia); } } if (previousRange && formattingScanner.getTokenFullStart() >= originalRange.end) { @@ -437650,24 +443261,24 @@ ${options.prefix}` : "\n" : options.prefix return modifier.kind; } switch (node.kind) { - case 262 /* ClassDeclaration */: + case 263 /* ClassDeclaration */: return 86 /* ClassKeyword */; - case 263 /* InterfaceDeclaration */: + case 264 /* InterfaceDeclaration */: return 120 /* InterfaceKeyword */; - case 261 /* FunctionDeclaration */: + case 262 /* FunctionDeclaration */: return 100 /* FunctionKeyword */; - case 265 /* EnumDeclaration */: - return 265 /* EnumDeclaration */; - case 176 /* GetAccessor */: + case 266 /* EnumDeclaration */: + return 266 /* EnumDeclaration */; + case 177 /* GetAccessor */: return 139 /* GetKeyword */; - case 177 /* SetAccessor */: + case 178 /* SetAccessor */: return 153 /* SetKeyword */; - case 173 /* MethodDeclaration */: + case 174 /* MethodDeclaration */: if (node.asteriskToken) { return 42 /* AsteriskToken */; } - case 171 /* PropertyDeclaration */: - case 168 /* Parameter */: + case 172 /* PropertyDeclaration */: + case 169 /* Parameter */: const name = getNameOfDeclaration(node); if (name) { return name.kind; @@ -437717,15 +443328,15 @@ ${options.prefix}` : "\n" : options.prefix case 44 /* SlashToken */: case 32 /* GreaterThanToken */: switch (container.kind) { - case 285 /* JsxOpeningElement */: - case 286 /* JsxClosingElement */: - case 284 /* JsxSelfClosingElement */: + case 286 /* JsxOpeningElement */: + case 287 /* JsxClosingElement */: + case 285 /* JsxSelfClosingElement */: return false; } break; case 23 /* OpenBracketToken */: case 24 /* CloseBracketToken */: - if (container.kind !== 199 /* MappedType */) { + if (container.kind !== 200 /* MappedType */) { return false; } break; @@ -437826,11 +443437,11 @@ ${options.prefix}` : "\n" : options.prefix return inheritedIndentation; } } - const effectiveParentStartLine = child.kind === 169 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + const effectiveParentStartLine = child.kind === 170 /* Decorator */ ? childStartLine : undecoratedParentStartLine; const childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; - if (isFirstListItem && parent2.kind === 208 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent2.kind === 209 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -437935,17 +443546,12 @@ ${options.prefix}` : "\n" : options.prefix let indentNextTokenOrTrivia = true; if (currentTokenInfo.leadingTrivia) { const commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container); - indentNextTokenOrTrivia = indentTriviaItems( - currentTokenInfo.leadingTrivia, + indentNextTokenOrTrivia = indentTriviaItems(currentTokenInfo.leadingTrivia, commentIndentation, indentNextTokenOrTrivia, (item) => insertIndentation( + item.pos, commentIndentation, - indentNextTokenOrTrivia, - (item) => insertIndentation( - item.pos, - commentIndentation, - /*lineAdded*/ - false - ) - ); + /*lineAdded*/ + false + )); } if (tokenIndentation !== -1 /* Unknown */ && indentNextTokenOrTrivia) { insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAction === 1 /* LineAdded */); @@ -438251,50 +443857,50 @@ ${options.prefix}` : "\n" : options.prefix } function getOpenTokenForList(node, list) { switch (node.kind) { - case 175 /* Constructor */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 218 /* ArrowFunction */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: + case 176 /* Constructor */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 219 /* ArrowFunction */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: if (node.typeParameters === list) { return 30 /* LessThanToken */; } else if (node.parameters === list) { return 21 /* OpenParenToken */; } break; - case 212 /* CallExpression */: - case 213 /* NewExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: if (node.typeArguments === list) { return 30 /* LessThanToken */; } else if (node.arguments === list) { return 21 /* OpenParenToken */; } break; - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: if (node.typeParameters === list) { return 30 /* LessThanToken */; } break; - case 182 /* TypeReference */: - case 214 /* TaggedTemplateExpression */: - case 185 /* TypeQuery */: - case 232 /* ExpressionWithTypeArguments */: - case 204 /* ImportType */: + case 183 /* TypeReference */: + case 215 /* TaggedTemplateExpression */: + case 186 /* TypeQuery */: + case 233 /* ExpressionWithTypeArguments */: + case 205 /* ImportType */: if (node.typeArguments === list) { return 30 /* LessThanToken */; } break; - case 186 /* TypeLiteral */: + case 187 /* TypeLiteral */: return 19 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -438394,11 +444000,11 @@ ${options.prefix}` : "\n" : options.prefix } const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; const currentToken = getTokenAtPosition(sourceFile, position); - const isObjectLiteral = currentToken.kind === 19 /* OpenBraceToken */ && currentToken.parent.kind === 209 /* ObjectLiteralExpression */; + const isObjectLiteral = currentToken.kind === 19 /* OpenBraceToken */ && currentToken.parent.kind === 210 /* ObjectLiteralExpression */; if (options.indentStyle === 1 /* Block */ || isObjectLiteral) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 28 /* CommaToken */ && precedingToken.parent.kind !== 225 /* BinaryExpression */) { + if (precedingToken.kind === 28 /* CommaToken */ && precedingToken.parent.kind !== 226 /* BinaryExpression */) { const actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { return actualIndentation; @@ -438406,7 +444012,7 @@ ${options.prefix}` : "\n" : options.prefix } const containerList = getListByPosition(position, precedingToken.parent, sourceFile); if (containerList && !rangeContainsRange(containerList, precedingToken)) { - const useTheSameBaseIndentation = [217 /* FunctionExpression */, 218 /* ArrowFunction */].indexOf(currentToken.parent.kind) !== -1; + const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].includes(currentToken.parent.kind); const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize; return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize; } @@ -438548,7 +444154,7 @@ ${options.prefix}` : "\n" : options.prefix } } function getActualIndentationForNode(current, parent2, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 311 /* SourceFile */ || !parentAndChildShareLine); + const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent2.kind === 312 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -438586,7 +444192,7 @@ ${options.prefix}` : "\n" : options.prefix } SmartIndenter2.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent2, child, childStartLine, sourceFile) { - if (parent2.kind === 244 /* IfStatement */ && parent2.elseStatement === child) { + if (parent2.kind === 245 /* IfStatement */ && parent2.elseStatement === child) { const elseKeyword = findChildOfKind(parent2, 93 /* ElseKeyword */, sourceFile); Debug.assert(elseKeyword !== void 0); const elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -438637,42 +444243,42 @@ ${options.prefix}` : "\n" : options.prefix } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 182 /* TypeReference */: + case 183 /* TypeReference */: return getList(node.typeArguments); - case 209 /* ObjectLiteralExpression */: + case 210 /* ObjectLiteralExpression */: return getList(node.properties); - case 208 /* ArrayLiteralExpression */: + case 209 /* ArrayLiteralExpression */: return getList(node.elements); - case 186 /* TypeLiteral */: + case 187 /* TypeLiteral */: return getList(node.members); - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 218 /* ArrowFunction */: - case 173 /* MethodDeclaration */: - case 172 /* MethodSignature */: - case 178 /* CallSignature */: - case 175 /* Constructor */: - case 184 /* ConstructorType */: - case 179 /* ConstructSignature */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 219 /* ArrowFunction */: + case 174 /* MethodDeclaration */: + case 173 /* MethodSignature */: + case 179 /* CallSignature */: + case 176 /* Constructor */: + case 185 /* ConstructorType */: + case 180 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 176 /* GetAccessor */: + case 177 /* GetAccessor */: return getList(node.parameters); - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 351 /* JSDocTemplateTag */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 352 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 213 /* NewExpression */: - case 212 /* CallExpression */: + case 214 /* NewExpression */: + case 213 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 260 /* VariableDeclarationList */: + case 261 /* VariableDeclarationList */: return getList(node.declarations); - case 274 /* NamedImports */: - case 278 /* NamedExports */: + case 275 /* NamedImports */: + case 279 /* NamedExports */: return getList(node.elements); - case 205 /* ObjectBindingPattern */: - case 206 /* ArrayBindingPattern */: + case 206 /* ObjectBindingPattern */: + case 207 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -438695,7 +444301,7 @@ ${options.prefix}` : "\n" : options.prefix return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 260 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 261 /* VariableDeclarationList */) { return -1 /* Unknown */; } const containingList = getContainingList(node, sourceFile); @@ -438756,96 +444362,96 @@ ${options.prefix}` : "\n" : options.prefix function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) { const childKind = child ? child.kind : 0 /* Unknown */; switch (parent2.kind) { - case 243 /* ExpressionStatement */: - case 262 /* ClassDeclaration */: - case 230 /* ClassExpression */: - case 263 /* InterfaceDeclaration */: - case 265 /* EnumDeclaration */: - case 264 /* TypeAliasDeclaration */: - case 208 /* ArrayLiteralExpression */: - case 240 /* Block */: - case 267 /* ModuleBlock */: - case 209 /* ObjectLiteralExpression */: - case 186 /* TypeLiteral */: - case 199 /* MappedType */: - case 188 /* TupleType */: - case 216 /* ParenthesizedExpression */: - case 210 /* PropertyAccessExpression */: - case 212 /* CallExpression */: - case 213 /* NewExpression */: - case 242 /* VariableStatement */: - case 276 /* ExportAssignment */: - case 252 /* ReturnStatement */: - case 226 /* ConditionalExpression */: - case 206 /* ArrayBindingPattern */: - case 205 /* ObjectBindingPattern */: - case 285 /* JsxOpeningElement */: - case 288 /* JsxOpeningFragment */: - case 284 /* JsxSelfClosingElement */: - case 293 /* JsxExpression */: - case 172 /* MethodSignature */: - case 178 /* CallSignature */: - case 179 /* ConstructSignature */: - case 168 /* Parameter */: - case 183 /* FunctionType */: - case 184 /* ConstructorType */: - case 195 /* ParenthesizedType */: - case 214 /* TaggedTemplateExpression */: - case 222 /* AwaitExpression */: - case 278 /* NamedExports */: - case 274 /* NamedImports */: - case 280 /* ExportSpecifier */: - case 275 /* ImportSpecifier */: - case 171 /* PropertyDeclaration */: - case 295 /* CaseClause */: - case 296 /* DefaultClause */: + case 244 /* ExpressionStatement */: + case 263 /* ClassDeclaration */: + case 231 /* ClassExpression */: + case 264 /* InterfaceDeclaration */: + case 266 /* EnumDeclaration */: + case 265 /* TypeAliasDeclaration */: + case 209 /* ArrayLiteralExpression */: + case 241 /* Block */: + case 268 /* ModuleBlock */: + case 210 /* ObjectLiteralExpression */: + case 187 /* TypeLiteral */: + case 200 /* MappedType */: + case 189 /* TupleType */: + case 217 /* ParenthesizedExpression */: + case 211 /* PropertyAccessExpression */: + case 213 /* CallExpression */: + case 214 /* NewExpression */: + case 243 /* VariableStatement */: + case 277 /* ExportAssignment */: + case 253 /* ReturnStatement */: + case 227 /* ConditionalExpression */: + case 207 /* ArrayBindingPattern */: + case 206 /* ObjectBindingPattern */: + case 286 /* JsxOpeningElement */: + case 289 /* JsxOpeningFragment */: + case 285 /* JsxSelfClosingElement */: + case 294 /* JsxExpression */: + case 173 /* MethodSignature */: + case 179 /* CallSignature */: + case 180 /* ConstructSignature */: + case 169 /* Parameter */: + case 184 /* FunctionType */: + case 185 /* ConstructorType */: + case 196 /* ParenthesizedType */: + case 215 /* TaggedTemplateExpression */: + case 223 /* AwaitExpression */: + case 279 /* NamedExports */: + case 275 /* NamedImports */: + case 281 /* ExportSpecifier */: + case 276 /* ImportSpecifier */: + case 172 /* PropertyDeclaration */: + case 296 /* CaseClause */: + case 297 /* DefaultClause */: return true; - case 268 /* CaseBlock */: + case 269 /* CaseBlock */: return settings.indentSwitchCase ?? true; - case 259 /* VariableDeclaration */: - case 302 /* PropertyAssignment */: - case 225 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 209 /* ObjectLiteralExpression */) { + case 260 /* VariableDeclaration */: + case 303 /* PropertyAssignment */: + case 226 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 210 /* ObjectLiteralExpression */) { return rangeIsOnOneLine(sourceFile, child); } - if (parent2.kind === 225 /* BinaryExpression */ && sourceFile && child && childKind === 283 /* JsxElement */) { + if (parent2.kind === 226 /* BinaryExpression */ && sourceFile && child && childKind === 284 /* JsxElement */) { const parentStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, parent2.pos)).line; const childStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, child.pos)).line; return parentStartLine !== childStartLine; } - if (parent2.kind !== 225 /* BinaryExpression */) { + if (parent2.kind !== 226 /* BinaryExpression */) { return true; } break; - case 245 /* DoStatement */: - case 246 /* WhileStatement */: - case 248 /* ForInStatement */: - case 249 /* ForOfStatement */: - case 247 /* ForStatement */: - case 244 /* IfStatement */: - case 261 /* FunctionDeclaration */: - case 217 /* FunctionExpression */: - case 173 /* MethodDeclaration */: - case 175 /* Constructor */: - case 176 /* GetAccessor */: - case 177 /* SetAccessor */: - return childKind !== 240 /* Block */; - case 218 /* ArrowFunction */: - if (sourceFile && childKind === 216 /* ParenthesizedExpression */) { + case 246 /* DoStatement */: + case 247 /* WhileStatement */: + case 249 /* ForInStatement */: + case 250 /* ForOfStatement */: + case 248 /* ForStatement */: + case 245 /* IfStatement */: + case 262 /* FunctionDeclaration */: + case 218 /* FunctionExpression */: + case 174 /* MethodDeclaration */: + case 176 /* Constructor */: + case 177 /* GetAccessor */: + case 178 /* SetAccessor */: + return childKind !== 241 /* Block */; + case 219 /* ArrowFunction */: + if (sourceFile && childKind === 217 /* ParenthesizedExpression */) { return rangeIsOnOneLine(sourceFile, child); } - return childKind !== 240 /* Block */; - case 277 /* ExportDeclaration */: - return childKind !== 278 /* NamedExports */; - case 271 /* ImportDeclaration */: - return childKind !== 272 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 274 /* NamedImports */; - case 283 /* JsxElement */: - return childKind !== 286 /* JsxClosingElement */; - case 287 /* JsxFragment */: - return childKind !== 289 /* JsxClosingFragment */; - case 192 /* IntersectionType */: - case 191 /* UnionType */: - if (childKind === 186 /* TypeLiteral */ || childKind === 188 /* TupleType */) { + return childKind !== 241 /* Block */; + case 278 /* ExportDeclaration */: + return childKind !== 279 /* NamedExports */; + case 272 /* ImportDeclaration */: + return childKind !== 273 /* ImportClause */ || !!child.namedBindings && child.namedBindings.kind !== 275 /* NamedImports */; + case 284 /* JsxElement */: + return childKind !== 287 /* JsxClosingElement */; + case 288 /* JsxFragment */: + return childKind !== 290 /* JsxClosingFragment */; + case 193 /* IntersectionType */: + case 192 /* UnionType */: + if (childKind === 187 /* TypeLiteral */ || childKind === 189 /* TupleType */) { return false; } break; @@ -438855,11 +444461,11 @@ ${options.prefix}` : "\n" : options.prefix SmartIndenter2.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent2) { switch (kind) { - case 252 /* ReturnStatement */: - case 256 /* ThrowStatement */: - case 250 /* ContinueStatement */: - case 251 /* BreakStatement */: - return parent2.kind !== 240 /* Block */; + case 253 /* ReturnStatement */: + case 257 /* ThrowStatement */: + case 251 /* ContinueStatement */: + case 252 /* BreakStatement */: + return parent2.kind !== 241 /* Block */; default: return false; } @@ -438941,7 +444547,6 @@ ${options.prefix}` : "\n" : options.prefix init_transpile(); init_services(); init_transform(); - init_shims(); init_ts_BreakpointResolver(); init_ts_CallHierarchy(); init_ts_classifier(); @@ -438969,12 +444574,12 @@ ${options.prefix}` : "\n" : options.prefix function getTypeScriptVersion() { return typeScriptVersion2 ?? (typeScriptVersion2 = new Version(version)); } - function formatDeprecationMessage(name, error, errorAfter, since, message) { - let deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: "; + function formatDeprecationMessage(name, error2, errorAfter, since, message) { + let deprecationMessage = error2 ? "DeprecationError: " : "DeprecationWarning: "; deprecationMessage += `'${name}' `; deprecationMessage += since ? `has been deprecated since v${since}` : "is deprecated"; - deprecationMessage += error ? " and can no longer be used." : errorAfter ? ` and will no longer be usable after v${errorAfter}.` : "."; - deprecationMessage += message ? ` ${formatStringFromArgs(message, [name], 0)}` : ""; + deprecationMessage += error2 ? " and can no longer be used." : errorAfter ? ` and will no longer be usable after v${errorAfter}.` : "."; + deprecationMessage += message ? ` ${formatStringFromArgs(message, [name])}` : ""; return deprecationMessage; } function createErrorDeprecation(name, errorAfter, since, message) { @@ -439011,9 +444616,9 @@ ${options.prefix}` : "\n" : options.prefix const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter; const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter; const since = typeof options.since === "string" ? new Version(options.since) : options.since ?? warnAfter; - const error = options.error || errorAfter && version2.compareTo(errorAfter) >= 0; + const error2 = options.error || errorAfter && version2.compareTo(errorAfter) >= 0; const warn = !warnAfter || version2.compareTo(warnAfter) >= 0; - return error ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop; + return error2 ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop; } function wrapFunction(deprecation, func) { return function() { @@ -439093,9 +444698,9 @@ ${options.prefix}` : "\n" : options.prefix init_ts5(); init_deprecate(); addObjectAllocatorPatcher((objectAllocator2) => { - const Identifier74 = objectAllocator2.getIdentifierConstructor(); - if (!hasProperty(Identifier74.prototype, "originalKeywordKind")) { - Object.defineProperty(Identifier74.prototype, "originalKeywordKind", { + const Identifier79 = objectAllocator2.getIdentifierConstructor(); + if (!hasProperty(Identifier79.prototype, "originalKeywordKind")) { + Object.defineProperty(Identifier79.prototype, "originalKeywordKind", { get: deprecate(function() { return identifierToKeywordKind(this); }, { @@ -439107,10 +444712,10 @@ ${options.prefix}` : "\n" : options.prefix }) }); } - if (!hasProperty(Identifier74.prototype, "isInJSDocNamespace")) { - Object.defineProperty(Identifier74.prototype, "isInJSDocNamespace", { + if (!hasProperty(Identifier79.prototype, "isInJSDocNamespace")) { + Object.defineProperty(Identifier79.prototype, "isInJSDocNamespace", { get: deprecate(function() { - return this.flags & 2048 /* IdentifierIsInJSDocNamespace */ ? true : void 0; + return this.flags & 4096 /* IdentifierIsInJSDocNamespace */ ? true : void 0; }, { name: "isInJSDocNamespace", since: "5.0", @@ -439134,996 +444739,15288 @@ ${options.prefix}` : "\n" : options.prefix } }); - // src/typescript/_namespaces/ts.ts - var ts_exports2 = {}; - __export(ts_exports2, { - ANONYMOUS: () => ANONYMOUS, - AccessFlags: () => AccessFlags, - AssertionLevel: () => AssertionLevel, - AssignmentDeclarationKind: () => AssignmentDeclarationKind, - AssignmentKind: () => AssignmentKind, - Associativity: () => Associativity, - BreakpointResolver: () => ts_BreakpointResolver_exports, - BuilderFileEmit: () => BuilderFileEmit, - BuilderProgramKind: () => BuilderProgramKind, - BuilderState: () => BuilderState, - BundleFileSectionKind: () => BundleFileSectionKind, - CallHierarchy: () => ts_CallHierarchy_exports, - CharacterCodes: () => CharacterCodes, - CheckFlags: () => CheckFlags, - CheckMode: () => CheckMode, - ClassificationType: () => ClassificationType, - ClassificationTypeNames: () => ClassificationTypeNames, - CommentDirectiveType: () => CommentDirectiveType, - Comparison: () => Comparison, - CompletionInfoFlags: () => CompletionInfoFlags, - CompletionTriggerKind: () => CompletionTriggerKind, - Completions: () => ts_Completions_exports, - ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel, - ContextFlags: () => ContextFlags, - CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter, - Debug: () => Debug, - DiagnosticCategory: () => DiagnosticCategory, - Diagnostics: () => Diagnostics, - DocumentHighlights: () => DocumentHighlights, - ElementFlags: () => ElementFlags, - EmitFlags: () => EmitFlags, - EmitHint: () => EmitHint, - EmitOnly: () => EmitOnly, - EndOfLineState: () => EndOfLineState, - EnumKind: () => EnumKind, - ExitStatus: () => ExitStatus, - ExportKind: () => ExportKind, - Extension: () => Extension, - ExternalEmitHelpers: () => ExternalEmitHelpers, - FileIncludeKind: () => FileIncludeKind, - FilePreprocessingDiagnosticsKind: () => FilePreprocessingDiagnosticsKind, - FileSystemEntryKind: () => FileSystemEntryKind, - FileWatcherEventKind: () => FileWatcherEventKind, - FindAllReferences: () => ts_FindAllReferences_exports, - FlattenLevel: () => FlattenLevel, - FlowFlags: () => FlowFlags, - ForegroundColorEscapeSequences: () => ForegroundColorEscapeSequences, - FunctionFlags: () => FunctionFlags, - GeneratedIdentifierFlags: () => GeneratedIdentifierFlags, - GetLiteralTextFlags: () => GetLiteralTextFlags, - GoToDefinition: () => ts_GoToDefinition_exports, - HighlightSpanKind: () => HighlightSpanKind, - ImportKind: () => ImportKind, - ImportsNotUsedAsValues: () => ImportsNotUsedAsValues, - IndentStyle: () => IndentStyle, - IndexFlags: () => IndexFlags, - IndexKind: () => IndexKind, - InferenceFlags: () => InferenceFlags, - InferencePriority: () => InferencePriority, - InlayHintKind: () => InlayHintKind, - InlayHints: () => ts_InlayHints_exports, - InternalEmitFlags: () => InternalEmitFlags, - InternalSymbolName: () => InternalSymbolName, - InvalidatedProjectKind: () => InvalidatedProjectKind, - JsDoc: () => ts_JsDoc_exports, - JsTyping: () => ts_JsTyping_exports, - JsxEmit: () => JsxEmit, - JsxFlags: () => JsxFlags, - JsxReferenceKind: () => JsxReferenceKind, - LanguageServiceMode: () => LanguageServiceMode, - LanguageServiceShimHostAdapter: () => LanguageServiceShimHostAdapter, - LanguageVariant: () => LanguageVariant, - LexicalEnvironmentFlags: () => LexicalEnvironmentFlags, - ListFormat: () => ListFormat, - LogLevel: () => LogLevel, - MemberOverrideStatus: () => MemberOverrideStatus, - ModifierFlags: () => ModifierFlags, - ModuleDetectionKind: () => ModuleDetectionKind, - ModuleInstanceState: () => ModuleInstanceState, - ModuleKind: () => ModuleKind, - ModuleResolutionKind: () => ModuleResolutionKind, - ModuleSpecifierEnding: () => ModuleSpecifierEnding, - NavigateTo: () => ts_NavigateTo_exports, - NavigationBar: () => ts_NavigationBar_exports, - NewLineKind: () => NewLineKind, - NodeBuilderFlags: () => NodeBuilderFlags, - NodeCheckFlags: () => NodeCheckFlags, - NodeFactoryFlags: () => NodeFactoryFlags, - NodeFlags: () => NodeFlags, - NodeResolutionFeatures: () => NodeResolutionFeatures, - ObjectFlags: () => ObjectFlags, - OperationCanceledException: () => OperationCanceledException, - OperatorPrecedence: () => OperatorPrecedence, - OrganizeImports: () => ts_OrganizeImports_exports, - OrganizeImportsMode: () => OrganizeImportsMode, - OuterExpressionKinds: () => OuterExpressionKinds, - OutliningElementsCollector: () => ts_OutliningElementsCollector_exports, - OutliningSpanKind: () => OutliningSpanKind, - OutputFileType: () => OutputFileType, - PackageJsonAutoImportPreference: () => PackageJsonAutoImportPreference, - PackageJsonDependencyGroup: () => PackageJsonDependencyGroup, - PatternMatchKind: () => PatternMatchKind, - PollingInterval: () => PollingInterval, - PollingWatchKind: () => PollingWatchKind, - PragmaKindFlags: () => PragmaKindFlags, - PrivateIdentifierKind: () => PrivateIdentifierKind, - ProcessLevel: () => ProcessLevel, - QuotePreference: () => QuotePreference, - RelationComparisonResult: () => RelationComparisonResult, - Rename: () => ts_Rename_exports, - ScriptElementKind: () => ScriptElementKind, - ScriptElementKindModifier: () => ScriptElementKindModifier, - ScriptKind: () => ScriptKind, - ScriptSnapshot: () => ScriptSnapshot, - ScriptTarget: () => ScriptTarget, - SemanticClassificationFormat: () => SemanticClassificationFormat, - SemanticMeaning: () => SemanticMeaning, - SemicolonPreference: () => SemicolonPreference, - SignatureCheckMode: () => SignatureCheckMode, - SignatureFlags: () => SignatureFlags, - SignatureHelp: () => ts_SignatureHelp_exports, - SignatureKind: () => SignatureKind, - SmartSelectionRange: () => ts_SmartSelectionRange_exports, - SnippetKind: () => SnippetKind, - SortKind: () => SortKind, - StructureIsReused: () => StructureIsReused, - SymbolAccessibility: () => SymbolAccessibility, - SymbolDisplay: () => ts_SymbolDisplay_exports, - SymbolDisplayPartKind: () => SymbolDisplayPartKind, - SymbolFlags: () => SymbolFlags, - SymbolFormatFlags: () => SymbolFormatFlags, - SyntaxKind: () => SyntaxKind, - SyntheticSymbolKind: () => SyntheticSymbolKind, - Ternary: () => Ternary, - ThrottledCancellationToken: () => ThrottledCancellationToken, - TokenClass: () => TokenClass, - TokenFlags: () => TokenFlags, - TransformFlags: () => TransformFlags, - TypeFacts: () => TypeFacts, - TypeFlags: () => TypeFlags, - TypeFormatFlags: () => TypeFormatFlags, - TypeMapKind: () => TypeMapKind, - TypePredicateKind: () => TypePredicateKind, - TypeReferenceSerializationKind: () => TypeReferenceSerializationKind, - TypeScriptServicesFactory: () => TypeScriptServicesFactory, - UnionReduction: () => UnionReduction, - UpToDateStatusType: () => UpToDateStatusType, - VarianceFlags: () => VarianceFlags, - Version: () => Version, - VersionRange: () => VersionRange, - WatchDirectoryFlags: () => WatchDirectoryFlags, - WatchDirectoryKind: () => WatchDirectoryKind, - WatchFileKind: () => WatchFileKind, - WatchLogLevel: () => WatchLogLevel, - WatchType: () => WatchType, - accessPrivateIdentifier: () => accessPrivateIdentifier, - addEmitFlags: () => addEmitFlags, - addEmitHelper: () => addEmitHelper, - addEmitHelpers: () => addEmitHelpers, - addInternalEmitFlags: () => addInternalEmitFlags, - addNodeFactoryPatcher: () => addNodeFactoryPatcher, - addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, - addRange: () => addRange, - addRelatedInfo: () => addRelatedInfo, - addSyntheticLeadingComment: () => addSyntheticLeadingComment, - addSyntheticTrailingComment: () => addSyntheticTrailingComment, - addToSeen: () => addToSeen, - advancedAsyncSuperHelper: () => advancedAsyncSuperHelper, - affectsDeclarationPathOptionDeclarations: () => affectsDeclarationPathOptionDeclarations, - affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations, - allKeysStartWithDot: () => allKeysStartWithDot, - altDirectorySeparator: () => altDirectorySeparator, - and: () => and, - append: () => append, - appendIfUnique: () => appendIfUnique, - arrayFrom: () => arrayFrom, - arrayIsEqualTo: () => arrayIsEqualTo, - arrayIsHomogeneous: () => arrayIsHomogeneous, - arrayIsSorted: () => arrayIsSorted, - arrayOf: () => arrayOf, - arrayReverseIterator: () => arrayReverseIterator, - arrayToMap: () => arrayToMap, - arrayToMultiMap: () => arrayToMultiMap, - arrayToNumericMap: () => arrayToNumericMap, - arraysEqual: () => arraysEqual, - assertType: () => assertType, - assign: () => assign, - assignHelper: () => assignHelper, - asyncDelegator: () => asyncDelegator, - asyncGeneratorHelper: () => asyncGeneratorHelper, - asyncSuperHelper: () => asyncSuperHelper, - asyncValues: () => asyncValues, - attachFileToDiagnostics: () => attachFileToDiagnostics, - awaitHelper: () => awaitHelper, - awaiterHelper: () => awaiterHelper, - base64decode: () => base64decode, - base64encode: () => base64encode, - binarySearch: () => binarySearch, - binarySearchKey: () => binarySearchKey, - bindSourceFile: () => bindSourceFile, - breakIntoCharacterSpans: () => breakIntoCharacterSpans, - breakIntoWordSpans: () => breakIntoWordSpans, - buildLinkParts: () => buildLinkParts, - buildOpts: () => buildOpts, - buildOverload: () => buildOverload, - bundlerModuleNameResolver: () => bundlerModuleNameResolver, - canBeConvertedToAsync: () => canBeConvertedToAsync, - canHaveDecorators: () => canHaveDecorators, - canHaveExportModifier: () => canHaveExportModifier, - canHaveFlowNode: () => canHaveFlowNode, - canHaveIllegalDecorators: () => canHaveIllegalDecorators, - canHaveIllegalModifiers: () => canHaveIllegalModifiers, - canHaveIllegalType: () => canHaveIllegalType, - canHaveIllegalTypeParameters: () => canHaveIllegalTypeParameters, - canHaveJSDoc: () => canHaveJSDoc, - canHaveLocals: () => canHaveLocals, - canHaveModifiers: () => canHaveModifiers, - canHaveSymbol: () => canHaveSymbol, - canJsonReportNoInputFiles: () => canJsonReportNoInputFiles, - canProduceDiagnostics: () => canProduceDiagnostics, - canUsePropertyAccess: () => canUsePropertyAccess, - canWatchAffectingLocation: () => canWatchAffectingLocation, - canWatchAtTypes: () => canWatchAtTypes, - canWatchDirectoryOrFile: () => canWatchDirectoryOrFile, - cartesianProduct: () => cartesianProduct, - cast: () => cast, - chainBundle: () => chainBundle, - chainDiagnosticMessages: () => chainDiagnosticMessages, - changeAnyExtension: () => changeAnyExtension, - changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache, - changeExtension: () => changeExtension, - changesAffectModuleResolution: () => changesAffectModuleResolution, - changesAffectingProgramStructure: () => changesAffectingProgramStructure, - childIsDecorated: () => childIsDecorated, - classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, - classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, - classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, - classPrivateFieldInHelper: () => classPrivateFieldInHelper, - classPrivateFieldSetHelper: () => classPrivateFieldSetHelper, - classicNameResolver: () => classicNameResolver, - classifier: () => ts_classifier_exports, - cleanExtendedConfigCache: () => cleanExtendedConfigCache, - clear: () => clear, - clearMap: () => clearMap, - clearSharedExtendedConfigFileWatcher: () => clearSharedExtendedConfigFileWatcher, - climbPastPropertyAccess: () => climbPastPropertyAccess, - climbPastPropertyOrElementAccess: () => climbPastPropertyOrElementAccess, - clone: () => clone, - cloneCompilerOptions: () => cloneCompilerOptions, - closeFileWatcher: () => closeFileWatcher, - closeFileWatcherOf: () => closeFileWatcherOf, - codefix: () => ts_codefix_exports, - collapseTextChangeRangesAcrossMultipleVersions: () => collapseTextChangeRangesAcrossMultipleVersions, - collectExternalModuleInfo: () => collectExternalModuleInfo, - combine: () => combine, - combinePaths: () => combinePaths, - commentPragmas: () => commentPragmas, - commonOptionsWithBuild: () => commonOptionsWithBuild, - commonPackageFolders: () => commonPackageFolders, - compact: () => compact, - compareBooleans: () => compareBooleans, - compareDataObjects: () => compareDataObjects, - compareDiagnostics: () => compareDiagnostics, - compareDiagnosticsSkipRelatedInformation: () => compareDiagnosticsSkipRelatedInformation, - compareEmitHelpers: () => compareEmitHelpers, - compareNumberOfDirectorySeparators: () => compareNumberOfDirectorySeparators, - comparePaths: () => comparePaths, - comparePathsCaseInsensitive: () => comparePathsCaseInsensitive, - comparePathsCaseSensitive: () => comparePathsCaseSensitive, - comparePatternKeys: () => comparePatternKeys, - compareProperties: () => compareProperties, - compareStringsCaseInsensitive: () => compareStringsCaseInsensitive, - compareStringsCaseInsensitiveEslintCompatible: () => compareStringsCaseInsensitiveEslintCompatible, - compareStringsCaseSensitive: () => compareStringsCaseSensitive, - compareStringsCaseSensitiveUI: () => compareStringsCaseSensitiveUI, - compareTextSpans: () => compareTextSpans, - compareValues: () => compareValues, - compileOnSaveCommandLineOption: () => compileOnSaveCommandLineOption, - compilerOptionsAffectDeclarationPath: () => compilerOptionsAffectDeclarationPath, - compilerOptionsAffectEmit: () => compilerOptionsAffectEmit, - compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, - compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, - compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, - compose: () => compose, - computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, - computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, - computeLineOfPosition: () => computeLineOfPosition, - computeLineStarts: () => computeLineStarts, - computePositionOfLineAndCharacter: () => computePositionOfLineAndCharacter, - computeSignature: () => computeSignature, - computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics, - computeSuggestionDiagnostics: () => computeSuggestionDiagnostics, - concatenate: () => concatenate, - concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains, - consumesNodeCoreModules: () => consumesNodeCoreModules, - contains: () => contains, - containsIgnoredPath: () => containsIgnoredPath, - containsObjectRestOrSpread: () => containsObjectRestOrSpread, - containsParseError: () => containsParseError, - containsPath: () => containsPath, - convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, - convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, - convertJsonOption: () => convertJsonOption, - convertToBase64: () => convertToBase64, - convertToJson: () => convertToJson, - convertToObject: () => convertToObject, - convertToOptionsWithAbsolutePaths: () => convertToOptionsWithAbsolutePaths, - convertToRelativePath: () => convertToRelativePath, - convertToTSConfig: () => convertToTSConfig, - convertTypeAcquisitionFromJson: () => convertTypeAcquisitionFromJson, - copyComments: () => copyComments, - copyEntries: () => copyEntries, - copyLeadingComments: () => copyLeadingComments, - copyProperties: () => copyProperties, - copyTrailingAsLeadingComments: () => copyTrailingAsLeadingComments, - copyTrailingComments: () => copyTrailingComments, - couldStartTrivia: () => couldStartTrivia, - countWhere: () => countWhere, - createAbstractBuilder: () => createAbstractBuilder, - createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, - createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, - createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, - createBaseNodeFactory: () => createBaseNodeFactory, - createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, - createBindingHelper: () => createBindingHelper, - createBuildInfo: () => createBuildInfo, - createBuilderProgram: () => createBuilderProgram, - createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, - createBuilderStatusReporter: () => createBuilderStatusReporter, - createCacheWithRedirects: () => createCacheWithRedirects, - createCacheableExportInfoMap: () => createCacheableExportInfoMap, - createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, - createClassifier: () => createClassifier, - createCommentDirectivesMap: () => createCommentDirectivesMap, - createCompilerDiagnostic: () => createCompilerDiagnostic, - createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, - createCompilerDiagnosticFromMessageChain: () => createCompilerDiagnosticFromMessageChain, - createCompilerHost: () => createCompilerHost, - createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, - createCompilerHostWorker: () => createCompilerHostWorker, - createDetachedDiagnostic: () => createDetachedDiagnostic, - createDiagnosticCollection: () => createDiagnosticCollection, - createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, - createDiagnosticForNode: () => createDiagnosticForNode, - createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, - createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, - createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, - createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, - createDiagnosticForRange: () => createDiagnosticForRange, - createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, - createDiagnosticReporter: () => createDiagnosticReporter, - createDocumentPositionMapper: () => createDocumentPositionMapper, - createDocumentRegistry: () => createDocumentRegistry, - createDocumentRegistryInternal: () => createDocumentRegistryInternal, - createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, - createEmitHelperFactory: () => createEmitHelperFactory, - createEmptyExports: () => createEmptyExports, - createExpressionForJsxElement: () => createExpressionForJsxElement, - createExpressionForJsxFragment: () => createExpressionForJsxFragment, - createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, - createExpressionForPropertyName: () => createExpressionForPropertyName, - createExpressionFromEntityName: () => createExpressionFromEntityName, - createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, - createFileDiagnostic: () => createFileDiagnostic, - createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, - createForOfBindingStatement: () => createForOfBindingStatement, - createGetCanonicalFileName: () => createGetCanonicalFileName, - createGetSourceFile: () => createGetSourceFile, - createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, - createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, - createGetSymbolWalker: () => createGetSymbolWalker, - createIncrementalCompilerHost: () => createIncrementalCompilerHost, - createIncrementalProgram: () => createIncrementalProgram, - createInputFiles: () => createInputFiles, - createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, - createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, - createJsxFactoryExpression: () => createJsxFactoryExpression, - createLanguageService: () => createLanguageService, - createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, - createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, - createModeAwareCache: () => createModeAwareCache, - createModeAwareCacheKey: () => createModeAwareCacheKey, - createModuleNotFoundChain: () => createModuleNotFoundChain, - createModuleResolutionCache: () => createModuleResolutionCache, - createModuleResolutionLoader: () => createModuleResolutionLoader, - createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, - createMultiMap: () => createMultiMap, - createNodeConverters: () => createNodeConverters, - createNodeFactory: () => createNodeFactory, - createOptionNameMap: () => createOptionNameMap, - createOverload: () => createOverload, - createPackageJsonImportFilter: () => createPackageJsonImportFilter, - createPackageJsonInfo: () => createPackageJsonInfo, - createParenthesizerRules: () => createParenthesizerRules, - createPatternMatcher: () => createPatternMatcher, - createPrependNodes: () => createPrependNodes, - createPrinter: () => createPrinter, - createPrinterWithDefaults: () => createPrinterWithDefaults, - createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, - createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, - createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, - createProgram: () => createProgram, - createProgramHost: () => createProgramHost, - createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, - createQueue: () => createQueue, - createRange: () => createRange, - createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, - createResolutionCache: () => createResolutionCache, - createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, - createScanner: () => createScanner, - createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, - createSet: () => createSet, - createSolutionBuilder: () => createSolutionBuilder, - createSolutionBuilderHost: () => createSolutionBuilderHost, - createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, - createSolutionBuilderWithWatchHost: () => createSolutionBuilderWithWatchHost, - createSortedArray: () => createSortedArray, - createSourceFile: () => createSourceFile, - createSourceMapGenerator: () => createSourceMapGenerator, - createSourceMapSource: () => createSourceMapSource, - createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, - createSymbolTable: () => createSymbolTable, - createSymlinkCache: () => createSymlinkCache, - createSystemWatchFunctions: () => createSystemWatchFunctions, - createTextChange: () => createTextChange, - createTextChangeFromStartLength: () => createTextChangeFromStartLength, - createTextChangeRange: () => createTextChangeRange, - createTextRangeFromNode: () => createTextRangeFromNode, - createTextRangeFromSpan: () => createTextRangeFromSpan, - createTextSpan: () => createTextSpan, - createTextSpanFromBounds: () => createTextSpanFromBounds, - createTextSpanFromNode: () => createTextSpanFromNode, - createTextSpanFromRange: () => createTextSpanFromRange, - createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, - createTextWriter: () => createTextWriter, - createTokenRange: () => createTokenRange, - createTypeChecker: () => createTypeChecker, - createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, - createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, - createUnparsedSourceFile: () => createUnparsedSourceFile, - createWatchCompilerHost: () => createWatchCompilerHost2, - createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, - createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, - createWatchFactory: () => createWatchFactory, - createWatchHost: () => createWatchHost, - createWatchProgram: () => createWatchProgram, - createWatchStatusReporter: () => createWatchStatusReporter, - createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, - declarationNameToString: () => declarationNameToString, - decodeMappings: () => decodeMappings, - decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, - decorateHelper: () => decorateHelper, - deduplicate: () => deduplicate, - defaultIncludeSpec: () => defaultIncludeSpec, - defaultInitCompilerOptions: () => defaultInitCompilerOptions, - defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, - detectSortCaseSensitivity: () => detectSortCaseSensitivity, - diagnosticCategoryName: () => diagnosticCategoryName, - diagnosticToString: () => diagnosticToString, - directoryProbablyExists: () => directoryProbablyExists, - directorySeparator: () => directorySeparator, - displayPart: () => displayPart, - displayPartsToString: () => displayPartsToString, - disposeEmitNodes: () => disposeEmitNodes, - documentSpansEqual: () => documentSpansEqual, - dumpTracingLegend: () => dumpTracingLegend, - elementAt: () => elementAt, - elideNodes: () => elideNodes, - emitComments: () => emitComments, - emitDetachedComments: () => emitDetachedComments, - emitFiles: () => emitFiles, - emitFilesAndReportErrors: () => emitFilesAndReportErrors, - emitFilesAndReportErrorsAndGetExitStatus: () => emitFilesAndReportErrorsAndGetExitStatus, - emitModuleKindIsNonNodeESM: () => emitModuleKindIsNonNodeESM, - emitNewLineBeforeLeadingCommentOfPosition: () => emitNewLineBeforeLeadingCommentOfPosition, - emitNewLineBeforeLeadingComments: () => emitNewLineBeforeLeadingComments, - emitNewLineBeforeLeadingCommentsOfPosition: () => emitNewLineBeforeLeadingCommentsOfPosition, - emitSkippedWithNoDiagnostics: () => emitSkippedWithNoDiagnostics, - emitUsingBuildInfo: () => emitUsingBuildInfo, - emptyArray: () => emptyArray, - emptyFileSystemEntries: () => emptyFileSystemEntries, - emptyMap: () => emptyMap, - emptyOptions: () => emptyOptions, - emptySet: () => emptySet, - endsWith: () => endsWith, - ensurePathIsNonModuleName: () => ensurePathIsNonModuleName, - ensureScriptKind: () => ensureScriptKind, - ensureTrailingDirectorySeparator: () => ensureTrailingDirectorySeparator, - entityNameToString: () => entityNameToString, - enumerateInsertsAndDeletes: () => enumerateInsertsAndDeletes, - equalOwnProperties: () => equalOwnProperties, - equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, - equateStringsCaseSensitive: () => equateStringsCaseSensitive, - equateValues: () => equateValues, - esDecorateHelper: () => esDecorateHelper, - escapeJsxAttributeString: () => escapeJsxAttributeString, - escapeLeadingUnderscores: () => escapeLeadingUnderscores, - escapeNonAsciiString: () => escapeNonAsciiString, - escapeSnippetText: () => escapeSnippetText, - escapeString: () => escapeString, - every: () => every, - expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression, - explainFiles: () => explainFiles, - explainIfFileIsRedirectAndImpliedFormat: () => explainIfFileIsRedirectAndImpliedFormat, - exportAssignmentIsAlias: () => exportAssignmentIsAlias, - exportStarHelper: () => exportStarHelper, - expressionResultIsUnused: () => expressionResultIsUnused, - extend: () => extend, - extendsHelper: () => extendsHelper, - extensionFromPath: () => extensionFromPath, - extensionIsTS: () => extensionIsTS, - extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution, - externalHelpersModuleNameText: () => externalHelpersModuleNameText, - factory: () => factory, - fileExtensionIs: () => fileExtensionIs, - fileExtensionIsOneOf: () => fileExtensionIsOneOf, - fileIncludeReasonToDiagnostics: () => fileIncludeReasonToDiagnostics, - fileShouldUseJavaScriptRequire: () => fileShouldUseJavaScriptRequire, - filter: () => filter, - filterMutate: () => filterMutate, - filterSemanticDiagnostics: () => filterSemanticDiagnostics, - find: () => find, - findAncestor: () => findAncestor, - findBestPatternMatch: () => findBestPatternMatch, - findChildOfKind: () => findChildOfKind, - findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, - findConfigFile: () => findConfigFile, - findContainingList: () => findContainingList, - findDiagnosticForNode: () => findDiagnosticForNode, - findFirstNonJsxWhitespaceToken: () => findFirstNonJsxWhitespaceToken, - findIndex: () => findIndex, - findLast: () => findLast, - findLastIndex: () => findLastIndex, - findListItemInfo: () => findListItemInfo, - findMap: () => findMap, - findModifier: () => findModifier, - findNextToken: () => findNextToken, - findPackageJson: () => findPackageJson, - findPackageJsons: () => findPackageJsons, - findPrecedingMatchingToken: () => findPrecedingMatchingToken, - findPrecedingToken: () => findPrecedingToken, - findSuperStatementIndex: () => findSuperStatementIndex, - findTokenOnLeftOfPosition: () => findTokenOnLeftOfPosition, - findUseStrictPrologue: () => findUseStrictPrologue, - first: () => first, - firstDefined: () => firstDefined, - firstDefinedIterator: () => firstDefinedIterator, - firstIterator: () => firstIterator, - firstOrOnly: () => firstOrOnly, - firstOrUndefined: () => firstOrUndefined, - firstOrUndefinedIterator: () => firstOrUndefinedIterator, - fixupCompilerOptions: () => fixupCompilerOptions, - flatMap: () => flatMap, - flatMapIterator: () => flatMapIterator, - flatMapToMutable: () => flatMapToMutable, - flatten: () => flatten, - flattenCommaList: () => flattenCommaList, - flattenDestructuringAssignment: () => flattenDestructuringAssignment, - flattenDestructuringBinding: () => flattenDestructuringBinding, - flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, - forEach: () => forEach, - forEachAncestor: () => forEachAncestor, - forEachAncestorDirectory: () => forEachAncestorDirectory, - forEachChild: () => forEachChild, - forEachChildRecursively: () => forEachChildRecursively, - forEachEmittedFile: () => forEachEmittedFile, - forEachEnclosingBlockScopeContainer: () => forEachEnclosingBlockScopeContainer, - forEachEntry: () => forEachEntry, - forEachExternalModuleToImportFrom: () => forEachExternalModuleToImportFrom, - forEachImportClauseDeclaration: () => forEachImportClauseDeclaration, - forEachKey: () => forEachKey, - forEachLeadingCommentRange: () => forEachLeadingCommentRange, - forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft, - forEachPropertyAssignment: () => forEachPropertyAssignment, - forEachResolvedProjectReference: () => forEachResolvedProjectReference, - forEachReturnStatement: () => forEachReturnStatement, - forEachRight: () => forEachRight, - forEachTrailingCommentRange: () => forEachTrailingCommentRange, - forEachTsConfigPropArray: () => forEachTsConfigPropArray, - forEachUnique: () => forEachUnique, - forEachYieldExpression: () => forEachYieldExpression, - forSomeAncestorDirectory: () => forSomeAncestorDirectory, - formatColorAndReset: () => formatColorAndReset, - formatDiagnostic: () => formatDiagnostic, - formatDiagnostics: () => formatDiagnostics, - formatDiagnosticsWithColorAndContext: () => formatDiagnosticsWithColorAndContext, - formatGeneratedName: () => formatGeneratedName, - formatGeneratedNamePart: () => formatGeneratedNamePart, - formatLocation: () => formatLocation, - formatMessage: () => formatMessage, - formatStringFromArgs: () => formatStringFromArgs, - formatting: () => ts_formatting_exports, - fullTripleSlashAMDReferencePathRegEx: () => fullTripleSlashAMDReferencePathRegEx, - fullTripleSlashReferencePathRegEx: () => fullTripleSlashReferencePathRegEx, - generateDjb2Hash: () => generateDjb2Hash, - generateTSConfig: () => generateTSConfig, - generatorHelper: () => generatorHelper, - getAdjustedReferenceLocation: () => getAdjustedReferenceLocation, - getAdjustedRenameLocation: () => getAdjustedRenameLocation, - getAliasDeclarationFromName: () => getAliasDeclarationFromName, - getAllAccessorDeclarations: () => getAllAccessorDeclarations, - getAllDecoratorsOfClass: () => getAllDecoratorsOfClass, - getAllDecoratorsOfClassElement: () => getAllDecoratorsOfClassElement, - getAllJSDocTags: () => getAllJSDocTags, - getAllJSDocTagsOfKind: () => getAllJSDocTagsOfKind, - getAllKeys: () => getAllKeys, - getAllProjectOutputs: () => getAllProjectOutputs, - getAllSuperTypeNodes: () => getAllSuperTypeNodes, - getAllUnscopedEmitHelpers: () => getAllUnscopedEmitHelpers, - getAllowJSCompilerOption: () => getAllowJSCompilerOption, - getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports, - getAncestor: () => getAncestor, - getAnyExtensionFromPath: () => getAnyExtensionFromPath, - getAreDeclarationMapsEnabled: () => getAreDeclarationMapsEnabled, - getAssignedExpandoInitializer: () => getAssignedExpandoInitializer, - getAssignedName: () => getAssignedName, - getAssignmentDeclarationKind: () => getAssignmentDeclarationKind, - getAssignmentDeclarationPropertyAccessKind: () => getAssignmentDeclarationPropertyAccessKind, - getAssignmentTargetKind: () => getAssignmentTargetKind, - getAutomaticTypeDirectiveNames: () => getAutomaticTypeDirectiveNames, - getBaseFileName: () => getBaseFileName, - getBinaryOperatorPrecedence: () => getBinaryOperatorPrecedence, - getBuildInfo: () => getBuildInfo, - getBuildInfoFileVersionMap: () => getBuildInfoFileVersionMap, - getBuildInfoText: () => getBuildInfoText, - getBuildOrderFromAnyBuildOrder: () => getBuildOrderFromAnyBuildOrder, - getBuilderCreationParameters: () => getBuilderCreationParameters, - getBuilderFileEmit: () => getBuilderFileEmit, - getCheckFlags: () => getCheckFlags, - getClassExtendsHeritageElement: () => getClassExtendsHeritageElement, - getClassLikeDeclarationOfSymbol: () => getClassLikeDeclarationOfSymbol, - getCombinedLocalAndExportSymbolFlags: () => getCombinedLocalAndExportSymbolFlags, - getCombinedModifierFlags: () => getCombinedModifierFlags, - getCombinedNodeFlags: () => getCombinedNodeFlags, - getCombinedNodeFlagsAlwaysIncludeJSDoc: () => getCombinedNodeFlagsAlwaysIncludeJSDoc, - getCommentRange: () => getCommentRange, - getCommonSourceDirectory: () => getCommonSourceDirectory, - getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, - getCompilerOptionValue: () => getCompilerOptionValue, - getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, - getConditions: () => getConditions, - getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, - getConstantValue: () => getConstantValue, - getContainerNode: () => getContainerNode, - getContainingClass: () => getContainingClass, - getContainingClassStaticBlock: () => getContainingClassStaticBlock, - getContainingFunction: () => getContainingFunction, - getContainingFunctionDeclaration: () => getContainingFunctionDeclaration, - getContainingFunctionOrClassStaticBlock: () => getContainingFunctionOrClassStaticBlock, - getContainingNodeArray: () => getContainingNodeArray, - getContainingObjectLiteralElement: () => getContainingObjectLiteralElement, - getContextualTypeFromParent: () => getContextualTypeFromParent, - getContextualTypeFromParentOrAncestorTypeNode: () => getContextualTypeFromParentOrAncestorTypeNode, - getCurrentTime: () => getCurrentTime, - getDeclarationDiagnostics: () => getDeclarationDiagnostics, - getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath, - getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath, - getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker, - getDeclarationFromName: () => getDeclarationFromName, - getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol, - getDeclarationOfKind: () => getDeclarationOfKind, - getDeclarationsOfKind: () => getDeclarationsOfKind, - getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, - getDecorators: () => getDecorators, - getDefaultCompilerOptions: () => getDefaultCompilerOptions2, - getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, - getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, - getDefaultLibFileName: () => getDefaultLibFileName, - getDefaultLibFilePath: () => getDefaultLibFilePath, - getDefaultLikeExportInfo: () => getDefaultLikeExportInfo, - getDiagnosticText: () => getDiagnosticText, - getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan, - getDirectoryPath: () => getDirectoryPath, - getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation, - getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot, - getDocumentPositionMapper: () => getDocumentPositionMapper, - getESModuleInterop: () => getESModuleInterop, - getEditsForFileRename: () => getEditsForFileRename, - getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode, - getEffectiveConstraintOfTypeParameter: () => getEffectiveConstraintOfTypeParameter, - getEffectiveContainerForJSDocTemplateTag: () => getEffectiveContainerForJSDocTemplateTag, - getEffectiveImplementsTypeNodes: () => getEffectiveImplementsTypeNodes, - getEffectiveInitializer: () => getEffectiveInitializer, - getEffectiveJSDocHost: () => getEffectiveJSDocHost, - getEffectiveModifierFlags: () => getEffectiveModifierFlags, - getEffectiveModifierFlagsAlwaysIncludeJSDoc: () => getEffectiveModifierFlagsAlwaysIncludeJSDoc, - getEffectiveModifierFlagsNoCache: () => getEffectiveModifierFlagsNoCache, - getEffectiveReturnTypeNode: () => getEffectiveReturnTypeNode, - getEffectiveSetAccessorTypeAnnotationNode: () => getEffectiveSetAccessorTypeAnnotationNode, - getEffectiveTypeAnnotationNode: () => getEffectiveTypeAnnotationNode, - getEffectiveTypeParameterDeclarations: () => getEffectiveTypeParameterDeclarations, - getEffectiveTypeRoots: () => getEffectiveTypeRoots, - getElementOrPropertyAccessArgumentExpressionOrName: () => getElementOrPropertyAccessArgumentExpressionOrName, - getElementOrPropertyAccessName: () => getElementOrPropertyAccessName, - getElementsOfBindingOrAssignmentPattern: () => getElementsOfBindingOrAssignmentPattern, - getEmitDeclarations: () => getEmitDeclarations, - getEmitFlags: () => getEmitFlags, - getEmitHelpers: () => getEmitHelpers, - getEmitModuleDetectionKind: () => getEmitModuleDetectionKind, - getEmitModuleKind: () => getEmitModuleKind, - getEmitModuleResolutionKind: () => getEmitModuleResolutionKind, - getEmitScriptTarget: () => getEmitScriptTarget, - getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer, - getEncodedSemanticClassifications: () => getEncodedSemanticClassifications, - getEncodedSyntacticClassifications: () => getEncodedSyntacticClassifications, - getEndLinePosition: () => getEndLinePosition, - getEntityNameFromTypeNode: () => getEntityNameFromTypeNode, - getEntrypointsFromPackageJsonInfo: () => getEntrypointsFromPackageJsonInfo, - getErrorCountForSummary: () => getErrorCountForSummary, - getErrorSpanForNode: () => getErrorSpanForNode, - getErrorSummaryText: () => getErrorSummaryText, - getEscapedTextOfIdentifierOrLiteral: () => getEscapedTextOfIdentifierOrLiteral, - getEscapedTextOfJsxAttributeName: () => getEscapedTextOfJsxAttributeName, - getEscapedTextOfJsxNamespacedName: () => getEscapedTextOfJsxNamespacedName, - getExpandoInitializer: () => getExpandoInitializer, - getExportAssignmentExpression: () => getExportAssignmentExpression, - getExportInfoMap: () => getExportInfoMap, - getExportNeedsImportStarHelper: () => getExportNeedsImportStarHelper, - getExpressionAssociativity: () => getExpressionAssociativity, - getExpressionPrecedence: () => getExpressionPrecedence, - getExternalHelpersModuleName: () => getExternalHelpersModuleName, - getExternalModuleImportEqualsDeclarationExpression: () => getExternalModuleImportEqualsDeclarationExpression, - getExternalModuleName: () => getExternalModuleName, - getExternalModuleNameFromDeclaration: () => getExternalModuleNameFromDeclaration, - getExternalModuleNameFromPath: () => getExternalModuleNameFromPath, - getExternalModuleNameLiteral: () => getExternalModuleNameLiteral, - getExternalModuleRequireArgument: () => getExternalModuleRequireArgument, - getFallbackOptions: () => getFallbackOptions, - getFileEmitOutput: () => getFileEmitOutput, - getFileMatcherPatterns: () => getFileMatcherPatterns, - getFileNamesFromConfigSpecs: () => getFileNamesFromConfigSpecs, - getFileWatcherEventKind: () => getFileWatcherEventKind, - getFilesInErrorForSummary: () => getFilesInErrorForSummary, - getFirstConstructorWithBody: () => getFirstConstructorWithBody, - getFirstIdentifier: () => getFirstIdentifier, - getFirstNonSpaceCharacterPosition: () => getFirstNonSpaceCharacterPosition, - getFirstProjectOutput: () => getFirstProjectOutput, - getFixableErrorSpanExpression: () => getFixableErrorSpanExpression, - getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, - getFullWidth: () => getFullWidth, - getFunctionFlags: () => getFunctionFlags, - getHeritageClause: () => getHeritageClause, - getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, - getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, - getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, - getIdentifierTypeArguments: () => getIdentifierTypeArguments, - getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, - getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, - getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, - getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper, - getImportNeedsImportStarHelper: () => getImportNeedsImportStarHelper, - getIndentSize: () => getIndentSize, - getIndentString: () => getIndentString, - getInferredLibraryNameResolveFrom: () => getInferredLibraryNameResolveFrom, - getInitializedVariables: () => getInitializedVariables, - getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, - getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, - getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, - getInternalEmitFlags: () => getInternalEmitFlags, - getInvokedExpression: () => getInvokedExpression, - getIsolatedModules: () => getIsolatedModules, - getJSDocAugmentsTag: () => getJSDocAugmentsTag, - getJSDocClassTag: () => getJSDocClassTag, - getJSDocCommentRanges: () => getJSDocCommentRanges, - getJSDocCommentsAndTags: () => getJSDocCommentsAndTags, - getJSDocDeprecatedTag: () => getJSDocDeprecatedTag, - getJSDocDeprecatedTagNoCache: () => getJSDocDeprecatedTagNoCache, - getJSDocEnumTag: () => getJSDocEnumTag, - getJSDocHost: () => getJSDocHost, - getJSDocImplementsTags: () => getJSDocImplementsTags, - getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache, - getJSDocParameterTags: () => getJSDocParameterTags, - getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache, - getJSDocPrivateTag: () => getJSDocPrivateTag, - getJSDocPrivateTagNoCache: () => getJSDocPrivateTagNoCache, - getJSDocProtectedTag: () => getJSDocProtectedTag, - getJSDocProtectedTagNoCache: () => getJSDocProtectedTagNoCache, - getJSDocPublicTag: () => getJSDocPublicTag, - getJSDocPublicTagNoCache: () => getJSDocPublicTagNoCache, - getJSDocReadonlyTag: () => getJSDocReadonlyTag, - getJSDocReadonlyTagNoCache: () => getJSDocReadonlyTagNoCache, - getJSDocReturnTag: () => getJSDocReturnTag, - getJSDocReturnType: () => getJSDocReturnType, - getJSDocRoot: () => getJSDocRoot, - getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, - getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, - getJSDocTags: () => getJSDocTags, - getJSDocTagsNoCache: () => getJSDocTagsNoCache, - getJSDocTemplateTag: () => getJSDocTemplateTag, - getJSDocThisTag: () => getJSDocThisTag, - getJSDocType: () => getJSDocType, - getJSDocTypeAliasName: () => getJSDocTypeAliasName, - getJSDocTypeAssertionType: () => getJSDocTypeAssertionType, - getJSDocTypeParameterDeclarations: () => getJSDocTypeParameterDeclarations, - getJSDocTypeParameterTags: () => getJSDocTypeParameterTags, - getJSDocTypeParameterTagsNoCache: () => getJSDocTypeParameterTagsNoCache, - getJSDocTypeTag: () => getJSDocTypeTag, - getJSXImplicitImportBase: () => getJSXImplicitImportBase, - getJSXRuntimeImport: () => getJSXRuntimeImport, - getJSXTransformEnabled: () => getJSXTransformEnabled, - getKeyForCompilerOptions: () => getKeyForCompilerOptions, - getLanguageVariant: () => getLanguageVariant, - getLastChild: () => getLastChild, - getLeadingCommentRanges: () => getLeadingCommentRanges, - getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode, - getLeftmostAccessExpression: () => getLeftmostAccessExpression, - getLeftmostExpression: () => getLeftmostExpression, - getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition, - getLineInfo: () => getLineInfo, - getLineOfLocalPosition: () => getLineOfLocalPosition, - getLineOfLocalPositionFromLineMap: () => getLineOfLocalPositionFromLineMap, - getLineStartPositionForPosition: () => getLineStartPositionForPosition, - getLineStarts: () => getLineStarts, - getLinesBetweenPositionAndNextNonWhitespaceCharacter: () => getLinesBetweenPositionAndNextNonWhitespaceCharacter, - getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter: () => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter, - getLinesBetweenPositions: () => getLinesBetweenPositions, - getLinesBetweenRangeEndAndRangeStart: () => getLinesBetweenRangeEndAndRangeStart, - getLinesBetweenRangeEndPositions: () => getLinesBetweenRangeEndPositions, - getLiteralText: () => getLiteralText, - getLocalNameForExternalImport: () => getLocalNameForExternalImport, - getLocalSymbolForExportDefault: () => getLocalSymbolForExportDefault, - getLocaleSpecificMessage: () => getLocaleSpecificMessage, - getLocaleTimeString: () => getLocaleTimeString, - getMappedContextSpan: () => getMappedContextSpan, - getMappedDocumentSpan: () => getMappedDocumentSpan, - getMappedLocation: () => getMappedLocation, - getMatchedFileSpec: () => getMatchedFileSpec, - getMatchedIncludeSpec: () => getMatchedIncludeSpec, - getMeaningFromDeclaration: () => getMeaningFromDeclaration, - getMeaningFromLocation: () => getMeaningFromLocation, - getMembersOfDeclaration: () => getMembersOfDeclaration, - getModeForFileReference: () => getModeForFileReference, - getModeForResolutionAtIndex: () => getModeForResolutionAtIndex, - getModeForUsageLocation: () => getModeForUsageLocation, - getModifiedTime: () => getModifiedTime, - getModifiers: () => getModifiers, - getModuleInstanceState: () => getModuleInstanceState, - getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, - getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, - getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, - getNameForExportedSymbol: () => getNameForExportedSymbol, - getNameFromIndexInfo: () => getNameFromIndexInfo, - getNameFromPropertyName: () => getNameFromPropertyName, - getNameOfAccessExpression: () => getNameOfAccessExpression, - getNameOfCompilerOptionValue: () => getNameOfCompilerOptionValue, - getNameOfDeclaration: () => getNameOfDeclaration, - getNameOfExpando: () => getNameOfExpando, - getNameOfJSDocTypedef: () => getNameOfJSDocTypedef, - getNameOrArgument: () => getNameOrArgument, - getNameTable: () => getNameTable, - getNamesForExportedSymbol: () => getNamesForExportedSymbol, - getNamespaceDeclarationNode: () => getNamespaceDeclarationNode, - getNewLineCharacter: () => getNewLineCharacter, - getNewLineKind: () => getNewLineKind, - getNewLineOrDefaultFromHost: () => getNewLineOrDefaultFromHost, - getNewTargetContainer: () => getNewTargetContainer, - getNextJSDocCommentLocation: () => getNextJSDocCommentLocation, - getNodeForGeneratedName: () => getNodeForGeneratedName, - getNodeId: () => getNodeId, - getNodeKind: () => getNodeKind, - getNodeModifiers: () => getNodeModifiers, - getNodeModulePathParts: () => getNodeModulePathParts, - getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, - getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment, - getNonAugmentationDeclaration: () => getNonAugmentationDeclaration, - getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode, - getNormalizedAbsolutePath: () => getNormalizedAbsolutePath, - getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot, - getNormalizedPathComponents: () => getNormalizedPathComponents, - getObjectFlags: () => getObjectFlags, - getOperator: () => getOperator, - getOperatorAssociativity: () => getOperatorAssociativity, - getOperatorPrecedence: () => getOperatorPrecedence, - getOptionFromName: () => getOptionFromName, - getOptionsForLibraryResolution: () => getOptionsForLibraryResolution, - getOptionsNameMap: () => getOptionsNameMap, - getOrCreateEmitNode: () => getOrCreateEmitNode, - getOrCreateExternalHelpersModuleNameIfNeeded: () => getOrCreateExternalHelpersModuleNameIfNeeded, - getOrUpdate: () => getOrUpdate, - getOriginalNode: () => getOriginalNode, - getOriginalNodeId: () => getOriginalNodeId, - getOriginalSourceFile: () => getOriginalSourceFile, - getOutputDeclarationFileName: () => getOutputDeclarationFileName, - getOutputExtension: () => getOutputExtension, - getOutputFileNames: () => getOutputFileNames, - getOutputPathsFor: () => getOutputPathsFor, - getOutputPathsForBundle: () => getOutputPathsForBundle, - getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath, - getOwnKeys: () => getOwnKeys, - getOwnValues: () => getOwnValues, - getPackageJsonInfo: () => getPackageJsonInfo, - getPackageJsonTypesVersionsPaths: () => getPackageJsonTypesVersionsPaths, - getPackageJsonsVisibleToFile: () => getPackageJsonsVisibleToFile, - getPackageNameFromTypesPackageName: () => getPackageNameFromTypesPackageName, - getPackageScopeForPath: () => getPackageScopeForPath, - getParameterSymbolFromJSDoc: () => getParameterSymbolFromJSDoc, - getParameterTypeNode: () => getParameterTypeNode, - getParentNodeInSpan: () => getParentNodeInSpan, - getParseTreeNode: () => getParseTreeNode, - getParsedCommandLineOfConfigFile: () => getParsedCommandLineOfConfigFile, - getPathComponents: () => getPathComponents, - getPathComponentsRelativeTo: () => getPathComponentsRelativeTo, - getPathFromPathComponents: () => getPathFromPathComponents, - getPathUpdater: () => getPathUpdater, - getPathsBasePath: () => getPathsBasePath, - getPatternFromSpec: () => getPatternFromSpec, - getPendingEmitKind: () => getPendingEmitKind, - getPositionOfLineAndCharacter: () => getPositionOfLineAndCharacter, - getPossibleGenericSignatures: () => getPossibleGenericSignatures, - getPossibleOriginalInputExtensionForExtension: () => getPossibleOriginalInputExtensionForExtension, - getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, - getPreEmitDiagnostics: () => getPreEmitDiagnostics, - getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, - getPrivateIdentifier: () => getPrivateIdentifier, - getProperties: () => getProperties, - getProperty: () => getProperty, - getPropertyArrayElementValue: () => getPropertyArrayElementValue, - getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression, - getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode, - getPropertyNameForUniqueESSymbol: () => getPropertyNameForUniqueESSymbol, - getPropertyNameOfBindingOrAssignmentElement: () => getPropertyNameOfBindingOrAssignmentElement, - getPropertySymbolFromBindingElement: () => getPropertySymbolFromBindingElement, - getPropertySymbolsFromContextualType: () => getPropertySymbolsFromContextualType, - getQuoteFromPreference: () => getQuoteFromPreference, - getQuotePreference: () => getQuotePreference, - getRangesWhere: () => getRangesWhere, - getRefactorContextSpan: () => getRefactorContextSpan, - getReferencedFileLocation: () => getReferencedFileLocation, - getRegexFromPattern: () => getRegexFromPattern, - getRegularExpressionForWildcard: () => getRegularExpressionForWildcard, - getRegularExpressionsForWildcards: () => getRegularExpressionsForWildcards, - getRelativePathFromDirectory: () => getRelativePathFromDirectory, - getRelativePathFromFile: () => getRelativePathFromFile, - getRelativePathToDirectoryOrUrl: () => getRelativePathToDirectoryOrUrl, - getRenameLocation: () => getRenameLocation, - getReplacementSpanForContextToken: () => getReplacementSpanForContextToken, - getResolutionDiagnostic: () => getResolutionDiagnostic, - getResolutionModeOverrideForClause: () => getResolutionModeOverrideForClause, - getResolveJsonModule: () => getResolveJsonModule, - getResolvePackageJsonExports: () => getResolvePackageJsonExports, - getResolvePackageJsonImports: () => getResolvePackageJsonImports, - getResolvedExternalModuleName: () => getResolvedExternalModuleName, - getResolvedModule: () => getResolvedModule, - getResolvedTypeReferenceDirective: () => getResolvedTypeReferenceDirective, - getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement, - getRestParameterElementType: () => getRestParameterElementType, - getRightMostAssignedExpression: () => getRightMostAssignedExpression, - getRootDeclaration: () => getRootDeclaration, - getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache, - getRootLength: () => getRootLength, - getRootPathSplitLength: () => getRootPathSplitLength, - getScriptKind: () => getScriptKind, - getScriptKindFromFileName: () => getScriptKindFromFileName, - getScriptTargetFeatures: () => getScriptTargetFeatures, - getSelectedEffectiveModifierFlags: () => getSelectedEffectiveModifierFlags, - getSelectedSyntacticModifierFlags: () => getSelectedSyntacticModifierFlags, - getSemanticClassifications: () => getSemanticClassifications, - getSemanticJsxChildren: () => getSemanticJsxChildren, - getSetAccessorTypeAnnotationNode: () => getSetAccessorTypeAnnotationNode, - getSetAccessorValueParameter: () => getSetAccessorValueParameter, - getSetExternalModuleIndicator: () => getSetExternalModuleIndicator, - getShebang: () => getShebang, - getSingleInitializerOfVariableStatementOrPropertyDeclaration: () => getSingleInitializerOfVariableStatementOrPropertyDeclaration, - getSingleVariableOfVariableStatement: () => getSingleVariableOfVariableStatement, - getSnapshotText: () => getSnapshotText, - getSnippetElement: () => getSnippetElement, - getSourceFileOfModule: () => getSourceFileOfModule, - getSourceFileOfNode: () => getSourceFileOfNode, - getSourceFilePathInNewDir: () => getSourceFilePathInNewDir, - getSourceFilePathInNewDirWorker: () => getSourceFilePathInNewDirWorker, - getSourceFileVersionAsHashFromText: () => getSourceFileVersionAsHashFromText, - getSourceFilesToEmit: () => getSourceFilesToEmit, - getSourceMapRange: () => getSourceMapRange, - getSourceMapper: () => getSourceMapper, - getSourceTextOfNodeFromSourceFile: () => getSourceTextOfNodeFromSourceFile, - getSpanOfTokenAtPosition: () => getSpanOfTokenAtPosition, - getSpellingSuggestion: () => getSpellingSuggestion, - getStartPositionOfLine: () => getStartPositionOfLine, - getStartPositionOfRange: () => getStartPositionOfRange, - getStartsOnNewLine: () => getStartsOnNewLine, - getStaticPropertiesAndClassStaticBlock: () => getStaticPropertiesAndClassStaticBlock, - getStrictOptionValue: () => getStrictOptionValue, - getStringComparer: () => getStringComparer, - getSuperCallFromStatement: () => getSuperCallFromStatement, - getSuperContainer: () => getSuperContainer, - getSupportedCodeFixes: () => getSupportedCodeFixes, - getSupportedExtensions: () => getSupportedExtensions, + // src/typingsInstallerCore/_namespaces/ts.ts + var init_ts6 = __esm({ + "src/typingsInstallerCore/_namespaces/ts.ts"() { + "use strict"; + init_ts2(); + init_ts3(); + init_ts_server2(); + } + }); + + // src/typingsInstallerCore/typingsInstaller.ts + function typingToFileName(cachePath, packageName, installTypingHost, log) { + try { + const result = resolveModuleName(packageName, combinePaths(cachePath, "index.d.ts"), { moduleResolution: 2 /* Node10 */ }, installTypingHost); + return result.resolvedModule && result.resolvedModule.resolvedFileName; + } catch (e) { + if (log.isEnabled()) { + log.writeLine(`Failed to resolve ${packageName} in folder '${cachePath}': ${e.message}`); + } + return void 0; + } + } + function installNpmPackages(npmPath, tsVersion, packageNames, install) { + let hasError = false; + for (let remaining = packageNames.length; remaining > 0; ) { + const result = getNpmCommandForInstallation(npmPath, tsVersion, packageNames, remaining); + remaining = result.remaining; + hasError = install(result.command) || hasError; + } + return hasError; + } + function getNpmCommandForInstallation(npmPath, tsVersion, packageNames, remaining) { + const sliceStart = packageNames.length - remaining; + let command, toSlice = remaining; + while (true) { + command = `${npmPath} install --ignore-scripts ${(toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" ")} --save-dev --user-agent="typesInstaller/${tsVersion}"`; + if (command.length < 8e3) { + break; + } + toSlice = toSlice - Math.floor(toSlice / 2); + } + return { command, remaining: remaining - toSlice }; + } + function typingsName(packageName) { + return `@types/${packageName}@ts${versionMajorMinor}`; + } + var nullLog, TypingsInstaller; + var init_typingsInstaller = __esm({ + "src/typingsInstallerCore/typingsInstaller.ts"() { + "use strict"; + init_ts6(); + init_ts_server2(); + nullLog = { + isEnabled: () => false, + writeLine: noop + }; + TypingsInstaller = class { + constructor(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log = nullLog) { + this.installTypingHost = installTypingHost; + this.globalCachePath = globalCachePath; + this.safeListPath = safeListPath; + this.typesMapLocation = typesMapLocation; + this.throttleLimit = throttleLimit; + this.log = log; + this.packageNameToTypingLocation = /* @__PURE__ */ new Map(); + this.missingTypingsSet = /* @__PURE__ */ new Set(); + this.knownCachesSet = /* @__PURE__ */ new Set(); + this.projectWatchers = /* @__PURE__ */ new Map(); + /** @internal */ + this.pendingRunRequests = []; + this.installRunCount = 1; + this.inFlightRequestCount = 0; + this.latestDistTag = "latest"; + const isLoggingEnabled = this.log.isEnabled(); + if (isLoggingEnabled) { + this.log.writeLine(`Global cache location '${globalCachePath}', safe file path '${safeListPath}', types map path ${typesMapLocation}`); + } + 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); + } + closeWatchers(projectName) { + if (this.log.isEnabled()) { + this.log.writeLine(`Closing file watchers for project '${projectName}'`); + } + const watchers = this.projectWatchers.get(projectName); + if (!watchers) { + if (this.log.isEnabled()) { + this.log.writeLine(`No watchers are registered for project '${projectName}'`); + } + return; + } + this.projectWatchers.delete(projectName); + this.sendResponse({ kind: ActionWatchTypingLocations, projectName, files: [] }); + if (this.log.isEnabled()) { + this.log.writeLine(`Closing file watchers for project '${projectName}' - done.`); + } + } + install(req) { + if (this.log.isEnabled()) { + this.log.writeLine(`Got install request${stringifyIndented(req)}`); + } + if (req.cachePath) { + if (this.log.isEnabled()) { + this.log.writeLine(`Request specifies cache path '${req.cachePath}', loading cached information...`); + } + this.processCacheLocation(req.cachePath); + } + if (this.safeList === void 0) { + this.initializeSafeList(); + } + const discoverTypingsResult = ts_JsTyping_exports.discoverTypings( + this.installTypingHost, + this.log.isEnabled() ? (s) => this.log.writeLine(s) : void 0, + req.fileNames, + req.projectRootPath, + this.safeList, + this.packageNameToTypingLocation, + req.typeAcquisition, + req.unresolvedImports, + this.typesRegistry, + req.compilerOptions + ); + this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch); + if (discoverTypingsResult.newTypingNames.length) { + this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames); + } else { + this.sendResponse(this.createSetTypings(req, discoverTypingsResult.cachedTypingPaths)); + if (this.log.isEnabled()) { + this.log.writeLine(`No new typings were requested as a result of typings discovery`); + } + } + } + /** @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); + if (safeListFromMap) { + this.log.writeLine(`Loaded safelist from types map file '${this.typesMapLocation}'`); + this.safeList = safeListFromMap; + return; + } + this.log.writeLine(`Failed to load safelist from types map file '${this.typesMapLocation}'`); + } + this.safeList = ts_JsTyping_exports.loadSafeList(this.installTypingHost, this.safeListPath); + } + processCacheLocation(cacheLocation) { + if (this.log.isEnabled()) { + this.log.writeLine(`Processing cache location '${cacheLocation}'`); + } + if (this.knownCachesSet.has(cacheLocation)) { + if (this.log.isEnabled()) { + this.log.writeLine(`Cache location was already processed...`); + } + return; + } + const packageJson = combinePaths(cacheLocation, "package.json"); + const packageLockJson = combinePaths(cacheLocation, "package-lock.json"); + if (this.log.isEnabled()) { + this.log.writeLine(`Trying to find '${packageJson}'...`); + } + if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) { + const npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); + const npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); + if (this.log.isEnabled()) { + this.log.writeLine(`Loaded content of '${packageJson}':${stringifyIndented(npmConfig)}`); + this.log.writeLine(`Loaded content of '${packageLockJson}':${stringifyIndented(npmLock)}`); + } + if (npmConfig.devDependencies && npmLock.dependencies) { + for (const key in npmConfig.devDependencies) { + if (!hasProperty(npmLock.dependencies, key)) { + continue; + } + const packageName = getBaseFileName(key); + if (!packageName) { + continue; + } + const typingFile = typingToFileName(cacheLocation, packageName, this.installTypingHost, this.log); + if (!typingFile) { + this.missingTypingsSet.add(packageName); + continue; + } + const existingTypingFile = this.packageNameToTypingLocation.get(packageName); + if (existingTypingFile) { + if (existingTypingFile.typingLocation === typingFile) { + continue; + } + if (this.log.isEnabled()) { + this.log.writeLine(`New typing for package ${packageName} from '${typingFile}' conflicts with existing typing file '${existingTypingFile}'`); + } + } + if (this.log.isEnabled()) { + this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`); + } + const info = getProperty(npmLock.dependencies, key); + const version2 = info && info.version; + if (!version2) { + continue; + } + const newTyping = { typingLocation: typingFile, version: new Version(version2) }; + this.packageNameToTypingLocation.set(packageName, newTyping); + } + } + } + if (this.log.isEnabled()) { + this.log.writeLine(`Finished processing cache location '${cacheLocation}'`); + } + this.knownCachesSet.add(cacheLocation); + } + filterTypings(typingsToInstall) { + return mapDefined(typingsToInstall, (typing) => { + const typingKey = mangleScopedPackageName(typing); + if (this.missingTypingsSet.has(typingKey)) { + if (this.log.isEnabled()) + this.log.writeLine(`'${typing}':: '${typingKey}' is in missingTypingsSet - skipping...`); + return void 0; + } + const validationResult = ts_JsTyping_exports.validatePackageName(typing); + if (validationResult !== ts_JsTyping_exports.NameValidationResult.Ok) { + this.missingTypingsSet.add(typingKey); + if (this.log.isEnabled()) + this.log.writeLine(ts_JsTyping_exports.renderPackageNameValidationFailure(validationResult, typing)); + return void 0; + } + if (!this.typesRegistry.has(typingKey)) { + if (this.log.isEnabled()) + this.log.writeLine(`'${typing}':: Entry for package '${typingKey}' does not exist in local types registry - skipping...`); + return void 0; + } + if (this.packageNameToTypingLocation.get(typingKey) && ts_JsTyping_exports.isTypingUpToDate(this.packageNameToTypingLocation.get(typingKey), this.typesRegistry.get(typingKey))) { + if (this.log.isEnabled()) + this.log.writeLine(`'${typing}':: '${typingKey}' already has an up-to-date typing - skipping...`); + return void 0; + } + return typingKey; + }); + } + ensurePackageDirectoryExists(directory) { + const npmConfigPath = combinePaths(directory, "package.json"); + if (this.log.isEnabled()) { + this.log.writeLine(`Npm config file: ${npmConfigPath}`); + } + if (!this.installTypingHost.fileExists(npmConfigPath)) { + if (this.log.isEnabled()) { + this.log.writeLine(`Npm config file: '${npmConfigPath}' is missing, creating new one...`); + } + this.ensureDirectoryExists(directory, this.installTypingHost); + this.installTypingHost.writeFile(npmConfigPath, '{ "private": true }'); + } + } + installTypings(req, cachePath, currentlyCachedTypings, typingsToInstall) { + if (this.log.isEnabled()) { + this.log.writeLine(`Installing typings ${JSON.stringify(typingsToInstall)}`); + } + const filteredTypings = this.filterTypings(typingsToInstall); + if (filteredTypings.length === 0) { + if (this.log.isEnabled()) { + this.log.writeLine(`All typings are known to be missing or invalid - no need to install more typings`); + } + this.sendResponse(this.createSetTypings(req, currentlyCachedTypings)); + return; + } + this.ensurePackageDirectoryExists(cachePath); + const requestId = this.installRunCount; + this.installRunCount++; + this.sendResponse({ + kind: EventBeginInstallTypes, + eventId: requestId, + typingsInstallerVersion: version, + projectName: req.projectName + }); + const scopedTypings = filteredTypings.map(typingsName); + this.installTypingsAsync(requestId, scopedTypings, cachePath, (ok) => { + try { + if (!ok) { + if (this.log.isEnabled()) { + this.log.writeLine(`install request failed, marking packages as missing to prevent repeated requests: ${JSON.stringify(filteredTypings)}`); + } + for (const typing of filteredTypings) { + this.missingTypingsSet.add(typing); + } + return; + } + if (this.log.isEnabled()) { + this.log.writeLine(`Installed typings ${JSON.stringify(scopedTypings)}`); + } + const installedTypingFiles = []; + for (const packageName of filteredTypings) { + const typingFile = typingToFileName(cachePath, packageName, this.installTypingHost, this.log); + if (!typingFile) { + this.missingTypingsSet.add(packageName); + continue; + } + const distTags = this.typesRegistry.get(packageName); + const newVersion = new Version(distTags[`ts${versionMajorMinor}`] || distTags[this.latestDistTag]); + const newTyping = { typingLocation: typingFile, version: newVersion }; + this.packageNameToTypingLocation.set(packageName, newTyping); + installedTypingFiles.push(typingFile); + } + if (this.log.isEnabled()) { + this.log.writeLine(`Installed typing files ${JSON.stringify(installedTypingFiles)}`); + } + this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); + } finally { + const response = { + kind: EventEndInstallTypes, + eventId: requestId, + projectName: req.projectName, + packagesToInstall: scopedTypings, + installSuccess: ok, + typingsInstallerVersion: version + }; + this.sendResponse(response); + } + }); + } + ensureDirectoryExists(directory, host) { + const directoryName = getDirectoryPath(directory); + if (!host.directoryExists(directoryName)) { + this.ensureDirectoryExists(directoryName, host); + } + if (!host.directoryExists(directory)) { + host.createDirectory(directory); + } + } + watchFiles(projectName, files) { + if (!files.length) { + this.closeWatchers(projectName); + return; + } + const existing = this.projectWatchers.get(projectName); + const newSet = new Set(files); + if (!existing || forEachKey(newSet, (s) => !existing.has(s)) || forEachKey(existing, (s) => !newSet.has(s))) { + this.projectWatchers.set(projectName, newSet); + this.sendResponse({ kind: ActionWatchTypingLocations, projectName, files }); + } else { + this.sendResponse({ kind: ActionWatchTypingLocations, projectName, files: void 0 }); + } + } + createSetTypings(request, typings) { + return { + projectName: request.projectName, + typeAcquisition: request.typeAcquisition, + compilerOptions: request.compilerOptions, + typings, + unresolvedImports: request.unresolvedImports, + kind: ActionSet + }; + } + installTypingsAsync(requestId, packageNames, cwd, onRequestCompleted) { + this.pendingRunRequests.unshift({ requestId, packageNames, cwd, onRequestCompleted }); + this.executeWithThrottling(); + } + executeWithThrottling() { + while (this.inFlightRequestCount < this.throttleLimit && this.pendingRunRequests.length) { + this.inFlightRequestCount++; + const request = this.pendingRunRequests.pop(); + this.installWorker(request.requestId, request.packageNames, request.cwd, (ok) => { + this.inFlightRequestCount--; + request.onRequestCompleted(ok); + this.executeWithThrottling(); + }); + } + } + }; + } + }); + + // src/typingsInstallerCore/_namespaces/ts.server.typingsInstaller.ts + var ts_server_typingsInstaller_exports = {}; + __export(ts_server_typingsInstaller_exports, { + TypingsInstaller: () => TypingsInstaller, + getNpmCommandForInstallation: () => getNpmCommandForInstallation, + installNpmPackages: () => installNpmPackages, + typingsName: () => typingsName + }); + var init_ts_server_typingsInstaller = __esm({ + "src/typingsInstallerCore/_namespaces/ts.server.typingsInstaller.ts"() { + "use strict"; + init_typingsInstaller(); + } + }); + + // src/typingsInstallerCore/_namespaces/ts.server.ts + var init_ts_server2 = __esm({ + "src/typingsInstallerCore/_namespaces/ts.server.ts"() { + "use strict"; + init_ts_server(); + init_ts_server_typingsInstaller(); + } + }); + + // src/server/types.ts + var init_types4 = __esm({ + "src/server/types.ts"() { + "use strict"; + } + }); + + // src/server/utilitiesPublic.ts + function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { + return { + projectName: project.getProjectName(), + fileNames: project.getFileNames( + /*excludeFilesFromExternalLibraries*/ + true, + /*excludeConfigFiles*/ + true + ).concat(project.getExcludedFiles()), + compilerOptions: project.getCompilationSettings(), + typeAcquisition, + unresolvedImports, + projectRootPath: project.getCurrentDirectory(), + cachePath, + kind: "discover" + }; + } + function toNormalizedPath(fileName) { + return normalizePath(fileName); + } + function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) { + const f = isRootedDiskPath(normalizedPath) ? normalizedPath : getNormalizedAbsolutePath(normalizedPath, currentDirectory); + return getCanonicalFileName(f); + } + function asNormalizedPath(fileName) { + return fileName; + } + function createNormalizedPathMap() { + const map2 = /* @__PURE__ */ new Map(); + return { + get(path) { + return map2.get(path); + }, + set(path, value) { + map2.set(path, value); + }, + contains(path) { + return map2.has(path); + }, + remove(path) { + map2.delete(path); + } + }; + } + function isInferredProjectName(name) { + return /dev\/null\/inferredProject\d+\*/.test(name); + } + function makeInferredProjectName(counter) { + return `/dev/null/inferredProject${counter}*`; + } + function makeAutoImportProviderProjectName(counter) { + return `/dev/null/autoImportProviderProject${counter}*`; + } + function makeAuxiliaryProjectName(counter) { + return `/dev/null/auxiliaryProject${counter}*`; + } + function createSortedArray2() { + return []; + } + var LogLevel2, emptyArray2, Msg, Errors; + var init_utilitiesPublic3 = __esm({ + "src/server/utilitiesPublic.ts"() { + "use strict"; + init_ts7(); + LogLevel2 = /* @__PURE__ */ ((LogLevel3) => { + LogLevel3[LogLevel3["terse"] = 0] = "terse"; + LogLevel3[LogLevel3["normal"] = 1] = "normal"; + LogLevel3[LogLevel3["requestTime"] = 2] = "requestTime"; + LogLevel3[LogLevel3["verbose"] = 3] = "verbose"; + return LogLevel3; + })(LogLevel2 || {}); + emptyArray2 = createSortedArray2(); + Msg = /* @__PURE__ */ ((Msg2) => { + Msg2["Err"] = "Err"; + Msg2["Info"] = "Info"; + Msg2["Perf"] = "Perf"; + return Msg2; + })(Msg || {}); + ((Errors2) => { + function ThrowNoProject() { + throw new Error("No Project."); + } + Errors2.ThrowNoProject = ThrowNoProject; + function ThrowProjectLanguageServiceDisabled() { + throw new Error("The project's language service is disabled."); + } + Errors2.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled; + function ThrowProjectDoesNotContainDocument(fileName, project) { + throw new Error(`Project '${project.getProjectName()}' does not contain document '${fileName}'`); + } + Errors2.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument; + })(Errors || (Errors = {})); + } + }); + + // src/server/utilities.ts + function getBaseConfigFileName(configFilePath) { + const base = getBaseFileName(configFilePath); + return base === "tsconfig.json" || base === "jsconfig.json" ? base : void 0; + } + function removeSorted(array, remove, compare) { + if (!array || array.length === 0) { + return; + } + if (array[0] === remove) { + array.splice(0, 1); + return; + } + const removeIndex = binarySearch(array, remove, identity, compare); + if (removeIndex >= 0) { + array.splice(removeIndex, 1); + } + } + var ThrottledOperations, GcTimer; + var init_utilities5 = __esm({ + "src/server/utilities.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + ThrottledOperations = class _ThrottledOperations { + constructor(host, logger) { + this.host = host; + this.pendingTimeouts = /* @__PURE__ */ new Map(); + this.logger = logger.hasLevel(3 /* verbose */) ? logger : void 0; + } + /** + * Wait `number` milliseconds and then invoke `cb`. If, while waiting, schedule + * is called again with the same `operationId`, cancel this operation in favor + * of the new one. (Note that the amount of time the canceled operation had been + * waiting does not affect the amount of time that the new operation waits.) + */ + schedule(operationId, delay, cb) { + const pendingTimeout = this.pendingTimeouts.get(operationId); + if (pendingTimeout) { + this.host.clearTimeout(pendingTimeout); + } + this.pendingTimeouts.set(operationId, this.host.setTimeout(_ThrottledOperations.run, delay, operationId, this, cb)); + if (this.logger) { + this.logger.info(`Scheduled: ${operationId}${pendingTimeout ? ", Cancelled earlier one" : ""}`); + } + } + cancel(operationId) { + const pendingTimeout = this.pendingTimeouts.get(operationId); + if (!pendingTimeout) + return false; + this.host.clearTimeout(pendingTimeout); + return this.pendingTimeouts.delete(operationId); + } + static run(operationId, self, cb) { + var _a, _b; + (_a = perfLogger) == null ? void 0 : _a.logStartScheduledOperation(operationId); + self.pendingTimeouts.delete(operationId); + if (self.logger) { + self.logger.info(`Running: ${operationId}`); + } + cb(); + (_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation(); + } + }; + GcTimer = class _GcTimer { + constructor(host, delay, logger) { + this.host = host; + this.delay = delay; + this.logger = logger; + } + scheduleCollect() { + if (!this.host.gc || this.timerId !== void 0) { + return; + } + this.timerId = this.host.setTimeout(_GcTimer.run, this.delay, this); + } + static run(self) { + var _a, _b; + self.timerId = void 0; + (_a = perfLogger) == null ? void 0 : _a.logStartScheduledOperation("GC collect"); + const log = self.logger.hasLevel(2 /* requestTime */); + const before = log && self.host.getMemoryUsage(); + self.host.gc(); + if (log) { + const after = self.host.getMemoryUsage(); + self.logger.perftrc(`GC::before ${before}, after ${after}`); + } + (_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation(); + } + }; + } + }); + + // src/server/protocol.ts + var CommandTypes, OrganizeImportsMode2, WatchFileKind2, WatchDirectoryKind2, PollingWatchKind2, CompletionTriggerKind2, IndentStyle2, SemicolonPreference2, JsxEmit2, ModuleKind2, ModuleResolutionKind2, NewLineKind2, ScriptTarget10, ClassificationType2; + var init_protocol = __esm({ + "src/server/protocol.ts"() { + "use strict"; + CommandTypes = /* @__PURE__ */ ((CommandTypes2) => { + CommandTypes2["JsxClosingTag"] = "jsxClosingTag"; + CommandTypes2["LinkedEditingRange"] = "linkedEditingRange"; + CommandTypes2["Brace"] = "brace"; + CommandTypes2["BraceFull"] = "brace-full"; + CommandTypes2["BraceCompletion"] = "braceCompletion"; + CommandTypes2["GetSpanOfEnclosingComment"] = "getSpanOfEnclosingComment"; + CommandTypes2["Change"] = "change"; + CommandTypes2["Close"] = "close"; + CommandTypes2["Completions"] = "completions"; + CommandTypes2["CompletionInfo"] = "completionInfo"; + CommandTypes2["CompletionsFull"] = "completions-full"; + CommandTypes2["CompletionDetails"] = "completionEntryDetails"; + CommandTypes2["CompletionDetailsFull"] = "completionEntryDetails-full"; + CommandTypes2["CompileOnSaveAffectedFileList"] = "compileOnSaveAffectedFileList"; + CommandTypes2["CompileOnSaveEmitFile"] = "compileOnSaveEmitFile"; + CommandTypes2["Configure"] = "configure"; + CommandTypes2["Definition"] = "definition"; + CommandTypes2["DefinitionFull"] = "definition-full"; + CommandTypes2["DefinitionAndBoundSpan"] = "definitionAndBoundSpan"; + CommandTypes2["DefinitionAndBoundSpanFull"] = "definitionAndBoundSpan-full"; + CommandTypes2["Implementation"] = "implementation"; + CommandTypes2["ImplementationFull"] = "implementation-full"; + CommandTypes2["EmitOutput"] = "emit-output"; + CommandTypes2["Exit"] = "exit"; + CommandTypes2["FileReferences"] = "fileReferences"; + CommandTypes2["FileReferencesFull"] = "fileReferences-full"; + CommandTypes2["Format"] = "format"; + CommandTypes2["Formatonkey"] = "formatonkey"; + CommandTypes2["FormatFull"] = "format-full"; + CommandTypes2["FormatonkeyFull"] = "formatonkey-full"; + CommandTypes2["FormatRangeFull"] = "formatRange-full"; + CommandTypes2["Geterr"] = "geterr"; + CommandTypes2["GeterrForProject"] = "geterrForProject"; + CommandTypes2["SemanticDiagnosticsSync"] = "semanticDiagnosticsSync"; + CommandTypes2["SyntacticDiagnosticsSync"] = "syntacticDiagnosticsSync"; + CommandTypes2["SuggestionDiagnosticsSync"] = "suggestionDiagnosticsSync"; + CommandTypes2["NavBar"] = "navbar"; + CommandTypes2["NavBarFull"] = "navbar-full"; + CommandTypes2["Navto"] = "navto"; + CommandTypes2["NavtoFull"] = "navto-full"; + CommandTypes2["NavTree"] = "navtree"; + CommandTypes2["NavTreeFull"] = "navtree-full"; + CommandTypes2["DocumentHighlights"] = "documentHighlights"; + CommandTypes2["DocumentHighlightsFull"] = "documentHighlights-full"; + CommandTypes2["Open"] = "open"; + CommandTypes2["Quickinfo"] = "quickinfo"; + CommandTypes2["QuickinfoFull"] = "quickinfo-full"; + CommandTypes2["References"] = "references"; + CommandTypes2["ReferencesFull"] = "references-full"; + CommandTypes2["Reload"] = "reload"; + CommandTypes2["Rename"] = "rename"; + CommandTypes2["RenameInfoFull"] = "rename-full"; + CommandTypes2["RenameLocationsFull"] = "renameLocations-full"; + CommandTypes2["Saveto"] = "saveto"; + CommandTypes2["SignatureHelp"] = "signatureHelp"; + CommandTypes2["SignatureHelpFull"] = "signatureHelp-full"; + CommandTypes2["FindSourceDefinition"] = "findSourceDefinition"; + CommandTypes2["Status"] = "status"; + CommandTypes2["TypeDefinition"] = "typeDefinition"; + CommandTypes2["ProjectInfo"] = "projectInfo"; + CommandTypes2["ReloadProjects"] = "reloadProjects"; + CommandTypes2["Unknown"] = "unknown"; + CommandTypes2["OpenExternalProject"] = "openExternalProject"; + CommandTypes2["OpenExternalProjects"] = "openExternalProjects"; + CommandTypes2["CloseExternalProject"] = "closeExternalProject"; + CommandTypes2["SynchronizeProjectList"] = "synchronizeProjectList"; + CommandTypes2["ApplyChangedToOpenFiles"] = "applyChangedToOpenFiles"; + CommandTypes2["UpdateOpen"] = "updateOpen"; + CommandTypes2["EncodedSyntacticClassificationsFull"] = "encodedSyntacticClassifications-full"; + CommandTypes2["EncodedSemanticClassificationsFull"] = "encodedSemanticClassifications-full"; + CommandTypes2["Cleanup"] = "cleanup"; + CommandTypes2["GetOutliningSpans"] = "getOutliningSpans"; + CommandTypes2["GetOutliningSpansFull"] = "outliningSpans"; + CommandTypes2["TodoComments"] = "todoComments"; + CommandTypes2["Indentation"] = "indentation"; + CommandTypes2["DocCommentTemplate"] = "docCommentTemplate"; + CommandTypes2["CompilerOptionsDiagnosticsFull"] = "compilerOptionsDiagnostics-full"; + CommandTypes2["NameOrDottedNameSpan"] = "nameOrDottedNameSpan"; + CommandTypes2["BreakpointStatement"] = "breakpointStatement"; + CommandTypes2["CompilerOptionsForInferredProjects"] = "compilerOptionsForInferredProjects"; + CommandTypes2["GetCodeFixes"] = "getCodeFixes"; + CommandTypes2["GetCodeFixesFull"] = "getCodeFixes-full"; + CommandTypes2["GetCombinedCodeFix"] = "getCombinedCodeFix"; + CommandTypes2["GetCombinedCodeFixFull"] = "getCombinedCodeFix-full"; + CommandTypes2["ApplyCodeActionCommand"] = "applyCodeActionCommand"; + CommandTypes2["GetSupportedCodeFixes"] = "getSupportedCodeFixes"; + CommandTypes2["GetApplicableRefactors"] = "getApplicableRefactors"; + CommandTypes2["GetEditsForRefactor"] = "getEditsForRefactor"; + CommandTypes2["GetMoveToRefactoringFileSuggestions"] = "getMoveToRefactoringFileSuggestions"; + CommandTypes2["GetEditsForRefactorFull"] = "getEditsForRefactor-full"; + CommandTypes2["OrganizeImports"] = "organizeImports"; + CommandTypes2["OrganizeImportsFull"] = "organizeImports-full"; + CommandTypes2["GetEditsForFileRename"] = "getEditsForFileRename"; + CommandTypes2["GetEditsForFileRenameFull"] = "getEditsForFileRename-full"; + CommandTypes2["ConfigurePlugin"] = "configurePlugin"; + CommandTypes2["SelectionRange"] = "selectionRange"; + CommandTypes2["SelectionRangeFull"] = "selectionRange-full"; + CommandTypes2["ToggleLineComment"] = "toggleLineComment"; + CommandTypes2["ToggleLineCommentFull"] = "toggleLineComment-full"; + CommandTypes2["ToggleMultilineComment"] = "toggleMultilineComment"; + CommandTypes2["ToggleMultilineCommentFull"] = "toggleMultilineComment-full"; + CommandTypes2["CommentSelection"] = "commentSelection"; + CommandTypes2["CommentSelectionFull"] = "commentSelection-full"; + CommandTypes2["UncommentSelection"] = "uncommentSelection"; + CommandTypes2["UncommentSelectionFull"] = "uncommentSelection-full"; + CommandTypes2["PrepareCallHierarchy"] = "prepareCallHierarchy"; + CommandTypes2["ProvideCallHierarchyIncomingCalls"] = "provideCallHierarchyIncomingCalls"; + CommandTypes2["ProvideCallHierarchyOutgoingCalls"] = "provideCallHierarchyOutgoingCalls"; + CommandTypes2["ProvideInlayHints"] = "provideInlayHints"; + CommandTypes2["WatchChange"] = "watchChange"; + return CommandTypes2; + })(CommandTypes || {}); + OrganizeImportsMode2 = /* @__PURE__ */ ((OrganizeImportsMode3) => { + OrganizeImportsMode3["All"] = "All"; + OrganizeImportsMode3["SortAndCombine"] = "SortAndCombine"; + OrganizeImportsMode3["RemoveUnused"] = "RemoveUnused"; + return OrganizeImportsMode3; + })(OrganizeImportsMode2 || {}); + WatchFileKind2 = /* @__PURE__ */ ((WatchFileKind3) => { + WatchFileKind3["FixedPollingInterval"] = "FixedPollingInterval"; + WatchFileKind3["PriorityPollingInterval"] = "PriorityPollingInterval"; + WatchFileKind3["DynamicPriorityPolling"] = "DynamicPriorityPolling"; + WatchFileKind3["FixedChunkSizePolling"] = "FixedChunkSizePolling"; + WatchFileKind3["UseFsEvents"] = "UseFsEvents"; + WatchFileKind3["UseFsEventsOnParentDirectory"] = "UseFsEventsOnParentDirectory"; + return WatchFileKind3; + })(WatchFileKind2 || {}); + WatchDirectoryKind2 = /* @__PURE__ */ ((WatchDirectoryKind3) => { + WatchDirectoryKind3["UseFsEvents"] = "UseFsEvents"; + WatchDirectoryKind3["FixedPollingInterval"] = "FixedPollingInterval"; + WatchDirectoryKind3["DynamicPriorityPolling"] = "DynamicPriorityPolling"; + WatchDirectoryKind3["FixedChunkSizePolling"] = "FixedChunkSizePolling"; + return WatchDirectoryKind3; + })(WatchDirectoryKind2 || {}); + PollingWatchKind2 = /* @__PURE__ */ ((PollingWatchKind3) => { + PollingWatchKind3["FixedInterval"] = "FixedInterval"; + PollingWatchKind3["PriorityInterval"] = "PriorityInterval"; + PollingWatchKind3["DynamicPriority"] = "DynamicPriority"; + PollingWatchKind3["FixedChunkSize"] = "FixedChunkSize"; + return PollingWatchKind3; + })(PollingWatchKind2 || {}); + CompletionTriggerKind2 = /* @__PURE__ */ ((CompletionTriggerKind4) => { + CompletionTriggerKind4[CompletionTriggerKind4["Invoked"] = 1] = "Invoked"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerCharacter"] = 2] = "TriggerCharacter"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions"; + return CompletionTriggerKind4; + })(CompletionTriggerKind2 || {}); + IndentStyle2 = /* @__PURE__ */ ((IndentStyle3) => { + IndentStyle3["None"] = "None"; + IndentStyle3["Block"] = "Block"; + IndentStyle3["Smart"] = "Smart"; + return IndentStyle3; + })(IndentStyle2 || {}); + SemicolonPreference2 = /* @__PURE__ */ ((SemicolonPreference3) => { + SemicolonPreference3["Ignore"] = "ignore"; + SemicolonPreference3["Insert"] = "insert"; + SemicolonPreference3["Remove"] = "remove"; + return SemicolonPreference3; + })(SemicolonPreference2 || {}); + JsxEmit2 = /* @__PURE__ */ ((JsxEmit3) => { + JsxEmit3["None"] = "None"; + JsxEmit3["Preserve"] = "Preserve"; + JsxEmit3["ReactNative"] = "ReactNative"; + JsxEmit3["React"] = "React"; + return JsxEmit3; + })(JsxEmit2 || {}); + ModuleKind2 = /* @__PURE__ */ ((ModuleKind3) => { + ModuleKind3["None"] = "None"; + ModuleKind3["CommonJS"] = "CommonJS"; + ModuleKind3["AMD"] = "AMD"; + ModuleKind3["UMD"] = "UMD"; + ModuleKind3["System"] = "System"; + 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) => { + NewLineKind3["Crlf"] = "Crlf"; + NewLineKind3["Lf"] = "Lf"; + return NewLineKind3; + })(NewLineKind2 || {}); + ScriptTarget10 = /* @__PURE__ */ ((ScriptTarget11) => { + ScriptTarget11["ES3"] = "ES3"; + ScriptTarget11["ES5"] = "ES5"; + ScriptTarget11["ES6"] = "ES6"; + ScriptTarget11["ES2015"] = "ES2015"; + ScriptTarget11["ES2016"] = "ES2016"; + ScriptTarget11["ES2017"] = "ES2017"; + ScriptTarget11["ES2018"] = "ES2018"; + ScriptTarget11["ES2019"] = "ES2019"; + ScriptTarget11["ES2020"] = "ES2020"; + ScriptTarget11["ES2021"] = "ES2021"; + ScriptTarget11["ES2022"] = "ES2022"; + ScriptTarget11["ESNext"] = "ESNext"; + return ScriptTarget11; + })(ScriptTarget10 || {}); + ClassificationType2 = /* @__PURE__ */ ((ClassificationType3) => { + ClassificationType3[ClassificationType3["comment"] = 1] = "comment"; + ClassificationType3[ClassificationType3["identifier"] = 2] = "identifier"; + ClassificationType3[ClassificationType3["keyword"] = 3] = "keyword"; + ClassificationType3[ClassificationType3["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType3[ClassificationType3["operator"] = 5] = "operator"; + ClassificationType3[ClassificationType3["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType3[ClassificationType3["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType3[ClassificationType3["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType3[ClassificationType3["text"] = 9] = "text"; + ClassificationType3[ClassificationType3["punctuation"] = 10] = "punctuation"; + ClassificationType3[ClassificationType3["className"] = 11] = "className"; + ClassificationType3[ClassificationType3["enumName"] = 12] = "enumName"; + ClassificationType3[ClassificationType3["interfaceName"] = 13] = "interfaceName"; + ClassificationType3[ClassificationType3["moduleName"] = 14] = "moduleName"; + ClassificationType3[ClassificationType3["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType3[ClassificationType3["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType3[ClassificationType3["parameterName"] = 17] = "parameterName"; + ClassificationType3[ClassificationType3["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType3[ClassificationType3["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType3[ClassificationType3["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType3[ClassificationType3["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType3[ClassificationType3["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType3[ClassificationType3["jsxText"] = 23] = "jsxText"; + ClassificationType3[ClassificationType3["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; + ClassificationType3[ClassificationType3["bigintLiteral"] = 25] = "bigintLiteral"; + return ClassificationType3; + })(ClassificationType2 || {}); + } + }); + + // src/server/_namespaces/ts.server.protocol.ts + var ts_server_protocol_exports = {}; + __export(ts_server_protocol_exports, { + ClassificationType: () => ClassificationType2, + CommandTypes: () => CommandTypes, + CompletionTriggerKind: () => CompletionTriggerKind2, + IndentStyle: () => IndentStyle2, + JsxEmit: () => JsxEmit2, + ModuleKind: () => ModuleKind2, + ModuleResolutionKind: () => ModuleResolutionKind2, + NewLineKind: () => NewLineKind2, + OrganizeImportsMode: () => OrganizeImportsMode2, + PollingWatchKind: () => PollingWatchKind2, + ScriptTarget: () => ScriptTarget10, + SemicolonPreference: () => SemicolonPreference2, + WatchDirectoryKind: () => WatchDirectoryKind2, + WatchFileKind: () => WatchFileKind2 + }); + var init_ts_server_protocol = __esm({ + "src/server/_namespaces/ts.server.protocol.ts"() { + "use strict"; + init_protocol(); + } + }); + + // src/server/scriptInfo.ts + function isDynamicFileName(fileName) { + return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator); + } + function ensurePrimaryProjectKind(project) { + if (!project || isBackgroundProject(project)) { + return Errors.ThrowNoProject(); + } + return project; + } + function failIfInvalidPosition(position) { + Debug.assert(typeof position === "number", `Expected position ${position} to be a number.`); + Debug.assert(position >= 0, `Expected position to be non-negative.`); + } + function failIfInvalidLocation(location) { + Debug.assert(typeof location.line === "number", `Expected line ${location.line} to be a number.`); + Debug.assert(typeof location.offset === "number", `Expected offset ${location.offset} to be a number.`); + Debug.assert(location.line > 0, `Expected line to be non-${location.line === 0 ? "zero" : "negative"}`); + Debug.assert(location.offset > 0, `Expected offset to be non-${location.offset === 0 ? "zero" : "negative"}`); + } + var TextStorage, ScriptInfo; + var init_scriptInfo = __esm({ + "src/server/scriptInfo.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + TextStorage = class { + constructor(host, info, initialVersion) { + this.host = host; + this.info = info; + /** + * True if the text is for the file thats open in the editor + */ + this.isOpen = false; + /** + * True if the text present is the text from the file on the disk + */ + this.ownFileText = false; + /** + * True when reloading contents of file from the disk is pending + */ + this.pendingReloadFromDisk = false; + this.version = initialVersion || 0; + } + getVersion() { + return this.svc ? `SVC-${this.version}-${this.svc.getSnapshotVersion()}` : `Text-${this.version}`; + } + hasScriptVersionCache_TestOnly() { + return this.svc !== void 0; + } + resetSourceMapInfo() { + this.info.sourceFileLike = void 0; + this.info.closeSourceMapFileWatcher(); + this.info.sourceMapFilePath = void 0; + this.info.declarationInfoPath = void 0; + this.info.sourceInfos = void 0; + this.info.documentPositionMapper = void 0; + } + /** Public for testing */ + useText(newText) { + this.svc = void 0; + this.text = newText; + this.textSnapshot = void 0; + this.lineMap = void 0; + this.fileSize = void 0; + this.resetSourceMapInfo(); + this.version++; + } + edit(start, end, newText) { + this.switchToScriptVersionCache().edit(start, end - start, newText); + this.ownFileText = false; + this.text = void 0; + this.textSnapshot = void 0; + this.lineMap = void 0; + this.fileSize = void 0; + this.resetSourceMapInfo(); + } + /** + * Set the contents as newText + * returns true if text changed + */ + reload(newText) { + Debug.assert(newText !== void 0); + this.pendingReloadFromDisk = false; + if (!this.text && this.svc) { + this.text = getSnapshotText(this.svc.getSnapshot()); + } + if (this.text !== newText) { + this.useText(newText); + this.ownFileText = false; + return true; + } + return false; + } + /** + * Reads the contents from tempFile(if supplied) or own file and sets it as contents + * returns true if text changed + */ + reloadWithFileText(tempFileName) { + const { text: newText, fileSize } = tempFileName || !this.info.isDynamicOrHasMixedContent() ? this.getFileTextAndSize(tempFileName) : { text: "", fileSize: void 0 }; + const reloaded = this.reload(newText); + this.fileSize = fileSize; + this.ownFileText = !tempFileName || tempFileName === this.info.fileName; + return reloaded; + } + /** + * Schedule reload from the disk if its not already scheduled and its not own text + * returns true when scheduling reload + */ + scheduleReloadIfNeeded() { + return !this.pendingReloadFromDisk && !this.ownFileText ? this.pendingReloadFromDisk = true : false; + } + delayReloadFromFileIntoText() { + this.pendingReloadFromDisk = true; + } + /** + * For telemetry purposes, we would like to be able to report the size of the file. + * However, we do not want telemetry to require extra file I/O so we report a size + * that may be stale (e.g. may not reflect change made on disk since the last reload). + * NB: Will read from disk if the file contents have never been loaded because + * telemetry falsely indicating size 0 would be counter-productive. + */ + getTelemetryFileSize() { + return !!this.fileSize ? this.fileSize : !!this.text ? this.text.length : !!this.svc ? this.svc.getSnapshot().getLength() : this.getSnapshot().getLength(); + } + getSnapshot() { + var _a; + return ((_a = this.tryUseScriptVersionCache()) == null ? void 0 : _a.getSnapshot()) || (this.textSnapshot ?? (this.textSnapshot = ScriptSnapshot.fromString(Debug.checkDefined(this.text)))); + } + getAbsolutePositionAndLineText(oneBasedLine) { + const svc = this.tryUseScriptVersionCache(); + if (svc) + return svc.getAbsolutePositionAndLineText(oneBasedLine); + const lineMap = this.getLineMap(); + return oneBasedLine <= lineMap.length ? { + absolutePosition: lineMap[oneBasedLine - 1], + lineText: this.text.substring(lineMap[oneBasedLine - 1], lineMap[oneBasedLine]) + } : { + absolutePosition: this.text.length, + lineText: void 0 + }; + } + /** + * @param line 0 based index + */ + lineToTextSpan(line) { + const svc = this.tryUseScriptVersionCache(); + if (svc) + return svc.lineToTextSpan(line); + const lineMap = this.getLineMap(); + const start = lineMap[line]; + const end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length; + return createTextSpanFromBounds(start, end); + } + /** + * @param line 1 based index + * @param offset 1 based index + */ + lineOffsetToPosition(line, offset, allowEdits) { + const svc = this.tryUseScriptVersionCache(); + return svc ? svc.lineOffsetToPosition(line, offset) : computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text, allowEdits); + } + positionToLineOffset(position) { + const svc = this.tryUseScriptVersionCache(); + if (svc) + return svc.positionToLineOffset(position); + const { line, character } = computeLineAndCharacterOfPosition(this.getLineMap(), position); + return { line: line + 1, offset: character + 1 }; + } + getFileTextAndSize(tempFileName) { + let text; + const fileName = tempFileName || this.info.fileName; + const getText = () => text === void 0 ? text = this.host.readFile(fileName) || "" : text; + if (!hasTSFileExtension(this.info.fileName)) { + const fileSize = this.host.getFileSize ? this.host.getFileSize(fileName) : getText().length; + if (fileSize > maxFileSize) { + Debug.assert(!!this.info.containingProjects.length); + const service = this.info.containingProjects[0].projectService; + service.logger.info(`Skipped loading contents of large file ${fileName} for info ${this.info.fileName}: fileSize: ${fileSize}`); + this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(fileName, fileSize); + return { text: "", fileSize }; + } + } + return { text: getText() }; + } + /** @internal */ + switchToScriptVersionCache() { + if (!this.svc || this.pendingReloadFromDisk) { + this.svc = ScriptVersionCache.fromString(this.getOrLoadText()); + this.textSnapshot = void 0; + this.version++; + } + return this.svc; + } + tryUseScriptVersionCache() { + if (!this.svc || this.pendingReloadFromDisk) { + this.getOrLoadText(); + } + if (this.isOpen) { + if (!this.svc && !this.textSnapshot) { + this.svc = ScriptVersionCache.fromString(Debug.checkDefined(this.text)); + this.textSnapshot = void 0; + } + return this.svc; + } + return this.svc; + } + getOrLoadText() { + if (this.text === void 0 || this.pendingReloadFromDisk) { + Debug.assert(!this.svc || this.pendingReloadFromDisk, "ScriptVersionCache should not be set when reloading from disk"); + this.reloadWithFileText(); + } + return this.text; + } + getLineMap() { + Debug.assert(!this.svc, "ScriptVersionCache should not be set"); + return this.lineMap || (this.lineMap = computeLineStarts(Debug.checkDefined(this.text))); + } + getLineInfo() { + const svc = this.tryUseScriptVersionCache(); + if (svc) { + return { + getLineCount: () => svc.getLineCount(), + getLineText: (line) => svc.getAbsolutePositionAndLineText(line + 1).lineText + }; + } + const lineMap = this.getLineMap(); + return getLineInfo(this.text, lineMap); + } + }; + ScriptInfo = class { + constructor(host, fileName, scriptKind, hasMixedContent, path, initialVersion) { + this.host = host; + this.fileName = fileName; + this.scriptKind = scriptKind; + this.hasMixedContent = hasMixedContent; + this.path = path; + /** + * All projects that include this file + */ + this.containingProjects = []; + this.isDynamic = isDynamicFileName(fileName); + this.textStorage = new TextStorage(host, this, initialVersion); + if (hasMixedContent || this.isDynamic) { + this.realpath = this.path; + } + this.scriptKind = scriptKind ? scriptKind : getScriptKindFromFileName(fileName); + } + /** @internal */ + isDynamicOrHasMixedContent() { + return this.hasMixedContent || this.isDynamic; + } + isScriptOpen() { + return this.textStorage.isOpen; + } + open(newText) { + this.textStorage.isOpen = true; + if (newText !== void 0 && this.textStorage.reload(newText)) { + this.markContainingProjectsAsDirty(); + } + } + close(fileExists = true) { + this.textStorage.isOpen = false; + if (fileExists && this.textStorage.scheduleReloadIfNeeded()) { + this.markContainingProjectsAsDirty(); + } + } + getSnapshot() { + return this.textStorage.getSnapshot(); + } + ensureRealPath() { + if (this.realpath === void 0) { + this.realpath = this.path; + if (this.host.realpath) { + Debug.assert(!!this.containingProjects.length); + const project = this.containingProjects[0]; + const realpath = this.host.realpath(this.path); + if (realpath) { + this.realpath = project.toPath(realpath); + if (this.realpath !== this.path) { + project.projectService.realpathToScriptInfos.add(this.realpath, this); + } + } + } + } + } + /** @internal */ + getRealpathIfDifferent() { + return this.realpath && this.realpath !== this.path ? this.realpath : void 0; + } + /** + * @internal + * Does not compute realpath; uses precomputed result. Use `ensureRealPath` + * first if a definite result is needed. + */ + isSymlink() { + return this.realpath && this.realpath !== this.path; + } + getFormatCodeSettings() { + return this.formatSettings; + } + getPreferences() { + return this.preferences; + } + attachToProject(project) { + const isNew = !this.isAttached(project); + if (isNew) { + this.containingProjects.push(project); + if (!project.getCompilerOptions().preserveSymlinks) { + this.ensureRealPath(); + } + project.onFileAddedOrRemoved(this.isSymlink()); + } + return isNew; + } + isAttached(project) { + switch (this.containingProjects.length) { + case 0: + return false; + case 1: + return this.containingProjects[0] === project; + case 2: + return this.containingProjects[0] === project || this.containingProjects[1] === project; + default: + return contains(this.containingProjects, project); + } + } + detachFromProject(project) { + switch (this.containingProjects.length) { + case 0: + return; + case 1: + if (this.containingProjects[0] === project) { + project.onFileAddedOrRemoved(this.isSymlink()); + this.containingProjects.pop(); + } + break; + case 2: + if (this.containingProjects[0] === project) { + project.onFileAddedOrRemoved(this.isSymlink()); + this.containingProjects[0] = this.containingProjects.pop(); + } else if (this.containingProjects[1] === project) { + project.onFileAddedOrRemoved(this.isSymlink()); + this.containingProjects.pop(); + } + break; + default: + if (orderedRemoveItem(this.containingProjects, project)) { + project.onFileAddedOrRemoved(this.isSymlink()); + } + break; + } + } + detachAllProjects() { + for (const p of this.containingProjects) { + if (isConfiguredProject(p)) { + p.getCachedDirectoryStructureHost().addOrDeleteFile(this.fileName, this.path, 2 /* Deleted */); + } + const existingRoot = p.getRootFilesMap().get(this.path); + p.removeFile( + this, + /*fileExists*/ + false, + /*detachFromProject*/ + false + ); + p.onFileAddedOrRemoved(this.isSymlink()); + if (existingRoot && !isInferredProject(p)) { + p.addMissingFileRoot(existingRoot.fileName); + } + } + clear(this.containingProjects); + } + getDefaultProject() { + switch (this.containingProjects.length) { + case 0: + return Errors.ThrowNoProject(); + case 1: + return ensurePrimaryProjectKind(this.containingProjects[0]); + default: + let firstExternalProject; + let firstConfiguredProject; + let firstInferredProject; + let firstNonSourceOfProjectReferenceRedirect; + let defaultConfiguredProject; + for (let index = 0; index < this.containingProjects.length; index++) { + const project = this.containingProjects[index]; + if (isConfiguredProject(project)) { + if (!project.isSourceOfProjectReferenceRedirect(this.fileName)) { + if (defaultConfiguredProject === void 0 && index !== this.containingProjects.length - 1) { + defaultConfiguredProject = project.projectService.findDefaultConfiguredProject(this) || false; + } + if (defaultConfiguredProject === project) + return project; + if (!firstNonSourceOfProjectReferenceRedirect) + firstNonSourceOfProjectReferenceRedirect = project; + } + if (!firstConfiguredProject) + firstConfiguredProject = project; + } else if (!firstExternalProject && isExternalProject(project)) { + firstExternalProject = project; + } else if (!firstInferredProject && isInferredProject(project)) { + firstInferredProject = project; + } + } + return ensurePrimaryProjectKind( + defaultConfiguredProject || firstNonSourceOfProjectReferenceRedirect || firstConfiguredProject || firstExternalProject || firstInferredProject + ); + } + } + registerFileUpdate() { + for (const p of this.containingProjects) { + p.registerFileUpdate(this.path); + } + } + setOptions(formatSettings, preferences) { + if (formatSettings) { + if (!this.formatSettings) { + this.formatSettings = getDefaultFormatCodeSettings(this.host.newLine); + assign(this.formatSettings, formatSettings); + } else { + this.formatSettings = { ...this.formatSettings, ...formatSettings }; + } + } + if (preferences) { + if (!this.preferences) { + this.preferences = emptyOptions; + } + this.preferences = { ...this.preferences, ...preferences }; + } + } + getLatestVersion() { + this.textStorage.getSnapshot(); + return this.textStorage.getVersion(); + } + saveTo(fileName) { + this.host.writeFile(fileName, getSnapshotText(this.textStorage.getSnapshot())); + } + /** @internal */ + delayReloadNonMixedContentFile() { + Debug.assert(!this.isDynamicOrHasMixedContent()); + this.textStorage.delayReloadFromFileIntoText(); + this.markContainingProjectsAsDirty(); + } + reloadFromFile(tempFileName) { + if (this.textStorage.reloadWithFileText(tempFileName)) { + this.markContainingProjectsAsDirty(); + return true; + } + return false; + } + editContent(start, end, newText) { + this.textStorage.edit(start, end, newText); + this.markContainingProjectsAsDirty(); + } + markContainingProjectsAsDirty() { + for (const p of this.containingProjects) { + p.markFileAsDirty(this.path); + } + } + isOrphan() { + return !forEach(this.containingProjects, (p) => !p.isOrphan()); + } + /** @internal */ + isContainedByBackgroundProject() { + return some( + this.containingProjects, + isBackgroundProject + ); + } + /** + * @param line 1 based index + */ + lineToTextSpan(line) { + return this.textStorage.lineToTextSpan(line); + } + // eslint-disable-line @typescript-eslint/unified-signatures + lineOffsetToPosition(line, offset, allowEdits) { + return this.textStorage.lineOffsetToPosition(line, offset, allowEdits); + } + positionToLineOffset(position) { + failIfInvalidPosition(position); + const location = this.textStorage.positionToLineOffset(position); + failIfInvalidLocation(location); + return location; + } + isJavaScript() { + return this.scriptKind === 1 /* JS */ || this.scriptKind === 2 /* JSX */; + } + /** @internal */ + closeSourceMapFileWatcher() { + if (this.sourceMapFilePath && !isString(this.sourceMapFilePath)) { + closeFileWatcherOf(this.sourceMapFilePath); + this.sourceMapFilePath = void 0; + } + } + }; + } + }); + + // src/server/typingsCache.ts + function setIsEqualTo(arr1, arr2) { + if (arr1 === arr2) { + return true; + } + if ((arr1 || emptyArray2).length === 0 && (arr2 || emptyArray2).length === 0) { + return true; + } + const set = /* @__PURE__ */ new Map(); + let unique = 0; + for (const v of arr1) { + if (set.get(v) !== true) { + set.set(v, true); + unique++; + } + } + for (const v of arr2) { + const isSet = set.get(v); + if (isSet === void 0) { + return false; + } + if (isSet === true) { + set.set(v, false); + unique--; + } + } + return unique === 0; + } + function typeAcquisitionChanged(opt1, opt2) { + return opt1.enable !== opt2.enable || !setIsEqualTo(opt1.include, opt2.include) || !setIsEqualTo(opt1.exclude, opt2.exclude); + } + function compilerOptionsChanged(opt1, opt2) { + return getAllowJSCompilerOption(opt1) !== getAllowJSCompilerOption(opt2); + } + function unresolvedImportsChanged(imports1, imports2) { + if (imports1 === imports2) { + return false; + } + return !arrayIsEqualTo(imports1, imports2); + } + var nullTypingsInstaller, TypingsCache; + var init_typingsCache = __esm({ + "src/server/typingsCache.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + nullTypingsInstaller = { + isKnownTypesPackageName: returnFalse, + // Should never be called because we never provide a types registry. + installPackage: notImplemented, + enqueueInstallTypingsRequest: noop, + attach: noop, + onProjectClosed: noop, + globalTypingsCacheLocation: void 0 + // TODO: GH#18217 + }; + TypingsCache = class { + constructor(installer) { + this.installer = installer; + this.perProjectCache = /* @__PURE__ */ new Map(); + } + isKnownTypesPackageName(name) { + return this.installer.isKnownTypesPackageName(name); + } + installPackage(options) { + return this.installer.installPackage(options); + } + enqueueInstallTypingsForProject(project, unresolvedImports, forceRefresh) { + const typeAcquisition = project.getTypeAcquisition(); + if (!typeAcquisition || !typeAcquisition.enable) { + return; + } + const entry = this.perProjectCache.get(project.getProjectName()); + if (forceRefresh || !entry || typeAcquisitionChanged(typeAcquisition, entry.typeAcquisition) || compilerOptionsChanged(project.getCompilationSettings(), entry.compilerOptions) || unresolvedImportsChanged(unresolvedImports, entry.unresolvedImports)) { + this.perProjectCache.set(project.getProjectName(), { + compilerOptions: project.getCompilationSettings(), + typeAcquisition, + typings: entry ? entry.typings : emptyArray2, + unresolvedImports, + poisoned: true + }); + this.installer.enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports); + } + } + updateTypingsForProject(projectName, compilerOptions, typeAcquisition, unresolvedImports, newTypings) { + const typings = sort(newTypings); + this.perProjectCache.set(projectName, { + compilerOptions, + typeAcquisition, + typings, + unresolvedImports, + poisoned: false + }); + return !typeAcquisition || !typeAcquisition.enable ? emptyArray2 : typings; + } + onProjectClosed(project) { + if (this.perProjectCache.delete(project.getProjectName())) { + this.installer.onProjectClosed(project); + } + } + }; + } + }); + + // src/server/project.ts + function countEachFileTypes(infos, includeSizes = false) { + const result = { + js: 0, + jsSize: 0, + jsx: 0, + jsxSize: 0, + ts: 0, + tsSize: 0, + tsx: 0, + tsxSize: 0, + dts: 0, + dtsSize: 0, + deferred: 0, + deferredSize: 0 + }; + for (const info of infos) { + const fileSize = includeSizes ? info.textStorage.getTelemetryFileSize() : 0; + switch (info.scriptKind) { + case 1 /* JS */: + result.js += 1; + result.jsSize += fileSize; + break; + case 2 /* JSX */: + result.jsx += 1; + result.jsxSize += fileSize; + break; + case 3 /* TS */: + if (isDeclarationFileName(info.fileName)) { + result.dts += 1; + result.dtsSize += fileSize; + } else { + result.ts += 1; + result.tsSize += fileSize; + } + break; + case 4 /* TSX */: + result.tsx += 1; + result.tsxSize += fileSize; + break; + case 7 /* Deferred */: + result.deferred += 1; + result.deferredSize += fileSize; + break; + } + } + return result; + } + function hasOneOrMoreJsAndNoTsFiles(project) { + const counts2 = countEachFileTypes(project.getScriptInfos()); + return counts2.js > 0 && counts2.ts === 0 && counts2.tsx === 0; + } + function allRootFilesAreJsOrDts(project) { + const counts2 = countEachFileTypes(project.getRootScriptInfos()); + return counts2.ts === 0 && counts2.tsx === 0; + } + function allFilesAreJsOrDts(project) { + const counts2 = countEachFileTypes(project.getScriptInfos()); + return counts2.ts === 0 && counts2.tsx === 0; + } + function hasNoTypeScriptSource(fileNames) { + return !fileNames.some((fileName) => fileExtensionIs(fileName, ".ts" /* Ts */) && !isDeclarationFileName(fileName) || fileExtensionIs(fileName, ".tsx" /* Tsx */)); + } + function isGeneratedFileWatcher(watch) { + return watch.generatedFilePath !== void 0; + } + function getUnresolvedImports(program, cachedUnresolvedImportsPerFile) { + var _a, _b; + const sourceFiles = program.getSourceFiles(); + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "getUnresolvedImports", { count: sourceFiles.length }); + const ambientModules = program.getTypeChecker().getAmbientModules().map((mod) => stripQuotes(mod.getName())); + const result = sortAndDeduplicate(flatMap(sourceFiles, (sourceFile) => extractUnresolvedImportsFromSourceFile( + program, + sourceFile, + ambientModules, + cachedUnresolvedImportsPerFile + ))); + (_b = tracing) == null ? void 0 : _b.pop(); + return result; + } + function extractUnresolvedImportsFromSourceFile(program, file, ambientModules, cachedUnresolvedImportsPerFile) { + return getOrUpdate(cachedUnresolvedImportsPerFile, file.path, () => { + let unresolvedImports; + program.forEachResolvedModule(({ resolvedModule }, name) => { + if ((!resolvedModule || !resolutionExtensionIsTSOrJson(resolvedModule.extension)) && !isExternalModuleNameRelative(name) && !ambientModules.some((m) => m === name)) { + unresolvedImports = append(unresolvedImports, parsePackageName(name).packageName); + } + }, file); + return unresolvedImports || emptyArray2; + }); + } + function isInferredProject(project) { + return project.projectKind === 0 /* Inferred */; + } + function isConfiguredProject(project) { + return project.projectKind === 1 /* Configured */; + } + function isExternalProject(project) { + return project.projectKind === 2 /* External */; + } + function isBackgroundProject(project) { + return project.projectKind === 3 /* AutoImportProvider */ || project.projectKind === 4 /* Auxiliary */; + } + var ProjectKind, Project3, InferredProject2, AuxiliaryProject, _AutoImportProviderProject, AutoImportProviderProject, ConfiguredProject2, ExternalProject2; + var init_project = __esm({ + "src/server/project.ts"() { + "use strict"; + init_ts7(); + init_ts7(); + init_ts_server3(); + ProjectKind = /* @__PURE__ */ ((ProjectKind2) => { + ProjectKind2[ProjectKind2["Inferred"] = 0] = "Inferred"; + ProjectKind2[ProjectKind2["Configured"] = 1] = "Configured"; + ProjectKind2[ProjectKind2["External"] = 2] = "External"; + ProjectKind2[ProjectKind2["AutoImportProvider"] = 3] = "AutoImportProvider"; + ProjectKind2[ProjectKind2["Auxiliary"] = 4] = "Auxiliary"; + return ProjectKind2; + })(ProjectKind || {}); + Project3 = class _Project { + /** @internal */ + constructor(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory) { + this.projectKind = projectKind; + this.projectService = projectService; + this.documentRegistry = documentRegistry; + this.compilerOptions = compilerOptions; + this.compileOnSaveEnabled = compileOnSaveEnabled; + this.watchOptions = watchOptions; + this.rootFiles = []; + this.rootFilesMap = /* @__PURE__ */ new Map(); + /** @internal */ + this.plugins = []; + /** + * This is map from files to unresolved imports in it + * Maop does not contain entries for files that do not have unresolved imports + * This helps in containing the set of files to invalidate + * + * @internal + */ + this.cachedUnresolvedImportsPerFile = /* @__PURE__ */ new Map(); + /** @internal */ + this.hasAddedorRemovedFiles = false; + /** @internal */ + this.hasAddedOrRemovedSymlinks = false; + /** + * Last version that was reported. + */ + this.lastReportedVersion = 0; + /** + * 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; + /** + * Current version of the project state. It is changed when: + * - 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; + /** @internal */ + this.dirty = false; + /** @internal */ + this.typingFiles = emptyArray2; + /** @internal */ + this.moduleSpecifierCache = createModuleSpecifierCache(this); + /** @internal */ + 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); + this.getCanonicalFileName = this.projectService.toCanonicalFileName; + this.jsDocParsingMode = this.projectService.jsDocParsingMode; + this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds); + if (!this.compilerOptions) { + this.compilerOptions = getDefaultCompilerOptions2(); + this.compilerOptions.allowNonTsExtensions = true; + this.compilerOptions.allowJs = true; + } else if (hasExplicitListOfFiles || getAllowJSCompilerOption(this.compilerOptions) || this.projectService.hasDeferredExtension()) { + this.compilerOptions.allowNonTsExtensions = true; + } + switch (projectService.serverMode) { + case 0 /* Semantic */: + this.languageServiceEnabled = true; + break; + case 1 /* PartialSemantic */: + this.languageServiceEnabled = true; + this.compilerOptions.noResolve = true; + this.compilerOptions.types = []; + break; + case 2 /* Syntactic */: + this.languageServiceEnabled = false; + this.compilerOptions.noResolve = true; + this.compilerOptions.types = []; + break; + default: + Debug.assertNever(projectService.serverMode); + } + this.setInternalCompilerOptionsForEmittingJsFiles(); + const host = this.projectService.host; + if (this.projectService.logger.loggingEnabled()) { + this.trace = (s) => this.writeLog(s); + } else if (host.trace) { + this.trace = (s) => host.trace(s); + } + this.realpath = maybeBind(host, host.realpath); + this.resolutionCache = createResolutionCache( + this, + this.currentDirectory, + /*logChangesWhenResolvingModule*/ + true + ); + this.languageService = createLanguageService(this, this.documentRegistry, this.projectService.serverMode); + if (lastFileExceededProgramSize) { + this.disableLanguageService(lastFileExceededProgramSize); + } + this.markAsDirty(); + if (!isBackgroundProject(this)) { + this.projectService.pendingEnsureProjectForOpenFiles = true; + } + this.projectService.onProjectCreation(this); + } + /** @internal */ + getResolvedProjectReferenceToRedirect(_fileName) { + return void 0; + } + isNonTsProject() { + updateProjectIfDirty(this); + return allFilesAreJsOrDts(this); + } + isJsOnlyProject() { + updateProjectIfDirty(this); + return hasOneOrMoreJsAndNoTsFiles(this); + } + static resolveModule(moduleName, initialDir, host, log) { + return _Project.importServicePluginSync({ name: moduleName }, [initialDir], host, log).resolvedModule; + } + /** @internal */ + static importServicePluginSync(pluginConfigEntry, searchPaths, host, log) { + Debug.assertIsDefined(host.require); + let errorLogs; + let resolvedModule; + for (const initialDir of searchPaths) { + const resolvedPath = normalizeSlashes(host.resolvePath(combinePaths(initialDir, "node_modules"))); + log(`Loading ${pluginConfigEntry.name} from ${initialDir} (resolved to ${resolvedPath})`); + const result = host.require(resolvedPath, pluginConfigEntry.name); + if (!result.error) { + resolvedModule = result.module; + break; + } + const err = result.error.stack || result.error.message || JSON.stringify(result.error); + (errorLogs ?? (errorLogs = [])).push(`Failed to load module '${pluginConfigEntry.name}' from ${resolvedPath}: ${err}`); + } + return { pluginConfigEntry, resolvedModule, errorLogs }; + } + /** @internal */ + static async importServicePluginAsync(pluginConfigEntry, searchPaths, host, log) { + Debug.assertIsDefined(host.importPlugin); + let errorLogs; + let resolvedModule; + for (const initialDir of searchPaths) { + const resolvedPath = combinePaths(initialDir, "node_modules"); + log(`Dynamically importing ${pluginConfigEntry.name} from ${initialDir} (resolved to ${resolvedPath})`); + let result; + try { + result = await host.importPlugin(resolvedPath, pluginConfigEntry.name); + } catch (e) { + result = { module: void 0, error: e }; + } + if (!result.error) { + resolvedModule = result.module; + break; + } + const err = result.error.stack || result.error.message || JSON.stringify(result.error); + (errorLogs ?? (errorLogs = [])).push(`Failed to dynamically import module '${pluginConfigEntry.name}' from ${resolvedPath}: ${err}`); + } + return { pluginConfigEntry, resolvedModule, errorLogs }; + } + isKnownTypesPackageName(name) { + return this.typingsCache.isKnownTypesPackageName(name); + } + installPackage(options) { + return this.typingsCache.installPackage({ ...options, projectName: this.projectName, projectRootPath: this.toPath(this.currentDirectory) }); + } + /** @internal */ + getGlobalTypingsCacheLocation() { + return this.getGlobalCache(); + } + get typingsCache() { + return this.projectService.typingsCache; + } + /** @internal */ + getSymlinkCache() { + if (!this.symlinks) { + this.symlinks = createSymlinkCache(this.getCurrentDirectory(), this.getCanonicalFileName); + } + if (this.program && !this.symlinks.hasProcessedResolutions()) { + this.symlinks.setSymlinksFromResolutions( + this.program.forEachResolvedModule, + this.program.forEachResolvedTypeReferenceDirective, + this.program.getAutomaticTypeDirectiveResolutions() + ); + } + return this.symlinks; + } + // Method of LanguageServiceHost + getCompilationSettings() { + return this.compilerOptions; + } + // Method to support public API + getCompilerOptions() { + return this.getCompilationSettings(); + } + getNewLine() { + return this.projectService.host.newLine; + } + getProjectVersion() { + return this.projectStateVersion.toString(); + } + getProjectReferences() { + return void 0; + } + getScriptFileNames() { + if (!this.rootFiles) { + return emptyArray; + } + let result; + this.rootFilesMap.forEach((value) => { + if (this.languageServiceEnabled || value.info && value.info.isScriptOpen()) { + (result || (result = [])).push(value.fileName); + } + }); + return addRange(result, this.typingFiles) || emptyArray; + } + getOrCreateScriptInfoAndAttachToProject(fileName) { + const scriptInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClient(fileName, this.currentDirectory, this.directoryStructureHost); + if (scriptInfo) { + const existingValue = this.rootFilesMap.get(scriptInfo.path); + if (existingValue && existingValue.info !== scriptInfo) { + this.rootFiles.push(scriptInfo); + existingValue.info = scriptInfo; + } + scriptInfo.attachToProject(this); + } + return scriptInfo; + } + getScriptKind(fileName) { + const info = this.projectService.getScriptInfoForPath(this.toPath(fileName)); + return info && info.scriptKind; + } + getScriptVersion(filename) { + const info = this.projectService.getOrCreateScriptInfoNotOpenedByClient(filename, this.currentDirectory, this.directoryStructureHost); + return info && info.getLatestVersion(); + } + getScriptSnapshot(filename) { + const scriptInfo = this.getOrCreateScriptInfoAndAttachToProject(filename); + if (scriptInfo) { + return scriptInfo.getSnapshot(); + } + } + getCancellationToken() { + return this.cancellationToken; + } + getCurrentDirectory() { + return this.currentDirectory; + } + getDefaultLibFileName() { + const nodeModuleBinDir = getDirectoryPath(normalizePath(this.projectService.getExecutingFilePath())); + return combinePaths(nodeModuleBinDir, getDefaultLibFileName(this.compilerOptions)); + } + useCaseSensitiveFileNames() { + return this.projectService.host.useCaseSensitiveFileNames; + } + readDirectory(path, extensions, exclude, include, depth) { + return this.directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); + } + readFile(fileName) { + return this.projectService.host.readFile(fileName); + } + writeFile(fileName, content) { + return this.projectService.host.writeFile(fileName, content); + } + fileExists(file) { + const path = this.toPath(file); + return !this.isWatchedMissingFile(path) && this.directoryStructureHost.fileExists(file); + } + /** @internal */ + resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) { + return this.resolutionCache.resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames); + } + /** @internal */ + getModuleResolutionCache() { + return this.resolutionCache.getModuleResolutionCache(); + } + /** @internal */ + resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) { + return this.resolutionCache.resolveTypeReferenceDirectiveReferences( + typeDirectiveReferences, + containingFile, + redirectedReference, + options, + containingSourceFile, + reusedNames + ); + } + /** @internal */ + resolveLibrary(libraryName, resolveFrom, options, libFileName) { + return this.resolutionCache.resolveLibrary(libraryName, resolveFrom, options, libFileName); + } + directoryExists(path) { + return this.directoryStructureHost.directoryExists(path); + } + getDirectories(path) { + return this.directoryStructureHost.getDirectories(path); + } + /** @internal */ + getCachedDirectoryStructureHost() { + return void 0; + } + /** @internal */ + toPath(fileName) { + return toPath(fileName, this.currentDirectory, this.projectService.toCanonicalFileName); + } + /** @internal */ + watchDirectoryOfFailedLookupLocation(directory, cb, flags) { + return this.projectService.watchFactory.watchDirectory( + directory, + cb, + flags, + this.projectService.getWatchOptions(this), + WatchType.FailedLookupLocations, + this + ); + } + /** @internal */ + watchAffectingFileLocation(file, cb) { + return this.projectService.watchFactory.watchFile( + file, + cb, + 2e3 /* High */, + this.projectService.getWatchOptions(this), + WatchType.AffectingFileLocation, + this + ); + } + /** @internal */ + clearInvalidateResolutionOfFailedLookupTimer() { + return this.projectService.throttledOperations.cancel(`${this.getProjectName()}FailedLookupInvalidation`); + } + /** @internal */ + scheduleInvalidateResolutionsOfFailedLookupLocations() { + this.projectService.throttledOperations.schedule( + `${this.getProjectName()}FailedLookupInvalidation`, + /*delay*/ + 1e3, + () => { + if (this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()) { + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + } + ); + } + /** @internal */ + invalidateResolutionsOfFailedLookupLocations() { + if (this.clearInvalidateResolutionOfFailedLookupTimer() && this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()) { + this.markAsDirty(); + this.projectService.delayEnsureProjectForOpenFiles(); + } + } + /** @internal */ + onInvalidatedResolution() { + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + /** @internal */ + watchTypeRootsDirectory(directory, cb, flags) { + return this.projectService.watchFactory.watchDirectory( + directory, + cb, + flags, + this.projectService.getWatchOptions(this), + WatchType.TypeRoots, + this + ); + } + /** @internal */ + hasChangedAutomaticTypeDirectiveNames() { + return this.resolutionCache.hasChangedAutomaticTypeDirectiveNames(); + } + /** @internal */ + onChangedAutomaticTypeDirectiveNames() { + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + /** @internal */ + getGlobalCache() { + return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : void 0; + } + /** @internal */ + fileIsOpen(filePath) { + return this.projectService.openFiles.has(filePath); + } + /** @internal */ + writeLog(s) { + this.projectService.logger.info(s); + } + log(s) { + this.writeLog(s); + } + error(s) { + this.projectService.logger.msg(s, "Err" /* Err */); + } + setInternalCompilerOptionsForEmittingJsFiles() { + if (this.projectKind === 0 /* Inferred */ || this.projectKind === 2 /* External */) { + this.compilerOptions.noEmitForJsFiles = true; + } + } + /** + * Get the errors that dont have any file name associated + */ + getGlobalProjectErrors() { + return filter(this.projectErrors, (diagnostic) => !diagnostic.file) || emptyArray2; + } + /** + * Get all the project errors + */ + getAllProjectErrors() { + return this.projectErrors || emptyArray2; + } + setProjectErrors(projectErrors) { + this.projectErrors = projectErrors; + } + getLanguageService(ensureSynchronized = true) { + if (ensureSynchronized) { + updateProjectIfDirty(this); + } + return this.languageService; + } + /** @internal */ + getSourceMapper() { + return this.getLanguageService().getSourceMapper(); + } + /** @internal */ + clearSourceMapperCache() { + this.languageService.clearSourceMapperCache(); + } + /** @internal */ + getDocumentPositionMapper(generatedFileName, sourceFileName) { + return this.projectService.getDocumentPositionMapper(this, generatedFileName, sourceFileName); + } + /** @internal */ + getSourceFileLike(fileName) { + return this.projectService.getSourceFileLike(fileName, this); + } + /** @internal */ + shouldEmitFile(scriptInfo) { + return scriptInfo && !scriptInfo.isDynamicOrHasMixedContent() && !this.program.isSourceOfProjectReferenceRedirect(scriptInfo.path); + } + getCompileOnSaveAffectedFileList(scriptInfo) { + if (!this.languageServiceEnabled) { + return []; + } + updateProjectIfDirty(this); + this.builderState = BuilderState.create( + this.program, + this.builderState, + /*disableUseFileVersionAsSignature*/ + true + ); + return mapDefined( + BuilderState.getFilesAffectedBy( + this.builderState, + this.program, + scriptInfo.path, + this.cancellationToken, + this.projectService.host + ), + (sourceFile) => this.shouldEmitFile(this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : void 0 + ); + } + /** + * Returns true if emit was conducted + */ + emitFile(scriptInfo, writeFile2) { + if (!this.languageServiceEnabled || !this.shouldEmitFile(scriptInfo)) { + return { emitSkipped: true, diagnostics: emptyArray2 }; + } + const { emitSkipped, diagnostics, outputFiles } = this.getLanguageService().getEmitOutput(scriptInfo.fileName); + if (!emitSkipped) { + for (const outputFile of outputFiles) { + const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, this.currentDirectory); + writeFile2(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark); + } + if (this.builderState && getEmitDeclarations(this.compilerOptions)) { + const dtsFiles = outputFiles.filter((f) => isDeclarationFileName(f.name)); + if (dtsFiles.length === 1) { + const sourceFile = this.program.getSourceFile(scriptInfo.fileName); + const signature = this.projectService.host.createHash ? this.projectService.host.createHash(dtsFiles[0].text) : generateDjb2Hash(dtsFiles[0].text); + BuilderState.updateSignatureOfFile(this.builderState, signature, sourceFile.resolvedPath); + } + } + } + return { emitSkipped, diagnostics }; + } + enableLanguageService() { + if (this.languageServiceEnabled || this.projectService.serverMode === 2 /* Syntactic */) { + return; + } + this.languageServiceEnabled = true; + this.lastFileExceededProgramSize = void 0; + this.projectService.onUpdateLanguageServiceStateForProject( + this, + /*languageServiceEnabled*/ + true + ); + } + /** @internal */ + cleanupProgram() { + if (this.program) { + for (const f of this.program.getSourceFiles()) { + this.detachScriptInfoIfNotRoot(f.fileName); + } + this.program.forEachResolvedProjectReference((ref) => this.detachScriptInfoFromProject(ref.sourceFile.fileName)); + this.program = void 0; + } + } + disableLanguageService(lastFileExceededProgramSize) { + if (!this.languageServiceEnabled) { + return; + } + Debug.assert(this.projectService.serverMode !== 2 /* Syntactic */); + this.languageService.cleanupSemanticCache(); + this.languageServiceEnabled = false; + this.cleanupProgram(); + this.lastFileExceededProgramSize = lastFileExceededProgramSize; + this.builderState = void 0; + if (this.autoImportProviderHost) { + this.autoImportProviderHost.close(); + } + this.autoImportProviderHost = void 0; + this.resolutionCache.closeTypeRootsWatch(); + this.clearGeneratedFileWatch(); + this.projectService.verifyDocumentRegistry(); + this.projectService.onUpdateLanguageServiceStateForProject( + this, + /*languageServiceEnabled*/ + false + ); + } + getProjectName() { + return this.projectName; + } + removeLocalTypingsFromTypeAcquisition(newTypeAcquisition) { + if (!newTypeAcquisition || !newTypeAcquisition.include) { + return newTypeAcquisition; + } + return { ...newTypeAcquisition, include: this.removeExistingTypings(newTypeAcquisition.include) }; + } + getExternalFiles(updateLevel) { + return sort(flatMap(this.plugins, (plugin) => { + if (typeof plugin.module.getExternalFiles !== "function") + return; + try { + return plugin.module.getExternalFiles(this, updateLevel || 0 /* Update */); + } catch (e) { + this.projectService.logger.info(`A plugin threw an exception in getExternalFiles: ${e}`); + if (e.stack) { + this.projectService.logger.info(e.stack); + } + } + })); + } + getSourceFile(path) { + if (!this.program) { + return void 0; + } + return this.program.getSourceFileByPath(path); + } + /** @internal */ + getSourceFileOrConfigFile(path) { + const options = this.program.getCompilerOptions(); + return path === options.configFilePath ? options.configFile : this.getSourceFile(path); + } + close() { + var _a; + this.projectService.typingsCache.onProjectClosed(this); + this.closeWatchingTypingLocations(); + this.cleanupProgram(); + forEach(this.externalFiles, (externalFile) => this.detachScriptInfoIfNotRoot(externalFile)); + for (const root of this.rootFiles) { + root.detachFromProject(this); + } + this.projectService.pendingEnsureProjectForOpenFiles = true; + this.rootFiles = void 0; + this.rootFilesMap = void 0; + this.externalFiles = void 0; + this.program = void 0; + this.builderState = void 0; + 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; + this.projectErrors = void 0; + this.plugins.length = 0; + if (this.missingFilesMap) { + clearMap(this.missingFilesMap, closeFileWatcher); + this.missingFilesMap = void 0; + } + this.clearGeneratedFileWatch(); + this.clearInvalidateResolutionOfFailedLookupTimer(); + if (this.autoImportProviderHost) { + this.autoImportProviderHost.close(); + } + this.autoImportProviderHost = void 0; + if (this.noDtsResolutionProject) { + this.noDtsResolutionProject.close(); + } + this.noDtsResolutionProject = void 0; + this.languageService.dispose(); + this.languageService = void 0; + } + detachScriptInfoIfNotRoot(uncheckedFilename) { + const info = this.projectService.getScriptInfo(uncheckedFilename); + if (info && !this.isRoot(info)) { + info.detachFromProject(this); + } + } + isClosed() { + return this.rootFiles === void 0; + } + hasRoots() { + return this.rootFiles && this.rootFiles.length > 0; + } + /** @internal */ + isOrphan() { + return false; + } + getRootFiles() { + return this.rootFiles && this.rootFiles.map((info) => info.fileName); + } + /** @internal */ + getRootFilesMap() { + return this.rootFilesMap; + } + getRootScriptInfos() { + return this.rootFiles; + } + getScriptInfos() { + if (!this.languageServiceEnabled) { + return this.rootFiles; + } + return map(this.program.getSourceFiles(), (sourceFile) => { + const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.resolvedPath); + Debug.assert(!!scriptInfo, "getScriptInfo", () => `scriptInfo for a file '${sourceFile.fileName}' Path: '${sourceFile.path}' / '${sourceFile.resolvedPath}' is missing.`); + return scriptInfo; + }); + } + getExcludedFiles() { + return emptyArray2; + } + getFileNames(excludeFilesFromExternalLibraries, excludeConfigFiles) { + if (!this.program) { + return []; + } + if (!this.languageServiceEnabled) { + let rootFiles = this.getRootFiles(); + if (this.compilerOptions) { + const defaultLibrary = getDefaultLibFilePath(this.compilerOptions); + if (defaultLibrary) { + (rootFiles || (rootFiles = [])).push(asNormalizedPath(defaultLibrary)); + } + } + return rootFiles; + } + const result = []; + for (const f of this.program.getSourceFiles()) { + if (excludeFilesFromExternalLibraries && this.program.isSourceFileFromExternalLibrary(f)) { + continue; + } + result.push(asNormalizedPath(f.fileName)); + } + if (!excludeConfigFiles) { + const configFile = this.program.getCompilerOptions().configFile; + if (configFile) { + result.push(asNormalizedPath(configFile.fileName)); + if (configFile.extendedSourceFiles) { + for (const f of configFile.extendedSourceFiles) { + result.push(asNormalizedPath(f)); + } + } + } + } + return result; + } + /** @internal */ + getFileNamesWithRedirectInfo(includeProjectReferenceRedirectInfo) { + return this.getFileNames().map((fileName) => ({ + fileName, + isSourceOfProjectReferenceRedirect: includeProjectReferenceRedirectInfo && this.isSourceOfProjectReferenceRedirect(fileName) + })); + } + hasConfigFile(configFilePath) { + if (this.program && this.languageServiceEnabled) { + const configFile = this.program.getCompilerOptions().configFile; + if (configFile) { + if (configFilePath === asNormalizedPath(configFile.fileName)) { + return true; + } + if (configFile.extendedSourceFiles) { + for (const f of configFile.extendedSourceFiles) { + if (configFilePath === asNormalizedPath(f)) { + return true; + } + } + } + } + } + return false; + } + containsScriptInfo(info) { + if (this.isRoot(info)) + return true; + if (!this.program) + return false; + const file = this.program.getSourceFileByPath(info.path); + return !!file && file.resolvedPath === info.path; + } + containsFile(filename, requireOpen) { + const info = this.projectService.getScriptInfoForNormalizedPath(filename); + if (info && (info.isScriptOpen() || !requireOpen)) { + return this.containsScriptInfo(info); + } + return false; + } + isRoot(info) { + var _a; + return this.rootFilesMap && ((_a = this.rootFilesMap.get(info.path)) == null ? void 0 : _a.info) === info; + } + // add a root file to project + addRoot(info, fileName) { + Debug.assert(!this.isRoot(info)); + this.rootFiles.push(info); + this.rootFilesMap.set(info.path, { fileName: fileName || info.fileName, info }); + info.attachToProject(this); + this.markAsDirty(); + } + // add a root file that doesnt exist on host + addMissingFileRoot(fileName) { + const path = this.projectService.toPath(fileName); + this.rootFilesMap.set(path, { fileName }); + this.markAsDirty(); + } + removeFile(info, fileExists, detachFromProject) { + if (this.isRoot(info)) { + this.removeRoot(info); + } + if (fileExists) { + this.resolutionCache.removeResolutionsOfFile(info.path); + } else { + this.resolutionCache.invalidateResolutionOfFile(info.path); + } + this.cachedUnresolvedImportsPerFile.delete(info.path); + if (detachFromProject) { + info.detachFromProject(this); + } + this.markAsDirty(); + } + registerFileUpdate(fileName) { + (this.updatedFileNames || (this.updatedFileNames = /* @__PURE__ */ new Set())).add(fileName); + } + /** @internal */ + markFileAsDirty(changedFile) { + this.markAsDirty(); + if (this.exportMapCache && !this.exportMapCache.isEmpty()) { + (this.changedFilesForExportMapCache || (this.changedFilesForExportMapCache = /* @__PURE__ */ new Set())).add(changedFile); + } + } + markAsDirty() { + if (!this.dirty) { + this.projectStateVersion++; + this.dirty = true; + } + } + /** @internal */ + onAutoImportProviderSettingsChanged() { + var _a; + if (this.autoImportProviderHost === false) { + this.autoImportProviderHost = void 0; + } else { + (_a = this.autoImportProviderHost) == null ? void 0 : _a.markAsDirty(); + } + } + /** @internal */ + onPackageJsonChange() { + this.moduleSpecifierCache.clear(); + if (this.autoImportProviderHost) { + this.autoImportProviderHost.markAsDirty(); + } + } + /** @internal */ + onFileAddedOrRemoved(isSymlink) { + this.hasAddedorRemovedFiles = true; + if (isSymlink) { + this.hasAddedOrRemovedSymlinks = true; + } + } + /** @internal */ + 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. + */ + updateGraph() { + var _a, _b, _c, _d, _e; + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "updateGraph", { name: this.projectName, kind: ProjectKind[this.projectKind] }); + (_b = perfLogger) == null ? void 0 : _b.logStartUpdateGraph(); + this.resolutionCache.startRecordingFilesWithChangedResolutions(); + const hasNewProgram = this.updateGraphWorker(); + const hasAddedorRemovedFiles = this.hasAddedorRemovedFiles; + this.hasAddedorRemovedFiles = false; + this.hasAddedOrRemovedSymlinks = false; + const changedFiles = this.resolutionCache.finishRecordingFilesWithChangedResolutions() || emptyArray2; + for (const file of changedFiles) { + this.cachedUnresolvedImportsPerFile.delete(file); + } + if (this.languageServiceEnabled && this.projectService.serverMode === 0 /* Semantic */ && !this.isOrphan()) { + if (hasNewProgram || changedFiles.length) { + this.lastCachedUnresolvedImportsList = getUnresolvedImports(this.program, this.cachedUnresolvedImportsPerFile); + } + this.projectService.typingsCache.enqueueInstallTypingsForProject(this, this.lastCachedUnresolvedImportsList, hasAddedorRemovedFiles); + } else { + this.lastCachedUnresolvedImportsList = void 0; + } + const isFirstProgramLoad = this.projectProgramVersion === 0 && hasNewProgram; + if (hasNewProgram) { + this.projectProgramVersion++; + } + if (hasAddedorRemovedFiles) { + if (!this.autoImportProviderHost) + this.autoImportProviderHost = void 0; + (_c = this.autoImportProviderHost) == null ? void 0 : _c.markAsDirty(); + } + if (isFirstProgramLoad) { + this.getPackageJsonAutoImportProvider(); + } + (_d = perfLogger) == null ? void 0 : _d.logStopUpdateGraph(); + (_e = tracing) == null ? void 0 : _e.pop(); + return !hasNewProgram; + } + /** @internal */ + updateTypingFiles(typingFiles) { + if (enumerateInsertsAndDeletes( + typingFiles, + this.typingFiles, + getStringComparer(!this.useCaseSensitiveFileNames()), + /*inserted*/ + noop, + (removed) => this.detachScriptInfoFromProject(removed) + )) { + this.typingFiles = typingFiles; + this.resolutionCache.setFilesWithInvalidatedNonRelativeUnresolvedImports(this.cachedUnresolvedImportsPerFile); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + } + /** @internal */ + closeWatchingTypingLocations() { + if (this.typingWatchers) + clearMap(this.typingWatchers, closeFileWatcher); + this.typingWatchers = void 0; + } + /** @internal */ + onTypingInstallerWatchInvoke() { + this.typingWatchers.isInvoked = true; + this.projectService.updateTypingsForProject({ projectName: this.getProjectName(), kind: ActionInvalidate }); + } + /** @internal */ + watchTypingLocations(files) { + if (!files) { + this.typingWatchers.isInvoked = false; + return; + } + if (!files.length) { + this.closeWatchingTypingLocations(); + return; + } + const toRemove = new Map(this.typingWatchers); + if (!this.typingWatchers) + this.typingWatchers = /* @__PURE__ */ new Map(); + this.typingWatchers.isInvoked = false; + const createProjectWatcher = (path, typingsWatcherType) => { + const canonicalPath = this.toPath(path); + toRemove.delete(canonicalPath); + if (!this.typingWatchers.has(canonicalPath)) { + this.typingWatchers.set( + canonicalPath, + typingsWatcherType === "FileWatcher" /* FileWatcher */ ? this.projectService.watchFactory.watchFile( + path, + () => !this.typingWatchers.isInvoked ? this.onTypingInstallerWatchInvoke() : this.writeLog(`TypingWatchers already invoked`), + 2e3 /* High */, + this.projectService.getWatchOptions(this), + WatchType.TypingInstallerLocationFile, + this + ) : this.projectService.watchFactory.watchDirectory( + path, + (f) => { + if (this.typingWatchers.isInvoked) + return this.writeLog(`TypingWatchers already invoked`); + if (!fileExtensionIs(f, ".json" /* Json */)) + return this.writeLog(`Ignoring files that are not *.json`); + if (comparePaths(f, combinePaths(this.projectService.typingsInstaller.globalTypingsCacheLocation, "package.json"), !this.useCaseSensitiveFileNames())) + return this.writeLog(`Ignoring package.json change at global typings location`); + this.onTypingInstallerWatchInvoke(); + }, + 1 /* Recursive */, + this.projectService.getWatchOptions(this), + WatchType.TypingInstallerLocationDirectory, + this + ) + ); + } + }; + for (const file of files) { + const basename = getBaseFileName(file); + if (basename === "package.json" || basename === "bower.json") { + createProjectWatcher(file, "FileWatcher" /* FileWatcher */); + continue; + } + if (containsPath(this.currentDirectory, file, this.currentDirectory, !this.useCaseSensitiveFileNames())) { + const subDirectory = file.indexOf(directorySeparator, this.currentDirectory.length + 1); + if (subDirectory !== -1) { + createProjectWatcher(file.substr(0, subDirectory), "DirectoryWatcher" /* DirectoryWatcher */); + } else { + createProjectWatcher(file, "DirectoryWatcher" /* DirectoryWatcher */); + } + continue; + } + if (containsPath(this.projectService.typingsInstaller.globalTypingsCacheLocation, file, this.currentDirectory, !this.useCaseSensitiveFileNames())) { + createProjectWatcher(this.projectService.typingsInstaller.globalTypingsCacheLocation, "DirectoryWatcher" /* DirectoryWatcher */); + continue; + } + createProjectWatcher(file, "DirectoryWatcher" /* DirectoryWatcher */); + } + toRemove.forEach((watch, path) => { + watch.close(); + this.typingWatchers.delete(path); + }); + } + /** @internal */ + getCurrentProgram() { + return this.program; + } + removeExistingTypings(include) { + const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost); + return include.filter((i) => !existing.includes(i)); + } + updateGraphWorker() { + var _a, _b; + const oldProgram = this.languageService.getCurrentProgram(); + Debug.assert(oldProgram === this.program); + Debug.assert(!this.isClosed(), "Called update graph worker of closed project"); + this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`); + const start = timestamp(); + const { hasInvalidatedResolutions, hasInvalidatedLibResolutions } = this.resolutionCache.createHasInvalidatedResolutions(returnFalse, returnFalse); + this.hasInvalidatedResolutions = hasInvalidatedResolutions; + this.hasInvalidatedLibResolutions = hasInvalidatedLibResolutions; + this.resolutionCache.startCachingPerDirectoryResolution(); + 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(); + Debug.assert(oldProgram === void 0 || this.program !== void 0); + let hasNewProgram = false; + if (this.program && (!oldProgram || this.program !== oldProgram && this.program.structureIsReused !== 2 /* Completely */)) { + hasNewProgram = true; + if (oldProgram) { + for (const f of oldProgram.getSourceFiles()) { + const newFile = this.program.getSourceFileByPath(f.resolvedPath); + if (!newFile || f.resolvedPath === f.path && newFile.resolvedPath !== f.path) { + this.detachScriptInfoFromProject( + f.fileName, + !!this.program.getSourceFileByPath(f.path), + /*syncDirWatcherRemove*/ + true + ); + } + } + oldProgram.forEachResolvedProjectReference((resolvedProjectReference) => { + if (!this.program.getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + this.detachScriptInfoFromProject( + resolvedProjectReference.sourceFile.fileName, + /*noRemoveResolution*/ + void 0, + /*syncDirWatcherRemove*/ + true + ); + } + }); + } + updateMissingFilePathsWatch( + this.program, + this.missingFilesMap || (this.missingFilesMap = /* @__PURE__ */ new Map()), + // Watch the missing files + (missingFilePath, missingFileName) => this.addMissingFileWatcher(missingFilePath, missingFileName) + ); + if (this.generatedFilesMap) { + const outPath = outFile(this.compilerOptions); + if (isGeneratedFileWatcher(this.generatedFilesMap)) { + if (!outPath || !this.isValidGeneratedFileWatcher( + removeFileExtension(outPath) + ".d.ts" /* Dts */, + this.generatedFilesMap + )) { + this.clearGeneratedFileWatch(); + } + } else { + if (outPath) { + this.clearGeneratedFileWatch(); + } else { + this.generatedFilesMap.forEach((watcher, source) => { + const sourceFile = this.program.getSourceFileByPath(source); + if (!sourceFile || sourceFile.resolvedPath !== source || !this.isValidGeneratedFileWatcher( + getDeclarationEmitOutputFilePathWorker(sourceFile.fileName, this.compilerOptions, this.currentDirectory, this.program.getCommonSourceDirectory(), this.getCanonicalFileName), + watcher + )) { + closeFileWatcherOf(watcher); + this.generatedFilesMap.delete(source); + } + }); + } + } + } + if (this.languageServiceEnabled && this.projectService.serverMode === 0 /* Semantic */) { + this.resolutionCache.updateTypeRootsWatch(); + } + } + this.projectService.verifyProgram(this); + if (this.exportMapCache && !this.exportMapCache.isEmpty()) { + this.exportMapCache.releaseSymbols(); + if (this.hasAddedorRemovedFiles || oldProgram && !this.program.structureIsReused) { + this.exportMapCache.clear(); + } else if (this.changedFilesForExportMapCache && oldProgram && this.program) { + forEachKey(this.changedFilesForExportMapCache, (fileName) => { + const oldSourceFile = oldProgram.getSourceFileByPath(fileName); + const sourceFile = this.program.getSourceFileByPath(fileName); + if (!oldSourceFile || !sourceFile) { + this.exportMapCache.clear(); + return true; + } + return this.exportMapCache.onFileChanged(oldSourceFile, sourceFile, !!this.getTypeAcquisition().enable); + }); + } + } + if (this.changedFilesForExportMapCache) { + this.changedFilesForExportMapCache.clear(); + } + if (this.hasAddedOrRemovedSymlinks || this.program && !this.program.structureIsReused && this.getCompilerOptions().preserveSymlinks) { + this.symlinks = void 0; + this.moduleSpecifierCache.clear(); + } + const oldExternalFiles = this.externalFiles || emptyArray2; + this.externalFiles = this.getExternalFiles(); + enumerateInsertsAndDeletes( + this.externalFiles, + oldExternalFiles, + getStringComparer(!this.useCaseSensitiveFileNames()), + // Ensure a ScriptInfo is created for new external files. This is performed indirectly + // by the host for files in the program when the program is retrieved above but + // the program doesn't contain external files so this must be done explicitly. + (inserted) => { + const scriptInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClient(inserted, this.currentDirectory, this.directoryStructureHost); + scriptInfo == null ? void 0 : scriptInfo.attachToProject(this); + }, + (removed) => this.detachScriptInfoFromProject(removed) + ); + const elapsed = timestamp() - start; + this.sendPerformanceEvent("UpdateGraph", elapsed); + 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( + /*writeProjectFileNames*/ + true, + this.hasAddedorRemovedFiles, + /*writeFileVersionAndText*/ + true + ); + } else { + this.writeLog(`Same program as before`); + } + } else if (this.hasAddedorRemovedFiles) { + this.print( + /*writeProjectFileNames*/ + true, + /*writeFileExplaination*/ + true, + /*writeFileVersionAndText*/ + false + ); + } else if (this.program !== oldProgram) { + this.writeLog(`Different program with same set of files`); + } + this.projectService.verifyDocumentRegistry(); + return hasNewProgram; + } + /** @internal */ + sendPerformanceEvent(kind, durationMs) { + this.projectService.sendPerformanceEvent(kind, durationMs); + } + detachScriptInfoFromProject(uncheckedFileName, noRemoveResolution, syncDirWatcherRemove) { + const scriptInfoToDetach = this.projectService.getScriptInfo(uncheckedFileName); + if (scriptInfoToDetach) { + scriptInfoToDetach.detachFromProject(this); + if (!noRemoveResolution) { + this.resolutionCache.removeResolutionsOfFile(scriptInfoToDetach.path, syncDirWatcherRemove); + } + } + } + addMissingFileWatcher(missingFilePath, missingFileName) { + var _a; + if (isConfiguredProject(this)) { + const configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(missingFilePath); + if ((_a = configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config) == null ? void 0 : _a.projects.has(this.canonicalConfigFilePath)) + return noopFileWatcher; + } + const fileWatcher = this.projectService.watchFactory.watchFile( + getNormalizedAbsolutePath(missingFileName, this.currentDirectory), + (fileName, eventKind) => { + if (isConfiguredProject(this)) { + this.getCachedDirectoryStructureHost().addOrDeleteFile(fileName, missingFilePath, eventKind); + } + if (eventKind === 0 /* Created */ && this.missingFilesMap.has(missingFilePath)) { + this.missingFilesMap.delete(missingFilePath); + fileWatcher.close(); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + }, + 500 /* Medium */, + this.projectService.getWatchOptions(this), + WatchType.MissingFile, + this + ); + return fileWatcher; + } + isWatchedMissingFile(path) { + return !!this.missingFilesMap && this.missingFilesMap.has(path); + } + /** @internal */ + addGeneratedFileWatch(generatedFile, sourceFile) { + if (outFile(this.compilerOptions)) { + if (!this.generatedFilesMap) { + this.generatedFilesMap = this.createGeneratedFileWatcher(generatedFile); + } + } else { + const path = this.toPath(sourceFile); + if (this.generatedFilesMap) { + if (isGeneratedFileWatcher(this.generatedFilesMap)) { + Debug.fail(`${this.projectName} Expected to not have --out watcher for generated file with options: ${JSON.stringify(this.compilerOptions)}`); + return; + } + if (this.generatedFilesMap.has(path)) + return; + } else { + this.generatedFilesMap = /* @__PURE__ */ new Map(); + } + this.generatedFilesMap.set(path, this.createGeneratedFileWatcher(generatedFile)); + } + } + createGeneratedFileWatcher(generatedFile) { + return { + generatedFilePath: this.toPath(generatedFile), + watcher: this.projectService.watchFactory.watchFile( + generatedFile, + () => { + this.clearSourceMapperCache(); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + }, + 2e3 /* High */, + this.projectService.getWatchOptions(this), + WatchType.MissingGeneratedFile, + this + ) + }; + } + isValidGeneratedFileWatcher(generateFile, watcher) { + return this.toPath(generateFile) === watcher.generatedFilePath; + } + clearGeneratedFileWatch() { + if (this.generatedFilesMap) { + if (isGeneratedFileWatcher(this.generatedFilesMap)) { + closeFileWatcherOf(this.generatedFilesMap); + } else { + clearMap(this.generatedFilesMap, closeFileWatcherOf); + } + this.generatedFilesMap = void 0; + } + } + getScriptInfoForNormalizedPath(fileName) { + const scriptInfo = this.projectService.getScriptInfoForPath(this.toPath(fileName)); + if (scriptInfo && !scriptInfo.isAttached(this)) { + return Errors.ThrowProjectDoesNotContainDocument(fileName, this); + } + return scriptInfo; + } + getScriptInfo(uncheckedFileName) { + return this.projectService.getScriptInfo(uncheckedFileName); + } + filesToString(writeProjectFileNames) { + return this.filesToStringWorker( + writeProjectFileNames, + /*writeFileExplaination*/ + true, + /*writeFileVersionAndText*/ + false + ); + } + /** @internal */ + filesToStringWorker(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) { + if (this.isInitialLoadPending()) + return " Files (0) InitialLoadPending\n"; + if (!this.program) + return " Files (0) NoProgram\n"; + const sourceFiles = this.program.getSourceFiles(); + let strBuilder = ` Files (${sourceFiles.length}) +`; + if (writeProjectFileNames) { + for (const file of sourceFiles) { + strBuilder += ` ${file.fileName}${writeFileVersionAndText ? ` ${file.version} ${JSON.stringify(file.text)}` : ""} +`; + } + if (writeFileExplaination) { + strBuilder += "\n\n"; + explainFiles(this.program, (s) => strBuilder += ` ${s} +`); + } + } + return strBuilder; + } + /** @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 */), + writeFileExplaination && this.projectService.logger.hasLevel(3 /* verbose */), + writeFileVersionAndText && this.projectService.logger.hasLevel(3 /* verbose */) + )); + this.writeLog("-----------------------------------------------"); + if (this.autoImportProviderHost) { + this.autoImportProviderHost.print( + /*writeProjectFileNames*/ + false, + /*writeFileExplaination*/ + false, + /*writeFileVersionAndText*/ + false + ); + } + (_a = this.noDtsResolutionProject) == null ? void 0 : _a.print( + /*writeProjectFileNames*/ + false, + /*writeFileExplaination*/ + false, + /*writeFileVersionAndText*/ + false + ); + } + setCompilerOptions(compilerOptions) { + var _a; + if (compilerOptions) { + compilerOptions.allowNonTsExtensions = true; + const oldOptions = this.compilerOptions; + this.compilerOptions = compilerOptions; + this.setInternalCompilerOptionsForEmittingJsFiles(); + (_a = this.noDtsResolutionProject) == null ? void 0 : _a.setCompilerOptions(this.getCompilerOptionsForNoDtsResolutionProject()); + if (changesAffectModuleResolution(oldOptions, compilerOptions)) { + this.cachedUnresolvedImportsPerFile.clear(); + this.lastCachedUnresolvedImportsList = void 0; + this.resolutionCache.onChangesAffectModuleResolution(); + this.moduleSpecifierCache.clear(); + } + this.markAsDirty(); + } + } + /** @internal */ + setWatchOptions(watchOptions) { + this.watchOptions = watchOptions; + } + /** @internal */ + getWatchOptions() { + return this.watchOptions; + } + setTypeAcquisition(newTypeAcquisition) { + if (newTypeAcquisition) { + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); + } + } + getTypeAcquisition() { + return this.typeAcquisition || {}; + } + /** @internal */ + getChangesSinceVersion(lastKnownVersion, includeProjectReferenceRedirectInfo) { + var _a, _b; + const includeProjectReferenceRedirectInfoIfRequested = includeProjectReferenceRedirectInfo ? (files) => arrayFrom(files.entries(), ([fileName, isSourceOfProjectReferenceRedirect]) => ({ + fileName, + isSourceOfProjectReferenceRedirect + })) : (files) => arrayFrom(files.keys()); + if (!this.isInitialLoadPending()) { + updateProjectIfDirty(this); + } + const info = { + projectName: this.getProjectName(), + version: this.projectProgramVersion, + isInferred: isInferredProject(this), + options: this.getCompilationSettings(), + languageServiceDisabled: !this.languageServiceEnabled, + lastFileExceededProgramSize: this.lastFileExceededProgramSize + }; + const updatedFileNames = this.updatedFileNames; + this.updatedFileNames = void 0; + if (this.lastReportedFileNames && lastKnownVersion === this.lastReportedVersion) { + if (this.projectProgramVersion === this.lastReportedVersion && !updatedFileNames) { + return { info, projectErrors: this.getGlobalProjectErrors() }; + } + const lastReportedFileNames = this.lastReportedFileNames; + const externalFiles = ((_a = this.externalFiles) == null ? void 0 : _a.map((f) => ({ + fileName: toNormalizedPath(f), + isSourceOfProjectReferenceRedirect: false + }))) || emptyArray2; + const currentFiles = arrayToMap( + this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo).concat(externalFiles), + (info2) => info2.fileName, + (info2) => info2.isSourceOfProjectReferenceRedirect + ); + const added = /* @__PURE__ */ new Map(); + const removed = /* @__PURE__ */ new Map(); + const updated = updatedFileNames ? arrayFrom(updatedFileNames.keys()) : []; + const updatedRedirects = []; + forEachEntry(currentFiles, (isSourceOfProjectReferenceRedirect, fileName) => { + if (!lastReportedFileNames.has(fileName)) { + added.set(fileName, isSourceOfProjectReferenceRedirect); + } else if (includeProjectReferenceRedirectInfo && isSourceOfProjectReferenceRedirect !== lastReportedFileNames.get(fileName)) { + updatedRedirects.push({ + fileName, + isSourceOfProjectReferenceRedirect + }); + } + }); + forEachEntry(lastReportedFileNames, (isSourceOfProjectReferenceRedirect, fileName) => { + if (!currentFiles.has(fileName)) { + removed.set(fileName, isSourceOfProjectReferenceRedirect); + } + }); + this.lastReportedFileNames = currentFiles; + this.lastReportedVersion = this.projectProgramVersion; + return { + info, + changes: { + added: includeProjectReferenceRedirectInfoIfRequested(added), + removed: includeProjectReferenceRedirectInfoIfRequested(removed), + updated: includeProjectReferenceRedirectInfo ? updated.map((fileName) => ({ + fileName, + isSourceOfProjectReferenceRedirect: this.isSourceOfProjectReferenceRedirect(fileName) + })) : updated, + updatedRedirects: includeProjectReferenceRedirectInfo ? updatedRedirects : void 0 + }, + projectErrors: this.getGlobalProjectErrors() + }; + } else { + const projectFileNames = this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo); + const externalFiles = ((_b = this.externalFiles) == null ? void 0 : _b.map((f) => ({ + fileName: toNormalizedPath(f), + isSourceOfProjectReferenceRedirect: false + }))) || emptyArray2; + const allFiles = projectFileNames.concat(externalFiles); + this.lastReportedFileNames = arrayToMap( + allFiles, + (info2) => info2.fileName, + (info2) => info2.isSourceOfProjectReferenceRedirect + ); + this.lastReportedVersion = this.projectProgramVersion; + return { + info, + files: includeProjectReferenceRedirectInfo ? allFiles : allFiles.map((f) => f.fileName), + projectErrors: this.getGlobalProjectErrors() + }; + } + } + // remove a root file from project + removeRoot(info) { + orderedRemoveItem(this.rootFiles, info); + this.rootFilesMap.delete(info.path); + } + /** @internal */ + isSourceOfProjectReferenceRedirect(fileName) { + return !!this.program && this.program.isSourceOfProjectReferenceRedirect(fileName); + } + /** @internal */ + getGlobalPluginSearchPaths() { + return [ + ...this.projectService.pluginProbeLocations, + // ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/ + combinePaths(this.projectService.getExecutingFilePath(), "../../..") + ]; + } + enableGlobalPlugins(options) { + if (!this.projectService.globalPlugins.length) + return; + const host = this.projectService.host; + if (!host.require && !host.importPlugin) { + this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + const searchPaths = this.getGlobalPluginSearchPaths(); + for (const globalPluginName of this.projectService.globalPlugins) { + if (!globalPluginName) + continue; + if (options.plugins && options.plugins.some((p) => p.name === globalPluginName)) + continue; + this.projectService.logger.info(`Loading global plugin ${globalPluginName}`); + this.enablePlugin({ name: globalPluginName, global: true }, searchPaths); + } + } + enablePlugin(pluginConfigEntry, searchPaths) { + this.projectService.requestEnablePlugin(this, pluginConfigEntry, searchPaths); + } + /** @internal */ + enableProxy(pluginModuleFactory, configEntry) { + try { + if (typeof pluginModuleFactory !== "function") { + this.projectService.logger.info(`Skipped loading plugin ${configEntry.name} because it did not expose a proper factory function`); + return; + } + const info = { + config: configEntry, + project: this, + languageService: this.languageService, + languageServiceHost: this, + serverHost: this.projectService.host, + session: this.projectService.session + }; + const pluginModule = pluginModuleFactory({ typescript: ts_exports2 }); + const newLS = pluginModule.create(info); + for (const k of Object.keys(this.languageService)) { + if (!(k in newLS)) { + this.projectService.logger.info(`Plugin activation warning: Missing proxied method ${k} in created LS. Patching.`); + newLS[k] = this.languageService[k]; + } + } + this.projectService.logger.info(`Plugin validation succeeded`); + this.languageService = newLS; + this.plugins.push({ name: configEntry.name, module: pluginModule }); + } catch (e) { + this.projectService.logger.info(`Plugin activation failed: ${e}`); + } + } + /** @internal */ + onPluginConfigurationChanged(pluginName, configuration) { + this.plugins.filter((plugin) => plugin.name === pluginName).forEach((plugin) => { + if (plugin.module.onConfigurationChanged) { + plugin.module.onConfigurationChanged(configuration); + } + }); + } + /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */ + refreshDiagnostics() { + this.projectService.sendProjectsUpdatedInBackgroundEvent(); + } + /** @internal */ + getPackageJsonsVisibleToFile(fileName, rootDir) { + if (this.projectService.serverMode !== 0 /* Semantic */) + return emptyArray2; + return this.projectService.getPackageJsonsVisibleToFile(fileName, this, rootDir); + } + /** @internal */ + getNearestAncestorDirectoryWithPackageJson(fileName) { + return this.projectService.getNearestAncestorDirectoryWithPackageJson(fileName); + } + /** @internal */ + getPackageJsonsForAutoImport(rootDir) { + return this.getPackageJsonsVisibleToFile(combinePaths(this.currentDirectory, inferredTypesContainingFile), rootDir); + } + /** @internal */ + getPackageJsonCache() { + return this.projectService.packageJsonCache; + } + /** @internal */ + getCachedExportInfoMap() { + return this.exportMapCache || (this.exportMapCache = createCacheableExportInfoMap(this)); + } + /** @internal */ + clearCachedExportInfoMap() { + var _a; + (_a = this.exportMapCache) == null ? void 0 : _a.clear(); + } + /** @internal */ + getModuleSpecifierCache() { + return this.moduleSpecifierCache; + } + /** @internal */ + includePackageJsonAutoImports() { + if (this.projectService.includePackageJsonAutoImports() === 0 /* Off */ || !this.languageServiceEnabled || isInsideNodeModules(this.currentDirectory) || !this.isDefaultProjectForOpenFiles()) { + return 0 /* Off */; + } + return this.projectService.includePackageJsonAutoImports(); + } + /** @internal */ + getHostForAutoImportProvider() { + var _a, _b; + if (this.program) { + return { + fileExists: this.program.fileExists, + directoryExists: this.program.directoryExists, + realpath: this.program.realpath || ((_a = this.projectService.host.realpath) == null ? void 0 : _a.bind(this.projectService.host)), + getCurrentDirectory: this.getCurrentDirectory.bind(this), + readFile: this.projectService.host.readFile.bind(this.projectService.host), + getDirectories: this.projectService.host.getDirectories.bind(this.projectService.host), + trace: (_b = this.projectService.host.trace) == null ? void 0 : _b.bind(this.projectService.host), + useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames(), + readDirectory: this.projectService.host.readDirectory.bind(this.projectService.host) + }; + } + return this.projectService.host; + } + /** @internal */ + getPackageJsonAutoImportProvider() { + var _a, _b, _c; + if (this.autoImportProviderHost === false) { + return void 0; + } + if (this.projectService.serverMode !== 0 /* Semantic */) { + this.autoImportProviderHost = false; + return void 0; + } + if (this.autoImportProviderHost) { + updateProjectIfDirty(this.autoImportProviderHost); + if (this.autoImportProviderHost.isEmpty()) { + this.autoImportProviderHost.close(); + this.autoImportProviderHost = void 0; + return void 0; + } + return this.autoImportProviderHost.getCurrentProgram(); + } + const dependencySelection = this.includePackageJsonAutoImports(); + if (dependencySelection) { + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "getPackageJsonAutoImportProvider"); + const start = timestamp(); + this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getHostForAutoImportProvider(), this.documentRegistry); + if (this.autoImportProviderHost) { + updateProjectIfDirty(this.autoImportProviderHost); + this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() - start); + (_b = tracing) == null ? void 0 : _b.pop(); + return this.autoImportProviderHost.getCurrentProgram(); + } + (_c = tracing) == null ? void 0 : _c.pop(); + } + } + /** @internal */ + isDefaultProjectForOpenFiles() { + return !!forEachEntry( + this.projectService.openFiles, + (_, fileName) => this.projectService.tryGetDefaultProjectForFile(toNormalizedPath(fileName)) === this + ); + } + /** @internal */ + watchNodeModulesForPackageJsonChanges(directoryPath) { + return this.projectService.watchPackageJsonsInNodeModules(directoryPath, this); + } + /** @internal */ + getIncompleteCompletionsCache() { + return this.projectService.getIncompleteCompletionsCache(); + } + /** @internal */ + getNoDtsResolutionProject(rootFile) { + Debug.assert(this.projectService.serverMode === 0 /* Semantic */); + if (!this.noDtsResolutionProject) { + this.noDtsResolutionProject = new AuxiliaryProject(this.projectService, this.documentRegistry, this.getCompilerOptionsForNoDtsResolutionProject(), this.currentDirectory); + } + if (this.noDtsResolutionProject.rootFile !== rootFile) { + this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this.noDtsResolutionProject, [rootFile]); + this.noDtsResolutionProject.rootFile = rootFile; + } + return this.noDtsResolutionProject; + } + /** @internal */ + getCompilerOptionsForNoDtsResolutionProject() { + return { + ...this.getCompilerOptions(), + noDtsResolution: true, + allowJs: true, + maxNodeModuleJsDepth: 3, + diagnostics: false, + skipLibCheck: true, + sourceMap: false, + types: emptyArray, + lib: emptyArray, + noLib: true + }; + } + }; + InferredProject2 = class extends Project3 { + /** @internal */ + constructor(projectService, documentRegistry, compilerOptions, watchOptions, projectRootPath, currentDirectory, typeAcquisition) { + super( + projectService.newInferredProjectName(), + 0 /* Inferred */, + projectService, + documentRegistry, + // TODO: GH#18217 + /*files*/ + void 0, + /*lastFileExceededProgramSize*/ + void 0, + compilerOptions, + /*compileOnSaveEnabled*/ + false, + watchOptions, + projectService.host, + currentDirectory + ); + this._isJsInferredProject = false; + this.typeAcquisition = typeAcquisition; + this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath); + if (!projectRootPath && !projectService.useSingleInferredProject) { + this.canonicalCurrentDirectory = projectService.toCanonicalFileName(this.currentDirectory); + } + this.enableGlobalPlugins(this.getCompilerOptions()); + } + toggleJsInferredProject(isJsInferredProject) { + if (isJsInferredProject !== this._isJsInferredProject) { + this._isJsInferredProject = isJsInferredProject; + this.setCompilerOptions(); + } + } + setCompilerOptions(options) { + if (!options && !this.getCompilationSettings()) { + return; + } + const newOptions = cloneCompilerOptions(options || this.getCompilationSettings()); + if (this._isJsInferredProject && typeof newOptions.maxNodeModuleJsDepth !== "number") { + newOptions.maxNodeModuleJsDepth = 2; + } else if (!this._isJsInferredProject) { + newOptions.maxNodeModuleJsDepth = void 0; + } + newOptions.allowJs = true; + super.setCompilerOptions(newOptions); + } + addRoot(info) { + Debug.assert(info.isScriptOpen()); + this.projectService.startWatchingConfigFilesForInferredProjectRoot(info); + if (!this._isJsInferredProject && info.isJavaScript()) { + this.toggleJsInferredProject( + /*isJsInferredProject*/ + true + ); + } else if (this.isOrphan() && this._isJsInferredProject && !info.isJavaScript()) { + this.toggleJsInferredProject( + /*isJsInferredProject*/ + false + ); + } + super.addRoot(info); + } + removeRoot(info) { + this.projectService.stopWatchingConfigFilesForInferredProjectRoot(info); + super.removeRoot(info); + if (!this.isOrphan() && this._isJsInferredProject && info.isJavaScript()) { + if (every(this.getRootScriptInfos(), (rootInfo) => !rootInfo.isJavaScript())) { + this.toggleJsInferredProject( + /*isJsInferredProject*/ + false + ); + } + } + } + /** @internal */ + isOrphan() { + return !this.hasRoots(); + } + isProjectWithSingleRoot() { + return !this.projectRootPath && !this.projectService.useSingleInferredProject || this.getRootScriptInfos().length === 1; + } + close() { + forEach(this.getRootScriptInfos(), (info) => this.projectService.stopWatchingConfigFilesForInferredProjectRoot(info)); + super.close(); + } + getTypeAcquisition() { + return this.typeAcquisition || { + enable: allRootFilesAreJsOrDts(this), + include: emptyArray, + exclude: emptyArray + }; + } + }; + AuxiliaryProject = class extends Project3 { + constructor(projectService, documentRegistry, compilerOptions, currentDirectory) { + super( + projectService.newAuxiliaryProjectName(), + 4 /* Auxiliary */, + projectService, + documentRegistry, + /*hasExplicitListOfFiles*/ + false, + /*lastFileExceededProgramSize*/ + void 0, + compilerOptions, + /*compileOnSaveEnabled*/ + false, + /*watchOptions*/ + void 0, + projectService.host, + currentDirectory + ); + } + isOrphan() { + return true; + } + scheduleInvalidateResolutionsOfFailedLookupLocations() { + return; + } + }; + _AutoImportProviderProject = class _AutoImportProviderProject extends Project3 { + /** @internal */ + constructor(hostProject, initialRootNames, documentRegistry, compilerOptions) { + super( + hostProject.projectService.newAutoImportProviderProjectName(), + 3 /* AutoImportProvider */, + hostProject.projectService, + documentRegistry, + /*hasExplicitListOfFiles*/ + false, + /*lastFileExceededProgramSize*/ + void 0, + compilerOptions, + /*compileOnSaveEnabled*/ + false, + hostProject.getWatchOptions(), + hostProject.projectService.host, + hostProject.currentDirectory + ); + this.hostProject = hostProject; + this.rootFileNames = initialRootNames; + this.useSourceOfProjectReferenceRedirect = maybeBind(this.hostProject, this.hostProject.useSourceOfProjectReferenceRedirect); + this.getParsedCommandLine = maybeBind(this.hostProject, this.hostProject.getParsedCommandLine); + } + /** @internal */ + static getRootFileNames(dependencySelection, hostProject, host, compilerOptions) { + var _a, _b; + if (!dependencySelection) { + return emptyArray; + } + const program = hostProject.getCurrentProgram(); + if (!program) { + return emptyArray; + } + const start = timestamp(); + let dependencyNames; + let rootNames; + const rootFileName = combinePaths(hostProject.currentDirectory, inferredTypesContainingFile); + const packageJsons = hostProject.getPackageJsonsForAutoImport(combinePaths(hostProject.currentDirectory, rootFileName)); + for (const packageJson of packageJsons) { + (_a = packageJson.dependencies) == null ? void 0 : _a.forEach((_, dependenyName) => addDependency(dependenyName)); + (_b = packageJson.peerDependencies) == null ? void 0 : _b.forEach((_, dependencyName) => addDependency(dependencyName)); + } + let dependenciesAdded = 0; + if (dependencyNames) { + const symlinkCache = hostProject.getSymlinkCache(); + for (const name of arrayFrom(dependencyNames.keys())) { + if (dependencySelection === 2 /* Auto */ && dependenciesAdded > this.maxDependencies) { + hostProject.log(`AutoImportProviderProject: attempted to add more than ${this.maxDependencies} dependencies. Aborting.`); + return emptyArray; + } + const packageJson = resolvePackageNameToPackageJson( + name, + hostProject.currentDirectory, + compilerOptions, + host, + program.getModuleResolutionCache() + ); + if (packageJson) { + const entrypoints = getRootNamesFromPackageJson(packageJson, program, symlinkCache); + if (entrypoints) { + rootNames = concatenate(rootNames, entrypoints); + dependenciesAdded += entrypoints.length ? 1 : 0; + continue; + } + } + const done = forEach([hostProject.currentDirectory, hostProject.getGlobalTypingsCacheLocation()], (directory) => { + if (directory) { + const typesPackageJson = resolvePackageNameToPackageJson( + `@types/${name}`, + directory, + compilerOptions, + host, + program.getModuleResolutionCache() + ); + if (typesPackageJson) { + const entrypoints = getRootNamesFromPackageJson(typesPackageJson, program, symlinkCache); + rootNames = concatenate(rootNames, entrypoints); + dependenciesAdded += (entrypoints == null ? void 0 : entrypoints.length) ? 1 : 0; + return true; + } + } + }); + if (done) + continue; + if (packageJson && compilerOptions.allowJs && compilerOptions.maxNodeModuleJsDepth) { + const entrypoints = getRootNamesFromPackageJson( + packageJson, + program, + symlinkCache, + /*resolveJs*/ + true + ); + rootNames = concatenate(rootNames, entrypoints); + dependenciesAdded += (entrypoints == null ? void 0 : entrypoints.length) ? 1 : 0; + } + } + } + if (rootNames == null ? void 0 : rootNames.length) { + hostProject.log(`AutoImportProviderProject: found ${rootNames.length} root files in ${dependenciesAdded} dependencies in ${timestamp() - start} ms`); + } + return rootNames || emptyArray; + function addDependency(dependency) { + if (!startsWith(dependency, "@types/")) { + (dependencyNames || (dependencyNames = /* @__PURE__ */ new Set())).add(dependency); + } + } + function getRootNamesFromPackageJson(packageJson, program2, symlinkCache, resolveJs) { + var _a2; + const entrypoints = getEntrypointsFromPackageJsonInfo( + packageJson, + compilerOptions, + host, + program2.getModuleResolutionCache(), + resolveJs + ); + if (entrypoints) { + const real = (_a2 = host.realpath) == null ? void 0 : _a2.call(host, packageJson.packageDirectory); + const realPath2 = real ? hostProject.toPath(real) : void 0; + const isSymlink = realPath2 && realPath2 !== hostProject.toPath(packageJson.packageDirectory); + if (isSymlink) { + symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, { + real: ensureTrailingDirectorySeparator(real), + realPath: ensureTrailingDirectorySeparator(realPath2) + }); + } + return mapDefined(entrypoints, (entrypoint) => { + const resolvedFileName = isSymlink ? entrypoint.replace(packageJson.packageDirectory, real) : entrypoint; + if (!program2.getSourceFile(resolvedFileName) && !(isSymlink && program2.getSourceFile(entrypoint))) { + return resolvedFileName; + } + }); + } + } + } + /** @internal */ + static create(dependencySelection, hostProject, host, documentRegistry) { + if (dependencySelection === 0 /* Off */) { + return void 0; + } + const compilerOptions = { + ...hostProject.getCompilerOptions(), + ...this.compilerOptionsOverrides + }; + const rootNames = this.getRootFileNames(dependencySelection, hostProject, host, compilerOptions); + if (!rootNames.length) { + return void 0; + } + return new _AutoImportProviderProject(hostProject, rootNames, documentRegistry, compilerOptions); + } + /** @internal */ + isEmpty() { + return !some(this.rootFileNames); + } + isOrphan() { + return true; + } + updateGraph() { + let rootFileNames = this.rootFileNames; + if (!rootFileNames) { + rootFileNames = _AutoImportProviderProject.getRootFileNames( + this.hostProject.includePackageJsonAutoImports(), + this.hostProject, + this.hostProject.getHostForAutoImportProvider(), + this.getCompilationSettings() + ); + } + this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this, rootFileNames); + this.rootFileNames = rootFileNames; + const oldProgram = this.getCurrentProgram(); + const hasSameSetOfFiles = super.updateGraph(); + if (oldProgram && oldProgram !== this.getCurrentProgram()) { + this.hostProject.clearCachedExportInfoMap(); + } + return hasSameSetOfFiles; + } + /** @internal */ + scheduleInvalidateResolutionsOfFailedLookupLocations() { + return; + } + hasRoots() { + var _a; + return !!((_a = this.rootFileNames) == null ? void 0 : _a.length); + } + markAsDirty() { + this.rootFileNames = void 0; + super.markAsDirty(); + } + getScriptFileNames() { + return this.rootFileNames || emptyArray; + } + getLanguageService() { + throw new Error("AutoImportProviderProject language service should never be used. To get the program, use `project.getCurrentProgram()`."); + } + /** @internal */ + onAutoImportProviderSettingsChanged() { + throw new Error("AutoImportProviderProject is an auto import provider; use `markAsDirty()` instead."); + } + /** @internal */ + onPackageJsonChange() { + throw new Error("package.json changes should be notified on an AutoImportProvider's host project"); + } + getHostForAutoImportProvider() { + throw new Error("AutoImportProviderProject cannot provide its own host; use `hostProject.getModuleResolutionHostForAutomImportProvider()` instead."); + } + getProjectReferences() { + return this.hostProject.getProjectReferences(); + } + /** @internal */ + includePackageJsonAutoImports() { + return 0 /* Off */; + } + /** @internal */ + getSymlinkCache() { + return this.hostProject.getSymlinkCache(); + } + /** @internal */ + getModuleResolutionCache() { + var _a; + return (_a = this.hostProject.getCurrentProgram()) == null ? void 0 : _a.getModuleResolutionCache(); + } + }; + /** @internal */ + _AutoImportProviderProject.maxDependencies = 10; + /** @internal */ + _AutoImportProviderProject.compilerOptionsOverrides = { + diagnostics: false, + skipLibCheck: true, + sourceMap: false, + types: emptyArray, + lib: emptyArray, + noLib: true + }; + AutoImportProviderProject = _AutoImportProviderProject; + ConfiguredProject2 = class extends Project3 { + /** @internal */ + constructor(configFileName, canonicalConfigFilePath, projectService, documentRegistry, cachedDirectoryStructureHost) { + super( + configFileName, + 1 /* Configured */, + projectService, + documentRegistry, + /*hasExplicitListOfFiles*/ + false, + /*lastFileExceededProgramSize*/ + void 0, + /*compilerOptions*/ + {}, + /*compileOnSaveEnabled*/ + false, + /*watchOptions*/ + void 0, + cachedDirectoryStructureHost, + getDirectoryPath(configFileName) + ); + this.canonicalConfigFilePath = canonicalConfigFilePath; + /** @internal */ + this.openFileWatchTriggered = /* @__PURE__ */ new Map(); + /** @internal */ + this.canConfigFileJsonReportNoInputFiles = false; + /** Ref count to the project when opened from external project */ + this.externalProjectRefCount = 0; + /** @internal */ + this.isInitialLoadPending = returnTrue; + /** @internal */ + this.sendLoadingProjectFinish = false; + } + /** @internal */ + setCompilerHost(host) { + this.compilerHost = host; + } + /** @internal */ + getCompilerHost() { + return this.compilerHost; + } + /** @internal */ + useSourceOfProjectReferenceRedirect() { + return this.languageServiceEnabled; + } + /** @internal */ + getParsedCommandLine(fileName) { + const configFileName = asNormalizedPath(normalizePath(fileName)); + const canonicalConfigFilePath = asNormalizedPath(this.projectService.toCanonicalFileName(configFileName)); + let configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo) { + this.projectService.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo = { exists: this.projectService.host.fileExists(configFileName) }); + } + this.projectService.ensureParsedConfigUptoDate(configFileName, canonicalConfigFilePath, configFileExistenceInfo, this); + if (this.languageServiceEnabled && this.projectService.serverMode === 0 /* Semantic */) { + this.projectService.watchWildcards(configFileName, configFileExistenceInfo, this); + } + return configFileExistenceInfo.exists ? configFileExistenceInfo.config.parsedCommandLine : void 0; + } + /** @internal */ + onReleaseParsedCommandLine(fileName) { + this.releaseParsedConfig(asNormalizedPath(this.projectService.toCanonicalFileName(asNormalizedPath(normalizePath(fileName))))); + } + /** @internal */ + releaseParsedConfig(canonicalConfigFilePath) { + this.projectService.stopWatchingWildCards(canonicalConfigFilePath, this); + this.projectService.releaseParsedConfig(canonicalConfigFilePath, this); + } + /** + * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph + * @returns: true if set of files in the project stays the same and false - otherwise. + */ + updateGraph() { + const isInitialLoad = this.isInitialLoadPending(); + this.isInitialLoadPending = returnFalse; + const updateLevel = this.pendingUpdateLevel; + this.pendingUpdateLevel = 0 /* Update */; + let result; + switch (updateLevel) { + case 1 /* RootNamesAndUpdate */: + this.openFileWatchTriggered.clear(); + result = this.projectService.reloadFileNamesOfConfiguredProject(this); + break; + case 2 /* Full */: + this.openFileWatchTriggered.clear(); + const reason = Debug.checkDefined(this.pendingUpdateReason); + this.pendingUpdateReason = void 0; + this.projectService.reloadConfiguredProject( + this, + reason, + isInitialLoad, + /*clearSemanticCache*/ + false + ); + result = true; + break; + default: + result = super.updateGraph(); + } + this.compilerHost = void 0; + this.projectService.sendProjectLoadingFinishEvent(this); + this.projectService.sendProjectTelemetry(this); + return result; + } + /** @internal */ + getCachedDirectoryStructureHost() { + return this.directoryStructureHost; + } + getConfigFilePath() { + return asNormalizedPath(this.getProjectName()); + } + getProjectReferences() { + return this.projectReferences; + } + updateReferences(refs) { + this.projectReferences = refs; + this.potentialProjectReferences = void 0; + } + /** @internal */ + setPotentialProjectReference(canonicalConfigPath) { + Debug.assert(this.isInitialLoadPending()); + (this.potentialProjectReferences || (this.potentialProjectReferences = /* @__PURE__ */ new Set())).add(canonicalConfigPath); + } + /** @internal */ + getResolvedProjectReferenceToRedirect(fileName) { + const program = this.getCurrentProgram(); + return program && program.getResolvedProjectReferenceToRedirect(fileName); + } + /** @internal */ + forEachResolvedProjectReference(cb) { + var _a; + return (_a = this.getCurrentProgram()) == null ? void 0 : _a.forEachResolvedProjectReference(cb); + } + /** @internal */ + enablePluginsWithOptions(options) { + var _a; + this.plugins.length = 0; + if (!((_a = options.plugins) == null ? void 0 : _a.length) && !this.projectService.globalPlugins.length) + return; + const host = this.projectService.host; + if (!host.require && !host.importPlugin) { + this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + const searchPaths = this.getGlobalPluginSearchPaths(); + if (this.projectService.allowLocalPluginLoads) { + const local = getDirectoryPath(this.canonicalConfigFilePath); + this.projectService.logger.info(`Local plugin loading enabled; adding ${local} to search paths`); + searchPaths.unshift(local); + } + if (options.plugins) { + for (const pluginConfigEntry of options.plugins) { + this.enablePlugin(pluginConfigEntry, searchPaths); + } + } + return this.enableGlobalPlugins(options); + } + /** + * Get the errors that dont have any file name associated + */ + getGlobalProjectErrors() { + return filter(this.projectErrors, (diagnostic) => !diagnostic.file) || emptyArray2; + } + /** + * Get all the project errors + */ + getAllProjectErrors() { + return this.projectErrors || emptyArray2; + } + setProjectErrors(projectErrors) { + this.projectErrors = projectErrors; + } + close() { + this.projectService.configFileExistenceInfoCache.forEach((_configFileExistenceInfo, canonicalConfigFilePath) => this.releaseParsedConfig(canonicalConfigFilePath)); + this.projectErrors = void 0; + this.openFileWatchTriggered.clear(); + this.compilerHost = void 0; + super.close(); + } + /** @internal */ + addExternalProjectReference() { + this.externalProjectRefCount++; + } + /** @internal */ + deleteExternalProjectReference() { + this.externalProjectRefCount--; + } + /** @internal */ + isSolution() { + return this.getRootFilesMap().size === 0 && !this.canConfigFileJsonReportNoInputFiles; + } + /** + * Find the configured project from the project references in project which contains the info directly + * + * @internal + */ + getDefaultChildProjectFromProjectWithReferences(info) { + return forEachResolvedProjectReferenceProject( + this, + info.path, + (child) => projectContainsInfoDirectly(child, info) ? child : void 0, + 0 /* Find */ + ); + } + /** + * Returns true if the project is needed by any of the open script info/external project + * + * @internal + */ + hasOpenRef() { + var _a; + if (!!this.externalProjectRefCount) { + return true; + } + if (this.isClosed()) { + return false; + } + const configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(this.canonicalConfigFilePath); + if (this.projectService.hasPendingProjectUpdate(this)) { + return !!((_a = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a.size); + } + return !!configFileExistenceInfo.openFilesImpactedByConfigFile && forEachEntry( + configFileExistenceInfo.openFilesImpactedByConfigFile, + (_value, infoPath) => { + const info = this.projectService.getScriptInfoForPath(infoPath); + return this.containsScriptInfo(info) || !!forEachResolvedProjectReferenceProject( + this, + info.path, + (child) => child.containsScriptInfo(info), + 0 /* Find */ + ); + } + ) || false; + } + /** @internal */ + hasExternalProjectRef() { + return !!this.externalProjectRefCount; + } + getEffectiveTypeRoots() { + return getEffectiveTypeRoots(this.getCompilationSettings(), this) || []; + } + /** @internal */ + updateErrorOnNoInputFiles(fileNames) { + updateErrorForNoInputFiles(fileNames, this.getConfigFilePath(), this.getCompilerOptions().configFile.configFileSpecs, this.projectErrors, this.canConfigFileJsonReportNoInputFiles); + } + }; + ExternalProject2 = class extends Project3 { + /** @internal */ + constructor(externalProjectName, projectService, documentRegistry, compilerOptions, lastFileExceededProgramSize, compileOnSaveEnabled, projectFilePath, watchOptions) { + super( + externalProjectName, + 2 /* External */, + projectService, + documentRegistry, + /*hasExplicitListOfFiles*/ + true, + lastFileExceededProgramSize, + compilerOptions, + compileOnSaveEnabled, + watchOptions, + projectService.host, + getDirectoryPath(projectFilePath || normalizeSlashes(externalProjectName)) + ); + this.externalProjectName = externalProjectName; + this.compileOnSaveEnabled = compileOnSaveEnabled; + this.excludedFiles = []; + this.enableGlobalPlugins(this.getCompilerOptions()); + } + updateGraph() { + const result = super.updateGraph(); + this.projectService.sendProjectTelemetry(this); + return result; + } + getExcludedFiles() { + return this.excludedFiles; + } + }; + } + }); + + // src/server/editorServices.ts + function prepareConvertersForEnumLikeCompilerOptions(commandLineOptions) { + const map2 = /* @__PURE__ */ new Map(); + for (const option of commandLineOptions) { + if (typeof option.type === "object") { + const optionMap = option.type; + optionMap.forEach((value) => { + Debug.assert(typeof value === "number"); + }); + map2.set(option.name, optionMap); + } + } + return map2; + } + function convertFormatOptions(protocolOptions) { + if (isString(protocolOptions.indentStyle)) { + protocolOptions.indentStyle = indentStyle.get(protocolOptions.indentStyle.toLowerCase()); + Debug.assert(protocolOptions.indentStyle !== void 0); + } + return protocolOptions; + } + function convertCompilerOptions(protocolOptions) { + compilerOptionConverters.forEach((mappedValues, id) => { + const propertyValue = protocolOptions[id]; + if (isString(propertyValue)) { + protocolOptions[id] = mappedValues.get(propertyValue.toLowerCase()); + } + }); + return protocolOptions; + } + function convertWatchOptions(protocolOptions, currentDirectory) { + let watchOptions; + let errors; + optionsForWatch.forEach((option) => { + const propertyValue = protocolOptions[option.name]; + if (propertyValue === void 0) + return; + const mappedValues = watchOptionsConverters.get(option.name); + (watchOptions || (watchOptions = {}))[option.name] = mappedValues ? isString(propertyValue) ? mappedValues.get(propertyValue.toLowerCase()) : propertyValue : convertJsonOption(option, propertyValue, currentDirectory || "", errors || (errors = [])); + }); + return watchOptions && { watchOptions, errors }; + } + function convertTypeAcquisition(protocolOptions) { + let result; + typeAcquisitionDeclarations.forEach((option) => { + const propertyValue = protocolOptions[option.name]; + if (propertyValue === void 0) + return; + (result || (result = {}))[option.name] = propertyValue; + }); + return result; + } + function tryConvertScriptKindName(scriptKindName) { + return isString(scriptKindName) ? convertScriptKindName(scriptKindName) : scriptKindName; + } + function convertScriptKindName(scriptKindName) { + switch (scriptKindName) { + case "JS": + return 1 /* JS */; + case "JSX": + return 2 /* JSX */; + case "TS": + return 3 /* TS */; + case "TSX": + return 4 /* TSX */; + default: + return 0 /* Unknown */; + } + } + function convertUserPreferences(preferences) { + const { lazyConfiguredProjectsFromExternalProject: _, ...userPreferences } = preferences; + return userPreferences; + } + function findProjectByName(projectName, projects) { + for (const proj of projects) { + if (proj.getProjectName() === projectName) { + return proj; + } + } + } + function isOpenScriptInfo(infoOrFileNameOrConfig) { + return !!infoOrFileNameOrConfig.containingProjects; + } + function isAncestorConfigFileInfo(infoOrFileNameOrConfig) { + return !!infoOrFileNameOrConfig.configFileInfo; + } + function forEachResolvedProjectReferenceProject(project, fileName, cb, projectReferenceProjectLoadKind, reason) { + var _a; + const resolvedRefs = (_a = project.getCurrentProgram()) == null ? void 0 : _a.getResolvedProjectReferences(); + if (!resolvedRefs) + return void 0; + let seenResolvedRefs; + const possibleDefaultRef = fileName ? project.getResolvedProjectReferenceToRedirect(fileName) : void 0; + if (possibleDefaultRef) { + const configFileName = toNormalizedPath(possibleDefaultRef.sourceFile.fileName); + const child = project.projectService.findConfiguredProjectByProjectName(configFileName); + if (child) { + const result = cb(child); + if (result) + return result; + } else if (projectReferenceProjectLoadKind !== 0 /* Find */) { + seenResolvedRefs = /* @__PURE__ */ new Map(); + const result = forEachResolvedProjectReferenceProjectWorker( + resolvedRefs, + project.getCompilerOptions(), + (ref, loadKind) => possibleDefaultRef === ref ? callback(ref, loadKind) : void 0, + projectReferenceProjectLoadKind, + project.projectService, + seenResolvedRefs + ); + if (result) + return result; + seenResolvedRefs.clear(); + } + } + return forEachResolvedProjectReferenceProjectWorker( + resolvedRefs, + project.getCompilerOptions(), + (ref, loadKind) => possibleDefaultRef !== ref ? callback(ref, loadKind) : void 0, + projectReferenceProjectLoadKind, + project.projectService, + seenResolvedRefs + ); + function callback(ref, loadKind) { + const configFileName = toNormalizedPath(ref.sourceFile.fileName); + const child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (loadKind === 0 /* Find */ ? void 0 : loadKind === 1 /* FindCreate */ ? project.projectService.createConfiguredProject(configFileName) : loadKind === 2 /* FindCreateLoad */ ? project.projectService.createAndLoadConfiguredProject(configFileName, reason) : Debug.assertNever(loadKind)); + return child && cb(child); + } + } + function forEachResolvedProjectReferenceProjectWorker(resolvedProjectReferences, parentOptions, cb, projectReferenceProjectLoadKind, projectService, seenResolvedRefs) { + const loadKind = parentOptions.disableReferencedProjectLoad ? 0 /* Find */ : projectReferenceProjectLoadKind; + return forEach(resolvedProjectReferences, (ref) => { + if (!ref) + return void 0; + const configFileName = toNormalizedPath(ref.sourceFile.fileName); + const canonicalPath = projectService.toCanonicalFileName(configFileName); + const seenValue = seenResolvedRefs == null ? void 0 : seenResolvedRefs.get(canonicalPath); + if (seenValue !== void 0 && seenValue >= loadKind) { + return void 0; + } + const result = cb(ref, loadKind); + if (result) { + return result; + } + (seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Map())).set(canonicalPath, loadKind); + return ref.references && forEachResolvedProjectReferenceProjectWorker(ref.references, ref.commandLine.options, cb, loadKind, projectService, seenResolvedRefs); + }); + } + function forEachPotentialProjectReference(project, cb) { + return project.potentialProjectReferences && forEachKey(project.potentialProjectReferences, cb); + } + function forEachAnyProjectReferenceKind(project, cb, cbProjectRef, cbPotentialProjectRef) { + return project.getCurrentProgram() ? project.forEachResolvedProjectReference(cb) : project.isInitialLoadPending() ? forEachPotentialProjectReference(project, cbPotentialProjectRef) : forEach(project.getProjectReferences(), cbProjectRef); + } + function callbackRefProject(project, cb, refPath) { + const refProject = refPath && project.projectService.configuredProjects.get(refPath); + return refProject && cb(refProject); + } + function forEachReferencedProject(project, cb) { + return forEachAnyProjectReferenceKind( + project, + (resolvedRef) => callbackRefProject(project, cb, resolvedRef.sourceFile.path), + (projectRef) => callbackRefProject(project, cb, project.toPath(resolveProjectReferencePath(projectRef))), + (potentialProjectRef) => callbackRefProject(project, cb, potentialProjectRef) + ); + } + function getDetailWatchInfo(watchType, project) { + return `${isString(project) ? `Config: ${project} ` : project ? `Project: ${project.getProjectName()} ` : ""}WatchType: ${watchType}`; + } + function isScriptInfoWatchedFromNodeModules(info) { + return !info.isScriptOpen() && info.mTime !== void 0; + } + function projectContainsInfoDirectly(project, info) { + return project.containsScriptInfo(info) && !project.isSourceOfProjectReferenceRedirect(info.path); + } + function updateProjectIfDirty(project) { + project.invalidateResolutionsOfFailedLookupLocations(); + return project.dirty && project.updateGraph(); + } + function setProjectOptionsUsed(project) { + if (isConfiguredProject(project)) { + project.projectOptions = true; + } + } + function createProjectNameFactoryWithCounter(nameFactory) { + let nextId = 1; + return () => nameFactory(nextId++); + } + function getHostWatcherMap() { + return { idToCallbacks: /* @__PURE__ */ new Map(), pathToId: /* @__PURE__ */ new Map() }; + } + function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) { + if (!canUseWatchEvents || !service.eventHandler || !service.session) + return void 0; + const watchedFiles = getHostWatcherMap(); + const watchedDirectories = getHostWatcherMap(); + const watchedDirectoriesRecursive = getHostWatcherMap(); + let ids = 1; + service.session.addProtocolHandler("watchChange" /* WatchChange */, (req) => { + onWatchChange(req.arguments); + return { responseRequired: false }; + }); + return { + watchFile: watchFile2, + watchDirectory, + getCurrentDirectory: () => service.host.getCurrentDirectory(), + useCaseSensitiveFileNames: service.host.useCaseSensitiveFileNames + }; + function watchFile2(path, callback) { + return getOrCreateFileWatcher( + watchedFiles, + path, + callback, + (id) => ({ eventName: CreateFileWatcherEvent, data: { id, path } }) + ); + } + function watchDirectory(path, callback, recursive) { + return getOrCreateFileWatcher( + recursive ? watchedDirectoriesRecursive : watchedDirectories, + path, + callback, + (id) => ({ eventName: CreateDirectoryWatcherEvent, data: { id, path, recursive: !!recursive } }) + ); + } + function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path, callback, event) { + const key = service.toPath(path); + let id = pathToId.get(key); + if (!id) + pathToId.set(key, id = ids++); + let callbacks = idToCallbacks.get(id); + if (!callbacks) { + idToCallbacks.set(id, callbacks = /* @__PURE__ */ new Set()); + service.eventHandler(event(id)); + } + callbacks.add(callback); + return { + close() { + const callbacks2 = idToCallbacks.get(id); + if (!(callbacks2 == null ? void 0 : callbacks2.delete(callback))) + return; + if (callbacks2.size) + return; + idToCallbacks.delete(id); + pathToId.delete(key); + service.eventHandler({ eventName: CloseFileWatcherEvent, data: { id } }); + } + }; + } + function onWatchChange({ id, path, eventType }) { + onFileWatcherCallback(id, path, eventType); + onDirectoryWatcherCallback(watchedDirectories, id, path, eventType); + onDirectoryWatcherCallback(watchedDirectoriesRecursive, id, path, eventType); + } + 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 onDirectoryWatcherCallback({ idToCallbacks }, id, eventPath, eventType) { + var _a; + if (eventType === "update") + return; + (_a = idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => { + callback(eventPath); + }); + } + } + function createIncompleteCompletionsCache() { + let info; + return { + get() { + return info; + }, + set(newInfo) { + info = newInfo; + }, + clear() { + info = void 0; + } + }; + } + function isConfigFile(config) { + return config.kind !== void 0; + } + function printProjectWithoutFileNames(project) { + project.print( + /*writeProjectFileNames*/ + false, + /*writeFileExplaination*/ + false, + /*writeFileVersionAndText*/ + false + ); + } + var maxProgramSizeForNonTsFiles, maxFileSize, ProjectsUpdatedInBackgroundEvent, ProjectLoadingStartEvent, ProjectLoadingFinishEvent, LargeFileReferencedEvent, ConfigFileDiagEvent, ProjectLanguageServiceStateEvent, ProjectInfoTelemetryEvent, OpenFileInfoTelemetryEvent, CreateFileWatcherEvent, CreateDirectoryWatcherEvent, CloseFileWatcherEvent, ensureProjectForOpenFileSchedule, compilerOptionConverters, watchOptionsConverters, indentStyle, defaultTypeSafeList, fileNamePropertyReader, externalFilePropertyReader, noopConfigFileWatcher, ProjectReferenceProjectLoadKind, _ProjectService, ProjectService3; + var init_editorServices = __esm({ + "src/server/editorServices.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + init_protocol(); + maxProgramSizeForNonTsFiles = 20 * 1024 * 1024; + maxFileSize = 4 * 1024 * 1024; + ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground"; + ProjectLoadingStartEvent = "projectLoadingStart"; + ProjectLoadingFinishEvent = "projectLoadingFinish"; + LargeFileReferencedEvent = "largeFileReferenced"; + ConfigFileDiagEvent = "configFileDiag"; + ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; + ProjectInfoTelemetryEvent = "projectInfo"; + OpenFileInfoTelemetryEvent = "openFileInfo"; + CreateFileWatcherEvent = "createFileWatcher"; + CreateDirectoryWatcherEvent = "createDirectoryWatcher"; + CloseFileWatcherEvent = "closeFileWatcher"; + ensureProjectForOpenFileSchedule = "*ensureProjectForOpenFiles*"; + compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(optionDeclarations); + watchOptionsConverters = prepareConvertersForEnumLikeCompilerOptions(optionsForWatch); + indentStyle = new Map(Object.entries({ + none: 0 /* None */, + block: 1 /* Block */, + smart: 2 /* Smart */ + })); + defaultTypeSafeList = { + "jquery": { + // jquery files can have names like "jquery-1.10.2.min.js" (or "jquery.intellisense.js") + match: /jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i, + types: ["jquery"] + }, + "WinJS": { + // e.g. c:/temp/UWApp1/lib/winjs-4.0.1/js/base.js + match: /^(.*\/winjs-[.\d]+)\/js\/base\.js$/i, + // If the winjs/base.js file is found.. + exclude: [["^", 1, "/.*"]], + // ..then exclude all files under the winjs folder + types: ["winjs"] + // And fetch the @types package for WinJS + }, + "Kendo": { + // e.g. /Kendo3/wwwroot/lib/kendo/kendo.all.min.js + match: /^(.*\/kendo(-ui)?)\/kendo\.all(\.min)?\.js$/i, + exclude: [["^", 1, "/.*"]], + types: ["kendo-ui"] + }, + "Office Nuget": { + // e.g. /scripts/Office/1/excel-15.debug.js + match: /^(.*\/office\/1)\/excel-\d+\.debug\.js$/i, + // Office NuGet package is installed under a "1/office" folder + exclude: [["^", 1, "/.*"]], + // Exclude that whole folder if the file indicated above is found in it + types: ["office"] + // @types package to fetch instead + }, + "References": { + match: /^(.*\/_references\.js)$/i, + exclude: [["^", 1, "$"]] + } + }; + fileNamePropertyReader = { + getFileName: (x) => x, + getScriptKind: (fileName, extraFileExtensions) => { + let result; + if (extraFileExtensions) { + const fileExtension = getAnyExtensionFromPath(fileName); + if (fileExtension) { + some(extraFileExtensions, (info) => { + if (info.extension === fileExtension) { + result = info.scriptKind; + return true; + } + return false; + }); + } + } + return result; + }, + hasMixedContent: (fileName, extraFileExtensions) => some(extraFileExtensions, (ext) => ext.isMixedContent && fileExtensionIs(fileName, ext.extension)) + }; + externalFilePropertyReader = { + getFileName: (x) => x.fileName, + getScriptKind: (x) => tryConvertScriptKindName(x.scriptKind), + // TODO: GH#18217 + hasMixedContent: (x) => !!x.hasMixedContent + }; + noopConfigFileWatcher = { close: noop }; + ProjectReferenceProjectLoadKind = /* @__PURE__ */ ((ProjectReferenceProjectLoadKind2) => { + ProjectReferenceProjectLoadKind2[ProjectReferenceProjectLoadKind2["Find"] = 0] = "Find"; + ProjectReferenceProjectLoadKind2[ProjectReferenceProjectLoadKind2["FindCreate"] = 1] = "FindCreate"; + ProjectReferenceProjectLoadKind2[ProjectReferenceProjectLoadKind2["FindCreateLoad"] = 2] = "FindCreateLoad"; + return ProjectReferenceProjectLoadKind2; + })(ProjectReferenceProjectLoadKind || {}); + _ProjectService = class _ProjectService { + constructor(opts) { + /** + * Container of all known scripts + * + * @internal + */ + this.filenameToScriptInfo = /* @__PURE__ */ new Map(); + this.nodeModulesWatchers = /* @__PURE__ */ new Map(); + /** + * Contains all the deleted script info's version information so that + * it does not reset when creating script info again + * (and could have potentially collided with version where contents mismatch) + */ + this.filenameToScriptInfoVersion = /* @__PURE__ */ new Map(); + // Set of all '.js' files ever opened. + this.allJsFilesForOpenFileTelemetry = /* @__PURE__ */ new Map(); + /** + * maps external project file name to list of config files that were the part of this project + */ + this.externalProjectToConfiguredProjectMap = /* @__PURE__ */ new Map(); + /** + * external projects (configuration and list of root files is not controlled by tsserver) + */ + this.externalProjects = []; + /** + * projects built from openFileRoots + */ + this.inferredProjects = []; + /** + * projects specified by a tsconfig.json file + */ + this.configuredProjects = /* @__PURE__ */ new Map(); + /** @internal */ + this.newInferredProjectName = createProjectNameFactoryWithCounter(makeInferredProjectName); + /** @internal */ + this.newAutoImportProviderProjectName = createProjectNameFactoryWithCounter(makeAutoImportProviderProjectName); + /** @internal */ + this.newAuxiliaryProjectName = createProjectNameFactoryWithCounter(makeAuxiliaryProjectName); + /** + * Open files: with value being project root path, and key being Path of the file that is open + */ + this.openFiles = /* @__PURE__ */ new Map(); + /** @internal */ + this.configFileForOpenFiles = /* @__PURE__ */ new Map(); + /** + * Map of open files that are opened without complete path but have projectRoot as current directory + */ + this.openFilesWithNonRootedDiskPath = /* @__PURE__ */ new Map(); + this.compilerOptionsForInferredProjectsPerProjectRoot = /* @__PURE__ */ new Map(); + this.watchOptionsForInferredProjectsPerProjectRoot = /* @__PURE__ */ new Map(); + this.typeAcquisitionForInferredProjectsPerProjectRoot = /* @__PURE__ */ new Map(); + /** + * Project size for configured or external projects + */ + this.projectToSizeMap = /* @__PURE__ */ new Map(); + /** + * This is a map of config file paths existence that doesnt need query to disk + * - The entry can be present because there is inferred project that needs to watch addition of config file to directory + * In this case the exists could be true/false based on config file is present or not + * - Or it is present if we have configured project open with config file at that location + * In this case the exists property is always true + * + * @internal + */ + this.configFileExistenceInfoCache = /* @__PURE__ */ new Map(); + this.safelist = defaultTypeSafeList; + this.legacySafelist = /* @__PURE__ */ new Map(); + this.pendingProjectUpdates = /* @__PURE__ */ new Map(); + /** @internal */ + this.pendingEnsureProjectForOpenFiles = false; + /** Tracks projects that we have already sent telemetry for. */ + this.seenProjects = /* @__PURE__ */ new Map(); + /** @internal */ + this.sharedExtendedConfigFileWatchers = /* @__PURE__ */ new Map(); + /** @internal */ + this.extendedConfigCache = /* @__PURE__ */ new Map(); + /** @internal */ + this.baseline = noop; + /** @internal */ + this.verifyDocumentRegistry = noop; + /** @internal */ + this.verifyProgram = noop; + /** @internal */ + this.onProjectCreation = noop; + var _a; + this.host = opts.host; + this.logger = opts.logger; + this.cancellationToken = opts.cancellationToken; + this.useSingleInferredProject = opts.useSingleInferredProject; + this.useInferredProjectPerProjectRoot = opts.useInferredProjectPerProjectRoot; + this.typingsInstaller = opts.typingsInstaller || nullTypingsInstaller; + this.throttleWaitMilliseconds = opts.throttleWaitMilliseconds; + this.eventHandler = opts.eventHandler; + this.suppressDiagnosticEvents = opts.suppressDiagnosticEvents; + this.globalPlugins = opts.globalPlugins || emptyArray2; + this.pluginProbeLocations = opts.pluginProbeLocations || emptyArray2; + this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; + this.typesMapLocation = opts.typesMapLocation === void 0 ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation; + this.session = opts.session; + this.jsDocParsingMode = opts.jsDocParsingMode; + if (opts.serverMode !== void 0) { + this.serverMode = opts.serverMode; + } else { + this.serverMode = 0 /* Semantic */; + } + if (this.host.realpath) { + this.realpathToScriptInfos = createMultiMap(); + } + this.currentDirectory = toNormalizedPath(this.host.getCurrentDirectory()); + this.toCanonicalFileName = createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); + this.globalCacheLocationDirectoryPath = this.typingsInstaller.globalTypingsCacheLocation ? ensureTrailingDirectorySeparator(this.toPath(this.typingsInstaller.globalTypingsCacheLocation)) : void 0; + this.throttledOperations = new ThrottledOperations(this.host, this.logger); + if (this.typesMapLocation) { + this.loadTypesMap(); + } else { + this.logger.info("No types map provided; using the default"); + } + this.typingsInstaller.attach(this); + this.typingsCache = new TypingsCache(this.typingsInstaller); + this.hostConfiguration = { + formatCodeOptions: getDefaultFormatCodeSettings(this.host.newLine), + preferences: emptyOptions, + hostInfo: "Unknown host", + extraFileExtensions: [] + }; + this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this); + const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */; + const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop; + this.packageJsonCache = createPackageJsonCache(this); + this.watchFactory = this.serverMode !== 0 /* Semantic */ ? { + watchFile: returnNoopFileWatcher, + watchDirectory: returnNoopFileWatcher + } : getWatchFactory( + createWatchFactoryHostUsingWatchEvents(this, opts.canUseWatchEvents) || this.host, + watchLogLevel, + log, + getDetailWatchInfo + ); + (_a = opts.incrementalVerifier) == null ? void 0 : _a.call(opts, this); + } + toPath(fileName) { + return toPath(fileName, this.currentDirectory, this.toCanonicalFileName); + } + /** @internal */ + getExecutingFilePath() { + return this.getNormalizedAbsolutePath(this.host.getExecutingFilePath()); + } + /** @internal */ + getNormalizedAbsolutePath(fileName) { + return getNormalizedAbsolutePath(fileName, this.host.getCurrentDirectory()); + } + /** @internal */ + setDocument(key, path, sourceFile) { + const info = Debug.checkDefined(this.getScriptInfoForPath(path)); + info.cacheSourceFile = { key, sourceFile }; + } + /** @internal */ + getDocument(key, path) { + const info = this.getScriptInfoForPath(path); + return info && info.cacheSourceFile && info.cacheSourceFile.key === key ? info.cacheSourceFile.sourceFile : void 0; + } + /** @internal */ + ensureInferredProjectsUpToDate_TestOnly() { + this.ensureProjectStructuresUptoDate(); + } + /** @internal */ + getCompilerOptionsForInferredProjects() { + return this.compilerOptionsForInferredProjects; + } + /** @internal */ + onUpdateLanguageServiceStateForProject(project, languageServiceEnabled) { + if (!this.eventHandler) { + return; + } + const event = { + eventName: ProjectLanguageServiceStateEvent, + data: { project, languageServiceEnabled } + }; + this.eventHandler(event); + } + loadTypesMap() { + try { + const fileContent = this.host.readFile(this.typesMapLocation); + if (fileContent === void 0) { + this.logger.info(`Provided types map file "${this.typesMapLocation}" doesn't exist`); + return; + } + const raw = JSON.parse(fileContent); + for (const k of Object.keys(raw.typesMap)) { + raw.typesMap[k].match = new RegExp(raw.typesMap[k].match, "i"); + } + this.safelist = raw.typesMap; + for (const key in raw.simpleMap) { + if (hasProperty(raw.simpleMap, key)) { + this.legacySafelist.set(key, raw.simpleMap[key].toLowerCase()); + } + } + } catch (e) { + this.logger.info(`Error loading types map: ${e}`); + this.safelist = defaultTypeSafeList; + this.legacySafelist.clear(); + } + } + // eslint-disable-line @typescript-eslint/unified-signatures + updateTypingsForProject(response) { + const project = this.findProject(response.projectName); + if (!project) { + return; + } + switch (response.kind) { + case ActionSet: + project.updateTypingFiles(this.typingsCache.updateTypingsForProject(response.projectName, response.compilerOptions, response.typeAcquisition, response.unresolvedImports, response.typings)); + return; + case ActionInvalidate: + this.typingsCache.enqueueInstallTypingsForProject( + project, + project.lastCachedUnresolvedImportsList, + /*forceRefresh*/ + true + ); + return; + } + } + /** @internal */ + watchTypingLocations(response) { + var _a; + (_a = this.findProject(response.projectName)) == null ? void 0 : _a.watchTypingLocations(response.files); + } + /** @internal */ + delayEnsureProjectForOpenFiles() { + if (!this.openFiles.size) + return; + this.pendingEnsureProjectForOpenFiles = true; + this.throttledOperations.schedule( + ensureProjectForOpenFileSchedule, + /*delay*/ + 2500, + () => { + if (this.pendingProjectUpdates.size !== 0) { + this.delayEnsureProjectForOpenFiles(); + } else { + if (this.pendingEnsureProjectForOpenFiles) { + this.ensureProjectForOpenFiles(); + this.sendProjectsUpdatedInBackgroundEvent(); + } + } + } + ); + } + delayUpdateProjectGraph(project) { + project.markAsDirty(); + if (isBackgroundProject(project)) + return; + const projectName = project.getProjectName(); + this.pendingProjectUpdates.set(projectName, project); + this.throttledOperations.schedule( + projectName, + /*delay*/ + 250, + () => { + if (this.pendingProjectUpdates.delete(projectName)) { + updateProjectIfDirty(project); + } + } + ); + } + /** @internal */ + hasPendingProjectUpdate(project) { + return this.pendingProjectUpdates.has(project.getProjectName()); + } + /** @internal */ + sendProjectsUpdatedInBackgroundEvent() { + if (!this.eventHandler) { + return; + } + const event = { + eventName: ProjectsUpdatedInBackgroundEvent, + data: { + openFiles: arrayFrom(this.openFiles.keys(), (path) => this.getScriptInfoForPath(path).fileName) + } + }; + this.eventHandler(event); + } + /** @internal */ + sendLargeFileReferencedEvent(file, fileSize) { + if (!this.eventHandler) { + return; + } + const event = { + eventName: LargeFileReferencedEvent, + data: { file, fileSize, maxFileSize } + }; + this.eventHandler(event); + } + /** @internal */ + sendProjectLoadingStartEvent(project, reason) { + if (!this.eventHandler) { + return; + } + project.sendLoadingProjectFinish = true; + const event = { + eventName: ProjectLoadingStartEvent, + data: { project, reason } + }; + this.eventHandler(event); + } + /** @internal */ + sendProjectLoadingFinishEvent(project) { + if (!this.eventHandler || !project.sendLoadingProjectFinish) { + return; + } + project.sendLoadingProjectFinish = false; + const event = { + eventName: ProjectLoadingFinishEvent, + data: { project } + }; + this.eventHandler(event); + } + /** @internal */ + sendPerformanceEvent(kind, durationMs) { + if (this.performanceEventHandler) { + this.performanceEventHandler({ kind, durationMs }); + } + } + /** @internal */ + delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project) { + this.delayUpdateProjectGraph(project); + this.delayEnsureProjectForOpenFiles(); + } + delayUpdateProjectGraphs(projects, clearSourceMapperCache) { + if (projects.length) { + for (const project of projects) { + if (clearSourceMapperCache) + project.clearSourceMapperCache(); + this.delayUpdateProjectGraph(project); + } + this.delayEnsureProjectForOpenFiles(); + } + } + setCompilerOptionsForInferredProjects(projectCompilerOptions, projectRootPath) { + Debug.assert(projectRootPath === void 0 || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled"); + const compilerOptions = convertCompilerOptions(projectCompilerOptions); + const watchOptions = convertWatchOptions(projectCompilerOptions, projectRootPath); + const typeAcquisition = convertTypeAcquisition(projectCompilerOptions); + compilerOptions.allowNonTsExtensions = true; + const canonicalProjectRootPath = projectRootPath && this.toCanonicalFileName(projectRootPath); + if (canonicalProjectRootPath) { + this.compilerOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, compilerOptions); + this.watchOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, watchOptions || false); + this.typeAcquisitionForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, typeAcquisition); + } else { + this.compilerOptionsForInferredProjects = compilerOptions; + this.watchOptionsForInferredProjects = watchOptions; + this.typeAcquisitionForInferredProjects = typeAcquisition; + } + for (const project of this.inferredProjects) { + if (canonicalProjectRootPath ? project.projectRootPath === canonicalProjectRootPath : !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { + project.setCompilerOptions(compilerOptions); + project.setTypeAcquisition(typeAcquisition); + project.setWatchOptions(watchOptions == null ? void 0 : watchOptions.watchOptions); + project.setProjectErrors(watchOptions == null ? void 0 : watchOptions.errors); + project.compileOnSaveEnabled = compilerOptions.compileOnSave; + project.markAsDirty(); + this.delayUpdateProjectGraph(project); + } + } + this.delayEnsureProjectForOpenFiles(); + } + findProject(projectName) { + if (projectName === void 0) { + return void 0; + } + if (isInferredProjectName(projectName)) { + return findProjectByName(projectName, this.inferredProjects); + } + return this.findExternalProjectByProjectName(projectName) || this.findConfiguredProjectByProjectName(toNormalizedPath(projectName)); + } + /** @internal */ + forEachProject(cb) { + this.externalProjects.forEach(cb); + this.configuredProjects.forEach(cb); + this.inferredProjects.forEach(cb); + } + /** @internal */ + forEachEnabledProject(cb) { + this.forEachProject((project) => { + if (!project.isOrphan() && project.languageServiceEnabled) { + cb(project); + } + }); + } + getDefaultProjectForFile(fileName, ensureProject) { + return ensureProject ? this.ensureDefaultProjectForFile(fileName) : this.tryGetDefaultProjectForFile(fileName); + } + /** @internal */ + tryGetDefaultProjectForFile(fileNameOrScriptInfo) { + const scriptInfo = isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo; + return scriptInfo && !scriptInfo.isOrphan() ? scriptInfo.getDefaultProject() : void 0; + } + /** @internal */ + ensureDefaultProjectForFile(fileNameOrScriptInfo) { + return this.tryGetDefaultProjectForFile(fileNameOrScriptInfo) || this.doEnsureDefaultProjectForFile(fileNameOrScriptInfo); + } + doEnsureDefaultProjectForFile(fileNameOrScriptInfo) { + this.ensureProjectStructuresUptoDate(); + const scriptInfo = isString(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo; + return scriptInfo ? scriptInfo.getDefaultProject() : (this.logErrorForScriptInfoNotFound(isString(fileNameOrScriptInfo) ? fileNameOrScriptInfo : fileNameOrScriptInfo.fileName), Errors.ThrowNoProject()); + } + getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName) { + this.ensureProjectStructuresUptoDate(); + return this.getScriptInfo(uncheckedFileName); + } + /** + * Ensures the project structures are upto date + * This means, + * - we go through all the projects and update them if they are dirty + * - if updates reflect some change in structure or there was pending request to ensure projects for open files + * ensure that each open script info has project + */ + ensureProjectStructuresUptoDate() { + let hasChanges = this.pendingEnsureProjectForOpenFiles; + this.pendingProjectUpdates.clear(); + const updateGraph = (project) => { + hasChanges = updateProjectIfDirty(project) || hasChanges; + }; + this.externalProjects.forEach(updateGraph); + this.configuredProjects.forEach(updateGraph); + this.inferredProjects.forEach(updateGraph); + if (hasChanges) { + this.ensureProjectForOpenFiles(); + } + } + getFormatCodeOptions(file) { + const info = this.getScriptInfoForNormalizedPath(file); + return info && info.getFormatCodeSettings() || this.hostConfiguration.formatCodeOptions; + } + getPreferences(file) { + const info = this.getScriptInfoForNormalizedPath(file); + return { ...this.hostConfiguration.preferences, ...info && info.getPreferences() }; + } + getHostFormatCodeOptions() { + return this.hostConfiguration.formatCodeOptions; + } + getHostPreferences() { + return this.hostConfiguration.preferences; + } + onSourceFileChanged(info, eventKind) { + if (eventKind === 2 /* Deleted */) { + this.handleDeletedFile(info); + } else if (!info.isScriptOpen()) { + info.delayReloadNonMixedContentFile(); + this.delayUpdateProjectGraphs( + info.containingProjects, + /*clearSourceMapperCache*/ + false + ); + this.handleSourceMapProjects(info); + } + } + handleSourceMapProjects(info) { + if (info.sourceMapFilePath) { + if (isString(info.sourceMapFilePath)) { + const sourceMapFileInfo = this.getScriptInfoForPath(info.sourceMapFilePath); + this.delayUpdateSourceInfoProjects(sourceMapFileInfo && sourceMapFileInfo.sourceInfos); + } else { + this.delayUpdateSourceInfoProjects(info.sourceMapFilePath.sourceInfos); + } + } + this.delayUpdateSourceInfoProjects(info.sourceInfos); + if (info.declarationInfoPath) { + this.delayUpdateProjectsOfScriptInfoPath(info.declarationInfoPath); + } + } + delayUpdateSourceInfoProjects(sourceInfos) { + if (sourceInfos) { + sourceInfos.forEach((_value, path) => this.delayUpdateProjectsOfScriptInfoPath(path)); + } + } + delayUpdateProjectsOfScriptInfoPath(path) { + const info = this.getScriptInfoForPath(path); + if (info) { + this.delayUpdateProjectGraphs( + info.containingProjects, + /*clearSourceMapperCache*/ + true + ); + } + } + handleDeletedFile(info) { + this.stopWatchingScriptInfo(info); + if (!info.isScriptOpen()) { + this.deleteScriptInfo(info); + const containingProjects = info.containingProjects.slice(); + info.detachAllProjects(); + this.delayUpdateProjectGraphs( + containingProjects, + /*clearSourceMapperCache*/ + false + ); + this.handleSourceMapProjects(info); + info.closeSourceMapFileWatcher(); + if (info.declarationInfoPath) { + const declarationInfo = this.getScriptInfoForPath(info.declarationInfoPath); + if (declarationInfo) { + declarationInfo.sourceMapFilePath = void 0; + } + } + } + } + /** + * This is to watch whenever files are added or removed to the wildcard directories + * + * @internal + */ + watchWildcardDirectory(directory, flags, configFileName, config) { + 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(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: this.toPath(directory), + fileOrDirectory, + fileOrDirectoryPath, + configFileName, + extraFileExtensions: this.hostConfiguration.extraFileExtensions, + currentDirectory: this.currentDirectory, + options: config.parsedCommandLine.options, + program: (configuredProjectForConfig == null ? void 0 : configuredProjectForConfig.getCurrentProgram()) || config.parsedCommandLine.fileNames, + useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames, + writeLog: (s) => this.logger.info(s), + toPath: (s) => this.toPath(s), + getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0 + })) + return; + if (config.updateLevel !== 2 /* Full */) + config.updateLevel = 1 /* RootNamesAndUpdate */; + config.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => { + if (!watchWildcardDirectories) + return; + const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath); + if (!project) + return; + const updateLevel = configuredProjectForConfig === project ? 1 /* RootNamesAndUpdate */ : 0 /* Update */; + if (project.pendingUpdateLevel !== void 0 && project.pendingUpdateLevel > updateLevel) + return; + if (this.openFiles.has(fileOrDirectoryPath)) { + const info = Debug.checkDefined(this.getScriptInfoForPath(fileOrDirectoryPath)); + if (info.isAttached(project)) { + const loadLevelToSet = Math.max(updateLevel, project.openFileWatchTriggered.get(fileOrDirectoryPath) || 0 /* Update */); + project.openFileWatchTriggered.set(fileOrDirectoryPath, loadLevelToSet); + } else { + project.pendingUpdateLevel = updateLevel; + this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); + } + } else { + project.pendingUpdateLevel = updateLevel; + this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); + } + }); + }, + flags, + this.getWatchOptionsFromProjectWatchOptions(config.parsedCommandLine.watchOptions), + 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) { + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!(configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config)) + return false; + let scheduledAnyProjectUpdate = false; + configFileExistenceInfo.config.updateLevel = 2 /* Full */; + configFileExistenceInfo.config.projects.forEach((_watchWildcardDirectories, projectCanonicalPath) => { + const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath); + if (!project) + return; + scheduledAnyProjectUpdate = true; + if (projectCanonicalPath === canonicalConfigFilePath) { + if (project.isInitialLoadPending()) + return; + project.pendingUpdateLevel = 2 /* Full */; + project.pendingUpdateReason = loadReason; + this.delayUpdateProjectGraph(project); + } else { + project.resolutionCache.removeResolutionsFromProjectReferenceRedirects(this.toPath(canonicalConfigFilePath)); + this.delayUpdateProjectGraph(project); + } + }); + return scheduledAnyProjectUpdate; + } + /** @internal */ + onConfigFileChanged(canonicalConfigFilePath, eventKind) { + var _a; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (eventKind === 2 /* Deleted */) { + configFileExistenceInfo.exists = false; + const project = ((_a = configFileExistenceInfo.config) == null ? void 0 : _a.projects.has(canonicalConfigFilePath)) ? this.getConfiguredProjectByCanonicalConfigFilePath(canonicalConfigFilePath) : void 0; + if (project) + this.removeProject(project); + } else { + configFileExistenceInfo.exists = true; + } + this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, "Change in config file detected"); + this.reloadConfiguredProjectForFiles( + configFileExistenceInfo.openFilesImpactedByConfigFile, + /*clearSemanticCache*/ + false, + /*delayReload*/ + true, + eventKind !== 2 /* Deleted */ ? identity : ( + // Reload open files if they are root of inferred project + returnTrue + ), + // Reload all the open files impacted by config file + "Change in config file detected" + ); + this.delayEnsureProjectForOpenFiles(); + } + removeProject(project) { + this.logger.info("`remove Project::"); + project.print( + /*writeProjectFileNames*/ + true, + /*writeFileExplaination*/ + true, + /*writeFileVersionAndText*/ + false + ); + project.close(); + if (Debug.shouldAssert(1 /* Normal */)) { + this.filenameToScriptInfo.forEach( + (info) => Debug.assert( + !info.isAttached(project), + "Found script Info still attached to project", + () => `${project.projectName}: ScriptInfos still attached: ${JSON.stringify( + arrayFrom( + mapDefinedIterator( + this.filenameToScriptInfo.values(), + (info2) => info2.isAttached(project) ? { + fileName: info2.fileName, + projects: info2.containingProjects.map((p) => p.projectName), + hasMixedContent: info2.hasMixedContent + } : void 0 + ) + ), + /*replacer*/ + void 0, + " " + )}` + ) + ); + } + this.pendingProjectUpdates.delete(project.getProjectName()); + switch (project.projectKind) { + case 2 /* External */: + unorderedRemoveItem(this.externalProjects, project); + this.projectToSizeMap.delete(project.getProjectName()); + break; + case 1 /* Configured */: + this.configuredProjects.delete(project.canonicalConfigFilePath); + this.projectToSizeMap.delete(project.canonicalConfigFilePath); + break; + case 0 /* Inferred */: + unorderedRemoveItem(this.inferredProjects, project); + break; + } + } + /** @internal */ + assignOrphanScriptInfoToInferredProject(info, projectRootPath) { + Debug.assert(info.isOrphan()); + const project = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(info, projectRootPath) || this.getOrCreateSingleInferredProjectIfEnabled() || this.getOrCreateSingleInferredWithoutProjectRoot( + info.isDynamic ? projectRootPath || this.currentDirectory : getDirectoryPath( + isRootedDiskPath(info.fileName) ? info.fileName : getNormalizedAbsolutePath( + info.fileName, + projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory + ) + ) + ); + project.addRoot(info); + if (info.containingProjects[0] !== project) { + orderedRemoveItem(info.containingProjects, project); + info.containingProjects.unshift(project); + } + project.updateGraph(); + if (!this.useSingleInferredProject && !project.projectRootPath) { + for (const inferredProject of this.inferredProjects) { + if (inferredProject === project || inferredProject.isOrphan()) { + continue; + } + const roots = inferredProject.getRootScriptInfos(); + Debug.assert(roots.length === 1 || !!inferredProject.projectRootPath); + if (roots.length === 1 && forEach(roots[0].containingProjects, (p) => p !== roots[0].containingProjects[0] && !p.isOrphan())) { + inferredProject.removeFile( + roots[0], + /*fileExists*/ + true, + /*detachFromProject*/ + true + ); + } + } + } + return project; + } + assignOrphanScriptInfosToInferredProject() { + this.openFiles.forEach((projectRootPath, path) => { + const info = this.getScriptInfoForPath(path); + if (info.isOrphan()) { + this.assignOrphanScriptInfoToInferredProject(info, projectRootPath); + } + }); + } + /** + * Remove this file from the set of open, non-configured files. + * @param info The file that has been closed or newly configured + */ + closeOpenFile(info, skipAssignOrphanScriptInfosToInferredProject) { + const fileExists = info.isDynamic ? false : this.host.fileExists(info.fileName); + info.close(fileExists); + this.stopWatchingConfigFilesForClosedScriptInfo(info); + const canonicalFileName = this.toCanonicalFileName(info.fileName); + if (this.openFilesWithNonRootedDiskPath.get(canonicalFileName) === info) { + this.openFilesWithNonRootedDiskPath.delete(canonicalFileName); + } + let ensureProjectsForOpenFiles = false; + for (const p of info.containingProjects) { + if (isConfiguredProject(p)) { + if (info.hasMixedContent) { + info.registerFileUpdate(); + } + const updateLevel = p.openFileWatchTriggered.get(info.path); + if (updateLevel !== void 0) { + p.openFileWatchTriggered.delete(info.path); + if (p.pendingUpdateLevel !== void 0 && p.pendingUpdateLevel < updateLevel) { + p.pendingUpdateLevel = updateLevel; + p.markFileAsDirty(info.path); + } + } + } else if (isInferredProject(p) && p.isRoot(info)) { + if (p.isProjectWithSingleRoot()) { + ensureProjectsForOpenFiles = true; + } + p.removeFile( + info, + fileExists, + /*detachFromProject*/ + true + ); + } + if (!p.languageServiceEnabled) { + p.markAsDirty(); + } + } + this.openFiles.delete(info.path); + this.configFileForOpenFiles.delete(info.path); + if (!skipAssignOrphanScriptInfosToInferredProject && ensureProjectsForOpenFiles) { + this.assignOrphanScriptInfosToInferredProject(); + } + if (fileExists) { + this.watchClosedScriptInfo(info); + } else { + this.handleDeletedFile(info); + } + return ensureProjectsForOpenFiles; + } + deleteScriptInfo(info) { + this.filenameToScriptInfo.delete(info.path); + this.filenameToScriptInfoVersion.set(info.path, info.textStorage.version); + const realpath = info.getRealpathIfDifferent(); + if (realpath) { + this.realpathToScriptInfos.remove(realpath, info); + } + } + configFileExists(configFileName, canonicalConfigFilePath, info) { + var _a; + let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (configFileExistenceInfo) { + if (isOpenScriptInfo(info) && !((_a = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a.has(info.path))) { + (configFileExistenceInfo.openFilesImpactedByConfigFile || (configFileExistenceInfo.openFilesImpactedByConfigFile = /* @__PURE__ */ new Map())).set(info.path, false); + } + return configFileExistenceInfo.exists; + } + const exists = this.host.fileExists(configFileName); + let openFilesImpactedByConfigFile; + if (isOpenScriptInfo(info)) { + (openFilesImpactedByConfigFile || (openFilesImpactedByConfigFile = /* @__PURE__ */ new Map())).set(info.path, false); + } + configFileExistenceInfo = { exists, openFilesImpactedByConfigFile }; + this.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo); + return exists; + } + /** @internal */ + createConfigFileWatcherForParsedConfig(configFileName, canonicalConfigFilePath, forProject) { + var _a, _b; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo.watcher || configFileExistenceInfo.watcher === noopConfigFileWatcher) { + configFileExistenceInfo.watcher = this.watchFactory.watchFile( + configFileName, + (_fileName, eventKind) => this.onConfigFileChanged(canonicalConfigFilePath, eventKind), + 2e3 /* High */, + this.getWatchOptionsFromProjectWatchOptions((_b = (_a = configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config) == null ? void 0 : _a.parsedCommandLine) == null ? void 0 : _b.watchOptions), + WatchType.ConfigFile, + forProject + ); + } + const projects = configFileExistenceInfo.config.projects; + projects.set(forProject.canonicalConfigFilePath, projects.get(forProject.canonicalConfigFilePath) || false); + } + /** + * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project + */ + configFileExistenceImpactsRootOfInferredProject(configFileExistenceInfo) { + return configFileExistenceInfo.openFilesImpactedByConfigFile && forEachEntry(configFileExistenceInfo.openFilesImpactedByConfigFile, identity); + } + /** @internal */ + releaseParsedConfig(canonicalConfigFilePath, forProject) { + var _a, _b, _c; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!((_a = configFileExistenceInfo.config) == null ? void 0 : _a.projects.delete(forProject.canonicalConfigFilePath))) + return; + if ((_b = configFileExistenceInfo.config) == null ? void 0 : _b.projects.size) + return; + configFileExistenceInfo.config = void 0; + clearSharedExtendedConfigFileWatcher(canonicalConfigFilePath, this.sharedExtendedConfigFileWatchers); + Debug.checkDefined(configFileExistenceInfo.watcher); + if ((_c = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _c.size) { + if (this.configFileExistenceImpactsRootOfInferredProject(configFileExistenceInfo)) { + if (!canWatchDirectoryOrFile(getPathComponents(getDirectoryPath(canonicalConfigFilePath)))) { + configFileExistenceInfo.watcher.close(); + configFileExistenceInfo.watcher = noopConfigFileWatcher; + } + } else { + configFileExistenceInfo.watcher.close(); + configFileExistenceInfo.watcher = void 0; + } + } else { + configFileExistenceInfo.watcher.close(); + this.configFileExistenceInfoCache.delete(canonicalConfigFilePath); + } + } + /** + * Close the config file watcher in the cached ConfigFileExistenceInfo + * if there arent any open files that are root of inferred project and there is no parsed config held by any project + * + * @internal + */ + closeConfigFileWatcherOnReleaseOfOpenFile(configFileExistenceInfo) { + if (configFileExistenceInfo.watcher && !configFileExistenceInfo.config && !this.configFileExistenceImpactsRootOfInferredProject(configFileExistenceInfo)) { + configFileExistenceInfo.watcher.close(); + configFileExistenceInfo.watcher = void 0; + } + } + /** + * This is called on file close, so that we stop watching the config file for this script info + */ + stopWatchingConfigFilesForClosedScriptInfo(info) { + Debug.assert(!info.isScriptOpen()); + this.forEachConfigFileLocation(info, (canonicalConfigFilePath) => { + var _a, _b, _c; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (configFileExistenceInfo) { + const infoIsRootOfInferredProject = (_a = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a.get(info.path); + (_b = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _b.delete(info.path); + if (infoIsRootOfInferredProject) { + this.closeConfigFileWatcherOnReleaseOfOpenFile(configFileExistenceInfo); + } + if (!((_c = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _c.size) && !configFileExistenceInfo.config) { + Debug.assert(!configFileExistenceInfo.watcher); + this.configFileExistenceInfoCache.delete(canonicalConfigFilePath); + } + } + }); + } + /** + * This is called by inferred project whenever script info is added as a root + * + * @internal + */ + startWatchingConfigFilesForInferredProjectRoot(info) { + Debug.assert(info.isScriptOpen()); + this.forEachConfigFileLocation(info, (canonicalConfigFilePath, configFileName) => { + let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo) { + configFileExistenceInfo = { exists: this.host.fileExists(configFileName) }; + this.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo); + } + (configFileExistenceInfo.openFilesImpactedByConfigFile || (configFileExistenceInfo.openFilesImpactedByConfigFile = /* @__PURE__ */ new Map())).set(info.path, true); + configFileExistenceInfo.watcher || (configFileExistenceInfo.watcher = canWatchDirectoryOrFile(getPathComponents(getDirectoryPath(canonicalConfigFilePath))) ? this.watchFactory.watchFile( + configFileName, + (_filename, eventKind) => this.onConfigFileChanged(canonicalConfigFilePath, eventKind), + 2e3 /* High */, + this.hostConfiguration.watchOptions, + WatchType.ConfigFileForInferredRoot + ) : noopConfigFileWatcher); + }); + } + /** + * This is called by inferred project whenever root script info is removed from it + * + * @internal + */ + stopWatchingConfigFilesForInferredProjectRoot(info) { + this.forEachConfigFileLocation(info, (canonicalConfigFilePath) => { + var _a; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if ((_a = configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a.has(info.path)) { + Debug.assert(info.isScriptOpen()); + configFileExistenceInfo.openFilesImpactedByConfigFile.set(info.path, false); + this.closeConfigFileWatcherOnReleaseOfOpenFile(configFileExistenceInfo); + } + }); + } + /** + * This function tries to search for a tsconfig.json for the given file. + * This is different from the method the compiler uses because + * the compiler can assume it will always start searching in the + * current directory (the directory in which tsc was invoked). + * The server must start searching from the directory containing + * the newly opened file. + */ + forEachConfigFileLocation(info, action) { + if (this.serverMode !== 0 /* Semantic */) { + return void 0; + } + Debug.assert(!isOpenScriptInfo(info) || this.openFiles.has(info.path)); + const projectRootPath = this.openFiles.get(info.path); + const scriptInfo = Debug.checkDefined(this.getScriptInfo(info.path)); + if (scriptInfo.isDynamic) + return void 0; + let searchPath = asNormalizedPath(getDirectoryPath(info.fileName)); + const isSearchPathInProjectRoot = () => containsPath(projectRootPath, searchPath, this.currentDirectory, !this.host.useCaseSensitiveFileNames); + const anySearchPathOk = !projectRootPath || !isSearchPathInProjectRoot(); + let searchInDirectory = !isAncestorConfigFileInfo(info); + do { + if (searchInDirectory) { + const canonicalSearchPath = normalizedPathToPath(searchPath, this.currentDirectory, this.toCanonicalFileName); + const tsconfigFileName = asNormalizedPath(combinePaths(searchPath, "tsconfig.json")); + let result = action(combinePaths(canonicalSearchPath, "tsconfig.json"), tsconfigFileName); + if (result) + return tsconfigFileName; + const jsconfigFileName = asNormalizedPath(combinePaths(searchPath, "jsconfig.json")); + result = action(combinePaths(canonicalSearchPath, "jsconfig.json"), jsconfigFileName); + if (result) + return jsconfigFileName; + if (isNodeModulesDirectory(canonicalSearchPath)) { + break; + } + } + const parentPath = asNormalizedPath(getDirectoryPath(searchPath)); + if (parentPath === searchPath) + break; + searchPath = parentPath; + searchInDirectory = true; + } while (anySearchPathOk || isSearchPathInProjectRoot()); + return void 0; + } + /** @internal */ + findDefaultConfiguredProject(info) { + if (!info.isScriptOpen()) + return void 0; + const configFileName = this.getConfigFileNameForFile(info); + const project = configFileName && this.findConfiguredProjectByProjectName(configFileName); + return project && projectContainsInfoDirectly(project, info) ? project : project == null ? void 0 : project.getDefaultChildProjectFromProjectWithReferences(info); + } + /** + * This function tries to search for a tsconfig.json for the given file. + * This is different from the method the compiler uses because + * the compiler can assume it will always start searching in the + * current directory (the directory in which tsc was invoked). + * The server must start searching from the directory containing + * the newly opened file. + * If script info is passed in, it is asserted to be open script info + * otherwise just file name + */ + getConfigFileNameForFile(info) { + if (!isAncestorConfigFileInfo(info)) { + const result = this.configFileForOpenFiles.get(info.path); + if (result !== void 0) + return result || void 0; + } + this.logger.info(`Search path: ${getDirectoryPath(info.fileName)}`); + const configFileName = this.forEachConfigFileLocation(info, (canonicalConfigFilePath, configFileName2) => this.configFileExists(configFileName2, canonicalConfigFilePath, info)); + if (configFileName) { + this.logger.info(`For info: ${info.fileName} :: Config file name: ${configFileName}`); + } else { + this.logger.info(`For info: ${info.fileName} :: No config files found.`); + } + if (isOpenScriptInfo(info)) { + this.configFileForOpenFiles.set(info.path, configFileName || false); + } + return configFileName; + } + printProjects() { + if (!this.logger.hasLevel(1 /* normal */)) { + return; + } + this.logger.startGroup(); + this.externalProjects.forEach(printProjectWithoutFileNames); + this.configuredProjects.forEach(printProjectWithoutFileNames); + this.inferredProjects.forEach(printProjectWithoutFileNames); + this.logger.info("Open files: "); + this.openFiles.forEach((projectRootPath, path) => { + const info = this.getScriptInfoForPath(path); + this.logger.info(` FileName: ${info.fileName} ProjectRootPath: ${projectRootPath}`); + this.logger.info(` Projects: ${info.containingProjects.map((p) => p.getProjectName())}`); + }); + this.logger.endGroup(); + } + /** @internal */ + findConfiguredProjectByProjectName(configFileName) { + const canonicalConfigFilePath = asNormalizedPath(this.toCanonicalFileName(configFileName)); + return this.getConfiguredProjectByCanonicalConfigFilePath(canonicalConfigFilePath); + } + getConfiguredProjectByCanonicalConfigFilePath(canonicalConfigFilePath) { + return this.configuredProjects.get(canonicalConfigFilePath); + } + findExternalProjectByProjectName(projectFileName) { + return findProjectByName(projectFileName, this.externalProjects); + } + /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */ + getFilenameForExceededTotalSizeLimitForNonTsFiles(name, options, fileNames, propertyReader) { + if (options && options.disableSizeLimit || !this.host.getFileSize) { + return; + } + let availableSpace = maxProgramSizeForNonTsFiles; + this.projectToSizeMap.set(name, 0); + this.projectToSizeMap.forEach((val) => availableSpace -= val || 0); + let totalNonTsFileSize = 0; + for (const f of fileNames) { + const fileName = propertyReader.getFileName(f); + if (hasTSFileExtension(fileName)) { + continue; + } + totalNonTsFileSize += this.host.getFileSize(fileName); + if (totalNonTsFileSize > maxProgramSizeForNonTsFiles || totalNonTsFileSize > availableSpace) { + const top5LargestFiles = fileNames.map((f2) => propertyReader.getFileName(f2)).filter((name2) => !hasTSFileExtension(name2)).map((name2) => ({ name: name2, size: this.host.getFileSize(name2) })).sort((a, b) => b.size - a.size).slice(0, 5); + this.logger.info(`Non TS file size exceeded limit (${totalNonTsFileSize}). Largest files: ${top5LargestFiles.map((file) => `${file.name}:${file.size}`).join(", ")}`); + return fileName; + } + } + this.projectToSizeMap.set(name, totalNonTsFileSize); + } + createExternalProject(projectFileName, files, options, typeAcquisition, excludedFiles) { + const compilerOptions = convertCompilerOptions(options); + const watchOptionsAndErrors = convertWatchOptions(options, getDirectoryPath(normalizeSlashes(projectFileName))); + const project = new ExternalProject2( + projectFileName, + this, + this.documentRegistry, + compilerOptions, + /*lastFileExceededProgramSize*/ + this.getFilenameForExceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader), + options.compileOnSave === void 0 ? true : options.compileOnSave, + /*projectFilePath*/ + void 0, + watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions + ); + project.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors); + project.excludedFiles = excludedFiles; + this.addFilesToNonInferredProject(project, files, externalFilePropertyReader, typeAcquisition); + this.externalProjects.push(project); + return project; + } + /** @internal */ + sendProjectTelemetry(project) { + if (this.seenProjects.has(project.projectName)) { + setProjectOptionsUsed(project); + return; + } + this.seenProjects.set(project.projectName, true); + if (!this.eventHandler || !this.host.createSHA256Hash) { + setProjectOptionsUsed(project); + return; + } + const projectOptions = isConfiguredProject(project) ? project.projectOptions : void 0; + setProjectOptionsUsed(project); + const data = { + projectId: this.host.createSHA256Hash(project.projectName), + fileStats: countEachFileTypes( + project.getScriptInfos(), + /*includeSizes*/ + true + ), + compilerOptions: convertCompilerOptionsForTelemetry(project.getCompilationSettings()), + typeAcquisition: convertTypeAcquisition2(project.getTypeAcquisition()), + extends: projectOptions && projectOptions.configHasExtendsProperty, + files: projectOptions && projectOptions.configHasFilesProperty, + include: projectOptions && projectOptions.configHasIncludeProperty, + exclude: projectOptions && projectOptions.configHasExcludeProperty, + compileOnSave: project.compileOnSaveEnabled, + configFileName: configFileName(), + projectType: project instanceof ExternalProject2 ? "external" : "configured", + languageServiceEnabled: project.languageServiceEnabled, + version + }; + this.eventHandler({ eventName: ProjectInfoTelemetryEvent, data }); + function configFileName() { + if (!isConfiguredProject(project)) { + return "other"; + } + return getBaseConfigFileName(project.getConfigFilePath()) || "other"; + } + function convertTypeAcquisition2({ enable: enable2, include, exclude }) { + return { + enable: enable2, + include: include !== void 0 && include.length !== 0, + exclude: exclude !== void 0 && exclude.length !== 0 + }; + } + } + addFilesToNonInferredProject(project, files, propertyReader, typeAcquisition) { + this.updateNonInferredProjectFiles(project, files, propertyReader); + project.setTypeAcquisition(typeAcquisition); + project.markAsDirty(); + } + /** @internal */ + createConfiguredProject(configFileName) { + var _a; + (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.Session, "createConfiguredProject", { configFilePath: configFileName }); + this.logger.info(`Creating configuration project ${configFileName}`); + const canonicalConfigFilePath = asNormalizedPath(this.toCanonicalFileName(configFileName)); + let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo) { + this.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo = { exists: true }); + } else { + configFileExistenceInfo.exists = true; + } + if (!configFileExistenceInfo.config) { + configFileExistenceInfo.config = { + cachedDirectoryStructureHost: createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames), + projects: /* @__PURE__ */ new Map(), + updateLevel: 2 /* Full */ + }; + } + const project = new ConfiguredProject2( + configFileName, + canonicalConfigFilePath, + this, + this.documentRegistry, + configFileExistenceInfo.config.cachedDirectoryStructureHost + ); + this.configuredProjects.set(canonicalConfigFilePath, project); + this.createConfigFileWatcherForParsedConfig(configFileName, canonicalConfigFilePath, project); + return project; + } + /** @internal */ + createConfiguredProjectWithDelayLoad(configFileName, reason) { + const project = this.createConfiguredProject(configFileName); + project.pendingUpdateLevel = 2 /* Full */; + project.pendingUpdateReason = reason; + return project; + } + /** @internal */ + createAndLoadConfiguredProject(configFileName, reason) { + const project = this.createConfiguredProject(configFileName); + this.loadConfiguredProject(project, reason); + return project; + } + /** @internal */ + createLoadAndUpdateConfiguredProject(configFileName, reason) { + const project = this.createAndLoadConfiguredProject(configFileName, reason); + project.updateGraph(); + return project; + } + /** + * Read the config file of the project, and update the project root file names. + * + * @internal + */ + loadConfiguredProject(project, reason) { + var _a, _b; + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "loadConfiguredProject", { configFilePath: project.canonicalConfigFilePath }); + this.sendProjectLoadingStartEvent(project, reason); + const configFilename = asNormalizedPath(normalizePath(project.getConfigFilePath())); + const configFileExistenceInfo = this.ensureParsedConfigUptoDate( + configFilename, + project.canonicalConfigFilePath, + this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath), + project + ); + const parsedCommandLine = configFileExistenceInfo.config.parsedCommandLine; + Debug.assert(!!parsedCommandLine.fileNames); + const compilerOptions = parsedCommandLine.options; + if (!project.projectOptions) { + project.projectOptions = { + configHasExtendsProperty: parsedCommandLine.raw.extends !== void 0, + configHasFilesProperty: parsedCommandLine.raw.files !== void 0, + configHasIncludeProperty: parsedCommandLine.raw.include !== void 0, + configHasExcludeProperty: parsedCommandLine.raw.exclude !== void 0 + }; + } + project.canConfigFileJsonReportNoInputFiles = canJsonReportNoInputFiles(parsedCommandLine.raw); + project.setProjectErrors(parsedCommandLine.options.configFile.parseDiagnostics); + project.updateReferences(parsedCommandLine.projectReferences); + const lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(project.canonicalConfigFilePath, compilerOptions, parsedCommandLine.fileNames, fileNamePropertyReader); + if (lastFileExceededProgramSize) { + project.disableLanguageService(lastFileExceededProgramSize); + this.configFileExistenceInfoCache.forEach((_configFileExistenceInfo, canonicalConfigFilePath) => this.stopWatchingWildCards(canonicalConfigFilePath, project)); + } else { + project.setCompilerOptions(compilerOptions); + project.setWatchOptions(parsedCommandLine.watchOptions); + project.enableLanguageService(); + this.watchWildcards(configFilename, configFileExistenceInfo, project); + } + project.enablePluginsWithOptions(compilerOptions); + const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles(2 /* Full */)); + this.updateRootAndOptionsOfNonInferredProject(project, filesToAdd, fileNamePropertyReader, compilerOptions, parsedCommandLine.typeAcquisition, parsedCommandLine.compileOnSave, parsedCommandLine.watchOptions); + (_b = tracing) == null ? void 0 : _b.pop(); + } + /** @internal */ + ensureParsedConfigUptoDate(configFilename, canonicalConfigFilePath, configFileExistenceInfo, forProject) { + var _a, _b, _c; + if (configFileExistenceInfo.config) { + if (!configFileExistenceInfo.config.updateLevel) + return configFileExistenceInfo; + if (configFileExistenceInfo.config.updateLevel === 1 /* RootNamesAndUpdate */) { + this.reloadFileNamesOfParsedConfig(configFilename, configFileExistenceInfo.config); + return configFileExistenceInfo; + } + } + const cachedDirectoryStructureHost = ((_a = configFileExistenceInfo.config) == null ? void 0 : _a.cachedDirectoryStructureHost) || createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames); + const configFileContent = tryReadFile(configFilename, (fileName) => this.host.readFile(fileName)); + const configFile = parseJsonText(configFilename, isString(configFileContent) ? configFileContent : ""); + const configFileErrors = configFile.parseDiagnostics; + if (!isString(configFileContent)) + configFileErrors.push(configFileContent); + const parsedCommandLine = parseJsonSourceFileConfigFileContent( + configFile, + cachedDirectoryStructureHost, + getDirectoryPath(configFilename), + /*existingOptions*/ + {}, + configFilename, + /*resolutionStack*/ + [], + this.hostConfiguration.extraFileExtensions, + this.extendedConfigCache + ); + if (parsedCommandLine.errors.length) { + configFileErrors.push(...parsedCommandLine.errors); + } + this.logger.info(`Config: ${configFilename} : ${JSON.stringify( + { + rootNames: parsedCommandLine.fileNames, + options: parsedCommandLine.options, + watchOptions: parsedCommandLine.watchOptions, + projectReferences: parsedCommandLine.projectReferences + }, + /*replacer*/ + void 0, + " " + )}`); + const oldCommandLine = (_b = configFileExistenceInfo.config) == null ? void 0 : _b.parsedCommandLine; + if (!configFileExistenceInfo.config) { + configFileExistenceInfo.config = { parsedCommandLine, cachedDirectoryStructureHost, projects: /* @__PURE__ */ new Map() }; + } else { + configFileExistenceInfo.config.parsedCommandLine = parsedCommandLine; + configFileExistenceInfo.config.watchedDirectoriesStale = true; + configFileExistenceInfo.config.updateLevel = void 0; + } + if (!oldCommandLine && !isJsonEqual( + // Old options + this.getWatchOptionsFromProjectWatchOptions( + /*projectOptions*/ + void 0 + ), + // New options + this.getWatchOptionsFromProjectWatchOptions(parsedCommandLine.watchOptions) + )) { + (_c = configFileExistenceInfo.watcher) == null ? void 0 : _c.close(); + configFileExistenceInfo.watcher = void 0; + } + this.createConfigFileWatcherForParsedConfig(configFilename, canonicalConfigFilePath, forProject); + updateSharedExtendedConfigFileWatcher( + canonicalConfigFilePath, + parsedCommandLine.options, + this.sharedExtendedConfigFileWatchers, + (extendedConfigFileName, extendedConfigFilePath) => this.watchFactory.watchFile( + extendedConfigFileName, + () => { + var _a2; + cleanExtendedConfigCache(this.extendedConfigCache, extendedConfigFilePath, (fileName) => this.toPath(fileName)); + let ensureProjectsForOpenFiles = false; + (_a2 = this.sharedExtendedConfigFileWatchers.get(extendedConfigFilePath)) == null ? void 0 : _a2.projects.forEach((canonicalPath) => { + ensureProjectsForOpenFiles = this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalPath, `Change in extended config file ${extendedConfigFileName} detected`) || ensureProjectsForOpenFiles; + }); + if (ensureProjectsForOpenFiles) + this.delayEnsureProjectForOpenFiles(); + }, + 2e3 /* High */, + this.hostConfiguration.watchOptions, + WatchType.ExtendedConfigFile, + configFilename + ), + (fileName) => this.toPath(fileName) + ); + return configFileExistenceInfo; + } + /** @internal */ + watchWildcards(configFileName, { exists, config }, forProject) { + config.projects.set(forProject.canonicalConfigFilePath, true); + if (exists) { + if (config.watchedDirectories && !config.watchedDirectoriesStale) + return; + config.watchedDirectoriesStale = false; + updateWatchingWildcardDirectories( + config.watchedDirectories || (config.watchedDirectories = /* @__PURE__ */ new Map()), + config.parsedCommandLine.wildcardDirectories, + // Create new directory watcher + (directory, flags) => this.watchWildcardDirectory(directory, flags, configFileName, config) + ); + } else { + config.watchedDirectoriesStale = false; + if (!config.watchedDirectories) + return; + clearMap(config.watchedDirectories, closeFileWatcherOf); + config.watchedDirectories = void 0; + } + } + /** @internal */ + stopWatchingWildCards(canonicalConfigFilePath, forProject) { + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo.config || !configFileExistenceInfo.config.projects.get(forProject.canonicalConfigFilePath)) { + return; + } + configFileExistenceInfo.config.projects.set(forProject.canonicalConfigFilePath, false); + if (forEachEntry(configFileExistenceInfo.config.projects, identity)) + return; + if (configFileExistenceInfo.config.watchedDirectories) { + clearMap(configFileExistenceInfo.config.watchedDirectories, closeFileWatcherOf); + configFileExistenceInfo.config.watchedDirectories = void 0; + } + configFileExistenceInfo.config.watchedDirectoriesStale = void 0; + } + updateNonInferredProjectFiles(project, files, propertyReader) { + const projectRootFilesMap = project.getRootFilesMap(); + const newRootScriptInfoMap = /* @__PURE__ */ new Map(); + for (const f of files) { + const newRootFile = propertyReader.getFileName(f); + const fileName = toNormalizedPath(newRootFile); + const isDynamic = isDynamicFileName(fileName); + let path; + if (!isDynamic && !project.fileExists(newRootFile)) { + path = normalizedPathToPath(fileName, this.currentDirectory, this.toCanonicalFileName); + const existingValue = projectRootFilesMap.get(path); + if (existingValue) { + if (existingValue.info) { + project.removeFile( + existingValue.info, + /*fileExists*/ + false, + /*detachFromProject*/ + true + ); + existingValue.info = void 0; + } + existingValue.fileName = fileName; + } else { + projectRootFilesMap.set(path, { fileName }); + } + } else { + const scriptKind = propertyReader.getScriptKind(f, this.hostConfiguration.extraFileExtensions); + const hasMixedContent = propertyReader.hasMixedContent(f, this.hostConfiguration.extraFileExtensions); + const scriptInfo = Debug.checkDefined(this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath( + fileName, + project.currentDirectory, + scriptKind, + hasMixedContent, + project.directoryStructureHost + )); + path = scriptInfo.path; + const existingValue = projectRootFilesMap.get(path); + if (!existingValue || existingValue.info !== scriptInfo) { + project.addRoot(scriptInfo, fileName); + if (scriptInfo.isScriptOpen()) { + this.removeRootOfInferredProjectIfNowPartOfOtherProject(scriptInfo); + } + } else { + existingValue.fileName = fileName; + } + } + newRootScriptInfoMap.set(path, true); + } + if (projectRootFilesMap.size > newRootScriptInfoMap.size) { + projectRootFilesMap.forEach((value, path) => { + if (!newRootScriptInfoMap.has(path)) { + if (value.info) { + project.removeFile( + value.info, + project.fileExists(value.info.fileName), + /*detachFromProject*/ + true + ); + } else { + projectRootFilesMap.delete(path); + } + } + }); + } + } + updateRootAndOptionsOfNonInferredProject(project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, watchOptions) { + project.setCompilerOptions(newOptions); + project.setWatchOptions(watchOptions); + if (compileOnSave !== void 0) { + project.compileOnSaveEnabled = compileOnSave; + } + this.addFilesToNonInferredProject(project, newUncheckedFiles, propertyReader, newTypeAcquisition); + } + /** + * Reload the file names from config file specs and update the project graph + * + * @internal + */ + reloadFileNamesOfConfiguredProject(project) { + const fileNames = this.reloadFileNamesOfParsedConfig(project.getConfigFilePath(), this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath).config); + project.updateErrorOnNoInputFiles(fileNames); + this.updateNonInferredProjectFiles(project, fileNames.concat(project.getExternalFiles(1 /* RootNamesAndUpdate */)), fileNamePropertyReader); + project.markAsDirty(); + return project.updateGraph(); + } + /** @internal */ + reloadFileNamesOfParsedConfig(configFileName, config) { + if (config.updateLevel === void 0) + return config.parsedCommandLine.fileNames; + Debug.assert(config.updateLevel === 1 /* RootNamesAndUpdate */); + const configFileSpecs = config.parsedCommandLine.options.configFile.configFileSpecs; + const fileNames = getFileNamesFromConfigSpecs( + configFileSpecs, + getDirectoryPath(configFileName), + config.parsedCommandLine.options, + config.cachedDirectoryStructureHost, + this.hostConfiguration.extraFileExtensions + ); + config.parsedCommandLine = { ...config.parsedCommandLine, fileNames }; + return fileNames; + } + /** @internal */ + setFileNamesOfAutpImportProviderOrAuxillaryProject(project, fileNames) { + this.updateNonInferredProjectFiles(project, fileNames, fileNamePropertyReader); + } + /** + * Read the config file of the project again by clearing the cache and update the project graph + * + * @internal + */ + reloadConfiguredProject(project, reason, isInitialLoad, clearSemanticCache) { + const host = project.getCachedDirectoryStructureHost(); + if (clearSemanticCache) + this.clearSemanticCache(project); + host.clearCache(); + const configFileName = project.getConfigFilePath(); + this.logger.info(`${isInitialLoad ? "Loading" : "Reloading"} configured project ${configFileName}`); + this.loadConfiguredProject(project, reason); + project.updateGraph(); + this.sendConfigFileDiagEvent(project, configFileName); + } + /** @internal */ + clearSemanticCache(project) { + project.resolutionCache.clear(); + project.getLanguageService( + /*ensureSynchronized*/ + false + ).cleanupSemanticCache(); + project.cleanupProgram(); + project.markAsDirty(); + } + sendConfigFileDiagEvent(project, triggerFile) { + if (!this.eventHandler || this.suppressDiagnosticEvents) { + return; + } + const diagnostics = project.getLanguageService().getCompilerOptionsDiagnostics(); + diagnostics.push(...project.getAllProjectErrors()); + this.eventHandler( + { + eventName: ConfigFileDiagEvent, + data: { configFileName: project.getConfigFilePath(), diagnostics, triggerFile } + } + ); + } + getOrCreateInferredProjectForProjectRootPathIfEnabled(info, projectRootPath) { + if (!this.useInferredProjectPerProjectRoot || // Its a dynamic info opened without project root + info.isDynamic && projectRootPath === void 0) { + return void 0; + } + if (projectRootPath) { + const canonicalProjectRootPath = this.toCanonicalFileName(projectRootPath); + for (const project of this.inferredProjects) { + if (project.projectRootPath === canonicalProjectRootPath) { + return project; + } + } + return this.createInferredProject( + projectRootPath, + /*isSingleInferredProject*/ + false, + projectRootPath + ); + } + let bestMatch; + for (const project of this.inferredProjects) { + if (!project.projectRootPath) + continue; + if (!containsPath(project.projectRootPath, info.path, this.host.getCurrentDirectory(), !this.host.useCaseSensitiveFileNames)) + continue; + if (bestMatch && bestMatch.projectRootPath.length > project.projectRootPath.length) + continue; + bestMatch = project; + } + return bestMatch; + } + getOrCreateSingleInferredProjectIfEnabled() { + if (!this.useSingleInferredProject) { + return void 0; + } + if (this.inferredProjects.length > 0 && this.inferredProjects[0].projectRootPath === void 0) { + return this.inferredProjects[0]; + } + return this.createInferredProject( + "", + /*isSingleInferredProject*/ + true + ); + } + getOrCreateSingleInferredWithoutProjectRoot(currentDirectory) { + Debug.assert(!this.useSingleInferredProject); + const expectedCurrentDirectory = this.toCanonicalFileName(this.getNormalizedAbsolutePath(currentDirectory)); + for (const inferredProject of this.inferredProjects) { + if (!inferredProject.projectRootPath && inferredProject.isOrphan() && inferredProject.canonicalCurrentDirectory === expectedCurrentDirectory) { + return inferredProject; + } + } + return this.createInferredProject(currentDirectory); + } + createInferredProject(currentDirectory, isSingleInferredProject, projectRootPath) { + const compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; + let watchOptionsAndErrors; + let typeAcquisition; + if (projectRootPath) { + watchOptionsAndErrors = this.watchOptionsForInferredProjectsPerProjectRoot.get(projectRootPath); + typeAcquisition = this.typeAcquisitionForInferredProjectsPerProjectRoot.get(projectRootPath); + } + if (watchOptionsAndErrors === void 0) { + watchOptionsAndErrors = this.watchOptionsForInferredProjects; + } + if (typeAcquisition === void 0) { + typeAcquisition = this.typeAcquisitionForInferredProjects; + } + watchOptionsAndErrors = watchOptionsAndErrors || void 0; + const project = new InferredProject2(this, this.documentRegistry, compilerOptions, watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions, projectRootPath, currentDirectory, typeAcquisition); + project.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors); + if (isSingleInferredProject) { + this.inferredProjects.unshift(project); + } else { + this.inferredProjects.push(project); + } + return project; + } + /** @internal */ + getOrCreateScriptInfoNotOpenedByClient(uncheckedFileName, currentDirectory, hostToQueryFileExistsOn) { + return this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath( + toNormalizedPath(uncheckedFileName), + currentDirectory, + /*scriptKind*/ + void 0, + /*hasMixedContent*/ + void 0, + hostToQueryFileExistsOn + ); + } + getScriptInfo(uncheckedFileName) { + return this.getScriptInfoForNormalizedPath(toNormalizedPath(uncheckedFileName)); + } + /** @internal */ + getScriptInfoOrConfig(uncheckedFileName) { + const path = toNormalizedPath(uncheckedFileName); + const info = this.getScriptInfoForNormalizedPath(path); + if (info) + return info; + const configProject = this.configuredProjects.get(this.toPath(uncheckedFileName)); + return configProject && configProject.getCompilerOptions().configFile; + } + /** @internal */ + logErrorForScriptInfoNotFound(fileName) { + const names = arrayFrom(this.filenameToScriptInfo.entries(), ([path, scriptInfo]) => ({ path, fileName: scriptInfo.fileName })); + this.logger.msg(`Could not find file ${JSON.stringify(fileName)}. +All files are: ${JSON.stringify(names)}`, "Err" /* Err */); + } + /** + * Returns the projects that contain script info through SymLink + * Note that this does not return projects in info.containingProjects + * + * @internal + */ + getSymlinkedProjects(info) { + let projects; + if (this.realpathToScriptInfos) { + const realpath = info.getRealpathIfDifferent(); + if (realpath) { + forEach(this.realpathToScriptInfos.get(realpath), combineProjects); + } + forEach(this.realpathToScriptInfos.get(info.path), combineProjects); + } + return projects; + function combineProjects(toAddInfo) { + if (toAddInfo !== info) { + for (const project of toAddInfo.containingProjects) { + if (project.languageServiceEnabled && !project.isOrphan() && !project.getCompilerOptions().preserveSymlinks && !info.isAttached(project)) { + if (!projects) { + projects = createMultiMap(); + projects.add(toAddInfo.path, project); + } else if (!forEachEntry(projects, (projs, path) => path === toAddInfo.path ? false : contains(projs, project))) { + projects.add(toAddInfo.path, project); + } + } + } + } + } + } + watchClosedScriptInfo(info) { + Debug.assert(!info.fileWatcher); + if (!info.isDynamicOrHasMixedContent() && (!this.globalCacheLocationDirectoryPath || !startsWith(info.path, this.globalCacheLocationDirectoryPath))) { + const indexOfNodeModules = info.fileName.indexOf("/node_modules/"); + if (!this.host.getModifiedTime || indexOfNodeModules === -1) { + info.fileWatcher = this.watchFactory.watchFile( + info.fileName, + (_fileName, eventKind) => this.onSourceFileChanged(info, eventKind), + 500 /* Medium */, + this.hostConfiguration.watchOptions, + WatchType.ClosedScriptInfo + ); + } else { + info.mTime = this.getModifiedTime(info); + info.fileWatcher = this.watchClosedScriptInfoInNodeModules(info.fileName.substring(0, indexOfNodeModules)); + } + } + } + createNodeModulesWatcher(dir, dirPath) { + let watcher = this.watchFactory.watchDirectory( + dir, + (fileOrDirectory) => { + var _a; + const fileOrDirectoryPath = removeIgnoredPath(this.toPath(fileOrDirectory)); + if (!fileOrDirectoryPath) + return; + const basename = getBaseFileName(fileOrDirectoryPath); + if (((_a = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.size) && (basename === "package.json" || basename === "node_modules")) { + result.affectedModuleSpecifierCacheProjects.forEach((project) => { + var _a2; + (_a2 = project.getModuleSpecifierCache()) == null ? void 0 : _a2.clear(); + }); + } + if (result.refreshScriptInfoRefCount) { + if (dirPath === fileOrDirectoryPath) { + this.refreshScriptInfosInDirectory(dirPath); + } else { + const info = this.getScriptInfoForPath(fileOrDirectoryPath); + if (info) { + if (isScriptInfoWatchedFromNodeModules(info)) { + this.refreshScriptInfo(info); + } + } else if (!hasExtension(fileOrDirectoryPath)) { + this.refreshScriptInfosInDirectory(fileOrDirectoryPath); + } + } + } + }, + 1 /* Recursive */, + this.hostConfiguration.watchOptions, + WatchType.NodeModules + ); + const result = { + refreshScriptInfoRefCount: 0, + affectedModuleSpecifierCacheProjects: void 0, + close: () => { + var _a; + if (watcher && !result.refreshScriptInfoRefCount && !((_a = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.size)) { + watcher.close(); + watcher = void 0; + this.nodeModulesWatchers.delete(dirPath); + } + } + }; + this.nodeModulesWatchers.set(dirPath, result); + return result; + } + /** @internal */ + watchPackageJsonsInNodeModules(dir, project) { + 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 _a2; + (_a2 = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a2.delete(project); + watcher.close(); + } + }; + } + watchClosedScriptInfoInNodeModules(dir) { + const watchDir = dir + "/node_modules"; + const watchDirPath = this.toPath(watchDir); + const watcher = this.nodeModulesWatchers.get(watchDirPath) || this.createNodeModulesWatcher(watchDir, watchDirPath); + watcher.refreshScriptInfoRefCount++; + return { + close: () => { + watcher.refreshScriptInfoRefCount--; + watcher.close(); + } + }; + } + getModifiedTime(info) { + return (this.host.getModifiedTime(info.fileName) || missingFileModifiedTime).getTime(); + } + refreshScriptInfo(info) { + const mTime = this.getModifiedTime(info); + if (mTime !== info.mTime) { + const eventKind = getFileWatcherEventKind(info.mTime, mTime); + info.mTime = mTime; + this.onSourceFileChanged(info, eventKind); + } + } + refreshScriptInfosInDirectory(dir) { + dir = dir + directorySeparator; + this.filenameToScriptInfo.forEach((info) => { + if (isScriptInfoWatchedFromNodeModules(info) && startsWith(info.path, dir)) { + this.refreshScriptInfo(info); + } + }); + } + stopWatchingScriptInfo(info) { + if (info.fileWatcher) { + info.fileWatcher.close(); + info.fileWatcher = void 0; + } + } + getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(fileName, currentDirectory, scriptKind, hasMixedContent, hostToQueryFileExistsOn) { + if (isRootedDiskPath(fileName) || isDynamicFileName(fileName)) { + return this.getOrCreateScriptInfoWorker( + fileName, + currentDirectory, + /*openedByClient*/ + false, + /*fileContent*/ + void 0, + scriptKind, + hasMixedContent, + hostToQueryFileExistsOn + ); + } + const info = this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(fileName)); + if (info) { + return info; + } + return void 0; + } + getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName, currentDirectory, fileContent, scriptKind, hasMixedContent) { + return this.getOrCreateScriptInfoWorker( + fileName, + currentDirectory, + /*openedByClient*/ + true, + fileContent, + scriptKind, + hasMixedContent + ); + } + getOrCreateScriptInfoForNormalizedPath(fileName, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn) { + return this.getOrCreateScriptInfoWorker(fileName, this.currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn); + } + getOrCreateScriptInfoWorker(fileName, currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn) { + Debug.assert(fileContent === void 0 || openedByClient, "ScriptInfo needs to be opened by client to be able to set its user defined content"); + const path = normalizedPathToPath(fileName, currentDirectory, this.toCanonicalFileName); + let info = this.getScriptInfoForPath(path); + if (!info) { + const isDynamic = isDynamicFileName(fileName); + Debug.assert(isRootedDiskPath(fileName) || isDynamic || openedByClient, "", () => `${JSON.stringify({ fileName, currentDirectory, hostCurrentDirectory: this.currentDirectory, openKeys: arrayFrom(this.openFilesWithNonRootedDiskPath.keys()) })} +Script info with non-dynamic relative file name can only be open script info or in context of host currentDirectory`); + Debug.assert(!isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "", () => `${JSON.stringify({ fileName, currentDirectory, hostCurrentDirectory: this.currentDirectory, openKeys: arrayFrom(this.openFilesWithNonRootedDiskPath.keys()) })} +Open script files with non rooted disk path opened with current directory context cannot have same canonical names`); + Debug.assert(!isDynamic || this.currentDirectory === currentDirectory || this.useInferredProjectPerProjectRoot, "", () => `${JSON.stringify({ fileName, currentDirectory, hostCurrentDirectory: this.currentDirectory, openKeys: arrayFrom(this.openFilesWithNonRootedDiskPath.keys()) })} +Dynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath.`); + if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) { + return; + } + info = new ScriptInfo(this.host, fileName, scriptKind, !!hasMixedContent, path, this.filenameToScriptInfoVersion.get(path)); + this.filenameToScriptInfo.set(info.path, info); + this.filenameToScriptInfoVersion.delete(info.path); + if (!openedByClient) { + this.watchClosedScriptInfo(info); + } else if (!isRootedDiskPath(fileName) && (!isDynamic || this.currentDirectory !== currentDirectory)) { + this.openFilesWithNonRootedDiskPath.set(this.toCanonicalFileName(fileName), info); + } + } + if (openedByClient) { + this.stopWatchingScriptInfo(info); + info.open(fileContent); + if (hasMixedContent) { + info.registerFileUpdate(); + } + } + return info; + } + /** + * This gets the script info for the normalized path. If the path is not rooted disk path then the open script info with project root context is preferred + */ + getScriptInfoForNormalizedPath(fileName) { + return !isRootedDiskPath(fileName) && this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(fileName)) || this.getScriptInfoForPath(normalizedPathToPath(fileName, this.currentDirectory, this.toCanonicalFileName)); + } + getScriptInfoForPath(fileName) { + return this.filenameToScriptInfo.get(fileName); + } + /** @internal */ + getDocumentPositionMapper(project, generatedFileName, sourceFileName) { + const declarationInfo = this.getOrCreateScriptInfoNotOpenedByClient(generatedFileName, project.currentDirectory, this.host); + if (!declarationInfo) { + if (sourceFileName) { + project.addGeneratedFileWatch(generatedFileName, sourceFileName); + } + return void 0; + } + declarationInfo.getSnapshot(); + if (isString(declarationInfo.sourceMapFilePath)) { + const sourceMapFileInfo2 = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); + if (sourceMapFileInfo2) { + sourceMapFileInfo2.getSnapshot(); + if (sourceMapFileInfo2.documentPositionMapper !== void 0) { + sourceMapFileInfo2.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, sourceMapFileInfo2.sourceInfos); + return sourceMapFileInfo2.documentPositionMapper ? sourceMapFileInfo2.documentPositionMapper : void 0; + } + } + declarationInfo.sourceMapFilePath = void 0; + } else if (declarationInfo.sourceMapFilePath) { + declarationInfo.sourceMapFilePath.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, declarationInfo.sourceMapFilePath.sourceInfos); + return void 0; + } else if (declarationInfo.sourceMapFilePath !== void 0) { + return void 0; + } + let sourceMapFileInfo; + let mapFileNameFromDeclarationInfo; + let readMapFile = (mapFileName, mapFileNameFromDts) => { + const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(mapFileName, project.currentDirectory, this.host); + if (!mapInfo) { + mapFileNameFromDeclarationInfo = mapFileNameFromDts; + return void 0; + } + sourceMapFileInfo = mapInfo; + const snap = mapInfo.getSnapshot(); + if (mapInfo.documentPositionMapper !== void 0) + return mapInfo.documentPositionMapper; + return getSnapshotText(snap); + }; + const projectName = project.projectName; + const documentPositionMapper = getDocumentPositionMapper( + { getCanonicalFileName: this.toCanonicalFileName, log: (s) => this.logger.info(s), getSourceFileLike: (f) => this.getSourceFileLike(f, projectName, declarationInfo) }, + declarationInfo.fileName, + declarationInfo.textStorage.getLineInfo(), + readMapFile + ); + readMapFile = void 0; + if (sourceMapFileInfo) { + declarationInfo.sourceMapFilePath = sourceMapFileInfo.path; + sourceMapFileInfo.declarationInfoPath = declarationInfo.path; + sourceMapFileInfo.documentPositionMapper = documentPositionMapper || false; + sourceMapFileInfo.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, sourceMapFileInfo.sourceInfos); + } else if (mapFileNameFromDeclarationInfo) { + declarationInfo.sourceMapFilePath = { + watcher: this.addMissingSourceMapFile( + project.currentDirectory === this.currentDirectory ? mapFileNameFromDeclarationInfo : getNormalizedAbsolutePath(mapFileNameFromDeclarationInfo, project.currentDirectory), + declarationInfo.path + ), + sourceInfos: this.addSourceInfoToSourceMap(sourceFileName, project) + }; + } else { + declarationInfo.sourceMapFilePath = false; + } + return documentPositionMapper; + } + addSourceInfoToSourceMap(sourceFileName, project, sourceInfos) { + if (sourceFileName) { + const sourceInfo = this.getOrCreateScriptInfoNotOpenedByClient(sourceFileName, project.currentDirectory, project.directoryStructureHost); + (sourceInfos || (sourceInfos = /* @__PURE__ */ new Set())).add(sourceInfo.path); + } + return sourceInfos; + } + addMissingSourceMapFile(mapFileName, declarationInfoPath) { + const fileWatcher = this.watchFactory.watchFile( + mapFileName, + () => { + const declarationInfo = this.getScriptInfoForPath(declarationInfoPath); + if (declarationInfo && declarationInfo.sourceMapFilePath && !isString(declarationInfo.sourceMapFilePath)) { + this.delayUpdateProjectGraphs( + declarationInfo.containingProjects, + /*clearSourceMapperCache*/ + true + ); + this.delayUpdateSourceInfoProjects(declarationInfo.sourceMapFilePath.sourceInfos); + declarationInfo.closeSourceMapFileWatcher(); + } + }, + 2e3 /* High */, + this.hostConfiguration.watchOptions, + WatchType.MissingSourceMapFile + ); + return fileWatcher; + } + /** @internal */ + getSourceFileLike(fileName, projectNameOrProject, declarationInfo) { + const project = projectNameOrProject.projectName ? projectNameOrProject : this.findProject(projectNameOrProject); + if (project) { + const path = project.toPath(fileName); + const sourceFile = project.getSourceFile(path); + if (sourceFile && sourceFile.resolvedPath === path) + return sourceFile; + } + const info = this.getOrCreateScriptInfoNotOpenedByClient(fileName, (project || this).currentDirectory, project ? project.directoryStructureHost : this.host); + if (!info) + return void 0; + if (declarationInfo && isString(declarationInfo.sourceMapFilePath) && info !== declarationInfo) { + const sourceMapInfo = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); + if (sourceMapInfo) { + (sourceMapInfo.sourceInfos || (sourceMapInfo.sourceInfos = /* @__PURE__ */ new Set())).add(info.path); + } + } + if (info.cacheSourceFile) + return info.cacheSourceFile.sourceFile; + if (!info.sourceFileLike) { + info.sourceFileLike = { + get text() { + Debug.fail("shouldnt need text"); + return ""; + }, + getLineAndCharacterOfPosition: (pos) => { + const lineOffset = info.positionToLineOffset(pos); + return { line: lineOffset.line - 1, character: lineOffset.offset - 1 }; + }, + getPositionOfLineAndCharacter: (line, character, allowEdits) => info.lineOffsetToPosition(line + 1, character + 1, allowEdits) + }; + } + return info.sourceFileLike; + } + /** @internal */ + setPerformanceEventHandler(performanceEventHandler) { + this.performanceEventHandler = performanceEventHandler; + } + setHostConfiguration(args) { + var _a; + if (args.file) { + const info = this.getScriptInfoForNormalizedPath(toNormalizedPath(args.file)); + if (info) { + info.setOptions(convertFormatOptions(args.formatOptions), args.preferences); + this.logger.info(`Host configuration update for file ${args.file}`); + } + } else { + if (args.hostInfo !== void 0) { + this.hostConfiguration.hostInfo = args.hostInfo; + this.logger.info(`Host information ${args.hostInfo}`); + } + if (args.formatOptions) { + this.hostConfiguration.formatCodeOptions = { ...this.hostConfiguration.formatCodeOptions, ...convertFormatOptions(args.formatOptions) }; + this.logger.info("Format host information updated"); + } + if (args.preferences) { + const { + lazyConfiguredProjectsFromExternalProject, + includePackageJsonAutoImports + } = this.hostConfiguration.preferences; + this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences }; + if (lazyConfiguredProjectsFromExternalProject && !this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject) { + 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.forEachProject((project) => { + project.onAutoImportProviderSettingsChanged(); + }); + } + } + if (args.extraFileExtensions) { + this.hostConfiguration.extraFileExtensions = args.extraFileExtensions; + this.reloadProjects(); + this.logger.info("Host file extension mappings updated"); + } + 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.`); + } + } + } + /** @internal */ + getWatchOptions(project) { + return this.getWatchOptionsFromProjectWatchOptions(project.getWatchOptions()); + } + /** @internal */ + getWatchOptionsFromProjectWatchOptions(projectOptions) { + return projectOptions && this.hostConfiguration.watchOptions ? { ...this.hostConfiguration.watchOptions, ...projectOptions } : projectOptions || this.hostConfiguration.watchOptions; + } + closeLog() { + this.logger.close(); + } + /** + * This function rebuilds the project for every file opened by the client + * This does not reload contents of open files from disk. But we could do that if needed + */ + reloadProjects() { + this.logger.info("reload projects."); + this.filenameToScriptInfo.forEach((info) => { + if (this.openFiles.has(info.path)) + return; + if (!info.fileWatcher) + return; + this.onSourceFileChanged(info, this.host.fileExists(info.fileName) ? 1 /* Changed */ : 2 /* Deleted */); + }); + this.pendingProjectUpdates.forEach((_project, projectName) => { + this.throttledOperations.cancel(projectName); + this.pendingProjectUpdates.delete(projectName); + }); + this.throttledOperations.cancel(ensureProjectForOpenFileSchedule); + this.pendingEnsureProjectForOpenFiles = false; + this.configFileExistenceInfoCache.forEach((info) => { + if (info.config) + info.config.updateLevel = 2 /* Full */; + }); + this.reloadConfiguredProjectForFiles( + this.openFiles, + /*clearSemanticCache*/ + true, + /*delayReload*/ + false, + returnTrue, + "User requested reload projects" + ); + this.externalProjects.forEach((project) => { + this.clearSemanticCache(project); + project.updateGraph(); + }); + 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. + * If the config file is found and it refers to existing project, it reloads it either immediately + * or schedules it for reload depending on delayReload option + * If there is no existing project it just opens the configured project for the config file + * reloadForInfo provides a way to filter out files to reload configured project for + */ + reloadConfiguredProjectForFiles(openFiles, clearSemanticCache, delayReload, shouldReloadProjectFor, reason) { + const updatedProjects = /* @__PURE__ */ new Map(); + const reloadChildProject = (child) => { + if (!updatedProjects.has(child.canonicalConfigFilePath)) { + updatedProjects.set(child.canonicalConfigFilePath, true); + this.reloadConfiguredProject( + child, + reason, + /*isInitialLoad*/ + false, + clearSemanticCache + ); + } + }; + openFiles == null ? void 0 : openFiles.forEach((openFileValue, path) => { + this.configFileForOpenFiles.delete(path); + if (!shouldReloadProjectFor(openFileValue)) { + return; + } + const info = this.getScriptInfoForPath(path); + Debug.assert(info.isScriptOpen()); + const configFileName = this.getConfigFileNameForFile(info); + if (configFileName) { + const project = this.findConfiguredProjectByProjectName(configFileName) || this.createConfiguredProject(configFileName); + if (!updatedProjects.has(project.canonicalConfigFilePath)) { + updatedProjects.set(project.canonicalConfigFilePath, true); + if (delayReload) { + project.pendingUpdateLevel = 2 /* Full */; + project.pendingUpdateReason = reason; + if (clearSemanticCache) + this.clearSemanticCache(project); + this.delayUpdateProjectGraph(project); + } else { + this.reloadConfiguredProject( + project, + reason, + /*isInitialLoad*/ + false, + clearSemanticCache + ); + if (!projectContainsInfoDirectly(project, info)) { + const referencedProject = forEachResolvedProjectReferenceProject( + project, + info.path, + (child) => { + reloadChildProject(child); + return projectContainsInfoDirectly(child, info); + }, + 1 /* FindCreate */ + ); + if (referencedProject) { + forEachResolvedProjectReferenceProject( + project, + /*fileName*/ + void 0, + reloadChildProject, + 0 /* Find */ + ); + } + } + } + } + } + }); + } + /** + * Remove the root of inferred project if script info is part of another project + */ + removeRootOfInferredProjectIfNowPartOfOtherProject(info) { + Debug.assert(info.containingProjects.length > 0); + const firstProject = info.containingProjects[0]; + if (!firstProject.isOrphan() && isInferredProject(firstProject) && firstProject.isRoot(info) && forEach(info.containingProjects, (p) => p !== firstProject && !p.isOrphan())) { + firstProject.removeFile( + info, + /*fileExists*/ + true, + /*detachFromProject*/ + true + ); + } + } + /** + * This function is to update the project structure for every inferred project. + * It is called on the premise that all the configured projects are + * up to date. + * This will go through open files and assign them to inferred project if open file is not part of any other project + * After that all the inferred project graphs are updated + */ + ensureProjectForOpenFiles() { + this.logger.info("Before ensureProjectForOpenFiles:"); + this.printProjects(); + this.openFiles.forEach((projectRootPath, path) => { + const info = this.getScriptInfoForPath(path); + if (info.isOrphan()) { + this.assignOrphanScriptInfoToInferredProject(info, projectRootPath); + } else { + this.removeRootOfInferredProjectIfNowPartOfOtherProject(info); + } + }); + this.pendingEnsureProjectForOpenFiles = false; + this.inferredProjects.forEach(updateProjectIfDirty); + this.logger.info("After ensureProjectForOpenFiles:"); + this.printProjects(); + } + /** + * Open file whose contents is managed by the client + * @param filename is absolute pathname + * @param fileContent is a known version of the file content that is more up to date than the one on disk + */ + openClientFile(fileName, fileContent, scriptKind, projectRootPath) { + return this.openClientFileWithNormalizedPath( + toNormalizedPath(fileName), + fileContent, + scriptKind, + /*hasMixedContent*/ + false, + projectRootPath ? toNormalizedPath(projectRootPath) : void 0 + ); + } + /** @internal */ + getOriginalLocationEnsuringConfiguredProject(project, location) { + const isSourceOfProjectReferenceRedirect = project.isSourceOfProjectReferenceRedirect(location.fileName); + const originalLocation = isSourceOfProjectReferenceRedirect ? location : project.getSourceMapper().tryGetSourcePosition(location); + if (!originalLocation) + return void 0; + const { fileName } = originalLocation; + const scriptInfo = this.getScriptInfo(fileName); + if (!scriptInfo && !this.host.fileExists(fileName)) + return void 0; + const originalFileInfo = { fileName: toNormalizedPath(fileName), path: this.toPath(fileName) }; + const configFileName = this.getConfigFileNameForFile(originalFileInfo); + if (!configFileName) + return void 0; + let configuredProject = this.findConfiguredProjectByProjectName(configFileName); + if (!configuredProject) { + if (project.getCompilerOptions().disableReferencedProjectLoad) { + if (isSourceOfProjectReferenceRedirect) { + return location; + } + return (scriptInfo == null ? void 0 : scriptInfo.containingProjects.length) ? originalLocation : location; + } + configuredProject = this.createAndLoadConfiguredProject(configFileName, `Creating project for original file: ${originalFileInfo.fileName}${location !== originalLocation ? " for location: " + location.fileName : ""}`); + } + updateProjectIfDirty(configuredProject); + const projectContainsOriginalInfo = (project2) => { + const info = this.getScriptInfo(fileName); + return info && projectContainsInfoDirectly(project2, info); + }; + if (configuredProject.isSolution() || !projectContainsOriginalInfo(configuredProject)) { + configuredProject = forEachResolvedProjectReferenceProject( + configuredProject, + fileName, + (child) => { + updateProjectIfDirty(child); + return projectContainsOriginalInfo(child) ? child : void 0; + }, + 2 /* FindCreateLoad */, + `Creating project referenced in solution ${configuredProject.projectName} to find possible configured project for original file: ${originalFileInfo.fileName}${location !== originalLocation ? " for location: " + location.fileName : ""}` + ); + if (!configuredProject) + return void 0; + if (configuredProject === project) + return originalLocation; + } + addOriginalConfiguredProject(configuredProject); + const originalScriptInfo = this.getScriptInfo(fileName); + if (!originalScriptInfo || !originalScriptInfo.containingProjects.length) + return void 0; + originalScriptInfo.containingProjects.forEach((project2) => { + if (isConfiguredProject(project2)) { + addOriginalConfiguredProject(project2); + } + }); + return originalLocation; + function addOriginalConfiguredProject(originalProject) { + if (!project.originalConfiguredProjects) { + project.originalConfiguredProjects = /* @__PURE__ */ new Set(); + } + project.originalConfiguredProjects.add(originalProject.canonicalConfigFilePath); + } + } + /** @internal */ + fileExists(fileName) { + return !!this.getScriptInfoForNormalizedPath(fileName) || this.host.fileExists(fileName); + } + findExternalProjectContainingOpenScriptInfo(info) { + return find(this.externalProjects, (proj) => { + updateProjectIfDirty(proj); + return proj.containsScriptInfo(info); + }); + } + getOrCreateOpenScriptInfo(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) { + const info = this.getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName, projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory, fileContent, scriptKind, hasMixedContent); + this.openFiles.set(info.path, projectRootPath); + return info; + } + assignProjectToOpenedScriptInfo(info) { + let configFileName; + let configFileErrors; + let project = this.findExternalProjectContainingOpenScriptInfo(info); + let retainProjects; + let projectForConfigFileDiag; + let defaultConfigProjectIsCreated = false; + if (!project && this.serverMode === 0 /* Semantic */) { + configFileName = this.getConfigFileNameForFile(info); + if (configFileName) { + project = this.findConfiguredProjectByProjectName(configFileName); + if (!project) { + project = this.createLoadAndUpdateConfiguredProject(configFileName, `Creating possible configured project for ${info.fileName} to open`); + defaultConfigProjectIsCreated = true; + } else { + updateProjectIfDirty(project); + } + projectForConfigFileDiag = project.containsScriptInfo(info) ? project : void 0; + retainProjects = project; + if (!projectContainsInfoDirectly(project, info)) { + forEachResolvedProjectReferenceProject( + project, + info.path, + (child) => { + updateProjectIfDirty(child); + if (!isArray(retainProjects)) { + retainProjects = [project, child]; + } else { + retainProjects.push(child); + } + if (projectContainsInfoDirectly(child, info)) { + projectForConfigFileDiag = child; + return child; + } + if (!projectForConfigFileDiag && child.containsScriptInfo(info)) { + projectForConfigFileDiag = child; + } + }, + 2 /* FindCreateLoad */, + `Creating project referenced in solution ${project.projectName} to find possible configured project for ${info.fileName} to open` + ); + } + if (projectForConfigFileDiag) { + configFileName = projectForConfigFileDiag.getConfigFilePath(); + if (projectForConfigFileDiag !== project || defaultConfigProjectIsCreated) { + configFileErrors = projectForConfigFileDiag.getAllProjectErrors(); + this.sendConfigFileDiagEvent(projectForConfigFileDiag, info.fileName); + } + } else { + configFileName = void 0; + } + this.createAncestorProjects(info, project); + } + } + info.containingProjects.forEach(updateProjectIfDirty); + if (info.isOrphan()) { + if (isArray(retainProjects)) { + retainProjects.forEach((project2) => this.sendConfigFileDiagEvent(project2, info.fileName)); + } else if (retainProjects) { + this.sendConfigFileDiagEvent(retainProjects, info.fileName); + } + Debug.assert(this.openFiles.has(info.path)); + this.assignOrphanScriptInfoToInferredProject(info, this.openFiles.get(info.path)); + } + Debug.assert(!info.isOrphan()); + return { configFileName, configFileErrors, retainProjects }; + } + createAncestorProjects(info, project) { + if (!info.isAttached(project)) + return; + while (true) { + if (!project.isInitialLoadPending() && (!project.getCompilerOptions().composite || project.getCompilerOptions().disableSolutionSearching)) + return; + const configFileName = this.getConfigFileNameForFile({ + fileName: project.getConfigFilePath(), + path: info.path, + configFileInfo: true + }); + if (!configFileName) + return; + const ancestor = this.findConfiguredProjectByProjectName(configFileName) || this.createConfiguredProjectWithDelayLoad(configFileName, `Creating project possibly referencing default composite project ${project.getProjectName()} of open file ${info.fileName}`); + if (ancestor.isInitialLoadPending()) { + ancestor.setPotentialProjectReference(project.canonicalConfigFilePath); + } + project = ancestor; + } + } + /** @internal */ + loadAncestorProjectTree(forProjects) { + forProjects = forProjects || mapDefinedEntries( + this.configuredProjects, + (key, project) => !project.isInitialLoadPending() ? [key, true] : void 0 + ); + const seenProjects = /* @__PURE__ */ new Set(); + for (const project of arrayFrom(this.configuredProjects.values())) { + if (forEachPotentialProjectReference(project, (potentialRefPath) => forProjects.has(potentialRefPath))) { + updateProjectIfDirty(project); + } + this.ensureProjectChildren(project, forProjects, seenProjects); + } + } + ensureProjectChildren(project, forProjects, seenProjects) { + var _a; + if (!tryAddToSet(seenProjects, project.canonicalConfigFilePath)) + return; + if (project.getCompilerOptions().disableReferencedProjectLoad) + return; + const children = (_a = project.getCurrentProgram()) == null ? void 0 : _a.getResolvedProjectReferences(); + if (!children) + return; + for (const child of children) { + if (!child) + continue; + const referencedProject = forEachResolvedProjectReference(child.references, (ref) => forProjects.has(ref.sourceFile.path) ? ref : void 0); + if (!referencedProject) + continue; + const configFileName = toNormalizedPath(child.sourceFile.fileName); + const childProject = project.projectService.findConfiguredProjectByProjectName(configFileName) || project.projectService.createAndLoadConfiguredProject(configFileName, `Creating project referenced by : ${project.projectName} as it references project ${referencedProject.sourceFile.fileName}`); + updateProjectIfDirty(childProject); + this.ensureProjectChildren(childProject, forProjects, seenProjects); + } + } + cleanupAfterOpeningFile(toRetainConfigProjects) { + this.removeOrphanConfiguredProjects(toRetainConfigProjects); + for (const inferredProject of this.inferredProjects.slice()) { + if (inferredProject.isOrphan()) { + this.removeProject(inferredProject); + } + } + this.removeOrphanScriptInfos(); + } + openClientFileWithNormalizedPath(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) { + const info = this.getOrCreateOpenScriptInfo(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath); + const { retainProjects, ...result } = this.assignProjectToOpenedScriptInfo(info); + this.cleanupAfterOpeningFile(retainProjects); + this.telemetryOnOpenFile(info); + this.printProjects(); + return result; + } + removeOrphanConfiguredProjects(toRetainConfiguredProjects) { + const toRemoveConfiguredProjects = new Map(this.configuredProjects); + const markOriginalProjectsAsUsed = (project) => { + if (!project.isOrphan() && project.originalConfiguredProjects) { + project.originalConfiguredProjects.forEach( + (_value, configuredProjectPath) => { + const project2 = this.getConfiguredProjectByCanonicalConfigFilePath(configuredProjectPath); + return project2 && retainConfiguredProject(project2); + } + ); + } + }; + if (toRetainConfiguredProjects) { + if (isArray(toRetainConfiguredProjects)) { + toRetainConfiguredProjects.forEach(retainConfiguredProject); + } else { + retainConfiguredProject(toRetainConfiguredProjects); + } + } + this.inferredProjects.forEach(markOriginalProjectsAsUsed); + this.externalProjects.forEach(markOriginalProjectsAsUsed); + this.configuredProjects.forEach((project) => { + if (project.hasOpenRef()) { + retainConfiguredProject(project); + } else if (toRemoveConfiguredProjects.has(project.canonicalConfigFilePath)) { + forEachReferencedProject( + project, + (ref) => isRetained(ref) && retainConfiguredProject(project) + ); + } + }); + toRemoveConfiguredProjects.forEach((project) => this.removeProject(project)); + function isRetained(project) { + return project.hasOpenRef() || !toRemoveConfiguredProjects.has(project.canonicalConfigFilePath); + } + function retainConfiguredProject(project) { + if (toRemoveConfiguredProjects.delete(project.canonicalConfigFilePath)) { + markOriginalProjectsAsUsed(project); + forEachReferencedProject(project, retainConfiguredProject); + } + } + } + removeOrphanScriptInfos() { + const toRemoveScriptInfos = new Map(this.filenameToScriptInfo); + this.filenameToScriptInfo.forEach((info) => { + if (!info.isScriptOpen() && info.isOrphan() && !info.isContainedByBackgroundProject()) { + if (!info.sourceMapFilePath) + return; + let sourceInfos; + if (isString(info.sourceMapFilePath)) { + const sourceMapInfo = this.getScriptInfoForPath(info.sourceMapFilePath); + sourceInfos = sourceMapInfo && sourceMapInfo.sourceInfos; + } else { + sourceInfos = info.sourceMapFilePath.sourceInfos; + } + if (!sourceInfos) + return; + if (!forEachKey(sourceInfos, (path) => { + const info2 = this.getScriptInfoForPath(path); + return !!info2 && (info2.isScriptOpen() || !info2.isOrphan()); + })) { + return; + } + } + toRemoveScriptInfos.delete(info.path); + if (info.sourceMapFilePath) { + let sourceInfos; + if (isString(info.sourceMapFilePath)) { + toRemoveScriptInfos.delete(info.sourceMapFilePath); + const sourceMapInfo = this.getScriptInfoForPath(info.sourceMapFilePath); + sourceInfos = sourceMapInfo && sourceMapInfo.sourceInfos; + } else { + sourceInfos = info.sourceMapFilePath.sourceInfos; + } + if (sourceInfos) { + sourceInfos.forEach((_value, path) => toRemoveScriptInfos.delete(path)); + } + } + }); + toRemoveScriptInfos.forEach((info) => { + this.stopWatchingScriptInfo(info); + this.deleteScriptInfo(info); + info.closeSourceMapFileWatcher(); + }); + } + telemetryOnOpenFile(scriptInfo) { + if (this.serverMode !== 0 /* Semantic */ || !this.eventHandler || !scriptInfo.isJavaScript() || !addToSeen(this.allJsFilesForOpenFileTelemetry, scriptInfo.path)) { + return; + } + const project = this.ensureDefaultProjectForFile(scriptInfo); + if (!project.languageServiceEnabled) { + return; + } + const sourceFile = project.getSourceFile(scriptInfo.path); + const checkJs = !!sourceFile && !!sourceFile.checkJsDirective; + this.eventHandler({ eventName: OpenFileInfoTelemetryEvent, data: { info: { checkJs } } }); + } + closeClientFile(uncheckedFileName, skipAssignOrphanScriptInfosToInferredProject) { + const info = this.getScriptInfoForNormalizedPath(toNormalizedPath(uncheckedFileName)); + const result = info ? this.closeOpenFile(info, skipAssignOrphanScriptInfosToInferredProject) : false; + if (!skipAssignOrphanScriptInfosToInferredProject) { + this.printProjects(); + } + return result; + } + collectChanges(lastKnownProjectVersions, currentProjects, includeProjectReferenceRedirectInfo, result) { + for (const proj of currentProjects) { + const knownProject = find(lastKnownProjectVersions, (p) => p.projectName === proj.getProjectName()); + result.push(proj.getChangesSinceVersion(knownProject && knownProject.version, includeProjectReferenceRedirectInfo)); + } + } + /** @internal */ + synchronizeProjectList(knownProjects, includeProjectReferenceRedirectInfo) { + const files = []; + this.collectChanges(knownProjects, this.externalProjects, includeProjectReferenceRedirectInfo, files); + this.collectChanges(knownProjects, this.configuredProjects.values(), includeProjectReferenceRedirectInfo, files); + this.collectChanges(knownProjects, this.inferredProjects, includeProjectReferenceRedirectInfo, files); + return files; + } + /** @internal */ + applyChangesInOpenFiles(openFiles, changedFiles, closedFiles) { + let openScriptInfos; + let assignOrphanScriptInfosToInferredProject = false; + if (openFiles) { + for (const file of openFiles) { + const info = this.getOrCreateOpenScriptInfo( + toNormalizedPath(file.fileName), + file.content, + tryConvertScriptKindName(file.scriptKind), + file.hasMixedContent, + file.projectRootPath ? toNormalizedPath(file.projectRootPath) : void 0 + ); + (openScriptInfos || (openScriptInfos = [])).push(info); + } + } + if (changedFiles) { + for (const file of changedFiles) { + const scriptInfo = this.getScriptInfo(file.fileName); + Debug.assert(!!scriptInfo); + this.applyChangesToFile(scriptInfo, file.changes); + } + } + if (closedFiles) { + for (const file of closedFiles) { + assignOrphanScriptInfosToInferredProject = this.closeClientFile( + file, + /*skipAssignOrphanScriptInfosToInferredProject*/ + true + ) || assignOrphanScriptInfosToInferredProject; + } + } + let retainProjects; + if (openScriptInfos) { + retainProjects = flatMap(openScriptInfos, (info) => this.assignProjectToOpenedScriptInfo(info).retainProjects); + } + if (assignOrphanScriptInfosToInferredProject) { + this.assignOrphanScriptInfosToInferredProject(); + } + if (openScriptInfos) { + this.cleanupAfterOpeningFile(retainProjects); + openScriptInfos.forEach((info) => this.telemetryOnOpenFile(info)); + this.printProjects(); + } else if (length(closedFiles)) { + this.printProjects(); + } + } + /** @internal */ + applyChangesToFile(scriptInfo, changes) { + for (const change of changes) { + scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); + } + } + closeConfiguredProjectReferencedFromExternalProject(configuredProjects) { + configuredProjects == null ? void 0 : configuredProjects.forEach((configuredProject) => { + if (!configuredProject.isClosed()) { + configuredProject.deleteExternalProjectReference(); + if (!configuredProject.hasOpenRef()) + this.removeProject(configuredProject); + } + }); + } + closeExternalProject(uncheckedFileName, print) { + const fileName = toNormalizedPath(uncheckedFileName); + const configuredProjects = this.externalProjectToConfiguredProjectMap.get(fileName); + if (configuredProjects) { + this.closeConfiguredProjectReferencedFromExternalProject(configuredProjects); + this.externalProjectToConfiguredProjectMap.delete(fileName); + } else { + const externalProject = this.findExternalProjectByProjectName(uncheckedFileName); + if (externalProject) { + this.removeProject(externalProject); + } + } + if (print) + this.printProjects(); + } + openExternalProjects(projects) { + const projectsToClose = arrayToMap(this.externalProjects, (p) => p.getProjectName(), (_) => true); + forEachKey(this.externalProjectToConfiguredProjectMap, (externalProjectName) => { + projectsToClose.set(externalProjectName, true); + }); + for (const externalProject of projects) { + this.openExternalProject( + externalProject, + /*print*/ + false + ); + projectsToClose.delete(externalProject.projectFileName); + } + forEachKey(projectsToClose, (externalProjectName) => { + this.closeExternalProject( + externalProjectName, + /*print*/ + false + ); + }); + this.printProjects(); + } + static escapeFilenameForRegex(filename) { + return filename.replace(this.filenameEscapeRegexp, "\\$&"); + } + resetSafeList() { + this.safelist = defaultTypeSafeList; + } + applySafeList(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 void 0; + } + const typeAcqInclude = typeAcquisition.include || (typeAcquisition.include = []); + const excludeRules = []; + const normalizedNames = rootFiles.map((f) => normalizeSlashes(f.fileName)); + for (const name of Object.keys(this.safelist)) { + const rule2 = this.safelist[name]; + for (const root of normalizedNames) { + if (rule2.match.test(root)) { + this.logger.info(`Excluding files based on rule ${name} matching file '${root}'`); + if (rule2.types) { + for (const type of rule2.types) { + if (!typeAcqInclude.includes(type)) { + typeAcqInclude.push(type); + } + } + } + if (rule2.exclude) { + for (const exclude of rule2.exclude) { + const processedRule = root.replace(rule2.match, (...groups) => { + return exclude.map((groupNumberOrString) => { + if (typeof groupNumberOrString === "number") { + if (!isString(groups[groupNumberOrString])) { + this.logger.info(`Incorrect RegExp specification in safelist rule ${name} - not enough groups`); + return "\\*"; + } + return _ProjectService.escapeFilenameForRegex(groups[groupNumberOrString]); + } + return groupNumberOrString; + }).join(""); + }); + if (!excludeRules.includes(processedRule)) { + excludeRules.push(processedRule); + } + } + } else { + const escaped = _ProjectService.escapeFilenameForRegex(root); + if (!excludeRules.includes(escaped)) { + excludeRules.push(escaped); + } + } + } + } + } + const excludeRegexes = excludeRules.map((e) => new RegExp(e, "i")); + let filesToKeep; + let excludedFiles; + for (let i = 0; i < rootFiles.length; i++) { + if (excludeRegexes.some((re) => re.test(normalizedNames[i]))) { + addExcludedFile(i); + } else { + if (typeAcquisition.enable) { + const baseName = getBaseFileName(toFileNameLowerCase(normalizedNames[i])); + if (fileExtensionIs(baseName, "js")) { + const inferredTypingName = removeFileExtension(baseName); + const cleanedTypingName = removeMinAndVersionNumbers(inferredTypingName); + const typeName = this.legacySafelist.get(cleanedTypingName); + if (typeName !== void 0) { + this.logger.info(`Excluded '${normalizedNames[i]}' because it matched ${cleanedTypingName} from the legacy safelist`); + addExcludedFile(i); + if (!typeAcqInclude.includes(typeName)) { + typeAcqInclude.push(typeName); + } + continue; + } + } + } + if (/^.+[.-]min\.js$/.test(normalizedNames[i])) { + addExcludedFile(i); + } else { + filesToKeep == null ? void 0 : filesToKeep.push(rootFiles[i]); + } + } + } + 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]); + } + } + 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)) { + 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 (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, existingExternalProject.getCurrentDirectory()); + const lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, rootFiles, externalFilePropertyReader); + if (lastFileExceededProgramSize) { + existingExternalProject.disableLanguageService(lastFileExceededProgramSize); + } else { + existingExternalProject.enableLanguageService(); + } + 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 project = this.createExternalProject(proj.projectFileName, rootFiles, proj.options, typeAcquisition, excludedFiles); + project.updateGraph(); + } + } + this.closeConfiguredProjectReferencedFromExternalProject(existingConfiguredProjects); + if (print) + this.printProjects(); + } + hasDeferredExtension() { + for (const extension of this.hostConfiguration.extraFileExtensions) { + if (extension.scriptKind === 7 /* Deferred */) { + return true; + } + } + return false; + } + /** + * Performs the initial steps of enabling a plugin by finding and instantiating the module for a plugin either asynchronously or synchronously + * @internal + */ + requestEnablePlugin(project, pluginConfigEntry, searchPaths) { + if (!this.host.importPlugin && !this.host.require) { + this.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + this.logger.info(`Enabling plugin ${pluginConfigEntry.name} from candidate paths: ${searchPaths.join(",")}`); + if (!pluginConfigEntry.name || parsePackageName(pluginConfigEntry.name).rest) { + this.logger.info(`Skipped loading plugin ${pluginConfigEntry.name || JSON.stringify(pluginConfigEntry)} because only package name is allowed plugin name`); + return; + } + if (this.host.importPlugin) { + const importPromise = Project3.importServicePluginAsync( + pluginConfigEntry, + searchPaths, + this.host, + (s) => this.logger.info(s) + ); + this.pendingPluginEnablements ?? (this.pendingPluginEnablements = /* @__PURE__ */ new Map()); + let promises = this.pendingPluginEnablements.get(project); + if (!promises) + this.pendingPluginEnablements.set(project, promises = []); + promises.push(importPromise); + return; + } + this.endEnablePlugin( + project, + Project3.importServicePluginSync( + pluginConfigEntry, + searchPaths, + this.host, + (s) => this.logger.info(s) + ) + ); + } + /** + * Performs the remaining steps of enabling a plugin after its module has been instantiated. + * @internal + */ + endEnablePlugin(project, { pluginConfigEntry, resolvedModule, errorLogs }) { + var _a; + if (resolvedModule) { + const configurationOverride = (_a = this.currentPluginConfigOverrides) == null ? void 0 : _a.get(pluginConfigEntry.name); + if (configurationOverride) { + const pluginName = pluginConfigEntry.name; + pluginConfigEntry = configurationOverride; + pluginConfigEntry.name = pluginName; + } + project.enableProxy(resolvedModule, pluginConfigEntry); + } else { + forEach(errorLogs, (message) => this.logger.info(message)); + this.logger.info(`Couldn't find ${pluginConfigEntry.name}`); + } + } + /** @internal */ + hasNewPluginEnablementRequests() { + return !!this.pendingPluginEnablements; + } + /** @internal */ + hasPendingPluginEnablements() { + return !!this.currentPluginEnablementPromise; + } + /** + * Waits for any ongoing plugin enablement requests to complete. + * + * @internal + */ + async waitForPendingPlugins() { + while (this.currentPluginEnablementPromise) { + await this.currentPluginEnablementPromise; + } + } + /** + * Starts enabling any requested plugins without waiting for the result. + * + * @internal + */ + enableRequestedPlugins() { + if (this.pendingPluginEnablements) { + void this.enableRequestedPluginsAsync(); + } + } + async enableRequestedPluginsAsync() { + if (this.currentPluginEnablementPromise) { + await this.waitForPendingPlugins(); + } + if (!this.pendingPluginEnablements) { + return; + } + const entries = arrayFrom(this.pendingPluginEnablements.entries()); + this.pendingPluginEnablements = void 0; + this.currentPluginEnablementPromise = this.enableRequestedPluginsWorker(entries); + await this.currentPluginEnablementPromise; + } + async enableRequestedPluginsWorker(pendingPlugins) { + Debug.assert(this.currentPluginEnablementPromise === void 0); + await Promise.all(map(pendingPlugins, ([project, promises]) => this.enableRequestedPluginsForProjectAsync(project, promises))); + this.currentPluginEnablementPromise = void 0; + this.sendProjectsUpdatedInBackgroundEvent(); + } + async enableRequestedPluginsForProjectAsync(project, promises) { + const results = await Promise.all(promises); + if (project.isClosed()) { + return; + } + for (const result of results) { + this.endEnablePlugin(project, result); + } + this.delayUpdateProjectGraph(project); + } + configurePlugin(args) { + this.forEachEnabledProject((project) => project.onPluginConfigurationChanged(args.pluginName, args.configuration)); + this.currentPluginConfigOverrides = this.currentPluginConfigOverrides || /* @__PURE__ */ new Map(); + this.currentPluginConfigOverrides.set(args.pluginName, args.configuration); + } + /** @internal */ + getPackageJsonsVisibleToFile(fileName, project, rootDir) { + const packageJsonCache = this.packageJsonCache; + const rootPath = rootDir && this.toPath(rootDir); + const result = []; + const processDirectory = (directory) => { + switch (packageJsonCache.directoryHasPackageJson(directory)) { + case 3 /* Maybe */: + packageJsonCache.searchDirectoryAndAncestors(directory); + return processDirectory(directory); + case -1 /* True */: + const packageJsonFileName = combinePaths(directory, "package.json"); + this.watchPackageJsonFile(packageJsonFileName, this.toPath(packageJsonFileName), project); + const info = packageJsonCache.getInDirectory(directory); + if (info) + result.push(info); + } + if (rootPath && rootPath === directory) { + return true; + } + }; + forEachAncestorDirectory(getDirectoryPath(fileName), processDirectory); + return result; + } + /** @internal */ + getNearestAncestorDirectoryWithPackageJson(fileName) { + return forEachAncestorDirectory(fileName, (directory) => { + switch (this.packageJsonCache.directoryHasPackageJson(directory)) { + case -1 /* True */: + return directory; + case 0 /* False */: + return void 0; + case 3 /* Maybe */: + return this.host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0; + } + }); + } + /** @internal */ + 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(); + } + }, + 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 */ + onPackageJsonChange(result) { + result.projects.forEach((project) => { + var _a; + return (_a = project.onPackageJsonChange) == null ? void 0 : _a.call(project); + }); + } + /** @internal */ + includePackageJsonAutoImports() { + switch (this.hostConfiguration.preferences.includePackageJsonAutoImports) { + case "on": + return 1 /* On */; + case "off": + return 0 /* Off */; + default: + return 2 /* Auto */; + } + } + /** @internal */ + getIncompleteCompletionsCache() { + return this.incompleteCompletionsCache || (this.incompleteCompletionsCache = createIncompleteCompletionsCache()); + } + }; + /** Makes a filename safe to insert in a RegExp */ + _ProjectService.filenameEscapeRegexp = /[-/\\^$*+?.()|[\]{}]/g; + ProjectService3 = _ProjectService; + } + }); + + // src/server/moduleSpecifierCache.ts + function createModuleSpecifierCache(host) { + let containedNodeModulesWatchers; + let cache; + let currentKey; + const result = { + get(fromFileName, toFileName2, preferences, options) { + if (!cache || currentKey !== key(fromFileName, preferences, options)) + return void 0; + return cache.get(toFileName2); + }, + set(fromFileName, toFileName2, preferences, options, modulePaths, moduleSpecifiers) { + ensureCache(fromFileName, preferences, options).set(toFileName2, createInfo( + modulePaths, + moduleSpecifiers, + /*isBlockedByPackageJsonDependencies*/ + false + )); + if (moduleSpecifiers) { + for (const p of modulePaths) { + if (p.isInNodeModules) { + const nodeModulesPath = p.path.substring(0, p.path.indexOf(nodeModulesPathPart) + nodeModulesPathPart.length - 1); + const key2 = host.toPath(nodeModulesPath); + if (!(containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.has(key2))) { + (containedNodeModulesWatchers || (containedNodeModulesWatchers = /* @__PURE__ */ new Map())).set( + key2, + host.watchNodeModulesForPackageJsonChanges(nodeModulesPath) + ); + } + } + } + } + }, + setModulePaths(fromFileName, toFileName2, preferences, options, modulePaths) { + const cache2 = ensureCache(fromFileName, preferences, options); + const info = cache2.get(toFileName2); + if (info) { + info.modulePaths = modulePaths; + } else { + cache2.set(toFileName2, createInfo( + modulePaths, + /*moduleSpecifiers*/ + void 0, + /*isBlockedByPackageJsonDependencies*/ + void 0 + )); + } + }, + setBlockedByPackageJsonDependencies(fromFileName, toFileName2, preferences, options, isBlockedByPackageJsonDependencies) { + const cache2 = ensureCache(fromFileName, preferences, options); + const info = cache2.get(toFileName2); + if (info) { + info.isBlockedByPackageJsonDependencies = isBlockedByPackageJsonDependencies; + } else { + cache2.set(toFileName2, createInfo( + /*modulePaths*/ + void 0, + /*moduleSpecifiers*/ + void 0, + isBlockedByPackageJsonDependencies + )); + } + }, + clear() { + containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.forEach(closeFileWatcher); + cache == null ? void 0 : cache.clear(); + containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.clear(); + currentKey = void 0; + }, + count() { + return cache ? cache.size : 0; + } + }; + if (Debug.isDebugging) { + Object.defineProperty(result, "__cache", { get: () => cache }); + } + return result; + function ensureCache(fromFileName, preferences, options) { + const newKey = key(fromFileName, preferences, options); + if (cache && currentKey !== newKey) { + result.clear(); + } + currentKey = newKey; + return cache || (cache = /* @__PURE__ */ new Map()); + } + function key(fromFileName, preferences, options) { + return `${fromFileName},${preferences.importModuleSpecifierEnding},${preferences.importModuleSpecifierPreference},${options.overrideImportMode}`; + } + function createInfo(modulePaths, moduleSpecifiers, isBlockedByPackageJsonDependencies) { + return { modulePaths, moduleSpecifiers, isBlockedByPackageJsonDependencies }; + } + } + var init_moduleSpecifierCache = __esm({ + "src/server/moduleSpecifierCache.ts"() { + "use strict"; + init_ts7(); + } + }); + + // src/server/packageJsonCache.ts + function createPackageJsonCache(host) { + const packageJsons = /* @__PURE__ */ new Map(); + const directoriesWithoutPackageJson = /* @__PURE__ */ new Map(); + return { + addOrUpdate, + invalidate, + delete: (fileName) => { + packageJsons.delete(fileName); + directoriesWithoutPackageJson.set(getDirectoryPath(fileName), true); + }, + getInDirectory: (directory) => { + return packageJsons.get(host.toPath(combinePaths(directory, "package.json"))) || void 0; + }, + directoryHasPackageJson: (directory) => directoryHasPackageJson(host.toPath(directory)), + searchDirectoryAndAncestors: (directory) => { + forEachAncestorDirectory(directory, (ancestor) => { + const ancestorPath = host.toPath(ancestor); + if (directoryHasPackageJson(ancestorPath) !== 3 /* Maybe */) { + return true; + } + const packageJsonFileName = combinePaths(ancestor, "package.json"); + if (tryFileExists(host, packageJsonFileName)) { + addOrUpdate(packageJsonFileName, combinePaths(ancestorPath, "package.json")); + } else { + directoriesWithoutPackageJson.set(ancestorPath, true); + } + }); + } + }; + function addOrUpdate(fileName, path) { + const packageJsonInfo = Debug.checkDefined(createPackageJsonInfo(fileName, host.host)); + 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 */; + } + } + var init_packageJsonCache = __esm({ + "src/server/packageJsonCache.ts"() { + "use strict"; + init_ts7(); + } + }); + + // src/server/session.ts + function hrTimeToMilliseconds(time) { + const seconds = time[0]; + const nanoseconds = time[1]; + return (1e9 * seconds + nanoseconds) / 1e6; + } + function isDeclarationFileInJSOnlyNonConfiguredProject(project, file) { + if ((isInferredProject(project) || isExternalProject(project)) && project.isJsOnlyProject()) { + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + return scriptInfo && !scriptInfo.isJavaScript(); + } + return false; + } + function dtsChangeCanAffectEmit(compilationSettings) { + return getEmitDeclarations(compilationSettings) || !!compilationSettings.emitDecoratorMetadata; + } + function formatDiag(fileName, project, diag2) { + const scriptInfo = project.getScriptInfoForNormalizedPath(fileName); + return { + start: scriptInfo.positionToLineOffset(diag2.start), + end: scriptInfo.positionToLineOffset(diag2.start + diag2.length), + // TODO: GH#18217 + text: flattenDiagnosticMessageText(diag2.messageText, "\n"), + code: diag2.code, + category: diagnosticCategoryName(diag2), + reportsUnnecessary: diag2.reportsUnnecessary, + reportsDeprecated: diag2.reportsDeprecated, + source: diag2.source, + relatedInformation: map(diag2.relatedInformation, formatRelatedInformation) + }; + } + function formatRelatedInformation(info) { + if (!info.file) { + return { + message: flattenDiagnosticMessageText(info.messageText, "\n"), + category: diagnosticCategoryName(info), + code: info.code + }; + } + return { + span: { + start: convertToLocation(getLineAndCharacterOfPosition(info.file, info.start)), + end: convertToLocation(getLineAndCharacterOfPosition(info.file, info.start + info.length)), + // TODO: GH#18217 + file: info.file.fileName + }, + message: flattenDiagnosticMessageText(info.messageText, "\n"), + category: diagnosticCategoryName(info), + code: info.code + }; + } + function convertToLocation(lineAndCharacter) { + return { line: lineAndCharacter.line + 1, offset: lineAndCharacter.character + 1 }; + } + function formatDiagnosticToProtocol(diag2, includeFileName) { + const start = diag2.file && convertToLocation(getLineAndCharacterOfPosition(diag2.file, diag2.start)); + const end = diag2.file && convertToLocation(getLineAndCharacterOfPosition(diag2.file, diag2.start + diag2.length)); + const text = flattenDiagnosticMessageText(diag2.messageText, "\n"); + const { code, source } = diag2; + const category = diagnosticCategoryName(diag2); + const common = { + start, + end, + text, + code, + category, + reportsUnnecessary: diag2.reportsUnnecessary, + reportsDeprecated: diag2.reportsDeprecated, + source, + relatedInformation: map(diag2.relatedInformation, formatRelatedInformation) + }; + return includeFileName ? { ...common, fileName: diag2.file && diag2.file.fileName } : common; + } + function allEditsBeforePos(edits, pos) { + return edits.every((edit) => textSpanEnd(edit.span) < pos); + } + function formatMessage2(msg, logger, byteLength, newLine) { + const verboseLogging = logger.hasLevel(3 /* verbose */); + const json = JSON.stringify(msg); + if (verboseLogging) { + logger.info(`${msg.type}:${stringifyIndented(msg)}`); + } + const len = byteLength(json, "utf8"); + return `Content-Length: ${1 + len}\r +\r +${json}${newLine}`; + } + function toEvent(eventName, body) { + return { + seq: 0, + type: "event", + event: eventName, + body + }; + } + function combineProjectOutput(defaultValue, getValue, projects, action) { + const outputs = flatMapToMutable(isArray(projects) ? projects : projects.projects, (project) => action(project, defaultValue)); + if (!isArray(projects) && projects.symLinkedProjects) { + projects.symLinkedProjects.forEach((projects2, path) => { + const value = getValue(path); + outputs.push(...flatMap(projects2, (project) => action(project, value))); + }); + } + return deduplicate(outputs, equateValues); + } + function createDocumentSpanSet(useCaseSensitiveFileNames2) { + return createSet(({ textSpan }) => textSpan.start + 100003 * textSpan.length, getDocumentSpansEqualityComparer(useCaseSensitiveFileNames2)); + } + function getRenameLocationsWorker(projects, defaultProject, initialLocation, findInStrings, findInComments, preferences, useCaseSensitiveFileNames2) { + const perProjectResults = getPerProjectReferences( + projects, + defaultProject, + initialLocation, + /*isForRename*/ + true, + (project, position) => project.getLanguageService().findRenameLocations(position.fileName, position.pos, findInStrings, findInComments, preferences), + (renameLocation, cb) => cb(documentSpanLocation(renameLocation)) + ); + if (isArray(perProjectResults)) { + return perProjectResults; + } + const results = []; + const seen = createDocumentSpanSet(useCaseSensitiveFileNames2); + perProjectResults.forEach((projectResults, project) => { + for (const result of projectResults) { + if (!seen.has(result) && !getMappedLocationForProject(documentSpanLocation(result), project)) { + results.push(result); + seen.add(result); + } + } + }); + return results; + } + function getDefinitionLocation(defaultProject, initialLocation, isForRename) { + const infos = defaultProject.getLanguageService().getDefinitionAtPosition( + initialLocation.fileName, + initialLocation.pos, + /*searchOtherFilesOnly*/ + false, + /*stopAtAlias*/ + isForRename + ); + const info = infos && firstOrUndefined(infos); + return info && !info.isLocal ? { fileName: info.fileName, pos: info.textSpan.start } : void 0; + } + function getReferencesWorker(projects, defaultProject, initialLocation, useCaseSensitiveFileNames2, logger) { + var _a, _b; + const perProjectResults = getPerProjectReferences( + projects, + defaultProject, + initialLocation, + /*isForRename*/ + false, + (project, position) => { + logger.info(`Finding references to ${position.fileName} position ${position.pos} in project ${project.getProjectName()}`); + return project.getLanguageService().findReferences(position.fileName, position.pos); + }, + (referencedSymbol, cb) => { + cb(documentSpanLocation(referencedSymbol.definition)); + for (const ref of referencedSymbol.references) { + cb(documentSpanLocation(ref)); + } + } + ); + if (isArray(perProjectResults)) { + return perProjectResults; + } + const defaultProjectResults = perProjectResults.get(defaultProject); + if (((_b = (_a = defaultProjectResults == null ? void 0 : defaultProjectResults[0]) == null ? void 0 : _a.references[0]) == null ? void 0 : _b.isDefinition) === void 0) { + perProjectResults.forEach((projectResults) => { + for (const referencedSymbol of projectResults) { + for (const ref of referencedSymbol.references) { + delete ref.isDefinition; + } + } + }); + } else { + const knownSymbolSpans = createDocumentSpanSet(useCaseSensitiveFileNames2); + for (const referencedSymbol of defaultProjectResults) { + for (const ref of referencedSymbol.references) { + if (ref.isDefinition) { + knownSymbolSpans.add(ref); + break; + } + } + } + const updatedProjects = /* @__PURE__ */ new Set(); + while (true) { + let progress = false; + perProjectResults.forEach((referencedSymbols, project) => { + if (updatedProjects.has(project)) + return; + const updated = project.getLanguageService().updateIsDefinitionOfReferencedSymbols(referencedSymbols, knownSymbolSpans); + if (updated) { + updatedProjects.add(project); + progress = true; + } + }); + if (!progress) + break; + } + perProjectResults.forEach((referencedSymbols, project) => { + if (updatedProjects.has(project)) + return; + for (const referencedSymbol of referencedSymbols) { + for (const ref of referencedSymbol.references) { + ref.isDefinition = false; + } + } + }); + } + const results = []; + const seenRefs = createDocumentSpanSet(useCaseSensitiveFileNames2); + perProjectResults.forEach((projectResults, project) => { + for (const referencedSymbol of projectResults) { + const mappedDefinitionFile = getMappedLocationForProject(documentSpanLocation(referencedSymbol.definition), project); + const definition = mappedDefinitionFile === void 0 ? referencedSymbol.definition : { + ...referencedSymbol.definition, + textSpan: createTextSpan(mappedDefinitionFile.pos, referencedSymbol.definition.textSpan.length), + // Why would the length be the same in the original? + fileName: mappedDefinitionFile.fileName, + contextSpan: getMappedContextSpanForProject(referencedSymbol.definition, project) + }; + let symbolToAddTo = find(results, (o) => documentSpansEqual(o.definition, definition, useCaseSensitiveFileNames2)); + if (!symbolToAddTo) { + symbolToAddTo = { definition, references: [] }; + results.push(symbolToAddTo); + } + for (const ref of referencedSymbol.references) { + if (!seenRefs.has(ref) && !getMappedLocationForProject(documentSpanLocation(ref), project)) { + seenRefs.add(ref); + symbolToAddTo.references.push(ref); + } + } + } + }); + return results.filter((o) => o.references.length !== 0); + } + function forEachProjectInProjects(projects, path, cb) { + for (const project of isArray(projects) ? projects : projects.projects) { + cb(project, path); + } + if (!isArray(projects) && projects.symLinkedProjects) { + projects.symLinkedProjects.forEach((symlinkedProjects, symlinkedPath) => { + for (const project of symlinkedProjects) { + cb(project, symlinkedPath); + } + }); + } + } + function getPerProjectReferences(projects, defaultProject, initialLocation, isForRename, getResultsForPosition, forPositionInResult) { + const resultsMap = /* @__PURE__ */ new Map(); + const queue = createQueue(); + queue.enqueue({ project: defaultProject, location: initialLocation }); + forEachProjectInProjects(projects, initialLocation.fileName, (project, path) => { + const location = { fileName: path, pos: initialLocation.pos }; + queue.enqueue({ project, location }); + }); + const projectService = defaultProject.projectService; + const cancellationToken = defaultProject.getCancellationToken(); + const defaultDefinition = getDefinitionLocation(defaultProject, initialLocation, isForRename); + const getGeneratedDefinition = memoize( + () => defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition.fileName) ? defaultDefinition : defaultProject.getLanguageService().getSourceMapper().tryGetGeneratedPosition(defaultDefinition) + ); + const getSourceDefinition = memoize( + () => defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition.fileName) ? defaultDefinition : defaultProject.getLanguageService().getSourceMapper().tryGetSourcePosition(defaultDefinition) + ); + const searchedProjectKeys = /* @__PURE__ */ new Set(); + onCancellation: + while (!queue.isEmpty()) { + while (!queue.isEmpty()) { + if (cancellationToken.isCancellationRequested()) + break onCancellation; + const { project, location } = queue.dequeue(); + if (resultsMap.has(project)) + continue; + if (isLocationProjectReferenceRedirect(project, location)) + continue; + updateProjectIfDirty(project); + if (!project.containsFile(toNormalizedPath(location.fileName))) { + continue; + } + const projectResults = searchPosition(project, location); + resultsMap.set(project, projectResults ?? emptyArray2); + searchedProjectKeys.add(getProjectKey(project)); + } + if (defaultDefinition) { + projectService.loadAncestorProjectTree(searchedProjectKeys); + projectService.forEachEnabledProject((project) => { + if (cancellationToken.isCancellationRequested()) + return; + if (resultsMap.has(project)) + return; + const location = mapDefinitionInProject(defaultDefinition, project, getGeneratedDefinition, getSourceDefinition); + if (location) { + queue.enqueue({ project, location }); + } + }); + } + } + if (resultsMap.size === 1) { + return firstIterator(resultsMap.values()); + } + return resultsMap; + function searchPosition(project, location) { + const projectResults = getResultsForPosition(project, location); + if (!projectResults) + return void 0; + for (const result of projectResults) { + forPositionInResult(result, (position) => { + const originalLocation = projectService.getOriginalLocationEnsuringConfiguredProject(project, position); + if (!originalLocation) + return; + const originalScriptInfo = projectService.getScriptInfo(originalLocation.fileName); + for (const project2 of originalScriptInfo.containingProjects) { + if (!project2.isOrphan() && !resultsMap.has(project2)) { + queue.enqueue({ project: project2, location: originalLocation }); + } + } + const symlinkedProjectsMap = projectService.getSymlinkedProjects(originalScriptInfo); + if (symlinkedProjectsMap) { + symlinkedProjectsMap.forEach((symlinkedProjects, symlinkedPath) => { + for (const symlinkedProject of symlinkedProjects) { + if (!symlinkedProject.isOrphan() && !resultsMap.has(symlinkedProject)) { + queue.enqueue({ project: symlinkedProject, location: { fileName: symlinkedPath, pos: originalLocation.pos } }); + } + } + }); + } + }); + } + return projectResults; + } + } + function mapDefinitionInProject(definition, project, getGeneratedDefinition, getSourceDefinition) { + if (project.containsFile(toNormalizedPath(definition.fileName)) && !isLocationProjectReferenceRedirect(project, definition)) { + return definition; + } + const generatedDefinition = getGeneratedDefinition(); + if (generatedDefinition && project.containsFile(toNormalizedPath(generatedDefinition.fileName))) + return generatedDefinition; + const sourceDefinition = getSourceDefinition(); + return sourceDefinition && project.containsFile(toNormalizedPath(sourceDefinition.fileName)) ? sourceDefinition : void 0; + } + function isLocationProjectReferenceRedirect(project, location) { + if (!location) + return false; + const program = project.getLanguageService().getProgram(); + if (!program) + return false; + const sourceFile = program.getSourceFile(location.fileName); + return !!sourceFile && sourceFile.resolvedPath !== sourceFile.path && sourceFile.resolvedPath !== project.toPath(location.fileName); + } + function getProjectKey(project) { + return isConfiguredProject(project) ? project.canonicalConfigFilePath : project.getProjectName(); + } + function documentSpanLocation({ fileName, textSpan }) { + return { fileName, pos: textSpan.start }; + } + function getMappedLocationForProject(location, project) { + return getMappedLocation(location, project.getSourceMapper(), (p) => project.projectService.fileExists(p)); + } + function getMappedDocumentSpanForProject(documentSpan, project) { + return getMappedDocumentSpan(documentSpan, project.getSourceMapper(), (p) => project.projectService.fileExists(p)); + } + function getMappedContextSpanForProject(documentSpan, project) { + return getMappedContextSpan(documentSpan, project.getSourceMapper(), (p) => project.projectService.fileExists(p)); + } + function toProtocolTextSpan(textSpan, scriptInfo) { + return { + start: scriptInfo.positionToLineOffset(textSpan.start), + end: scriptInfo.positionToLineOffset(textSpanEnd(textSpan)) + }; + } + function toProtocolTextSpanWithContext(span, contextSpan, scriptInfo) { + const textSpan = toProtocolTextSpan(span, scriptInfo); + const contextTextSpan = contextSpan && toProtocolTextSpan(contextSpan, scriptInfo); + return contextTextSpan ? { ...textSpan, contextStart: contextTextSpan.start, contextEnd: contextTextSpan.end } : textSpan; + } + function convertTextChangeToCodeEdit(change, scriptInfo) { + return { start: positionToLineOffset(scriptInfo, change.span.start), end: positionToLineOffset(scriptInfo, textSpanEnd(change.span)), newText: change.newText }; + } + function positionToLineOffset(info, position) { + return isConfigFile(info) ? locationFromLineAndCharacter(info.getLineAndCharacterOfPosition(position)) : info.positionToLineOffset(position); + } + function convertLinkedEditInfoToRanges(linkedEdit, scriptInfo) { + const ranges = linkedEdit.ranges.map( + (r) => { + return { + start: scriptInfo.positionToLineOffset(r.start), + end: scriptInfo.positionToLineOffset(r.start + r.length) + }; + } + ); + if (!linkedEdit.wordPattern) + return { ranges }; + return { ranges, wordPattern: linkedEdit.wordPattern }; + } + function locationFromLineAndCharacter(lc) { + return { line: lc.line + 1, offset: lc.character + 1 }; + } + function convertNewFileTextChangeToCodeEdit(textChanges2) { + Debug.assert(textChanges2.textChanges.length === 1); + const change = first(textChanges2.textChanges); + Debug.assert(change.span.start === 0 && change.span.length === 0); + return { fileName: textChanges2.fileName, textChanges: [{ start: { line: 0, offset: 0 }, end: { line: 0, offset: 0 }, newText: change.newText }] }; + } + function getLocationInNewDocument(oldText, renameFilename, renameLocation, edits) { + const newText = applyEdits(oldText, renameFilename, edits); + const { line, character } = computeLineAndCharacterOfPosition(computeLineStarts(newText), renameLocation); + return { line: line + 1, offset: character + 1 }; + } + function applyEdits(text, textFilename, edits) { + for (const { fileName, textChanges: textChanges2 } of edits) { + if (fileName !== textFilename) { + continue; + } + for (let i = textChanges2.length - 1; i >= 0; i--) { + const { newText, span: { start, length: length2 } } = textChanges2[i]; + text = text.slice(0, start) + newText + text.slice(start + length2); + } + } + return text; + } + function referenceEntryToReferencesResponseItem(projectService, { fileName, textSpan, contextSpan, isWriteAccess: isWriteAccess2, isDefinition }, { disableLineTextInReferences }) { + const scriptInfo = Debug.checkDefined(projectService.getScriptInfo(fileName)); + const span = toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo); + const lineText = disableLineTextInReferences ? void 0 : getLineText(scriptInfo, span); + return { + file: fileName, + ...span, + lineText, + isWriteAccess: isWriteAccess2, + isDefinition + }; + } + function getLineText(scriptInfo, span) { + const lineSpan = scriptInfo.lineToTextSpan(span.start.line - 1); + return scriptInfo.getSnapshot().getText(lineSpan.start, textSpanEnd(lineSpan)).replace(/\r|\n/g, ""); + } + function isCompletionEntryData(data) { + return data === void 0 || data && typeof data === "object" && typeof data.exportName === "string" && (data.fileName === void 0 || typeof data.fileName === "string") && (data.ambientModuleName === void 0 || typeof data.ambientModuleName === "string" && (data.isPackageJsonImport === void 0 || typeof data.isPackageJsonImport === "boolean")); + } + var nullCancellationToken, CommandNames, MultistepOperation, invalidPartialSemanticModeCommands, invalidSyntacticModeCommands, Session3; + var init_session = __esm({ + "src/server/session.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + init_protocol(); + nullCancellationToken = { + isCancellationRequested: () => false, + setRequest: () => void 0, + resetRequest: () => void 0 + }; + CommandNames = CommandTypes; + MultistepOperation = class { + constructor(operationHost) { + this.operationHost = operationHost; + } + startNew(action) { + this.complete(); + this.requestId = this.operationHost.getCurrentRequestId(); + this.executeAction(action); + } + complete() { + if (this.requestId !== void 0) { + this.operationHost.sendRequestCompletedEvent(this.requestId); + this.requestId = void 0; + } + this.setTimerHandle(void 0); + this.setImmediateId(void 0); + } + immediate(actionType, action) { + const requestId = this.requestId; + Debug.assert(requestId === this.operationHost.getCurrentRequestId(), "immediate: incorrect request id"); + this.setImmediateId( + this.operationHost.getServerHost().setImmediate(() => { + this.immediateId = void 0; + this.operationHost.executeWithRequestId(requestId, () => this.executeAction(action)); + }, actionType) + ); + } + delay(actionType, ms, action) { + const requestId = this.requestId; + Debug.assert(requestId === this.operationHost.getCurrentRequestId(), "delay: incorrect request id"); + this.setTimerHandle( + this.operationHost.getServerHost().setTimeout( + () => { + this.timerHandle = void 0; + this.operationHost.executeWithRequestId(requestId, () => this.executeAction(action)); + }, + ms, + actionType + ) + ); + } + executeAction(action) { + var _a, _b, _c, _d, _e, _f; + let stop = false; + try { + if (this.operationHost.isCancellationRequested()) { + stop = true; + (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.Session, "stepCanceled", { seq: this.requestId, early: true }); + } else { + (_b = tracing) == null ? void 0 : _b.push(tracing.Phase.Session, "stepAction", { seq: this.requestId }); + action(this); + (_c = tracing) == null ? void 0 : _c.pop(); + } + } catch (e) { + (_d = tracing) == null ? void 0 : _d.popAll(); + stop = true; + if (e instanceof OperationCanceledException) { + (_e = tracing) == null ? void 0 : _e.instant(tracing.Phase.Session, "stepCanceled", { seq: this.requestId }); + } else { + (_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "stepError", { seq: this.requestId, message: e.message }); + this.operationHost.logError(e, `delayed processing of request ${this.requestId}`); + } + } + if (stop || !this.hasPendingWork()) { + this.complete(); + } + } + setTimerHandle(timerHandle) { + if (this.timerHandle !== void 0) { + this.operationHost.getServerHost().clearTimeout(this.timerHandle); + } + this.timerHandle = timerHandle; + } + setImmediateId(immediateId) { + if (this.immediateId !== void 0) { + this.operationHost.getServerHost().clearImmediate(this.immediateId); + } + this.immediateId = immediateId; + } + hasPendingWork() { + return !!this.timerHandle || !!this.immediateId; + } + }; + invalidPartialSemanticModeCommands = [ + "openExternalProject" /* OpenExternalProject */, + "openExternalProjects" /* OpenExternalProjects */, + "closeExternalProject" /* CloseExternalProject */, + "synchronizeProjectList" /* SynchronizeProjectList */, + "emit-output" /* EmitOutput */, + "compileOnSaveAffectedFileList" /* CompileOnSaveAffectedFileList */, + "compileOnSaveEmitFile" /* CompileOnSaveEmitFile */, + "compilerOptionsDiagnostics-full" /* CompilerOptionsDiagnosticsFull */, + "encodedSemanticClassifications-full" /* EncodedSemanticClassificationsFull */, + "semanticDiagnosticsSync" /* SemanticDiagnosticsSync */, + "suggestionDiagnosticsSync" /* SuggestionDiagnosticsSync */, + "geterrForProject" /* GeterrForProject */, + "reload" /* Reload */, + "reloadProjects" /* ReloadProjects */, + "getCodeFixes" /* GetCodeFixes */, + "getCodeFixes-full" /* GetCodeFixesFull */, + "getCombinedCodeFix" /* GetCombinedCodeFix */, + "getCombinedCodeFix-full" /* GetCombinedCodeFixFull */, + "applyCodeActionCommand" /* ApplyCodeActionCommand */, + "getSupportedCodeFixes" /* GetSupportedCodeFixes */, + "getApplicableRefactors" /* GetApplicableRefactors */, + "getMoveToRefactoringFileSuggestions" /* GetMoveToRefactoringFileSuggestions */, + "getEditsForRefactor" /* GetEditsForRefactor */, + "getEditsForRefactor-full" /* GetEditsForRefactorFull */, + "organizeImports" /* OrganizeImports */, + "organizeImports-full" /* OrganizeImportsFull */, + "getEditsForFileRename" /* GetEditsForFileRename */, + "getEditsForFileRename-full" /* GetEditsForFileRenameFull */, + "prepareCallHierarchy" /* PrepareCallHierarchy */, + "provideCallHierarchyIncomingCalls" /* ProvideCallHierarchyIncomingCalls */, + "provideCallHierarchyOutgoingCalls" /* ProvideCallHierarchyOutgoingCalls */ + ]; + invalidSyntacticModeCommands = [ + ...invalidPartialSemanticModeCommands, + "definition" /* Definition */, + "definition-full" /* DefinitionFull */, + "definitionAndBoundSpan" /* DefinitionAndBoundSpan */, + "definitionAndBoundSpan-full" /* DefinitionAndBoundSpanFull */, + "typeDefinition" /* TypeDefinition */, + "implementation" /* Implementation */, + "implementation-full" /* ImplementationFull */, + "references" /* References */, + "references-full" /* ReferencesFull */, + "rename" /* Rename */, + "renameLocations-full" /* RenameLocationsFull */, + "rename-full" /* RenameInfoFull */, + "quickinfo" /* Quickinfo */, + "quickinfo-full" /* QuickinfoFull */, + "completionInfo" /* CompletionInfo */, + "completions" /* Completions */, + "completions-full" /* CompletionsFull */, + "completionEntryDetails" /* CompletionDetails */, + "completionEntryDetails-full" /* CompletionDetailsFull */, + "signatureHelp" /* SignatureHelp */, + "signatureHelp-full" /* SignatureHelpFull */, + "navto" /* Navto */, + "navto-full" /* NavtoFull */, + "documentHighlights" /* DocumentHighlights */, + "documentHighlights-full" /* DocumentHighlightsFull */ + ]; + Session3 = class _Session { + constructor(opts) { + this.changeSeq = 0; + this.handlers = new Map(Object.entries({ + // TODO(jakebailey): correctly type the handlers + ["status" /* Status */]: () => { + const response = { version }; + return this.requiredResponse(response); + }, + ["openExternalProject" /* OpenExternalProject */]: (request) => { + this.projectService.openExternalProject( + request.arguments, + /*print*/ + true + ); + return this.requiredResponse( + /*response*/ + true + ); + }, + ["openExternalProjects" /* OpenExternalProjects */]: (request) => { + this.projectService.openExternalProjects(request.arguments.projects); + return this.requiredResponse( + /*response*/ + true + ); + }, + ["closeExternalProject" /* CloseExternalProject */]: (request) => { + this.projectService.closeExternalProject( + request.arguments.projectFileName, + /*print*/ + true + ); + return this.requiredResponse( + /*response*/ + true + ); + }, + ["synchronizeProjectList" /* SynchronizeProjectList */]: (request) => { + const result = this.projectService.synchronizeProjectList(request.arguments.knownProjects, request.arguments.includeProjectReferenceRedirectInfo); + if (!result.some((p) => p.projectErrors && p.projectErrors.length !== 0)) { + return this.requiredResponse(result); + } + const converted = map(result, (p) => { + if (!p.projectErrors || p.projectErrors.length === 0) { + return p; + } + return { + info: p.info, + changes: p.changes, + files: p.files, + projectErrors: this.convertToDiagnosticsWithLinePosition( + p.projectErrors, + /*scriptInfo*/ + void 0 + ) + }; + }); + return this.requiredResponse(converted); + }, + ["updateOpen" /* UpdateOpen */]: (request) => { + this.changeSeq++; + this.projectService.applyChangesInOpenFiles( + request.arguments.openFiles && mapIterator(request.arguments.openFiles, (file) => ({ + fileName: file.file, + content: file.fileContent, + scriptKind: file.scriptKindName, + projectRootPath: file.projectRootPath + })), + request.arguments.changedFiles && mapIterator(request.arguments.changedFiles, (file) => ({ + fileName: file.fileName, + changes: mapDefinedIterator(arrayReverseIterator(file.textChanges), (change) => { + const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(file.fileName)); + const start = scriptInfo.lineOffsetToPosition(change.start.line, change.start.offset); + const end = scriptInfo.lineOffsetToPosition(change.end.line, change.end.offset); + return start >= 0 ? { span: { start, length: end - start }, newText: change.newText } : void 0; + }) + })), + request.arguments.closedFiles + ); + return this.requiredResponse( + /*response*/ + true + ); + }, + ["applyChangedToOpenFiles" /* ApplyChangedToOpenFiles */]: (request) => { + this.changeSeq++; + this.projectService.applyChangesInOpenFiles( + request.arguments.openFiles, + request.arguments.changedFiles && mapIterator(request.arguments.changedFiles, (file) => ({ + fileName: file.fileName, + // apply changes in reverse order + changes: arrayReverseIterator(file.changes) + })), + request.arguments.closedFiles + ); + return this.requiredResponse( + /*response*/ + true + ); + }, + ["exit" /* Exit */]: () => { + this.exit(); + return this.notRequired(); + }, + ["definition" /* Definition */]: (request) => { + return this.requiredResponse(this.getDefinition( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["definition-full" /* DefinitionFull */]: (request) => { + return this.requiredResponse(this.getDefinition( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["definitionAndBoundSpan" /* DefinitionAndBoundSpan */]: (request) => { + return this.requiredResponse(this.getDefinitionAndBoundSpan( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["definitionAndBoundSpan-full" /* DefinitionAndBoundSpanFull */]: (request) => { + return this.requiredResponse(this.getDefinitionAndBoundSpan( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["findSourceDefinition" /* FindSourceDefinition */]: (request) => { + return this.requiredResponse(this.findSourceDefinition(request.arguments)); + }, + ["emit-output" /* EmitOutput */]: (request) => { + return this.requiredResponse(this.getEmitOutput(request.arguments)); + }, + ["typeDefinition" /* TypeDefinition */]: (request) => { + return this.requiredResponse(this.getTypeDefinition(request.arguments)); + }, + ["implementation" /* Implementation */]: (request) => { + return this.requiredResponse(this.getImplementation( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["implementation-full" /* ImplementationFull */]: (request) => { + return this.requiredResponse(this.getImplementation( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["references" /* References */]: (request) => { + return this.requiredResponse(this.getReferences( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["references-full" /* ReferencesFull */]: (request) => { + return this.requiredResponse(this.getReferences( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["rename" /* Rename */]: (request) => { + return this.requiredResponse(this.getRenameLocations( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["renameLocations-full" /* RenameLocationsFull */]: (request) => { + return this.requiredResponse(this.getRenameLocations( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["rename-full" /* RenameInfoFull */]: (request) => { + return this.requiredResponse(this.getRenameInfo(request.arguments)); + }, + ["open" /* Open */]: (request) => { + this.openClientFile( + toNormalizedPath(request.arguments.file), + request.arguments.fileContent, + convertScriptKindName(request.arguments.scriptKindName), + // TODO: GH#18217 + request.arguments.projectRootPath ? toNormalizedPath(request.arguments.projectRootPath) : void 0 + ); + return this.notRequired(); + }, + ["quickinfo" /* Quickinfo */]: (request) => { + return this.requiredResponse(this.getQuickInfoWorker( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["quickinfo-full" /* QuickinfoFull */]: (request) => { + return this.requiredResponse(this.getQuickInfoWorker( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["getOutliningSpans" /* GetOutliningSpans */]: (request) => { + return this.requiredResponse(this.getOutliningSpans( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["outliningSpans" /* GetOutliningSpansFull */]: (request) => { + return this.requiredResponse(this.getOutliningSpans( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["todoComments" /* TodoComments */]: (request) => { + return this.requiredResponse(this.getTodoComments(request.arguments)); + }, + ["indentation" /* Indentation */]: (request) => { + return this.requiredResponse(this.getIndentation(request.arguments)); + }, + ["nameOrDottedNameSpan" /* NameOrDottedNameSpan */]: (request) => { + return this.requiredResponse(this.getNameOrDottedNameSpan(request.arguments)); + }, + ["breakpointStatement" /* BreakpointStatement */]: (request) => { + return this.requiredResponse(this.getBreakpointStatement(request.arguments)); + }, + ["braceCompletion" /* BraceCompletion */]: (request) => { + return this.requiredResponse(this.isValidBraceCompletion(request.arguments)); + }, + ["docCommentTemplate" /* DocCommentTemplate */]: (request) => { + return this.requiredResponse(this.getDocCommentTemplate(request.arguments)); + }, + ["getSpanOfEnclosingComment" /* GetSpanOfEnclosingComment */]: (request) => { + return this.requiredResponse(this.getSpanOfEnclosingComment(request.arguments)); + }, + ["fileReferences" /* FileReferences */]: (request) => { + return this.requiredResponse(this.getFileReferences( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["fileReferences-full" /* FileReferencesFull */]: (request) => { + return this.requiredResponse(this.getFileReferences( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["format" /* Format */]: (request) => { + return this.requiredResponse(this.getFormattingEditsForRange(request.arguments)); + }, + ["formatonkey" /* Formatonkey */]: (request) => { + return this.requiredResponse(this.getFormattingEditsAfterKeystroke(request.arguments)); + }, + ["format-full" /* FormatFull */]: (request) => { + return this.requiredResponse(this.getFormattingEditsForDocumentFull(request.arguments)); + }, + ["formatonkey-full" /* FormatonkeyFull */]: (request) => { + return this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(request.arguments)); + }, + ["formatRange-full" /* FormatRangeFull */]: (request) => { + return this.requiredResponse(this.getFormattingEditsForRangeFull(request.arguments)); + }, + ["completionInfo" /* CompletionInfo */]: (request) => { + return this.requiredResponse(this.getCompletions(request.arguments, "completionInfo" /* CompletionInfo */)); + }, + ["completions" /* Completions */]: (request) => { + return this.requiredResponse(this.getCompletions(request.arguments, "completions" /* Completions */)); + }, + ["completions-full" /* CompletionsFull */]: (request) => { + return this.requiredResponse(this.getCompletions(request.arguments, "completions-full" /* CompletionsFull */)); + }, + ["completionEntryDetails" /* CompletionDetails */]: (request) => { + return this.requiredResponse(this.getCompletionEntryDetails( + request.arguments, + /*fullResult*/ + false + )); + }, + ["completionEntryDetails-full" /* CompletionDetailsFull */]: (request) => { + return this.requiredResponse(this.getCompletionEntryDetails( + request.arguments, + /*fullResult*/ + true + )); + }, + ["compileOnSaveAffectedFileList" /* CompileOnSaveAffectedFileList */]: (request) => { + return this.requiredResponse(this.getCompileOnSaveAffectedFileList(request.arguments)); + }, + ["compileOnSaveEmitFile" /* CompileOnSaveEmitFile */]: (request) => { + return this.requiredResponse(this.emitFile(request.arguments)); + }, + ["signatureHelp" /* SignatureHelp */]: (request) => { + return this.requiredResponse(this.getSignatureHelpItems( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["signatureHelp-full" /* SignatureHelpFull */]: (request) => { + return this.requiredResponse(this.getSignatureHelpItems( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["compilerOptionsDiagnostics-full" /* CompilerOptionsDiagnosticsFull */]: (request) => { + return this.requiredResponse(this.getCompilerOptionsDiagnostics(request.arguments)); + }, + ["encodedSyntacticClassifications-full" /* EncodedSyntacticClassificationsFull */]: (request) => { + return this.requiredResponse(this.getEncodedSyntacticClassifications(request.arguments)); + }, + ["encodedSemanticClassifications-full" /* EncodedSemanticClassificationsFull */]: (request) => { + return this.requiredResponse(this.getEncodedSemanticClassifications(request.arguments)); + }, + ["cleanup" /* Cleanup */]: () => { + this.cleanup(); + return this.requiredResponse( + /*response*/ + true + ); + }, + ["semanticDiagnosticsSync" /* SemanticDiagnosticsSync */]: (request) => { + return this.requiredResponse(this.getSemanticDiagnosticsSync(request.arguments)); + }, + ["syntacticDiagnosticsSync" /* SyntacticDiagnosticsSync */]: (request) => { + return this.requiredResponse(this.getSyntacticDiagnosticsSync(request.arguments)); + }, + ["suggestionDiagnosticsSync" /* SuggestionDiagnosticsSync */]: (request) => { + return this.requiredResponse(this.getSuggestionDiagnosticsSync(request.arguments)); + }, + ["geterr" /* Geterr */]: (request) => { + this.errorCheck.startNew((next) => this.getDiagnostics(next, request.arguments.delay, request.arguments.files)); + return this.notRequired(); + }, + ["geterrForProject" /* GeterrForProject */]: (request) => { + this.errorCheck.startNew((next) => this.getDiagnosticsForProject(next, request.arguments.delay, request.arguments.file)); + return this.notRequired(); + }, + ["change" /* Change */]: (request) => { + this.change(request.arguments); + return this.notRequired(); + }, + ["configure" /* Configure */]: (request) => { + this.projectService.setHostConfiguration(request.arguments); + this.doOutput( + /*info*/ + void 0, + "configure" /* Configure */, + request.seq, + /*success*/ + true + ); + return this.notRequired(); + }, + ["reload" /* Reload */]: (request) => { + this.reload(request.arguments, request.seq); + return this.requiredResponse({ reloadFinished: true }); + }, + ["saveto" /* Saveto */]: (request) => { + const savetoArgs = request.arguments; + this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); + return this.notRequired(); + }, + ["close" /* Close */]: (request) => { + const closeArgs = request.arguments; + this.closeClientFile(closeArgs.file); + return this.notRequired(); + }, + ["navto" /* Navto */]: (request) => { + return this.requiredResponse(this.getNavigateToItems( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["navto-full" /* NavtoFull */]: (request) => { + return this.requiredResponse(this.getNavigateToItems( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["brace" /* Brace */]: (request) => { + return this.requiredResponse(this.getBraceMatching( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["brace-full" /* BraceFull */]: (request) => { + return this.requiredResponse(this.getBraceMatching( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["navbar" /* NavBar */]: (request) => { + return this.requiredResponse(this.getNavigationBarItems( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["navbar-full" /* NavBarFull */]: (request) => { + return this.requiredResponse(this.getNavigationBarItems( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["navtree" /* NavTree */]: (request) => { + return this.requiredResponse(this.getNavigationTree( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["navtree-full" /* NavTreeFull */]: (request) => { + return this.requiredResponse(this.getNavigationTree( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["documentHighlights" /* DocumentHighlights */]: (request) => { + return this.requiredResponse(this.getDocumentHighlights( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["documentHighlights-full" /* DocumentHighlightsFull */]: (request) => { + return this.requiredResponse(this.getDocumentHighlights( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["compilerOptionsForInferredProjects" /* CompilerOptionsForInferredProjects */]: (request) => { + this.setCompilerOptionsForInferredProjects(request.arguments); + return this.requiredResponse( + /*response*/ + true + ); + }, + ["projectInfo" /* ProjectInfo */]: (request) => { + return this.requiredResponse(this.getProjectInfo(request.arguments)); + }, + ["reloadProjects" /* ReloadProjects */]: () => { + this.projectService.reloadProjects(); + return this.notRequired(); + }, + ["jsxClosingTag" /* JsxClosingTag */]: (request) => { + return this.requiredResponse(this.getJsxClosingTag(request.arguments)); + }, + ["linkedEditingRange" /* LinkedEditingRange */]: (request) => { + return this.requiredResponse(this.getLinkedEditingRange(request.arguments)); + }, + ["getCodeFixes" /* GetCodeFixes */]: (request) => { + return this.requiredResponse(this.getCodeFixes( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["getCodeFixes-full" /* GetCodeFixesFull */]: (request) => { + return this.requiredResponse(this.getCodeFixes( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["getCombinedCodeFix" /* GetCombinedCodeFix */]: (request) => { + return this.requiredResponse(this.getCombinedCodeFix( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["getCombinedCodeFix-full" /* GetCombinedCodeFixFull */]: (request) => { + return this.requiredResponse(this.getCombinedCodeFix( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["applyCodeActionCommand" /* ApplyCodeActionCommand */]: (request) => { + return this.requiredResponse(this.applyCodeActionCommand(request.arguments)); + }, + ["getSupportedCodeFixes" /* GetSupportedCodeFixes */]: (request) => { + return this.requiredResponse(this.getSupportedCodeFixes(request.arguments)); + }, + ["getApplicableRefactors" /* GetApplicableRefactors */]: (request) => { + return this.requiredResponse(this.getApplicableRefactors(request.arguments)); + }, + ["getEditsForRefactor" /* GetEditsForRefactor */]: (request) => { + return this.requiredResponse(this.getEditsForRefactor( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["getMoveToRefactoringFileSuggestions" /* GetMoveToRefactoringFileSuggestions */]: (request) => { + return this.requiredResponse(this.getMoveToRefactoringFileSuggestions(request.arguments)); + }, + ["getEditsForRefactor-full" /* GetEditsForRefactorFull */]: (request) => { + return this.requiredResponse(this.getEditsForRefactor( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["organizeImports" /* OrganizeImports */]: (request) => { + return this.requiredResponse(this.organizeImports( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["organizeImports-full" /* OrganizeImportsFull */]: (request) => { + return this.requiredResponse(this.organizeImports( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["getEditsForFileRename" /* GetEditsForFileRename */]: (request) => { + return this.requiredResponse(this.getEditsForFileRename( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["getEditsForFileRename-full" /* GetEditsForFileRenameFull */]: (request) => { + return this.requiredResponse(this.getEditsForFileRename( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["configurePlugin" /* ConfigurePlugin */]: (request) => { + this.configurePlugin(request.arguments); + this.doOutput( + /*info*/ + void 0, + "configurePlugin" /* ConfigurePlugin */, + request.seq, + /*success*/ + true + ); + return this.notRequired(); + }, + ["selectionRange" /* SelectionRange */]: (request) => { + return this.requiredResponse(this.getSmartSelectionRange( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["selectionRange-full" /* SelectionRangeFull */]: (request) => { + return this.requiredResponse(this.getSmartSelectionRange( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["prepareCallHierarchy" /* PrepareCallHierarchy */]: (request) => { + return this.requiredResponse(this.prepareCallHierarchy(request.arguments)); + }, + ["provideCallHierarchyIncomingCalls" /* ProvideCallHierarchyIncomingCalls */]: (request) => { + return this.requiredResponse(this.provideCallHierarchyIncomingCalls(request.arguments)); + }, + ["provideCallHierarchyOutgoingCalls" /* ProvideCallHierarchyOutgoingCalls */]: (request) => { + return this.requiredResponse(this.provideCallHierarchyOutgoingCalls(request.arguments)); + }, + ["toggleLineComment" /* ToggleLineComment */]: (request) => { + return this.requiredResponse(this.toggleLineComment( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["toggleLineComment-full" /* ToggleLineCommentFull */]: (request) => { + return this.requiredResponse(this.toggleLineComment( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["toggleMultilineComment" /* ToggleMultilineComment */]: (request) => { + return this.requiredResponse(this.toggleMultilineComment( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["toggleMultilineComment-full" /* ToggleMultilineCommentFull */]: (request) => { + return this.requiredResponse(this.toggleMultilineComment( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["commentSelection" /* CommentSelection */]: (request) => { + return this.requiredResponse(this.commentSelection( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["commentSelection-full" /* CommentSelectionFull */]: (request) => { + return this.requiredResponse(this.commentSelection( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["uncommentSelection" /* UncommentSelection */]: (request) => { + return this.requiredResponse(this.uncommentSelection( + request.arguments, + /*simplifiedResult*/ + true + )); + }, + ["uncommentSelection-full" /* UncommentSelectionFull */]: (request) => { + return this.requiredResponse(this.uncommentSelection( + request.arguments, + /*simplifiedResult*/ + false + )); + }, + ["provideInlayHints" /* ProvideInlayHints */]: (request) => { + return this.requiredResponse(this.provideInlayHints(request.arguments)); + } + })); + this.host = opts.host; + this.cancellationToken = opts.cancellationToken; + this.typingsInstaller = opts.typingsInstaller || nullTypingsInstaller; + this.byteLength = opts.byteLength; + this.hrtime = opts.hrtime; + this.logger = opts.logger; + this.canUseEvents = opts.canUseEvents; + this.suppressDiagnosticEvents = opts.suppressDiagnosticEvents; + this.noGetErrOnBackgroundUpdate = opts.noGetErrOnBackgroundUpdate; + const { throttleWaitMilliseconds } = opts; + this.eventHandler = this.canUseEvents ? opts.eventHandler || ((event) => this.defaultEventHandler(event)) : void 0; + const multistepOperationHost = { + executeWithRequestId: (requestId, action) => this.executeWithRequestId(requestId, action), + getCurrentRequestId: () => this.currentRequestId, + getServerHost: () => this.host, + logError: (err, cmd) => this.logError(err, cmd), + sendRequestCompletedEvent: (requestId) => this.sendRequestCompletedEvent(requestId), + isCancellationRequested: () => this.cancellationToken.isCancellationRequested() + }; + this.errorCheck = new MultistepOperation(multistepOperationHost); + const settings = { + host: this.host, + logger: this.logger, + cancellationToken: this.cancellationToken, + useSingleInferredProject: opts.useSingleInferredProject, + useInferredProjectPerProjectRoot: opts.useInferredProjectPerProjectRoot, + typingsInstaller: this.typingsInstaller, + throttleWaitMilliseconds, + eventHandler: this.eventHandler, + suppressDiagnosticEvents: this.suppressDiagnosticEvents, + globalPlugins: opts.globalPlugins, + pluginProbeLocations: opts.pluginProbeLocations, + allowLocalPluginLoads: opts.allowLocalPluginLoads, + typesMapLocation: opts.typesMapLocation, + serverMode: opts.serverMode, + session: this, + canUseWatchEvents: opts.canUseWatchEvents, + incrementalVerifier: opts.incrementalVerifier + }; + this.projectService = new ProjectService3(settings); + this.projectService.setPerformanceEventHandler(this.performanceEventHandler.bind(this)); + this.gcTimer = new GcTimer( + this.host, + /*delay*/ + 7e3, + this.logger + ); + switch (this.projectService.serverMode) { + case 0 /* Semantic */: + break; + case 1 /* PartialSemantic */: + invalidPartialSemanticModeCommands.forEach( + (commandName) => this.handlers.set(commandName, (request) => { + throw new Error(`Request: ${request.command} not allowed in LanguageServiceMode.PartialSemantic`); + }) + ); + break; + case 2 /* Syntactic */: + invalidSyntacticModeCommands.forEach( + (commandName) => this.handlers.set(commandName, (request) => { + throw new Error(`Request: ${request.command} not allowed in LanguageServiceMode.Syntactic`); + }) + ); + break; + default: + Debug.assertNever(this.projectService.serverMode); + } + } + sendRequestCompletedEvent(requestId) { + this.event({ request_seq: requestId }, "requestCompleted"); + } + addPerformanceData(key, value) { + if (!this.performanceData) { + this.performanceData = {}; + } + this.performanceData[key] = (this.performanceData[key] ?? 0) + value; + } + performanceEventHandler(event) { + switch (event.kind) { + case "UpdateGraph": + this.addPerformanceData("updateGraphDurationMs", event.durationMs); + break; + case "CreatePackageJsonAutoImportProvider": + this.addPerformanceData("createAutoImportProviderProgramDurationMs", event.durationMs); + break; + } + } + defaultEventHandler(event) { + switch (event.eventName) { + case ProjectsUpdatedInBackgroundEvent: + this.projectsUpdatedInBackgroundEvent(event.data.openFiles); + break; + case ProjectLoadingStartEvent: + this.event({ + projectName: event.data.project.getProjectName(), + reason: event.data.reason + }, event.eventName); + break; + case ProjectLoadingFinishEvent: + this.event({ + projectName: event.data.project.getProjectName() + }, event.eventName); + break; + case LargeFileReferencedEvent: + case CreateFileWatcherEvent: + case CreateDirectoryWatcherEvent: + case CloseFileWatcherEvent: + this.event(event.data, event.eventName); + break; + case ConfigFileDiagEvent: + this.event({ + triggerFile: event.data.triggerFile, + configFile: event.data.configFileName, + diagnostics: map(event.data.diagnostics, (diagnostic) => formatDiagnosticToProtocol( + diagnostic, + /*includeFileName*/ + true + )) + }, event.eventName); + break; + case ProjectLanguageServiceStateEvent: { + this.event({ + projectName: event.data.project.getProjectName(), + languageServiceEnabled: event.data.languageServiceEnabled + }, event.eventName); + break; + } + case ProjectInfoTelemetryEvent: { + const eventName = "telemetry"; + this.event({ + telemetryEventName: event.eventName, + payload: event.data + }, eventName); + break; + } + } + } + projectsUpdatedInBackgroundEvent(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, + 100, + /*requireOpen*/ + true + )); + } + this.event({ + openFiles + }, ProjectsUpdatedInBackgroundEvent); + } + } + logError(err, cmd) { + this.logErrorWorker(err, cmd); + } + logErrorWorker(err, cmd, fileRequest) { + let msg = "Exception on executing command " + cmd; + if (err.message) { + msg += ":\n" + indent2(err.message); + if (err.stack) { + msg += "\n" + indent2(err.stack); + } + } + if (this.logger.hasLevel(3 /* verbose */)) { + if (fileRequest) { + try { + const { file, project } = this.getFileAndProject(fileRequest); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + if (scriptInfo) { + const text = getSnapshotText(scriptInfo.getSnapshot()); + msg += ` + +File text of ${fileRequest.file}:${indent2(text)} +`; + } + } catch { + } + } + if (err.ProgramFiles) { + msg += ` + +Program files: ${JSON.stringify(err.ProgramFiles)} +`; + msg += ` + +Projects:: +`; + let counter = 0; + const addProjectInfo = (project) => { + msg += ` +Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter} +`; + msg += project.filesToString( + /*writeProjectFileNames*/ + true + ); + msg += "\n-----------------------------------------------\n"; + counter++; + }; + this.projectService.externalProjects.forEach(addProjectInfo); + this.projectService.configuredProjects.forEach(addProjectInfo); + this.projectService.inferredProjects.forEach(addProjectInfo); + } + } + this.logger.msg(msg, "Err" /* Err */); + } + send(msg) { + if (msg.type === "event" && !this.canUseEvents) { + if (this.logger.hasLevel(3 /* verbose */)) { + this.logger.info(`Session does not support events: ignored event: ${stringifyIndented(msg)}`); + } + return; + } + this.writeMessage(msg); + } + writeMessage(msg) { + var _a; + const msgText = formatMessage2(msg, this.logger, this.byteLength, this.host.newLine); + (_a = perfLogger) == null ? void 0 : _a.logEvent(`Response message size: ${msgText.length}`); + this.host.write(msgText); + } + event(body, eventName) { + this.send(toEvent(eventName, body)); + } + /** @internal */ + doOutput(info, cmdName, reqSeq, success, message) { + const res = { + seq: 0, + type: "response", + command: cmdName, + request_seq: reqSeq, + success, + performanceData: this.performanceData + }; + if (success) { + let metadata; + if (isArray(info)) { + res.body = info; + metadata = info.metadata; + delete info.metadata; + } else if (typeof info === "object") { + if (info.metadata) { + const { metadata: infoMetadata, ...body } = info; + res.body = body; + metadata = infoMetadata; + } else { + res.body = info; + } + } else { + res.body = info; + } + if (metadata) + res.metadata = metadata; + } else { + Debug.assert(info === void 0); + } + if (message) { + res.message = message; + } + this.send(res); + } + semanticCheck(file, project) { + var _a, _b; + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "semanticCheck", { file, configFilePath: project.canonicalConfigFilePath }); + const diags = isDeclarationFileInJSOnlyNonConfiguredProject(project, file) ? emptyArray2 : project.getLanguageService().getSemanticDiagnostics(file).filter((d) => !!d.file); + this.sendDiagnosticsEvent(file, project, diags, "semanticDiag"); + (_b = tracing) == null ? void 0 : _b.pop(); + } + syntacticCheck(file, project) { + var _a, _b; + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "syntacticCheck", { file, configFilePath: project.canonicalConfigFilePath }); + this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSyntacticDiagnostics(file), "syntaxDiag"); + (_b = tracing) == null ? void 0 : _b.pop(); + } + suggestionCheck(file, project) { + var _a, _b; + (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "suggestionCheck", { file, configFilePath: project.canonicalConfigFilePath }); + this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSuggestionDiagnostics(file), "suggestionDiag"); + (_b = tracing) == null ? void 0 : _b.pop(); + } + sendDiagnosticsEvent(file, project, diagnostics, kind) { + try { + this.event({ file, diagnostics: diagnostics.map((diag2) => formatDiag(file, project, diag2)) }, kind); + } catch (err) { + this.logError(err, kind); + } + } + /** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */ + updateErrorCheck(next, checkList, ms, requireOpen = true) { + Debug.assert(!this.suppressDiagnosticEvents); + const seq = this.changeSeq; + const followMs = Math.min(ms, 200); + let index = 0; + const goNext = () => { + index++; + if (checkList.length > index) { + next.delay("checkOne", followMs, checkOne); + } + }; + const checkOne = () => { + if (this.changeSeq !== seq) { + return; + } + let item = checkList[index]; + if (isString(item)) { + item = this.toPendingErrorCheck(item); + if (!item) { + goNext(); + return; + } + } + const { fileName, project } = item; + updateProjectIfDirty(project); + if (!project.containsFile(fileName, requireOpen)) { + return; + } + this.syntacticCheck(fileName, project); + if (this.changeSeq !== seq) { + return; + } + if (project.projectService.serverMode !== 0 /* Semantic */) { + goNext(); + return; + } + next.immediate("semanticCheck", () => { + this.semanticCheck(fileName, project); + if (this.changeSeq !== seq) { + return; + } + if (this.getPreferences(fileName).disableSuggestions) { + goNext(); + return; + } + next.immediate("suggestionCheck", () => { + this.suggestionCheck(fileName, project); + goNext(); + }); + }); + }; + if (checkList.length > index && this.changeSeq === seq) { + next.delay("checkOne", ms, checkOne); + } + } + cleanProjects(caption, projects) { + if (!projects) { + return; + } + this.logger.info(`cleaning ${caption}`); + for (const p of projects) { + p.getLanguageService( + /*ensureSynchronized*/ + false + ).cleanupSemanticCache(); + p.cleanupProgram(); + } + } + cleanup() { + this.cleanProjects("inferred projects", this.projectService.inferredProjects); + this.cleanProjects("configured projects", arrayFrom(this.projectService.configuredProjects.values())); + this.cleanProjects("external projects", this.projectService.externalProjects); + if (this.host.gc) { + this.logger.info(`host.gc()`); + this.host.gc(); + } + } + getEncodedSyntacticClassifications(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + return languageService.getEncodedSyntacticClassifications(file, args); + } + getEncodedSemanticClassifications(args) { + const { file, project } = this.getFileAndProject(args); + const format = args.format === "2020" ? "2020" /* TwentyTwenty */ : "original" /* Original */; + return project.getLanguageService().getEncodedSemanticClassifications(file, args, format); + } + getProject(projectFileName) { + return projectFileName === void 0 ? void 0 : this.projectService.findProject(projectFileName); + } + getConfigFileAndProject(args) { + const project = this.getProject(args.projectFileName); + const file = toNormalizedPath(args.file); + return { + configFile: project && project.hasConfigFile(file) ? file : void 0, + project + }; + } + getConfigFileDiagnostics(configFile, project, includeLinePosition) { + const projectErrors = project.getAllProjectErrors(); + const optionsErrors = project.getLanguageService().getCompilerOptionsDiagnostics(); + const diagnosticsForConfigFile = filter( + concatenate(projectErrors, optionsErrors), + (diagnostic) => !!diagnostic.file && diagnostic.file.fileName === configFile + ); + return includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnosticsForConfigFile) : map( + diagnosticsForConfigFile, + (diagnostic) => formatDiagnosticToProtocol( + diagnostic, + /*includeFileName*/ + false + ) + ); + } + convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnostics) { + return diagnostics.map((d) => ({ + message: flattenDiagnosticMessageText(d.messageText, this.host.newLine), + start: d.start, + // TODO: GH#18217 + length: d.length, + // TODO: GH#18217 + category: diagnosticCategoryName(d), + code: d.code, + source: d.source, + startLocation: d.file && convertToLocation(getLineAndCharacterOfPosition(d.file, d.start)), + // TODO: GH#18217 + endLocation: d.file && convertToLocation(getLineAndCharacterOfPosition(d.file, d.start + d.length)), + // TODO: GH#18217 + reportsUnnecessary: d.reportsUnnecessary, + reportsDeprecated: d.reportsDeprecated, + relatedInformation: map(d.relatedInformation, formatRelatedInformation) + })); + } + getCompilerOptionsDiagnostics(args) { + const project = this.getProject(args.projectFileName); + return this.convertToDiagnosticsWithLinePosition( + filter( + project.getLanguageService().getCompilerOptionsDiagnostics(), + (diagnostic) => !diagnostic.file + ), + /*scriptInfo*/ + void 0 + ); + } + convertToDiagnosticsWithLinePosition(diagnostics, scriptInfo) { + return diagnostics.map( + (d) => ({ + message: flattenDiagnosticMessageText(d.messageText, this.host.newLine), + start: d.start, + length: d.length, + category: diagnosticCategoryName(d), + code: d.code, + source: d.source, + startLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start), + // TODO: GH#18217 + endLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start + d.length), + reportsUnnecessary: d.reportsUnnecessary, + reportsDeprecated: d.reportsDeprecated, + relatedInformation: map(d.relatedInformation, formatRelatedInformation) + }) + ); + } + getDiagnosticsWorker(args, isSemantic, selector, includeLinePosition) { + const { project, file } = this.getFileAndProject(args); + if (isSemantic && isDeclarationFileInJSOnlyNonConfiguredProject(project, file)) { + return emptyArray2; + } + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + const diagnostics = selector(project, file); + return includeLinePosition ? this.convertToDiagnosticsWithLinePosition(diagnostics, scriptInfo) : diagnostics.map((d) => formatDiag(file, project, d)); + } + getDefinition(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const definitions = this.mapDefinitionInfoLocations(project.getLanguageService().getDefinitionAtPosition(file, position) || emptyArray2, project); + return simplifiedResult ? this.mapDefinitionInfo(definitions, project) : definitions.map(_Session.mapToOriginalLocation); + } + mapDefinitionInfoLocations(definitions, project) { + return definitions.map((info) => { + const newDocumentSpan = getMappedDocumentSpanForProject(info, project); + return !newDocumentSpan ? info : { + ...newDocumentSpan, + containerKind: info.containerKind, + containerName: info.containerName, + kind: info.kind, + name: info.name, + failedAliasResolution: info.failedAliasResolution, + ...info.unverified && { unverified: info.unverified } + }; + }); + } + getDefinitionAndBoundSpan(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const scriptInfo = Debug.checkDefined(project.getScriptInfo(file)); + const unmappedDefinitionAndBoundSpan = project.getLanguageService().getDefinitionAndBoundSpan(file, position); + if (!unmappedDefinitionAndBoundSpan || !unmappedDefinitionAndBoundSpan.definitions) { + return { + definitions: emptyArray2, + textSpan: void 0 + // TODO: GH#18217 + }; + } + const definitions = this.mapDefinitionInfoLocations(unmappedDefinitionAndBoundSpan.definitions, project); + const { textSpan } = unmappedDefinitionAndBoundSpan; + if (simplifiedResult) { + return { + definitions: this.mapDefinitionInfo(definitions, project), + textSpan: toProtocolTextSpan(textSpan, scriptInfo) + }; + } + return { + definitions: definitions.map(_Session.mapToOriginalLocation), + textSpan + }; + } + findSourceDefinition(args) { + var _a; + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const unmappedDefinitions = project.getLanguageService().getDefinitionAtPosition(file, position); + 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, + getDocumentSpansEqualityComparer(this.host.useCaseSensitiveFileNames) + ); + definitions == null ? void 0 : definitions.forEach((d) => definitionSet.add(d)); + const noDtsProject = project.getNoDtsResolutionProject(file); + const ls = noDtsProject.getLanguageService(); + const jsDefinitions = (_a = ls.getDefinitionAtPosition( + file, + position, + /*searchOtherFilesOnly*/ + true, + /*stopAtAlias*/ + false + )) == null ? void 0 : _a.filter((d) => toNormalizedPath(d.fileName) !== file); + if (some(jsDefinitions)) { + for (const jsDefinition of jsDefinitions) { + if (jsDefinition.unverified) { + const refined = tryRefineDefinition(jsDefinition, project.getLanguageService().getProgram(), ls.getProgram()); + if (some(refined)) { + for (const def of refined) { + definitionSet.add(def); + } + continue; + } + } + definitionSet.add(jsDefinition); + } + } else { + const ambientCandidates = definitions.filter((d) => toNormalizedPath(d.fileName) !== file && d.isAmbient); + for (const candidate of some(ambientCandidates) ? ambientCandidates : getAmbientCandidatesByClimbingAccessChain()) { + const fileNameToSearch = findImplementationFileFromDtsFileName(candidate.fileName, file, noDtsProject); + if (!fileNameToSearch) + continue; + const info = this.projectService.getOrCreateScriptInfoNotOpenedByClient( + fileNameToSearch, + noDtsProject.currentDirectory, + noDtsProject.directoryStructureHost + ); + if (!info) + continue; + if (!noDtsProject.containsScriptInfo(info)) { + noDtsProject.addRoot(info); + noDtsProject.updateGraph(); + } + const noDtsProgram = ls.getProgram(); + const fileToSearch = Debug.checkDefined(noDtsProgram.getSourceFile(fileNameToSearch)); + for (const match of searchForDeclaration(candidate.name, fileToSearch, noDtsProgram)) { + definitionSet.add(match); + } + } + } + definitions = arrayFrom(definitionSet.values()); + } + definitions = definitions.filter((d) => !d.isAmbient && !d.failedAliasResolution); + return this.mapDefinitionInfo(definitions, project); + function findImplementationFileFromDtsFileName(fileName, resolveFromFile, auxiliaryProject) { + var _a2, _b, _c; + const nodeModulesPathParts = getNodeModulePathParts(fileName); + if (nodeModulesPathParts && fileName.lastIndexOf(nodeModulesPathPart) === nodeModulesPathParts.topLevelNodeModulesIndex) { + const packageDirectory = fileName.substring(0, nodeModulesPathParts.packageRootIndex); + const packageJsonCache = (_a2 = project.getModuleResolutionCache()) == null ? void 0 : _a2.getPackageJsonInfoCache(); + const compilerOptions = project.getCompilationSettings(); + const packageJson = getPackageScopeForPath(getNormalizedAbsolutePath(packageDirectory + "/package.json", project.getCurrentDirectory()), getTemporaryModuleResolutionState(packageJsonCache, project, compilerOptions)); + if (!packageJson) + return void 0; + const entrypoints = getEntrypointsFromPackageJsonInfo( + packageJson, + { moduleResolution: 2 /* Node10 */ }, + project, + project.getModuleResolutionCache() + ); + const packageNamePathPart = fileName.substring( + nodeModulesPathParts.topLevelPackageNameIndex + 1, + nodeModulesPathParts.packageRootIndex + ); + const packageName = getPackageNameFromTypesPackageName(unmangleScopedPackageName(packageNamePathPart)); + const path = project.toPath(fileName); + if (entrypoints && some(entrypoints, (e) => project.toPath(e) === path)) { + return (_b = auxiliaryProject.resolutionCache.resolveSingleModuleNameWithoutWatching(packageName, resolveFromFile).resolvedModule) == null ? void 0 : _b.resolvedFileName; + } else { + const pathToFileInPackage = fileName.substring(nodeModulesPathParts.packageRootIndex + 1); + const specifier = `${packageName}/${removeFileExtension(pathToFileInPackage)}`; + return (_c = auxiliaryProject.resolutionCache.resolveSingleModuleNameWithoutWatching(specifier, resolveFromFile).resolvedModule) == null ? void 0 : _c.resolvedFileName; + } + } + return void 0; + } + function getAmbientCandidatesByClimbingAccessChain() { + const ls = project.getLanguageService(); + const program = ls.getProgram(); + const initialNode = getTouchingPropertyName(program.getSourceFile(file), position); + if ((isStringLiteralLike(initialNode) || isIdentifier(initialNode)) && isAccessExpression(initialNode.parent)) { + return forEachNameInAccessChainWalkingLeft(initialNode, (nameInChain) => { + var _a2; + if (nameInChain === initialNode) + return void 0; + const candidates = (_a2 = ls.getDefinitionAtPosition( + file, + nameInChain.getStart(), + /*searchOtherFilesOnly*/ + true, + /*stopAtAlias*/ + false + )) == null ? void 0 : _a2.filter((d) => toNormalizedPath(d.fileName) !== file && d.isAmbient).map((d) => ({ + fileName: d.fileName, + name: getTextOfIdentifierOrLiteral(initialNode) + })); + if (some(candidates)) { + return candidates; + } + }) || emptyArray2; + } + return emptyArray2; + } + function tryRefineDefinition(definition, program, noDtsProgram) { + var _a2; + const fileToSearch = noDtsProgram.getSourceFile(definition.fileName); + if (!fileToSearch) { + return void 0; + } + const initialNode = getTouchingPropertyName(program.getSourceFile(file), position); + const symbol = program.getTypeChecker().getSymbolAtLocation(initialNode); + const importSpecifier = symbol && getDeclarationOfKind(symbol, 276 /* ImportSpecifier */); + if (!importSpecifier) + return void 0; + const nameToSearch = ((_a2 = importSpecifier.propertyName) == null ? void 0 : _a2.text) || importSpecifier.name.text; + return searchForDeclaration(nameToSearch, fileToSearch, noDtsProgram); + } + function searchForDeclaration(declarationName, fileToSearch, noDtsProgram) { + const matches = ts_FindAllReferences_exports.Core.getTopMostDeclarationNamesInFile(declarationName, fileToSearch); + return mapDefined(matches, (match) => { + const symbol = noDtsProgram.getTypeChecker().getSymbolAtLocation(match); + const decl = getDeclarationFromName(match); + if (symbol && decl) { + return ts_GoToDefinition_exports.createDefinitionInfo( + decl, + noDtsProgram.getTypeChecker(), + symbol, + decl, + /*unverified*/ + true + ); + } + }); + } + } + getEmitOutput(args) { + const { file, project } = this.getFileAndProject(args); + if (!project.shouldEmitFile(project.getScriptInfo(file))) { + return { emitSkipped: true, outputFiles: [], diagnostics: [] }; + } + const result = project.getLanguageService().getEmitOutput(file); + return args.richResponse ? { + ...result, + diagnostics: args.includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(result.diagnostics) : result.diagnostics.map((d) => formatDiagnosticToProtocol( + d, + /*includeFileName*/ + true + )) + } : result; + } + mapJSDocTagInfo(tags, project, richResponse) { + return tags ? tags.map((tag) => { + var _a; + return { + ...tag, + text: richResponse ? this.mapDisplayParts(tag.text, project) : (_a = tag.text) == null ? void 0 : _a.map((part) => part.text).join("") + }; + }) : []; + } + mapDisplayParts(parts, project) { + if (!parts) { + return []; + } + return parts.map( + (part) => part.kind !== "linkName" ? part : { + ...part, + target: this.toFileSpan(part.target.fileName, part.target.textSpan, project) + } + ); + } + mapSignatureHelpItems(items, project, richResponse) { + return items.map((item) => ({ + ...item, + documentation: this.mapDisplayParts(item.documentation, project), + parameters: item.parameters.map((p) => ({ ...p, documentation: this.mapDisplayParts(p.documentation, project) })), + tags: this.mapJSDocTagInfo(item.tags, project, richResponse) + })); + } + mapDefinitionInfo(definitions, project) { + return definitions.map((def) => ({ ...this.toFileSpanWithContext(def.fileName, def.textSpan, def.contextSpan, project), ...def.unverified && { unverified: def.unverified } })); + } + /* + * When we map a .d.ts location to .ts, Visual Studio gets confused because there's no associated Roslyn Document in + * the same project which corresponds to the file. VS Code has no problem with this, and luckily we have two protocols. + * This retains the existing behavior for the "simplified" (VS Code) protocol but stores the .d.ts location in a + * set of additional fields, and does the reverse for VS (store the .d.ts location where + * it used to be and stores the .ts location in the additional fields). + */ + static mapToOriginalLocation(def) { + if (def.originalFileName) { + Debug.assert(def.originalTextSpan !== void 0, "originalTextSpan should be present if originalFileName is"); + return { + ...def, + fileName: def.originalFileName, + textSpan: def.originalTextSpan, + targetFileName: def.fileName, + targetTextSpan: def.textSpan, + contextSpan: def.originalContextSpan, + targetContextSpan: def.contextSpan + }; + } + return def; + } + toFileSpan(fileName, textSpan, project) { + const ls = project.getLanguageService(); + const start = ls.toLineColumnOffset(fileName, textSpan.start); + const end = ls.toLineColumnOffset(fileName, textSpanEnd(textSpan)); + return { + file: fileName, + start: { line: start.line + 1, offset: start.character + 1 }, + end: { line: end.line + 1, offset: end.character + 1 } + }; + } + toFileSpanWithContext(fileName, textSpan, contextSpan, project) { + const fileSpan = this.toFileSpan(fileName, textSpan, project); + const context = contextSpan && this.toFileSpan(fileName, contextSpan, project); + return context ? { ...fileSpan, contextStart: context.start, contextEnd: context.end } : fileSpan; + } + getTypeDefinition(args) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const definitions = this.mapDefinitionInfoLocations(project.getLanguageService().getTypeDefinitionAtPosition(file, position) || emptyArray2, project); + return this.mapDefinitionInfo(definitions, project); + } + mapImplementationLocations(implementations, project) { + return implementations.map((info) => { + const newDocumentSpan = getMappedDocumentSpanForProject(info, project); + return !newDocumentSpan ? info : { + ...newDocumentSpan, + kind: info.kind, + displayParts: info.displayParts + }; + }); + } + getImplementation(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const implementations = this.mapImplementationLocations(project.getLanguageService().getImplementationAtPosition(file, position) || emptyArray2, project); + return simplifiedResult ? implementations.map(({ fileName, textSpan, contextSpan }) => this.toFileSpanWithContext(fileName, textSpan, contextSpan, project)) : implementations.map(_Session.mapToOriginalLocation); + } + getSyntacticDiagnosticsSync(args) { + const { configFile } = this.getConfigFileAndProject(args); + if (configFile) { + return emptyArray2; + } + return this.getDiagnosticsWorker( + args, + /*isSemantic*/ + false, + (project, file) => project.getLanguageService().getSyntacticDiagnostics(file), + !!args.includeLinePosition + ); + } + getSemanticDiagnosticsSync(args) { + const { configFile, project } = this.getConfigFileAndProject(args); + if (configFile) { + return this.getConfigFileDiagnostics(configFile, project, !!args.includeLinePosition); + } + return this.getDiagnosticsWorker( + args, + /*isSemantic*/ + true, + (project2, file) => project2.getLanguageService().getSemanticDiagnostics(file).filter((d) => !!d.file), + !!args.includeLinePosition + ); + } + getSuggestionDiagnosticsSync(args) { + const { configFile } = this.getConfigFileAndProject(args); + if (configFile) { + return emptyArray2; + } + return this.getDiagnosticsWorker( + args, + /*isSemantic*/ + true, + (project, file) => project.getLanguageService().getSuggestionDiagnostics(file), + !!args.includeLinePosition + ); + } + getJsxClosingTag(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + const tag = languageService.getJsxClosingTagAtPosition(file, position); + return tag === void 0 ? void 0 : { newText: tag.newText, caretOffset: 0 }; + } + getLinkedEditingRange(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + const linkedEditInfo = languageService.getLinkedEditingRangeAtPosition(file, position); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + if (scriptInfo === void 0 || linkedEditInfo === void 0) + return void 0; + return convertLinkedEditInfoToRanges(linkedEditInfo, scriptInfo); + } + getDocumentHighlights(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const documentHighlights = project.getLanguageService().getDocumentHighlights(file, position, args.filesToSearch); + if (!documentHighlights) + return emptyArray2; + if (!simplifiedResult) + return documentHighlights; + return documentHighlights.map(({ fileName, highlightSpans }) => { + const scriptInfo = project.getScriptInfo(fileName); + return { + file: fileName, + highlightSpans: highlightSpans.map(({ textSpan, kind, contextSpan }) => ({ + ...toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo), + kind + })) + }; + }); + } + provideInlayHints(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const hints = project.getLanguageService().provideInlayHints(file, args, this.getPreferences(file)); + return hints.map((hint) => { + const { position, displayParts } = hint; + return { + ...hint, + position: scriptInfo.positionToLineOffset(position), + displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => { + if (span) { + Debug.assertIsDefined(file2, "Target file should be defined together with its span."); + const scriptInfo2 = this.projectService.getScriptInfo(file2); + return { + text, + span: { + start: scriptInfo2.positionToLineOffset(span.start), + end: scriptInfo2.positionToLineOffset(span.start + span.length), + file: file2 + } + }; + } else { + return { text }; + } + }) + }; + }); + } + setCompilerOptionsForInferredProjects(args) { + this.projectService.setCompilerOptionsForInferredProjects(args.options, args.projectRootPath); + } + getProjectInfo(args) { + return this.getProjectInfoWorker( + args.file, + args.projectFileName, + args.needFileNameList, + /*excludeConfigFiles*/ + false + ); + } + getProjectInfoWorker(uncheckedFileName, projectFileName, needFileNameList, excludeConfigFiles) { + const { project } = this.getFileAndProjectWorker(uncheckedFileName, projectFileName); + updateProjectIfDirty(project); + const projectInfo = { + configFileName: project.getProjectName(), + languageServiceDisabled: !project.languageServiceEnabled, + fileNames: needFileNameList ? project.getFileNames( + /*excludeFilesFromExternalLibraries*/ + false, + excludeConfigFiles + ) : void 0 + }; + return projectInfo; + } + getRenameInfo(args) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const preferences = this.getPreferences(file); + return project.getLanguageService().getRenameInfo(file, position, preferences); + } + getProjects(args, getScriptInfoEnsuringProjectsUptoDate, ignoreNoProjectError) { + let projects; + let symLinkedProjects; + if (args.projectFileName) { + const project = this.getProject(args.projectFileName); + if (project) { + projects = [project]; + } + } else { + const scriptInfo = getScriptInfoEnsuringProjectsUptoDate ? this.projectService.getScriptInfoEnsuringProjectsUptoDate(args.file) : this.projectService.getScriptInfo(args.file); + if (!scriptInfo) { + if (ignoreNoProjectError) + return emptyArray2; + this.projectService.logErrorForScriptInfoNotFound(args.file); + return Errors.ThrowNoProject(); + } else if (!getScriptInfoEnsuringProjectsUptoDate) { + this.projectService.ensureDefaultProjectForFile(scriptInfo); + } + projects = scriptInfo.containingProjects; + symLinkedProjects = this.projectService.getSymlinkedProjects(scriptInfo); + } + projects = filter(projects, (p) => p.languageServiceEnabled && !p.isOrphan()); + if (!ignoreNoProjectError && (!projects || !projects.length) && !symLinkedProjects) { + this.projectService.logErrorForScriptInfoNotFound(args.file ?? args.projectFileName); + return Errors.ThrowNoProject(); + } + return symLinkedProjects ? { projects, symLinkedProjects } : projects; + } + getDefaultProject(args) { + if (args.projectFileName) { + const project = this.getProject(args.projectFileName); + if (project) { + return project; + } + if (!args.file) { + return Errors.ThrowNoProject(); + } + } + const info = this.projectService.getScriptInfo(args.file); + return info.getDefaultProject(); + } + getRenameLocations(args, simplifiedResult) { + const file = toNormalizedPath(args.file); + const position = this.getPositionInFile(args, file); + const projects = this.getProjects(args); + const defaultProject = this.getDefaultProject(args); + const preferences = this.getPreferences(file); + const renameInfo = this.mapRenameInfo( + defaultProject.getLanguageService().getRenameInfo(file, position, preferences), + Debug.checkDefined(this.projectService.getScriptInfo(file)) + ); + if (!renameInfo.canRename) + return simplifiedResult ? { info: renameInfo, locs: [] } : []; + const locations = getRenameLocationsWorker( + projects, + defaultProject, + { fileName: args.file, pos: position }, + !!args.findInStrings, + !!args.findInComments, + preferences, + this.host.useCaseSensitiveFileNames + ); + if (!simplifiedResult) + return locations; + return { info: renameInfo, locs: this.toSpanGroups(locations) }; + } + mapRenameInfo(info, scriptInfo) { + if (info.canRename) { + const { canRename, fileToRename, displayName, fullDisplayName, kind, kindModifiers, triggerSpan } = info; + return identity( + { canRename, fileToRename, displayName, fullDisplayName, kind, kindModifiers, triggerSpan: toProtocolTextSpan(triggerSpan, scriptInfo) } + ); + } else { + return info; + } + } + toSpanGroups(locations) { + const map2 = /* @__PURE__ */ new Map(); + for (const { fileName, textSpan, contextSpan, originalContextSpan: _2, originalTextSpan: _, originalFileName: _1, ...prefixSuffixText } of locations) { + let group2 = map2.get(fileName); + if (!group2) + map2.set(fileName, group2 = { file: fileName, locs: [] }); + const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(fileName)); + group2.locs.push({ ...toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo), ...prefixSuffixText }); + } + return arrayFrom(map2.values()); + } + getReferences(args, simplifiedResult) { + const file = toNormalizedPath(args.file); + const projects = this.getProjects(args); + const position = this.getPositionInFile(args, file); + const references = getReferencesWorker( + projects, + this.getDefaultProject(args), + { fileName: args.file, pos: position }, + this.host.useCaseSensitiveFileNames, + this.logger + ); + if (!simplifiedResult) + return references; + const preferences = this.getPreferences(file); + const defaultProject = this.getDefaultProject(args); + const scriptInfo = defaultProject.getScriptInfoForNormalizedPath(file); + const nameInfo = defaultProject.getLanguageService().getQuickInfoAtPosition(file, position); + const symbolDisplayString = nameInfo ? displayPartsToString(nameInfo.displayParts) : ""; + const nameSpan = nameInfo && nameInfo.textSpan; + const symbolStartOffset = nameSpan ? scriptInfo.positionToLineOffset(nameSpan.start).offset : 0; + const symbolName2 = nameSpan ? scriptInfo.getSnapshot().getText(nameSpan.start, textSpanEnd(nameSpan)) : ""; + const refs = flatMap(references, (referencedSymbol) => { + return referencedSymbol.references.map((entry) => referenceEntryToReferencesResponseItem(this.projectService, entry, preferences)); + }); + return { refs, symbolName: symbolName2, symbolStartOffset, symbolDisplayString }; + } + getFileReferences(args, simplifiedResult) { + const projects = this.getProjects(args); + const fileName = args.file; + const preferences = this.getPreferences(toNormalizedPath(fileName)); + const references = []; + const seen = createDocumentSpanSet(this.host.useCaseSensitiveFileNames); + forEachProjectInProjects( + projects, + /*path*/ + void 0, + (project) => { + if (project.getCancellationToken().isCancellationRequested()) + return; + const projectOutputs = project.getLanguageService().getFileReferences(fileName); + if (projectOutputs) { + for (const referenceEntry of projectOutputs) { + if (!seen.has(referenceEntry)) { + references.push(referenceEntry); + seen.add(referenceEntry); + } + } + } + } + ); + if (!simplifiedResult) + return references; + const refs = references.map((entry) => referenceEntryToReferencesResponseItem(this.projectService, entry, preferences)); + return { + refs, + symbolName: `"${args.file}"` + }; + } + /** + * @param fileName is the name of the file to be opened + * @param fileContent is a version of the file content that is known to be more up to date than the one on disk + */ + openClientFile(fileName, fileContent, scriptKind, projectRootPath) { + this.projectService.openClientFileWithNormalizedPath( + fileName, + fileContent, + scriptKind, + /*hasMixedContent*/ + false, + projectRootPath + ); + } + getPosition(args, scriptInfo) { + return args.position !== void 0 ? args.position : scriptInfo.lineOffsetToPosition(args.line, args.offset); + } + getPositionInFile(args, file) { + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + return this.getPosition(args, scriptInfo); + } + getFileAndProject(args) { + return this.getFileAndProjectWorker(args.file, args.projectFileName); + } + getFileAndLanguageServiceForSyntacticOperation(args) { + const { file, project } = this.getFileAndProject(args); + return { + file, + languageService: project.getLanguageService( + /*ensureSynchronized*/ + false + ) + }; + } + getFileAndProjectWorker(uncheckedFileName, projectFileName) { + const file = toNormalizedPath(uncheckedFileName); + const project = this.getProject(projectFileName) || this.projectService.ensureDefaultProjectForFile(file); + return { file, project }; + } + getOutliningSpans(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const spans = languageService.getOutliningSpans(file); + if (simplifiedResult) { + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + return spans.map((s) => ({ + textSpan: toProtocolTextSpan(s.textSpan, scriptInfo), + hintSpan: toProtocolTextSpan(s.hintSpan, scriptInfo), + bannerText: s.bannerText, + autoCollapse: s.autoCollapse, + kind: s.kind + })); + } else { + return spans; + } + } + getTodoComments(args) { + const { file, project } = this.getFileAndProject(args); + return project.getLanguageService().getTodoComments(file, args.descriptors); + } + getDocCommentTemplate(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file), this.getFormatOptions(file)); + } + getSpanOfEnclosingComment(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const onlyMultiLine = args.onlyMultiLine; + const position = this.getPositionInFile(args, file); + return languageService.getSpanOfEnclosingComment(file, position, onlyMultiLine); + } + getIndentation(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + const options = args.options ? convertFormatOptions(args.options) : this.getFormatOptions(file); + const indentation = languageService.getIndentationAtPosition(file, position, options); + return { position, indentation }; + } + getBreakpointStatement(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + return languageService.getBreakpointStatementAtPosition(file, position); + } + getNameOrDottedNameSpan(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + return languageService.getNameOrDottedNameSpan(file, position, position); + } + isValidBraceCompletion(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + return languageService.isValidBraceCompletionAtPosition(file, position, args.openingBrace.charCodeAt(0)); + } + getQuickInfoWorker(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const quickInfo = project.getLanguageService().getQuickInfoAtPosition(file, this.getPosition(args, scriptInfo)); + if (!quickInfo) { + return void 0; + } + const useDisplayParts = !!this.getPreferences(file).displayPartsForJSDoc; + if (simplifiedResult) { + const displayString = displayPartsToString(quickInfo.displayParts); + return { + kind: quickInfo.kind, + kindModifiers: quickInfo.kindModifiers, + start: scriptInfo.positionToLineOffset(quickInfo.textSpan.start), + end: scriptInfo.positionToLineOffset(textSpanEnd(quickInfo.textSpan)), + displayString, + documentation: useDisplayParts ? this.mapDisplayParts(quickInfo.documentation, project) : displayPartsToString(quickInfo.documentation), + tags: this.mapJSDocTagInfo(quickInfo.tags, project, useDisplayParts) + }; + } else { + return useDisplayParts ? quickInfo : { + ...quickInfo, + tags: this.mapJSDocTagInfo( + quickInfo.tags, + project, + /*richResponse*/ + false + ) + }; + } + } + getFormattingEditsForRange(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const startPosition = scriptInfo.lineOffsetToPosition(args.line, args.offset); + const endPosition = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); + const edits = languageService.getFormattingEditsForRange(file, startPosition, endPosition, this.getFormatOptions(file)); + if (!edits) { + return void 0; + } + return edits.map((edit) => this.convertTextChangeToCodeEdit(edit, scriptInfo)); + } + getFormattingEditsForRangeFull(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const options = args.options ? convertFormatOptions(args.options) : this.getFormatOptions(file); + return languageService.getFormattingEditsForRange(file, args.position, args.endPosition, options); + } + getFormattingEditsForDocumentFull(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const options = args.options ? convertFormatOptions(args.options) : this.getFormatOptions(file); + return languageService.getFormattingEditsForDocument(file, options); + } + getFormattingEditsAfterKeystrokeFull(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const options = args.options ? convertFormatOptions(args.options) : this.getFormatOptions(file); + return languageService.getFormattingEditsAfterKeystroke(file, args.position, args.key, options); + } + getFormattingEditsAfterKeystroke(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = scriptInfo.lineOffsetToPosition(args.line, args.offset); + const formatOptions = this.getFormatOptions(file); + const edits = languageService.getFormattingEditsAfterKeystroke(file, position, args.key, formatOptions); + if (args.key === "\n" && (!edits || edits.length === 0 || allEditsBeforePos(edits, position))) { + const { lineText, absolutePosition } = scriptInfo.textStorage.getAbsolutePositionAndLineText(args.line); + if (lineText && lineText.search("\\S") < 0) { + const preferredIndent = languageService.getIndentationAtPosition(file, position, formatOptions); + let hasIndent = 0; + let i, len; + for (i = 0, len = lineText.length; i < len; i++) { + if (lineText.charAt(i) === " ") { + hasIndent++; + } else if (lineText.charAt(i) === " ") { + hasIndent += formatOptions.tabSize; + } else { + break; + } + } + if (preferredIndent !== hasIndent) { + const firstNoWhiteSpacePosition = absolutePosition + i; + edits.push({ + span: createTextSpanFromBounds(absolutePosition, firstNoWhiteSpacePosition), + newText: ts_formatting_exports.getIndentationString(preferredIndent, formatOptions) + }); + } + } + } + if (!edits) { + return void 0; + } + return edits.map((edit) => { + return { + start: scriptInfo.positionToLineOffset(edit.span.start), + end: scriptInfo.positionToLineOffset(textSpanEnd(edit.span)), + newText: edit.newText ? edit.newText : "" + }; + }); + } + getCompletions(args, kind) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = this.getPosition(args, scriptInfo); + const completions = project.getLanguageService().getCompletionsAtPosition( + file, + position, + { + ...convertUserPreferences(this.getPreferences(file)), + triggerCharacter: args.triggerCharacter, + triggerKind: args.triggerKind, + includeExternalModuleExports: args.includeExternalModuleExports, + includeInsertTextCompletions: args.includeInsertTextCompletions + }, + project.projectService.getFormatCodeOptions(file) + ); + if (completions === void 0) + return void 0; + if (kind === "completions-full" /* CompletionsFull */) + return completions; + const prefix = args.prefix || ""; + const entries = mapDefined(completions.entries, (entry) => { + if (completions.isMemberCompletion || startsWith(entry.name.toLowerCase(), prefix.toLowerCase())) { + const { + name, + kind: kind2, + kindModifiers, + sortText, + insertText, + filterText, + replacementSpan, + hasAction, + source, + sourceDisplay, + labelDetails, + isSnippet, + isRecommended, + isPackageJsonImport, + isImportStatementCompletion, + data + } = entry; + const convertedSpan = replacementSpan ? toProtocolTextSpan(replacementSpan, scriptInfo) : void 0; + return { + name, + kind: kind2, + kindModifiers, + sortText, + insertText, + filterText, + replacementSpan: convertedSpan, + isSnippet, + hasAction: hasAction || void 0, + source, + sourceDisplay, + labelDetails, + isRecommended, + isPackageJsonImport, + isImportStatementCompletion, + data + }; + } + }); + if (kind === "completions" /* Completions */) { + if (completions.metadata) + entries.metadata = completions.metadata; + return entries; + } + const res = { + ...completions, + optionalReplacementSpan: completions.optionalReplacementSpan && toProtocolTextSpan(completions.optionalReplacementSpan, scriptInfo), + entries + }; + return res; + } + getCompletionEntryDetails(args, fullResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = this.getPosition(args, scriptInfo); + const formattingOptions = project.projectService.getFormatCodeOptions(file); + const useDisplayParts = !!this.getPreferences(file).displayPartsForJSDoc; + const result = mapDefined(args.entryNames, (entryName) => { + const { name, source, data } = typeof entryName === "string" ? { name: entryName, source: void 0, data: void 0 } : entryName; + return project.getLanguageService().getCompletionEntryDetails(file, position, name, formattingOptions, source, this.getPreferences(file), data ? cast(data, isCompletionEntryData) : void 0); + }); + return fullResult ? useDisplayParts ? result : result.map((details) => ({ ...details, tags: this.mapJSDocTagInfo( + details.tags, + project, + /*richResponse*/ + false + ) })) : result.map((details) => ({ + ...details, + codeActions: map(details.codeActions, (action) => this.mapCodeAction(action)), + documentation: this.mapDisplayParts(details.documentation, project), + tags: this.mapJSDocTagInfo(details.tags, project, useDisplayParts) + })); + } + getCompileOnSaveAffectedFileList(args) { + const projects = this.getProjects( + args, + /*getScriptInfoEnsuringProjectsUptoDate*/ + true, + /*ignoreNoProjectError*/ + true + ); + const info = this.projectService.getScriptInfo(args.file); + if (!info) { + return emptyArray2; + } + return combineProjectOutput( + info, + (path) => this.projectService.getScriptInfoForPath(path), + projects, + (project, info2) => { + if (!project.compileOnSaveEnabled || !project.languageServiceEnabled || project.isOrphan()) { + return void 0; + } + const compilationSettings = project.getCompilationSettings(); + if (!!compilationSettings.noEmit || isDeclarationFileName(info2.fileName) && !dtsChangeCanAffectEmit(compilationSettings)) { + return void 0; + } + return { + projectFileName: project.getProjectName(), + fileNames: project.getCompileOnSaveAffectedFileList(info2), + projectUsesOutFile: !!outFile(compilationSettings) + }; + } + ); + } + emitFile(args) { + const { file, project } = this.getFileAndProject(args); + if (!project) { + Errors.ThrowNoProject(); + } + if (!project.languageServiceEnabled) { + return args.richResponse ? { emitSkipped: true, diagnostics: [] } : false; + } + const scriptInfo = project.getScriptInfo(file); + const { emitSkipped, diagnostics } = project.emitFile(scriptInfo, (path, data, writeByteOrderMark) => this.host.writeFile(path, data, writeByteOrderMark)); + return args.richResponse ? { + emitSkipped, + diagnostics: args.includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnostics) : diagnostics.map((d) => formatDiagnosticToProtocol( + d, + /*includeFileName*/ + true + )) + } : !emitSkipped; + } + getSignatureHelpItems(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = this.getPosition(args, scriptInfo); + const helpItems = project.getLanguageService().getSignatureHelpItems(file, position, args); + const useDisplayParts = !!this.getPreferences(file).displayPartsForJSDoc; + if (helpItems && simplifiedResult) { + const span = helpItems.applicableSpan; + return { + ...helpItems, + applicableSpan: { + start: scriptInfo.positionToLineOffset(span.start), + end: scriptInfo.positionToLineOffset(span.start + span.length) + }, + items: this.mapSignatureHelpItems(helpItems.items, project, useDisplayParts) + }; + } else if (useDisplayParts || !helpItems) { + return helpItems; + } else { + return { + ...helpItems, + items: helpItems.items.map((item) => ({ ...item, tags: this.mapJSDocTagInfo( + item.tags, + project, + /*richResponse*/ + false + ) })) + }; + } + } + toPendingErrorCheck(uncheckedFileName) { + const fileName = toNormalizedPath(uncheckedFileName); + const project = this.projectService.tryGetDefaultProjectForFile(fileName); + return project && { fileName, project }; + } + getDiagnostics(next, delay, fileNames) { + if (this.suppressDiagnosticEvents) { + return; + } + if (fileNames.length > 0) { + this.updateErrorCheck(next, fileNames, delay); + } + } + change(args) { + const scriptInfo = this.projectService.getScriptInfo(args.file); + Debug.assert(!!scriptInfo); + scriptInfo.textStorage.switchToScriptVersionCache(); + const start = scriptInfo.lineOffsetToPosition(args.line, args.offset); + const end = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); + if (start >= 0) { + this.changeSeq++; + this.projectService.applyChangesToFile( + scriptInfo, + singleIterator({ + span: { start, length: end - start }, + newText: args.insertString + // TODO: GH#18217 + }) + ); + } + } + reload(args, reqSeq) { + const file = toNormalizedPath(args.file); + const tempFileName = args.tmpfile === void 0 ? void 0 : toNormalizedPath(args.tmpfile); + const info = this.projectService.getScriptInfoForNormalizedPath(file); + if (info) { + this.changeSeq++; + if (info.reloadFromFile(tempFileName)) { + this.doOutput( + /*info*/ + void 0, + "reload" /* Reload */, + reqSeq, + /*success*/ + true + ); + } + } + } + saveToTmp(fileName, tempFileName) { + const scriptInfo = this.projectService.getScriptInfo(fileName); + if (scriptInfo) { + scriptInfo.saveTo(tempFileName); + } + } + closeClientFile(fileName) { + if (!fileName) { + return; + } + const file = normalizePath(fileName); + this.projectService.closeClientFile(file); + } + mapLocationNavigationBarItems(items, scriptInfo) { + return map(items, (item) => ({ + text: item.text, + kind: item.kind, + kindModifiers: item.kindModifiers, + spans: item.spans.map((span) => toProtocolTextSpan(span, scriptInfo)), + childItems: this.mapLocationNavigationBarItems(item.childItems, scriptInfo), + indent: item.indent + })); + } + getNavigationBarItems(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const items = languageService.getNavigationBarItems(file); + return !items ? void 0 : simplifiedResult ? this.mapLocationNavigationBarItems(items, this.projectService.getScriptInfoForNormalizedPath(file)) : items; + } + toLocationNavigationTree(tree, scriptInfo) { + return { + text: tree.text, + kind: tree.kind, + kindModifiers: tree.kindModifiers, + spans: tree.spans.map((span) => toProtocolTextSpan(span, scriptInfo)), + nameSpan: tree.nameSpan && toProtocolTextSpan(tree.nameSpan, scriptInfo), + childItems: map(tree.childItems, (item) => this.toLocationNavigationTree(item, scriptInfo)) + }; + } + getNavigationTree(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const tree = languageService.getNavigationTree(file); + return !tree ? void 0 : simplifiedResult ? this.toLocationNavigationTree(tree, this.projectService.getScriptInfoForNormalizedPath(file)) : tree; + } + getNavigateToItems(args, simplifiedResult) { + const full = this.getFullNavigateToItems(args); + return !simplifiedResult ? flatMap(full, ({ navigateToItems }) => navigateToItems) : flatMap( + full, + ({ project, navigateToItems }) => navigateToItems.map((navItem) => { + const scriptInfo = project.getScriptInfo(navItem.fileName); + const bakedItem = { + name: navItem.name, + kind: navItem.kind, + kindModifiers: navItem.kindModifiers, + isCaseSensitive: navItem.isCaseSensitive, + matchKind: navItem.matchKind, + file: navItem.fileName, + start: scriptInfo.positionToLineOffset(navItem.textSpan.start), + end: scriptInfo.positionToLineOffset(textSpanEnd(navItem.textSpan)) + }; + if (navItem.kindModifiers && navItem.kindModifiers !== "") { + bakedItem.kindModifiers = navItem.kindModifiers; + } + if (navItem.containerName && navItem.containerName.length > 0) { + bakedItem.containerName = navItem.containerName; + } + if (navItem.containerKind && navItem.containerKind.length > 0) { + bakedItem.containerKind = navItem.containerKind; + } + return bakedItem; + }) + ); + } + getFullNavigateToItems(args) { + const { currentFileOnly, searchValue, maxResultCount, projectFileName } = args; + if (currentFileOnly) { + Debug.assertIsDefined(args.file); + const { file, project } = this.getFileAndProject(args); + return [{ project, navigateToItems: project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, file) }]; + } + const preferences = this.getHostPreferences(); + const outputs = []; + const seenItems = /* @__PURE__ */ new Map(); + if (!args.file && !projectFileName) { + this.projectService.loadAncestorProjectTree(); + this.projectService.forEachEnabledProject((project) => addItemsForProject(project)); + } else { + const projects = this.getProjects(args); + forEachProjectInProjects( + projects, + /*path*/ + void 0, + (project) => addItemsForProject(project) + ); + } + return outputs; + function addItemsForProject(project) { + const projectItems = project.getLanguageService().getNavigateToItems( + searchValue, + maxResultCount, + /*fileName*/ + void 0, + /*excludeDts*/ + project.isNonTsProject(), + /*excludeLibFiles*/ + preferences.excludeLibrarySymbolsInNavTo + ); + const unseenItems = filter(projectItems, (item) => tryAddSeenItem(item) && !getMappedLocationForProject(documentSpanLocation(item), project)); + if (unseenItems.length) { + outputs.push({ project, navigateToItems: unseenItems }); + } + } + function tryAddSeenItem(item) { + const name = item.name; + if (!seenItems.has(name)) { + seenItems.set(name, [item]); + return true; + } + const seen = seenItems.get(name); + for (const seenItem of seen) { + if (navigateToItemIsEqualTo(seenItem, item)) { + return false; + } + } + seen.push(item); + return true; + } + function navigateToItemIsEqualTo(a, b) { + if (a === b) { + return true; + } + if (!a || !b) { + return false; + } + return a.containerKind === b.containerKind && a.containerName === b.containerName && a.fileName === b.fileName && a.isCaseSensitive === b.isCaseSensitive && a.kind === b.kind && a.kindModifiers === b.kindModifiers && a.matchKind === b.matchKind && a.name === b.name && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length; + } + } + getSupportedCodeFixes(args) { + if (!args) + return getSupportedCodeFixes(); + if (args.file) { + const { file, project: project2 } = this.getFileAndProject(args); + return project2.getLanguageService().getSupportedCodeFixes(file); + } + const project = this.getProject(args.projectFileName); + if (!project) + Errors.ThrowNoProject(); + return project.getLanguageService().getSupportedCodeFixes(); + } + isLocation(locationOrSpan) { + return locationOrSpan.line !== void 0; + } + extractPositionOrRange(args, scriptInfo) { + let position; + let textRange; + if (this.isLocation(args)) { + position = getPosition(args); + } else { + textRange = this.getRange(args, scriptInfo); + } + return Debug.checkDefined(position === void 0 ? textRange : position); + function getPosition(loc) { + return loc.position !== void 0 ? loc.position : scriptInfo.lineOffsetToPosition(loc.line, loc.offset); + } + } + getRange(args, scriptInfo) { + const { startPosition, endPosition } = this.getStartAndEndPosition(args, scriptInfo); + return { pos: startPosition, end: endPosition }; + } + getApplicableRefactors(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + return project.getLanguageService().getApplicableRefactors(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file), args.triggerReason, args.kind, args.includeInteractiveActions); + } + getEditsForRefactor(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + const result = project.getLanguageService().getEditsForRefactor( + file, + this.getFormatOptions(file), + this.extractPositionOrRange(args, scriptInfo), + args.refactor, + args.action, + this.getPreferences(file), + args.interactiveRefactorArguments + ); + if (result === void 0) { + return { + edits: [] + }; + } + if (simplifiedResult) { + const { renameFilename, renameLocation, edits } = result; + let mappedRenameLocation; + if (renameFilename !== void 0 && renameLocation !== void 0) { + const renameScriptInfo = project.getScriptInfoForNormalizedPath(toNormalizedPath(renameFilename)); + mappedRenameLocation = getLocationInNewDocument(getSnapshotText(renameScriptInfo.getSnapshot()), renameFilename, renameLocation, edits); + } + return { + renameLocation: mappedRenameLocation, + renameFilename, + edits: this.mapTextChangesToCodeEdits(edits), + notApplicableReason: result.notApplicableReason + }; + } + return result; + } + getMoveToRefactoringFileSuggestions(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + return project.getLanguageService().getMoveToRefactoringFileSuggestions(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file)); + } + organizeImports(args, simplifiedResult) { + Debug.assert(args.scope.type === "file"); + const { file, project } = this.getFileAndProject(args.scope.args); + const changes = project.getLanguageService().organizeImports( + { + fileName: file, + mode: args.mode ?? (args.skipDestructiveCodeActions ? "SortAndCombine" /* SortAndCombine */ : void 0), + type: "file" + }, + this.getFormatOptions(file), + this.getPreferences(file) + ); + if (simplifiedResult) { + return this.mapTextChangesToCodeEdits(changes); + } else { + return changes; + } + } + getEditsForFileRename(args, simplifiedResult) { + const oldPath = toNormalizedPath(args.oldFilePath); + const newPath = toNormalizedPath(args.newFilePath); + const formatOptions = this.getHostFormatOptions(); + const preferences = this.getHostPreferences(); + const seenFiles = /* @__PURE__ */ new Set(); + const textChanges2 = []; + this.projectService.loadAncestorProjectTree(); + this.projectService.forEachEnabledProject((project) => { + const projectTextChanges = project.getLanguageService().getEditsForFileRename(oldPath, newPath, formatOptions, preferences); + const projectFiles = []; + for (const textChange of projectTextChanges) { + if (!seenFiles.has(textChange.fileName)) { + textChanges2.push(textChange); + projectFiles.push(textChange.fileName); + } + } + for (const file of projectFiles) { + seenFiles.add(file); + } + }); + return simplifiedResult ? textChanges2.map((c) => this.mapTextChangeToCodeEdit(c)) : textChanges2; + } + getCodeFixes(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + const { startPosition, endPosition } = this.getStartAndEndPosition(args, scriptInfo); + let codeActions; + try { + codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file)); + } catch (e) { + const ls = project.getLanguageService(); + const existingDiagCodes = [ + ...ls.getSyntacticDiagnostics(file), + ...ls.getSemanticDiagnostics(file), + ...ls.getSuggestionDiagnostics(file) + ].map( + (d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length) && d.code + ); + const badCode = args.errorCodes.find((c) => !existingDiagCodes.includes(c)); + if (badCode !== void 0) { + e.message = `BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")}); could have caused this error: +${e.message}`; + } + throw e; + } + return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions; + } + getCombinedCodeFix({ scope, fixId: fixId52 }, simplifiedResult) { + Debug.assert(scope.type === "file"); + const { file, project } = this.getFileAndProject(scope.args); + const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId52, this.getFormatOptions(file), this.getPreferences(file)); + if (simplifiedResult) { + return { changes: this.mapTextChangesToCodeEdits(res.changes), commands: res.commands }; + } else { + return res; + } + } + applyCodeActionCommand(args) { + const commands = args.command; + for (const command of toArray(commands)) { + const { file, project } = this.getFileAndProject(command); + project.getLanguageService().applyCodeActionCommand(command, this.getFormatOptions(file)).then( + (_result) => { + }, + (_error) => { + } + ); + } + return {}; + } + getStartAndEndPosition(args, scriptInfo) { + let startPosition, endPosition; + if (args.startPosition !== void 0) { + startPosition = args.startPosition; + } else { + startPosition = scriptInfo.lineOffsetToPosition(args.startLine, args.startOffset); + args.startPosition = startPosition; + } + if (args.endPosition !== void 0) { + endPosition = args.endPosition; + } else { + endPosition = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); + args.endPosition = endPosition; + } + return { startPosition, endPosition }; + } + mapCodeAction({ description: description3, changes, commands }) { + return { description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands }; + } + mapCodeFixAction({ fixName: fixName8, description: description3, changes, commands, fixId: fixId52, fixAllDescription }) { + return { fixName: fixName8, description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId52, fixAllDescription }; + } + mapTextChangesToCodeEdits(textChanges2) { + return textChanges2.map((change) => this.mapTextChangeToCodeEdit(change)); + } + mapTextChangeToCodeEdit(textChanges2) { + const scriptInfo = this.projectService.getScriptInfoOrConfig(textChanges2.fileName); + if (!!textChanges2.isNewFile === !!scriptInfo) { + if (!scriptInfo) { + this.projectService.logErrorForScriptInfoNotFound(textChanges2.fileName); + } + Debug.fail("Expected isNewFile for (only) new files. " + JSON.stringify({ isNewFile: !!textChanges2.isNewFile, hasScriptInfo: !!scriptInfo })); + } + return scriptInfo ? { fileName: textChanges2.fileName, textChanges: textChanges2.textChanges.map((textChange) => convertTextChangeToCodeEdit(textChange, scriptInfo)) } : convertNewFileTextChangeToCodeEdit(textChanges2); + } + convertTextChangeToCodeEdit(change, scriptInfo) { + return { + start: scriptInfo.positionToLineOffset(change.span.start), + end: scriptInfo.positionToLineOffset(change.span.start + change.span.length), + newText: change.newText ? change.newText : "" + }; + } + getBraceMatching(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = this.getPosition(args, scriptInfo); + const spans = languageService.getBraceMatchingAtPosition(file, position); + return !spans ? void 0 : simplifiedResult ? spans.map((span) => toProtocolTextSpan(span, scriptInfo)) : spans; + } + getDiagnosticsForProject(next, delay, fileName) { + if (this.suppressDiagnosticEvents) { + return; + } + const { fileNames, languageServiceDisabled } = this.getProjectInfoWorker( + fileName, + /*projectFileName*/ + void 0, + /*needFileNameList*/ + true, + /*excludeConfigFiles*/ + true + ); + if (languageServiceDisabled) { + return; + } + const fileNamesInProject = fileNames.filter((value) => !value.includes("lib.d.ts")); + if (fileNamesInProject.length === 0) { + return; + } + const highPriorityFiles = []; + const mediumPriorityFiles = []; + const lowPriorityFiles = []; + const veryLowPriorityFiles = []; + const normalizedFileName = toNormalizedPath(fileName); + const project = this.projectService.ensureDefaultProjectForFile(normalizedFileName); + for (const fileNameInProject of fileNamesInProject) { + if (this.getCanonicalFileName(fileNameInProject) === this.getCanonicalFileName(fileName)) { + highPriorityFiles.push(fileNameInProject); + } else { + const info = this.projectService.getScriptInfo(fileNameInProject); + if (!info.isScriptOpen()) { + if (isDeclarationFileName(fileNameInProject)) { + veryLowPriorityFiles.push(fileNameInProject); + } else { + lowPriorityFiles.push(fileNameInProject); + } + } else { + mediumPriorityFiles.push(fileNameInProject); + } + } + } + const sortedFiles = [...highPriorityFiles, ...mediumPriorityFiles, ...lowPriorityFiles, ...veryLowPriorityFiles]; + const checkList = sortedFiles.map((fileName2) => ({ fileName: fileName2, project })); + this.updateErrorCheck( + next, + checkList, + delay, + /*requireOpen*/ + false + ); + } + configurePlugin(args) { + this.projectService.configurePlugin(args); + } + getSmartSelectionRange(args, simplifiedResult) { + const { locations } = args; + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(file)); + return map(locations, (location) => { + const pos = this.getPosition(location, scriptInfo); + const selectionRange = languageService.getSmartSelectionRange(file, pos); + return simplifiedResult ? this.mapSelectionRange(selectionRange, scriptInfo) : selectionRange; + }); + } + toggleLineComment(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfo(file); + const textRange = this.getRange(args, scriptInfo); + const textChanges2 = languageService.toggleLineComment(file, textRange); + if (simplifiedResult) { + const scriptInfo2 = this.projectService.getScriptInfoForNormalizedPath(file); + return textChanges2.map((textChange) => this.convertTextChangeToCodeEdit(textChange, scriptInfo2)); + } + return textChanges2; + } + toggleMultilineComment(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const textRange = this.getRange(args, scriptInfo); + const textChanges2 = languageService.toggleMultilineComment(file, textRange); + if (simplifiedResult) { + const scriptInfo2 = this.projectService.getScriptInfoForNormalizedPath(file); + return textChanges2.map((textChange) => this.convertTextChangeToCodeEdit(textChange, scriptInfo2)); + } + return textChanges2; + } + commentSelection(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const textRange = this.getRange(args, scriptInfo); + const textChanges2 = languageService.commentSelection(file, textRange); + if (simplifiedResult) { + const scriptInfo2 = this.projectService.getScriptInfoForNormalizedPath(file); + return textChanges2.map((textChange) => this.convertTextChangeToCodeEdit(textChange, scriptInfo2)); + } + return textChanges2; + } + uncommentSelection(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const textRange = this.getRange(args, scriptInfo); + const textChanges2 = languageService.uncommentSelection(file, textRange); + if (simplifiedResult) { + const scriptInfo2 = this.projectService.getScriptInfoForNormalizedPath(file); + return textChanges2.map((textChange) => this.convertTextChangeToCodeEdit(textChange, scriptInfo2)); + } + return textChanges2; + } + mapSelectionRange(selectionRange, scriptInfo) { + const result = { + textSpan: toProtocolTextSpan(selectionRange.textSpan, scriptInfo) + }; + if (selectionRange.parent) { + result.parent = this.mapSelectionRange(selectionRange.parent, scriptInfo); + } + return result; + } + getScriptInfoFromProjectService(file) { + const normalizedFile = toNormalizedPath(file); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(normalizedFile); + if (!scriptInfo) { + this.projectService.logErrorForScriptInfoNotFound(normalizedFile); + return Errors.ThrowNoProject(); + } + return scriptInfo; + } + toProtocolCallHierarchyItem(item) { + const scriptInfo = this.getScriptInfoFromProjectService(item.file); + return { + name: item.name, + kind: item.kind, + kindModifiers: item.kindModifiers, + file: item.file, + containerName: item.containerName, + span: toProtocolTextSpan(item.span, scriptInfo), + selectionSpan: toProtocolTextSpan(item.selectionSpan, scriptInfo) + }; + } + toProtocolCallHierarchyIncomingCall(incomingCall) { + const scriptInfo = this.getScriptInfoFromProjectService(incomingCall.from.file); + return { + from: this.toProtocolCallHierarchyItem(incomingCall.from), + fromSpans: incomingCall.fromSpans.map((fromSpan) => toProtocolTextSpan(fromSpan, scriptInfo)) + }; + } + toProtocolCallHierarchyOutgoingCall(outgoingCall, scriptInfo) { + return { + to: this.toProtocolCallHierarchyItem(outgoingCall.to), + fromSpans: outgoingCall.fromSpans.map((fromSpan) => toProtocolTextSpan(fromSpan, scriptInfo)) + }; + } + prepareCallHierarchy(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + if (scriptInfo) { + const position = this.getPosition(args, scriptInfo); + const result = project.getLanguageService().prepareCallHierarchy(file, position); + return result && mapOneOrMany(result, (item) => this.toProtocolCallHierarchyItem(item)); + } + return void 0; + } + provideCallHierarchyIncomingCalls(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.getScriptInfoFromProjectService(file); + const incomingCalls = project.getLanguageService().provideCallHierarchyIncomingCalls(file, this.getPosition(args, scriptInfo)); + return incomingCalls.map((call) => this.toProtocolCallHierarchyIncomingCall(call)); + } + provideCallHierarchyOutgoingCalls(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.getScriptInfoFromProjectService(file); + const outgoingCalls = project.getLanguageService().provideCallHierarchyOutgoingCalls(file, this.getPosition(args, scriptInfo)); + return outgoingCalls.map((call) => this.toProtocolCallHierarchyOutgoingCall(call, scriptInfo)); + } + getCanonicalFileName(fileName) { + const name = this.host.useCaseSensitiveFileNames ? fileName : toFileNameLowerCase(fileName); + return normalizePath(name); + } + exit() { + } + notRequired() { + return { responseRequired: false }; + } + requiredResponse(response) { + return { response, responseRequired: true }; + } + addProtocolHandler(command, handler) { + if (this.handlers.has(command)) { + throw new Error(`Protocol handler already exists for command "${command}"`); + } + this.handlers.set(command, handler); + } + setCurrentRequest(requestId) { + Debug.assert(this.currentRequestId === void 0); + this.currentRequestId = requestId; + this.cancellationToken.setRequest(requestId); + } + resetCurrentRequest(requestId) { + Debug.assert(this.currentRequestId === requestId); + this.currentRequestId = void 0; + this.cancellationToken.resetRequest(requestId); + } + executeWithRequestId(requestId, f) { + try { + this.setCurrentRequest(requestId); + return f(); + } finally { + this.resetCurrentRequest(requestId); + } + } + executeCommand(request) { + const handler = this.handlers.get(request.command); + if (handler) { + const response = this.executeWithRequestId(request.seq, () => handler(request)); + this.projectService.enableRequestedPlugins(); + return response; + } else { + this.logger.msg(`Unrecognized JSON command:${stringifyIndented(request)}`, "Err" /* Err */); + this.doOutput( + /*info*/ + void 0, + "unknown" /* Unknown */, + request.seq, + /*success*/ + false, + `Unrecognized JSON command: ${request.command}` + ); + return { responseRequired: false }; + } + } + onMessage(message) { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k; + this.gcTimer.scheduleCollect(); + this.performanceData = void 0; + let start; + if (this.logger.hasLevel(2 /* requestTime */)) { + start = this.hrtime(); + if (this.logger.hasLevel(3 /* verbose */)) { + this.logger.info(`request:${indent2(this.toStringMessage(message))}`); + } + } + let request; + let relevantFile; + try { + request = this.parseMessage(message); + relevantFile = request.arguments && request.arguments.file ? request.arguments : void 0; + (_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.Session, "request", { seq: request.seq, command: request.command }); + (_b = perfLogger) == null ? void 0 : _b.logStartCommand("" + request.command, this.toStringMessage(message).substring(0, 100)); + (_c = tracing) == null ? void 0 : _c.push( + tracing.Phase.Session, + "executeCommand", + { seq: request.seq, command: request.command }, + /*separateBeginAndEnd*/ + true + ); + const { response, responseRequired } = this.executeCommand(request); + (_d = tracing) == null ? void 0 : _d.pop(); + if (this.logger.hasLevel(2 /* requestTime */)) { + const elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4); + if (responseRequired) { + this.logger.perftrc(`${request.seq}::${request.command}: elapsed time (in milliseconds) ${elapsedTime}`); + } else { + this.logger.perftrc(`${request.seq}::${request.command}: async elapsed time (in milliseconds) ${elapsedTime}`); + } + } + (_e = perfLogger) == null ? void 0 : _e.logStopCommand("" + request.command, "Success"); + (_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "response", { seq: request.seq, command: request.command, success: !!response }); + if (response) { + this.doOutput( + response, + request.command, + request.seq, + /*success*/ + true + ); + } else if (responseRequired) { + this.doOutput( + /*info*/ + void 0, + request.command, + request.seq, + /*success*/ + false, + "No content available." + ); + } + } catch (err) { + (_g = tracing) == null ? void 0 : _g.popAll(); + if (err instanceof OperationCanceledException) { + (_h = perfLogger) == null ? void 0 : _h.logStopCommand("" + (request && request.command), "Canceled: " + err); + (_i = tracing) == null ? void 0 : _i.instant(tracing.Phase.Session, "commandCanceled", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command }); + this.doOutput( + { canceled: true }, + request.command, + request.seq, + /*success*/ + true + ); + return; + } + this.logErrorWorker(err, this.toStringMessage(message), relevantFile); + (_j = perfLogger) == null ? void 0 : _j.logStopCommand("" + (request && request.command), "Error: " + err); + (_k = tracing) == null ? void 0 : _k.instant(tracing.Phase.Session, "commandError", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command, message: err.message }); + this.doOutput( + /*info*/ + void 0, + request ? request.command : "unknown" /* Unknown */, + request ? request.seq : 0, + /*success*/ + false, + "Error processing request. " + err.message + "\n" + err.stack + ); + } + } + parseMessage(message) { + return JSON.parse(message); + } + toStringMessage(message) { + return message; + } + getFormatOptions(file) { + return this.projectService.getFormatCodeOptions(file); + } + getPreferences(file) { + return this.projectService.getPreferences(file); + } + getHostFormatOptions() { + return this.projectService.getHostFormatCodeOptions(); + } + getHostPreferences() { + return this.projectService.getHostPreferences(); + } + }; + } + }); + + // src/server/scriptVersionCache.ts + var lineCollectionCapacity, CharRangeSection, EditWalker, TextChange9, _ScriptVersionCache, ScriptVersionCache, LineIndexSnapshot, LineIndex, LineNode, LineLeaf; + var init_scriptVersionCache = __esm({ + "src/server/scriptVersionCache.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + lineCollectionCapacity = 4; + CharRangeSection = /* @__PURE__ */ ((CharRangeSection2) => { + CharRangeSection2[CharRangeSection2["PreStart"] = 0] = "PreStart"; + CharRangeSection2[CharRangeSection2["Start"] = 1] = "Start"; + CharRangeSection2[CharRangeSection2["Entire"] = 2] = "Entire"; + CharRangeSection2[CharRangeSection2["Mid"] = 3] = "Mid"; + CharRangeSection2[CharRangeSection2["End"] = 4] = "End"; + CharRangeSection2[CharRangeSection2["PostEnd"] = 5] = "PostEnd"; + return CharRangeSection2; + })(CharRangeSection || {}); + EditWalker = class { + constructor() { + this.goSubtree = true; + this.lineIndex = new LineIndex(); + this.endBranch = []; + this.state = 2 /* Entire */; + this.initialText = ""; + this.trailingText = ""; + this.lineIndex.root = new LineNode(); + this.startPath = [this.lineIndex.root]; + this.stack = [this.lineIndex.root]; + } + get done() { + return false; + } + insertLines(insertedText, suppressTrailingText) { + if (suppressTrailingText) { + this.trailingText = ""; + } + if (insertedText) { + insertedText = this.initialText + insertedText + this.trailingText; + } else { + insertedText = this.initialText + this.trailingText; + } + const lm = LineIndex.linesFromText(insertedText); + const lines = lm.lines; + if (lines.length > 1 && lines[lines.length - 1] === "") { + lines.pop(); + } + let branchParent; + let lastZeroCount; + for (let k = this.endBranch.length - 1; k >= 0; k--) { + this.endBranch[k].updateCounts(); + if (this.endBranch[k].charCount() === 0) { + lastZeroCount = this.endBranch[k]; + if (k > 0) { + branchParent = this.endBranch[k - 1]; + } else { + branchParent = this.branchNode; + } + } + } + if (lastZeroCount) { + branchParent.remove(lastZeroCount); + } + const leafNode = this.startPath[this.startPath.length - 1]; + if (lines.length > 0) { + leafNode.text = lines[0]; + if (lines.length > 1) { + let insertedNodes = new Array(lines.length - 1); + let startNode2 = leafNode; + for (let i = 1; i < lines.length; i++) { + insertedNodes[i - 1] = new LineLeaf(lines[i]); + } + let pathIndex = this.startPath.length - 2; + while (pathIndex >= 0) { + const insertionNode = this.startPath[pathIndex]; + insertedNodes = insertionNode.insertAt(startNode2, insertedNodes); + pathIndex--; + startNode2 = insertionNode; + } + let insertedNodesLen = insertedNodes.length; + while (insertedNodesLen > 0) { + const newRoot = new LineNode(); + newRoot.add(this.lineIndex.root); + insertedNodes = newRoot.insertAt(this.lineIndex.root, insertedNodes); + insertedNodesLen = insertedNodes.length; + this.lineIndex.root = newRoot; + } + this.lineIndex.root.updateCounts(); + } else { + for (let j = this.startPath.length - 2; j >= 0; j--) { + this.startPath[j].updateCounts(); + } + } + } else { + const insertionNode = this.startPath[this.startPath.length - 2]; + insertionNode.remove(leafNode); + for (let j = this.startPath.length - 2; j >= 0; j--) { + this.startPath[j].updateCounts(); + } + } + return this.lineIndex; + } + post(_relativeStart, _relativeLength, lineCollection) { + if (lineCollection === this.lineCollectionAtBranch) { + this.state = 4 /* End */; + } + this.stack.pop(); + } + pre(_relativeStart, _relativeLength, lineCollection, _parent, nodeType) { + const currentNode = this.stack[this.stack.length - 1]; + if (this.state === 2 /* Entire */ && nodeType === 1 /* Start */) { + this.state = 1 /* Start */; + this.branchNode = currentNode; + this.lineCollectionAtBranch = lineCollection; + } + let child; + function fresh(node) { + if (node.isLeaf()) { + return new LineLeaf(""); + } else + return new LineNode(); + } + switch (nodeType) { + case 0 /* PreStart */: + this.goSubtree = false; + if (this.state !== 4 /* End */) { + currentNode.add(lineCollection); + } + break; + case 1 /* Start */: + if (this.state === 4 /* End */) { + this.goSubtree = false; + } else { + child = fresh(lineCollection); + currentNode.add(child); + this.startPath.push(child); + } + break; + case 2 /* Entire */: + if (this.state !== 4 /* End */) { + child = fresh(lineCollection); + currentNode.add(child); + this.startPath.push(child); + } else { + if (!lineCollection.isLeaf()) { + child = fresh(lineCollection); + currentNode.add(child); + this.endBranch.push(child); + } + } + break; + case 3 /* Mid */: + this.goSubtree = false; + break; + case 4 /* End */: + if (this.state !== 4 /* End */) { + this.goSubtree = false; + } else { + if (!lineCollection.isLeaf()) { + child = fresh(lineCollection); + currentNode.add(child); + this.endBranch.push(child); + } + } + break; + case 5 /* PostEnd */: + this.goSubtree = false; + if (this.state !== 1 /* Start */) { + currentNode.add(lineCollection); + } + break; + } + if (this.goSubtree) { + this.stack.push(child); + } + } + // just gather text from the leaves + leaf(relativeStart, relativeLength, ll) { + if (this.state === 1 /* Start */) { + this.initialText = ll.text.substring(0, relativeStart); + } else if (this.state === 2 /* Entire */) { + this.initialText = ll.text.substring(0, relativeStart); + this.trailingText = ll.text.substring(relativeStart + relativeLength); + } else { + this.trailingText = ll.text.substring(relativeStart + relativeLength); + } + } + }; + TextChange9 = class { + constructor(pos, deleteLen, insertedText) { + this.pos = pos; + this.deleteLen = deleteLen; + this.insertedText = insertedText; + } + getTextChangeRange() { + return createTextChangeRange(createTextSpan(this.pos, this.deleteLen), this.insertedText ? this.insertedText.length : 0); + } + }; + _ScriptVersionCache = class _ScriptVersionCache { + constructor() { + this.changes = []; + this.versions = new Array(_ScriptVersionCache.maxVersions); + this.minVersion = 0; + // no versions earlier than min version will maintain change history + this.currentVersion = 0; + } + versionToIndex(version2) { + if (version2 < this.minVersion || version2 > this.currentVersion) { + return void 0; + } + return version2 % _ScriptVersionCache.maxVersions; + } + currentVersionToIndex() { + return this.currentVersion % _ScriptVersionCache.maxVersions; + } + // REVIEW: can optimize by coalescing simple edits + edit(pos, deleteLen, insertedText) { + this.changes.push(new TextChange9(pos, deleteLen, insertedText)); + if (this.changes.length > _ScriptVersionCache.changeNumberThreshold || deleteLen > _ScriptVersionCache.changeLengthThreshold || insertedText && insertedText.length > _ScriptVersionCache.changeLengthThreshold) { + this.getSnapshot(); + } + } + getSnapshot() { + return this._getSnapshot(); + } + _getSnapshot() { + let snap = this.versions[this.currentVersionToIndex()]; + if (this.changes.length > 0) { + let snapIndex = snap.index; + for (const change of this.changes) { + snapIndex = snapIndex.edit(change.pos, change.deleteLen, change.insertedText); + } + snap = new LineIndexSnapshot(this.currentVersion + 1, this, snapIndex, this.changes); + this.currentVersion = snap.version; + this.versions[this.currentVersionToIndex()] = snap; + this.changes = []; + if (this.currentVersion - this.minVersion >= _ScriptVersionCache.maxVersions) { + this.minVersion = this.currentVersion - _ScriptVersionCache.maxVersions + 1; + } + } + return snap; + } + getSnapshotVersion() { + return this._getSnapshot().version; + } + getAbsolutePositionAndLineText(oneBasedLine) { + return this._getSnapshot().index.lineNumberToInfo(oneBasedLine); + } + lineOffsetToPosition(line, column) { + return this._getSnapshot().index.absolutePositionOfStartOfLine(line) + (column - 1); + } + positionToLineOffset(position) { + return this._getSnapshot().index.positionToLineOffset(position); + } + lineToTextSpan(line) { + const index = this._getSnapshot().index; + const { lineText, absolutePosition } = index.lineNumberToInfo(line + 1); + const len = lineText !== void 0 ? lineText.length : index.absolutePositionOfStartOfLine(line + 2) - absolutePosition; + return createTextSpan(absolutePosition, len); + } + getTextChangesBetweenVersions(oldVersion, newVersion) { + if (oldVersion < newVersion) { + if (oldVersion >= this.minVersion) { + const textChangeRanges = []; + for (let i = oldVersion + 1; i <= newVersion; i++) { + const snap = this.versions[this.versionToIndex(i)]; + for (const textChange of snap.changesSincePreviousVersion) { + textChangeRanges.push(textChange.getTextChangeRange()); + } + } + return collapseTextChangeRangesAcrossMultipleVersions(textChangeRanges); + } else { + return void 0; + } + } else { + return unchangedTextChangeRange; + } + } + getLineCount() { + return this._getSnapshot().index.getLineCount(); + } + static fromString(script) { + const svc = new _ScriptVersionCache(); + const snap = new LineIndexSnapshot(0, svc, new LineIndex()); + svc.versions[svc.currentVersion] = snap; + const lm = LineIndex.linesFromText(script); + snap.index.load(lm.lines); + return svc; + } + }; + _ScriptVersionCache.changeNumberThreshold = 8; + _ScriptVersionCache.changeLengthThreshold = 256; + _ScriptVersionCache.maxVersions = 8; + ScriptVersionCache = _ScriptVersionCache; + LineIndexSnapshot = class _LineIndexSnapshot { + constructor(version2, cache, index, changesSincePreviousVersion = emptyArray2) { + this.version = version2; + this.cache = cache; + this.index = index; + this.changesSincePreviousVersion = changesSincePreviousVersion; + } + getText(rangeStart, rangeEnd) { + return this.index.getText(rangeStart, rangeEnd - rangeStart); + } + getLength() { + return this.index.getLength(); + } + getChangeRange(oldSnapshot) { + if (oldSnapshot instanceof _LineIndexSnapshot && this.cache === oldSnapshot.cache) { + if (this.version <= oldSnapshot.version) { + return unchangedTextChangeRange; + } else { + return this.cache.getTextChangesBetweenVersions(oldSnapshot.version, this.version); + } + } + } + }; + LineIndex = class _LineIndex { + constructor() { + // set this to true to check each edit for accuracy + this.checkEdits = false; + } + absolutePositionOfStartOfLine(oneBasedLine) { + return this.lineNumberToInfo(oneBasedLine).absolutePosition; + } + positionToLineOffset(position) { + const { oneBasedLine, zeroBasedColumn } = this.root.charOffsetToLineInfo(1, position); + return { line: oneBasedLine, offset: zeroBasedColumn + 1 }; + } + positionToColumnAndLineText(position) { + return this.root.charOffsetToLineInfo(1, position); + } + getLineCount() { + return this.root.lineCount(); + } + lineNumberToInfo(oneBasedLine) { + const lineCount = this.getLineCount(); + if (oneBasedLine <= lineCount) { + const { position, leaf } = this.root.lineNumberToInfo(oneBasedLine, 0); + return { absolutePosition: position, lineText: leaf && leaf.text }; + } else { + return { absolutePosition: this.root.charCount(), lineText: void 0 }; + } + } + load(lines) { + if (lines.length > 0) { + const leaves = []; + for (let i = 0; i < lines.length; i++) { + leaves[i] = new LineLeaf(lines[i]); + } + this.root = _LineIndex.buildTreeFromBottom(leaves); + } else { + this.root = new LineNode(); + } + } + walk(rangeStart, rangeLength, walkFns) { + this.root.walk(rangeStart, rangeLength, walkFns); + } + getText(rangeStart, rangeLength) { + let accum = ""; + if (rangeLength > 0 && rangeStart < this.root.charCount()) { + this.walk(rangeStart, rangeLength, { + goSubtree: true, + done: false, + leaf: (relativeStart, relativeLength, ll) => { + accum = accum.concat(ll.text.substring(relativeStart, relativeStart + relativeLength)); + } + }); + } + return accum; + } + getLength() { + return this.root.charCount(); + } + every(f, rangeStart, rangeEnd) { + if (!rangeEnd) { + rangeEnd = this.root.charCount(); + } + const walkFns = { + goSubtree: true, + done: false, + leaf(relativeStart, relativeLength, ll) { + if (!f(ll, relativeStart, relativeLength)) { + this.done = true; + } + } + }; + this.walk(rangeStart, rangeEnd - rangeStart, walkFns); + return !walkFns.done; + } + edit(pos, deleteLength, newText) { + if (this.root.charCount() === 0) { + Debug.assert(deleteLength === 0); + if (newText !== void 0) { + this.load(_LineIndex.linesFromText(newText).lines); + return this; + } + return void 0; + } else { + let checkText; + if (this.checkEdits) { + const source = this.getText(0, this.root.charCount()); + checkText = source.slice(0, pos) + newText + source.slice(pos + deleteLength); + } + const walker = new EditWalker(); + let suppressTrailingText = false; + if (pos >= this.root.charCount()) { + pos = this.root.charCount() - 1; + const endString = this.getText(pos, 1); + if (newText) { + newText = endString + newText; + } else { + newText = endString; + } + deleteLength = 0; + suppressTrailingText = true; + } else if (deleteLength > 0) { + const e = pos + deleteLength; + const { zeroBasedColumn, lineText } = this.positionToColumnAndLineText(e); + if (zeroBasedColumn === 0) { + deleteLength += lineText.length; + newText = newText ? newText + lineText : lineText; + } + } + this.root.walk(pos, deleteLength, walker); + walker.insertLines(newText, suppressTrailingText); + if (this.checkEdits) { + const updatedText = walker.lineIndex.getText(0, walker.lineIndex.getLength()); + Debug.assert(checkText === updatedText, "buffer edit mismatch"); + } + return walker.lineIndex; + } + } + static buildTreeFromBottom(nodes) { + if (nodes.length < lineCollectionCapacity) { + return new LineNode(nodes); + } + const interiorNodes = new Array(Math.ceil(nodes.length / lineCollectionCapacity)); + let nodeIndex = 0; + for (let i = 0; i < interiorNodes.length; i++) { + const end = Math.min(nodeIndex + lineCollectionCapacity, nodes.length); + interiorNodes[i] = new LineNode(nodes.slice(nodeIndex, end)); + nodeIndex = end; + } + return this.buildTreeFromBottom(interiorNodes); + } + static linesFromText(text) { + const lineMap = computeLineStarts(text); + if (lineMap.length === 0) { + return { lines: [], lineMap }; + } + const lines = new Array(lineMap.length); + const lc = lineMap.length - 1; + for (let lmi = 0; lmi < lc; lmi++) { + lines[lmi] = text.substring(lineMap[lmi], lineMap[lmi + 1]); + } + const endText = text.substring(lineMap[lc]); + if (endText.length > 0) { + lines[lc] = endText; + } else { + lines.pop(); + } + return { lines, lineMap }; + } + }; + LineNode = class _LineNode { + constructor(children = []) { + this.children = children; + this.totalChars = 0; + this.totalLines = 0; + if (children.length) + this.updateCounts(); + } + isLeaf() { + return false; + } + updateCounts() { + this.totalChars = 0; + this.totalLines = 0; + for (const child of this.children) { + this.totalChars += child.charCount(); + this.totalLines += child.lineCount(); + } + } + execWalk(rangeStart, rangeLength, walkFns, childIndex, nodeType) { + if (walkFns.pre) { + walkFns.pre(rangeStart, rangeLength, this.children[childIndex], this, nodeType); + } + if (walkFns.goSubtree) { + this.children[childIndex].walk(rangeStart, rangeLength, walkFns); + if (walkFns.post) { + walkFns.post(rangeStart, rangeLength, this.children[childIndex], this, nodeType); + } + } else { + walkFns.goSubtree = true; + } + return walkFns.done; + } + skipChild(relativeStart, relativeLength, childIndex, walkFns, nodeType) { + if (walkFns.pre && !walkFns.done) { + walkFns.pre(relativeStart, relativeLength, this.children[childIndex], this, nodeType); + walkFns.goSubtree = true; + } + } + walk(rangeStart, rangeLength, walkFns) { + let childIndex = 0; + let childCharCount = this.children[childIndex].charCount(); + let adjustedStart = rangeStart; + while (adjustedStart >= childCharCount) { + this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, 0 /* PreStart */); + adjustedStart -= childCharCount; + childIndex++; + childCharCount = this.children[childIndex].charCount(); + } + if (adjustedStart + rangeLength <= childCharCount) { + if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, 2 /* Entire */)) { + return; + } + } else { + if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, 1 /* Start */)) { + return; + } + let adjustedLength = rangeLength - (childCharCount - adjustedStart); + childIndex++; + const child = this.children[childIndex]; + childCharCount = child.charCount(); + while (adjustedLength > childCharCount) { + if (this.execWalk(0, childCharCount, walkFns, childIndex, 3 /* Mid */)) { + return; + } + adjustedLength -= childCharCount; + childIndex++; + childCharCount = this.children[childIndex].charCount(); + } + if (adjustedLength > 0) { + if (this.execWalk(0, adjustedLength, walkFns, childIndex, 4 /* End */)) { + return; + } + } + } + if (walkFns.pre) { + const clen = this.children.length; + if (childIndex < clen - 1) { + for (let ej = childIndex + 1; ej < clen; ej++) { + this.skipChild(0, 0, ej, walkFns, 5 /* PostEnd */); + } + } + } + } + // Input position is relative to the start of this node. + // Output line number is absolute. + charOffsetToLineInfo(lineNumberAccumulator, relativePosition) { + if (this.children.length === 0) { + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: void 0 }; + } + for (const child of this.children) { + if (child.charCount() > relativePosition) { + if (child.isLeaf()) { + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: child.text }; + } else { + return child.charOffsetToLineInfo(lineNumberAccumulator, relativePosition); + } + } else { + relativePosition -= child.charCount(); + lineNumberAccumulator += child.lineCount(); + } + } + const lineCount = this.lineCount(); + if (lineCount === 0) { + return { oneBasedLine: 1, zeroBasedColumn: 0, lineText: void 0 }; + } + const leaf = Debug.checkDefined(this.lineNumberToInfo(lineCount, 0).leaf); + return { oneBasedLine: lineCount, zeroBasedColumn: leaf.charCount(), lineText: void 0 }; + } + /** + * Input line number is relative to the start of this node. + * Output line number is relative to the child. + * positionAccumulator will be an absolute position once relativeLineNumber reaches 0. + */ + lineNumberToInfo(relativeOneBasedLine, positionAccumulator) { + for (const child of this.children) { + const childLineCount = child.lineCount(); + if (childLineCount >= relativeOneBasedLine) { + return child.isLeaf() ? { position: positionAccumulator, leaf: child } : child.lineNumberToInfo(relativeOneBasedLine, positionAccumulator); + } else { + relativeOneBasedLine -= childLineCount; + positionAccumulator += child.charCount(); + } + } + return { position: positionAccumulator, leaf: void 0 }; + } + splitAfter(childIndex) { + let splitNode; + const clen = this.children.length; + childIndex++; + const endLength = childIndex; + if (childIndex < clen) { + splitNode = new _LineNode(); + while (childIndex < clen) { + splitNode.add(this.children[childIndex]); + childIndex++; + } + splitNode.updateCounts(); + } + this.children.length = endLength; + return splitNode; + } + remove(child) { + const childIndex = this.findChildIndex(child); + const clen = this.children.length; + if (childIndex < clen - 1) { + for (let i = childIndex; i < clen - 1; i++) { + this.children[i] = this.children[i + 1]; + } + } + this.children.pop(); + } + findChildIndex(child) { + const childIndex = this.children.indexOf(child); + Debug.assert(childIndex !== -1); + return childIndex; + } + insertAt(child, nodes) { + let childIndex = this.findChildIndex(child); + const clen = this.children.length; + const nodeCount = nodes.length; + if (clen < lineCollectionCapacity && childIndex === clen - 1 && nodeCount === 1) { + this.add(nodes[0]); + this.updateCounts(); + return []; + } else { + const shiftNode = this.splitAfter(childIndex); + let nodeIndex = 0; + childIndex++; + while (childIndex < lineCollectionCapacity && nodeIndex < nodeCount) { + this.children[childIndex] = nodes[nodeIndex]; + childIndex++; + nodeIndex++; + } + let splitNodes = []; + let splitNodeCount = 0; + if (nodeIndex < nodeCount) { + splitNodeCount = Math.ceil((nodeCount - nodeIndex) / lineCollectionCapacity); + splitNodes = new Array(splitNodeCount); + let splitNodeIndex = 0; + for (let i = 0; i < splitNodeCount; i++) { + splitNodes[i] = new _LineNode(); + } + let splitNode = splitNodes[0]; + while (nodeIndex < nodeCount) { + splitNode.add(nodes[nodeIndex]); + nodeIndex++; + if (splitNode.children.length === lineCollectionCapacity) { + splitNodeIndex++; + splitNode = splitNodes[splitNodeIndex]; + } + } + for (let i = splitNodes.length - 1; i >= 0; i--) { + if (splitNodes[i].children.length === 0) { + splitNodes.pop(); + } + } + } + if (shiftNode) { + splitNodes.push(shiftNode); + } + this.updateCounts(); + for (let i = 0; i < splitNodeCount; i++) { + splitNodes[i].updateCounts(); + } + return splitNodes; + } + } + // assume there is room for the item; return true if more room + add(collection) { + this.children.push(collection); + Debug.assert(this.children.length <= lineCollectionCapacity); + } + charCount() { + return this.totalChars; + } + lineCount() { + return this.totalLines; + } + }; + LineLeaf = class { + constructor(text) { + this.text = text; + } + isLeaf() { + return true; + } + walk(rangeStart, rangeLength, walkFns) { + walkFns.leaf(rangeStart, rangeLength, this); + } + charCount() { + return this.text.length; + } + lineCount() { + return 1; + } + }; + } + }); + + // 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, { + ActionInvalidate: () => ActionInvalidate, + ActionPackageInstalled: () => ActionPackageInstalled, + ActionSet: () => ActionSet, + ActionWatchTypingLocations: () => ActionWatchTypingLocations, + Arguments: () => Arguments, + AutoImportProviderProject: () => AutoImportProviderProject, + AuxiliaryProject: () => AuxiliaryProject, + CharRangeSection: () => CharRangeSection, + CloseFileWatcherEvent: () => CloseFileWatcherEvent, + CommandNames: () => CommandNames, + ConfigFileDiagEvent: () => ConfigFileDiagEvent, + ConfiguredProject: () => ConfiguredProject2, + CreateDirectoryWatcherEvent: () => CreateDirectoryWatcherEvent, + CreateFileWatcherEvent: () => CreateFileWatcherEvent, + Errors: () => Errors, + EventBeginInstallTypes: () => EventBeginInstallTypes, + EventEndInstallTypes: () => EventEndInstallTypes, + EventInitializationFailed: () => EventInitializationFailed, + EventTypesRegistry: () => EventTypesRegistry, + ExternalProject: () => ExternalProject2, + GcTimer: () => GcTimer, + InferredProject: () => InferredProject2, + LargeFileReferencedEvent: () => LargeFileReferencedEvent, + LineIndex: () => LineIndex, + LineLeaf: () => LineLeaf, + LineNode: () => LineNode, + LogLevel: () => LogLevel2, + Msg: () => Msg, + OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, + Project: () => Project3, + ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, + ProjectKind: () => ProjectKind, + ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, + ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, + ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, + ProjectReferenceProjectLoadKind: () => ProjectReferenceProjectLoadKind, + ProjectService: () => ProjectService3, + ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, + ScriptInfo: () => ScriptInfo, + ScriptVersionCache: () => ScriptVersionCache, + Session: () => Session3, + TextStorage: () => TextStorage, + ThrottledOperations: () => ThrottledOperations, + TypingsCache: () => TypingsCache, + TypingsInstallerAdapter: () => TypingsInstallerAdapter, + allFilesAreJsOrDts: () => allFilesAreJsOrDts, + allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts, + asNormalizedPath: () => asNormalizedPath, + convertCompilerOptions: () => convertCompilerOptions, + convertFormatOptions: () => convertFormatOptions, + convertScriptKindName: () => convertScriptKindName, + convertTypeAcquisition: () => convertTypeAcquisition, + convertUserPreferences: () => convertUserPreferences, + convertWatchOptions: () => convertWatchOptions, + countEachFileTypes: () => countEachFileTypes, + createInstallTypingsRequest: () => createInstallTypingsRequest, + createModuleSpecifierCache: () => createModuleSpecifierCache, + createNormalizedPathMap: () => createNormalizedPathMap, + createPackageJsonCache: () => createPackageJsonCache, + createSortedArray: () => createSortedArray2, + emptyArray: () => emptyArray2, + findArgument: () => findArgument, + forEachResolvedProjectReferenceProject: () => forEachResolvedProjectReferenceProject, + formatDiagnosticToProtocol: () => formatDiagnosticToProtocol, + formatMessage: () => formatMessage2, + getBaseConfigFileName: () => getBaseConfigFileName, + getLocationInNewDocument: () => getLocationInNewDocument, + hasArgument: () => hasArgument, + hasNoTypeScriptSource: () => hasNoTypeScriptSource, + indent: () => indent2, + isBackgroundProject: () => isBackgroundProject, + isConfigFile: () => isConfigFile, + isConfiguredProject: () => isConfiguredProject, + isDynamicFileName: () => isDynamicFileName, + isExternalProject: () => isExternalProject, + isInferredProject: () => isInferredProject, + isInferredProjectName: () => isInferredProjectName, + makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, + makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, + makeInferredProjectName: () => makeInferredProjectName, + maxFileSize: () => maxFileSize, + maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, + normalizedPathToPath: () => normalizedPathToPath, + nowString: () => nowString, + nullCancellationToken: () => nullCancellationToken, + nullTypingsInstaller: () => nullTypingsInstaller, + projectContainsInfoDirectly: () => projectContainsInfoDirectly, + protocol: () => ts_server_protocol_exports, + removeSorted: () => removeSorted, + stringifyIndented: () => stringifyIndented, + toEvent: () => toEvent, + toNormalizedPath: () => toNormalizedPath, + tryConvertScriptKindName: () => tryConvertScriptKindName, + typingsInstaller: () => ts_server_typingsInstaller_exports, + updateProjectIfDirty: () => updateProjectIfDirty + }); + var init_ts_server3 = __esm({ + "src/server/_namespaces/ts.server.ts"() { + "use strict"; + init_ts_server(); + init_ts_server2(); + init_types4(); + init_utilitiesPublic3(); + init_utilities5(); + init_ts_server_protocol(); + init_scriptInfo(); + init_typingsCache(); + init_project(); + init_editorServices(); + init_moduleSpecifierCache(); + init_packageJsonCache(); + init_session(); + init_scriptVersionCache(); + init_typingInstallerAdapter(); + } + }); + + // src/server/_namespaces/ts.ts + var ts_exports2 = {}; + __export(ts_exports2, { + ANONYMOUS: () => ANONYMOUS, + AccessFlags: () => AccessFlags, + AssertionLevel: () => AssertionLevel, + AssignmentDeclarationKind: () => AssignmentDeclarationKind, + AssignmentKind: () => AssignmentKind, + Associativity: () => Associativity, + BreakpointResolver: () => ts_BreakpointResolver_exports, + BuilderFileEmit: () => BuilderFileEmit, + BuilderProgramKind: () => BuilderProgramKind, + BuilderState: () => BuilderState, + BundleFileSectionKind: () => BundleFileSectionKind, + CallHierarchy: () => ts_CallHierarchy_exports, + CharacterCodes: () => CharacterCodes, + CheckFlags: () => CheckFlags, + CheckMode: () => CheckMode, + ClassificationType: () => ClassificationType, + ClassificationTypeNames: () => ClassificationTypeNames, + CommentDirectiveType: () => CommentDirectiveType, + Comparison: () => Comparison, + CompletionInfoFlags: () => CompletionInfoFlags, + CompletionTriggerKind: () => CompletionTriggerKind, + Completions: () => ts_Completions_exports, + ContainerFlags: () => ContainerFlags, + ContextFlags: () => ContextFlags, + Debug: () => Debug, + DiagnosticCategory: () => DiagnosticCategory, + Diagnostics: () => Diagnostics, + DocumentHighlights: () => DocumentHighlights, + ElementFlags: () => ElementFlags, + EmitFlags: () => EmitFlags, + EmitHint: () => EmitHint, + EmitOnly: () => EmitOnly, + EndOfLineState: () => EndOfLineState, + EnumKind: () => EnumKind, + ExitStatus: () => ExitStatus, + ExportKind: () => ExportKind, + Extension: () => Extension, + ExternalEmitHelpers: () => ExternalEmitHelpers, + FileIncludeKind: () => FileIncludeKind, + FilePreprocessingDiagnosticsKind: () => FilePreprocessingDiagnosticsKind, + FileSystemEntryKind: () => FileSystemEntryKind, + FileWatcherEventKind: () => FileWatcherEventKind, + FindAllReferences: () => ts_FindAllReferences_exports, + FlattenLevel: () => FlattenLevel, + FlowFlags: () => FlowFlags, + ForegroundColorEscapeSequences: () => ForegroundColorEscapeSequences, + FunctionFlags: () => FunctionFlags, + GeneratedIdentifierFlags: () => GeneratedIdentifierFlags, + GetLiteralTextFlags: () => GetLiteralTextFlags, + GoToDefinition: () => ts_GoToDefinition_exports, + HighlightSpanKind: () => HighlightSpanKind, + IdentifierNameMap: () => IdentifierNameMap, + IdentifierNameMultiMap: () => IdentifierNameMultiMap, + ImportKind: () => ImportKind, + ImportsNotUsedAsValues: () => ImportsNotUsedAsValues, + IndentStyle: () => IndentStyle, + IndexFlags: () => IndexFlags, + IndexKind: () => IndexKind, + InferenceFlags: () => InferenceFlags, + InferencePriority: () => InferencePriority, + InlayHintKind: () => InlayHintKind, + InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, + InternalSymbolName: () => InternalSymbolName, + InvalidatedProjectKind: () => InvalidatedProjectKind, + JSDocParsingMode: () => JSDocParsingMode, + JsDoc: () => ts_JsDoc_exports, + JsTyping: () => ts_JsTyping_exports, + JsxEmit: () => JsxEmit, + JsxFlags: () => JsxFlags, + JsxReferenceKind: () => JsxReferenceKind, + LanguageServiceMode: () => LanguageServiceMode, + LanguageVariant: () => LanguageVariant, + LexicalEnvironmentFlags: () => LexicalEnvironmentFlags, + ListFormat: () => ListFormat, + LogLevel: () => LogLevel, + MemberOverrideStatus: () => MemberOverrideStatus, + ModifierFlags: () => ModifierFlags, + ModuleDetectionKind: () => ModuleDetectionKind, + ModuleInstanceState: () => ModuleInstanceState, + ModuleKind: () => ModuleKind, + ModuleResolutionKind: () => ModuleResolutionKind, + ModuleSpecifierEnding: () => ModuleSpecifierEnding, + NavigateTo: () => ts_NavigateTo_exports, + NavigationBar: () => ts_NavigationBar_exports, + NewLineKind: () => NewLineKind, + NodeBuilderFlags: () => NodeBuilderFlags, + NodeCheckFlags: () => NodeCheckFlags, + NodeFactoryFlags: () => NodeFactoryFlags, + NodeFlags: () => NodeFlags, + NodeResolutionFeatures: () => NodeResolutionFeatures, + ObjectFlags: () => ObjectFlags, + OperationCanceledException: () => OperationCanceledException, + OperatorPrecedence: () => OperatorPrecedence, + OrganizeImports: () => ts_OrganizeImports_exports, + OrganizeImportsMode: () => OrganizeImportsMode, + OuterExpressionKinds: () => OuterExpressionKinds, + OutliningElementsCollector: () => ts_OutliningElementsCollector_exports, + OutliningSpanKind: () => OutliningSpanKind, + OutputFileType: () => OutputFileType, + PackageJsonAutoImportPreference: () => PackageJsonAutoImportPreference, + PackageJsonDependencyGroup: () => PackageJsonDependencyGroup, + PatternMatchKind: () => PatternMatchKind, + PollingInterval: () => PollingInterval, + PollingWatchKind: () => PollingWatchKind, + PragmaKindFlags: () => PragmaKindFlags, + PrivateIdentifierKind: () => PrivateIdentifierKind, + ProcessLevel: () => ProcessLevel, + ProgramUpdateLevel: () => ProgramUpdateLevel, + QuotePreference: () => QuotePreference, + RelationComparisonResult: () => RelationComparisonResult, + Rename: () => ts_Rename_exports, + ScriptElementKind: () => ScriptElementKind, + ScriptElementKindModifier: () => ScriptElementKindModifier, + ScriptKind: () => ScriptKind, + ScriptSnapshot: () => ScriptSnapshot, + ScriptTarget: () => ScriptTarget, + SemanticClassificationFormat: () => SemanticClassificationFormat, + SemanticMeaning: () => SemanticMeaning, + SemicolonPreference: () => SemicolonPreference, + SignatureCheckMode: () => SignatureCheckMode, + SignatureFlags: () => SignatureFlags, + SignatureHelp: () => ts_SignatureHelp_exports, + SignatureKind: () => SignatureKind, + SmartSelectionRange: () => ts_SmartSelectionRange_exports, + SnippetKind: () => SnippetKind, + SortKind: () => SortKind, + StructureIsReused: () => StructureIsReused, + SymbolAccessibility: () => SymbolAccessibility, + SymbolDisplay: () => ts_SymbolDisplay_exports, + SymbolDisplayPartKind: () => SymbolDisplayPartKind, + SymbolFlags: () => SymbolFlags, + SymbolFormatFlags: () => SymbolFormatFlags, + SyntaxKind: () => SyntaxKind, + SyntheticSymbolKind: () => SyntheticSymbolKind, + Ternary: () => Ternary, + ThrottledCancellationToken: () => ThrottledCancellationToken, + TokenClass: () => TokenClass, + TokenFlags: () => TokenFlags, + TransformFlags: () => TransformFlags, + TypeFacts: () => TypeFacts, + TypeFlags: () => TypeFlags, + TypeFormatFlags: () => TypeFormatFlags, + TypeMapKind: () => TypeMapKind, + TypePredicateKind: () => TypePredicateKind, + TypeReferenceSerializationKind: () => TypeReferenceSerializationKind, + UnionReduction: () => UnionReduction, + UpToDateStatusType: () => UpToDateStatusType, + VarianceFlags: () => VarianceFlags, + Version: () => Version, + VersionRange: () => VersionRange, + WatchDirectoryFlags: () => WatchDirectoryFlags, + WatchDirectoryKind: () => WatchDirectoryKind, + WatchFileKind: () => WatchFileKind, + WatchLogLevel: () => WatchLogLevel, + WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, + addDisposableResourceHelper: () => addDisposableResourceHelper, + addEmitFlags: () => addEmitFlags, + addEmitHelper: () => addEmitHelper, + addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, + addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, + addRange: () => addRange, + addRelatedInfo: () => addRelatedInfo, + addSyntheticLeadingComment: () => addSyntheticLeadingComment, + addSyntheticTrailingComment: () => addSyntheticTrailingComment, + addToSeen: () => addToSeen, + advancedAsyncSuperHelper: () => advancedAsyncSuperHelper, + affectsDeclarationPathOptionDeclarations: () => affectsDeclarationPathOptionDeclarations, + affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations, + allKeysStartWithDot: () => allKeysStartWithDot, + altDirectorySeparator: () => altDirectorySeparator, + and: () => and, + append: () => append, + appendIfUnique: () => appendIfUnique, + arrayFrom: () => arrayFrom, + arrayIsEqualTo: () => arrayIsEqualTo, + arrayIsHomogeneous: () => arrayIsHomogeneous, + arrayIsSorted: () => arrayIsSorted, + arrayOf: () => arrayOf, + arrayReverseIterator: () => arrayReverseIterator, + arrayToMap: () => arrayToMap, + arrayToMultiMap: () => arrayToMultiMap, + arrayToNumericMap: () => arrayToNumericMap, + arraysEqual: () => arraysEqual, + assertType: () => assertType, + assign: () => assign, + assignHelper: () => assignHelper, + asyncDelegator: () => asyncDelegator, + asyncGeneratorHelper: () => asyncGeneratorHelper, + asyncSuperHelper: () => asyncSuperHelper, + asyncValues: () => asyncValues, + attachFileToDiagnostics: () => attachFileToDiagnostics, + awaitHelper: () => awaitHelper, + awaiterHelper: () => awaiterHelper, + base64decode: () => base64decode, + base64encode: () => base64encode, + binarySearch: () => binarySearch, + binarySearchKey: () => binarySearchKey, + bindSourceFile: () => bindSourceFile, + breakIntoCharacterSpans: () => breakIntoCharacterSpans, + breakIntoWordSpans: () => breakIntoWordSpans, + buildLinkParts: () => buildLinkParts, + buildOpts: () => buildOpts, + buildOverload: () => buildOverload, + bundlerModuleNameResolver: () => bundlerModuleNameResolver, + canBeConvertedToAsync: () => canBeConvertedToAsync, + canHaveDecorators: () => canHaveDecorators, + canHaveExportModifier: () => canHaveExportModifier, + canHaveFlowNode: () => canHaveFlowNode, + canHaveIllegalDecorators: () => canHaveIllegalDecorators, + canHaveIllegalModifiers: () => canHaveIllegalModifiers, + canHaveIllegalType: () => canHaveIllegalType, + canHaveIllegalTypeParameters: () => canHaveIllegalTypeParameters, + canHaveJSDoc: () => canHaveJSDoc, + canHaveLocals: () => canHaveLocals, + canHaveModifiers: () => canHaveModifiers, + canHaveSymbol: () => canHaveSymbol, + canJsonReportNoInputFiles: () => canJsonReportNoInputFiles, + canProduceDiagnostics: () => canProduceDiagnostics, + canUsePropertyAccess: () => canUsePropertyAccess, + canWatchAffectingLocation: () => canWatchAffectingLocation, + canWatchAtTypes: () => canWatchAtTypes, + canWatchDirectoryOrFile: () => canWatchDirectoryOrFile, + cartesianProduct: () => cartesianProduct, + cast: () => cast, + chainBundle: () => chainBundle, + chainDiagnosticMessages: () => chainDiagnosticMessages, + changeAnyExtension: () => changeAnyExtension, + changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache, + changeExtension: () => changeExtension, + changeFullExtension: () => changeFullExtension, + changesAffectModuleResolution: () => changesAffectModuleResolution, + changesAffectingProgramStructure: () => changesAffectingProgramStructure, + childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, + classHasClassThisAssignment: () => classHasClassThisAssignment, + classHasDeclaredOrExplicitlyAssignedName: () => classHasDeclaredOrExplicitlyAssignedName, + classHasExplicitlyAssignedName: () => classHasExplicitlyAssignedName, + classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, + classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, + classPrivateFieldInHelper: () => classPrivateFieldInHelper, + classPrivateFieldSetHelper: () => classPrivateFieldSetHelper, + classicNameResolver: () => classicNameResolver, + classifier: () => ts_classifier_exports, + cleanExtendedConfigCache: () => cleanExtendedConfigCache, + clear: () => clear, + clearMap: () => clearMap, + clearSharedExtendedConfigFileWatcher: () => clearSharedExtendedConfigFileWatcher, + climbPastPropertyAccess: () => climbPastPropertyAccess, + climbPastPropertyOrElementAccess: () => climbPastPropertyOrElementAccess, + clone: () => clone, + cloneCompilerOptions: () => cloneCompilerOptions, + closeFileWatcher: () => closeFileWatcher, + closeFileWatcherOf: () => closeFileWatcherOf, + codefix: () => ts_codefix_exports, + collapseTextChangeRangesAcrossMultipleVersions: () => collapseTextChangeRangesAcrossMultipleVersions, + collectExternalModuleInfo: () => collectExternalModuleInfo, + combine: () => combine, + combinePaths: () => combinePaths, + commentPragmas: () => commentPragmas, + commonOptionsWithBuild: () => commonOptionsWithBuild, + commonPackageFolders: () => commonPackageFolders, + compact: () => compact, + compareBooleans: () => compareBooleans, + compareDataObjects: () => compareDataObjects, + compareDiagnostics: () => compareDiagnostics, + compareDiagnosticsSkipRelatedInformation: () => compareDiagnosticsSkipRelatedInformation, + compareEmitHelpers: () => compareEmitHelpers, + compareNumberOfDirectorySeparators: () => compareNumberOfDirectorySeparators, + comparePaths: () => comparePaths, + comparePathsCaseInsensitive: () => comparePathsCaseInsensitive, + comparePathsCaseSensitive: () => comparePathsCaseSensitive, + comparePatternKeys: () => comparePatternKeys, + compareProperties: () => compareProperties, + compareStringsCaseInsensitive: () => compareStringsCaseInsensitive, + compareStringsCaseInsensitiveEslintCompatible: () => compareStringsCaseInsensitiveEslintCompatible, + compareStringsCaseSensitive: () => compareStringsCaseSensitive, + compareStringsCaseSensitiveUI: () => compareStringsCaseSensitiveUI, + compareTextSpans: () => compareTextSpans, + compareValues: () => compareValues, + compileOnSaveCommandLineOption: () => compileOnSaveCommandLineOption, + compilerOptionsAffectDeclarationPath: () => compilerOptionsAffectDeclarationPath, + compilerOptionsAffectEmit: () => compilerOptionsAffectEmit, + compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, + compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, + compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, + computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, + computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, + computeLineOfPosition: () => computeLineOfPosition, + computeLineStarts: () => computeLineStarts, + computePositionOfLineAndCharacter: () => computePositionOfLineAndCharacter, + computeSignature: () => computeSignature, + computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics, + computeSuggestionDiagnostics: () => computeSuggestionDiagnostics, + computedOptions: () => computedOptions, + concatenate: () => concatenate, + concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains, + consumesNodeCoreModules: () => consumesNodeCoreModules, + contains: () => contains, + containsIgnoredPath: () => containsIgnoredPath, + containsObjectRestOrSpread: () => containsObjectRestOrSpread, + containsParseError: () => containsParseError, + containsPath: () => containsPath, + convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, + convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, + convertJsonOption: () => convertJsonOption, + convertToBase64: () => convertToBase64, + convertToJson: () => convertToJson, + convertToObject: () => convertToObject, + convertToOptionsWithAbsolutePaths: () => convertToOptionsWithAbsolutePaths, + convertToRelativePath: () => convertToRelativePath, + convertToTSConfig: () => convertToTSConfig, + convertTypeAcquisitionFromJson: () => convertTypeAcquisitionFromJson, + copyComments: () => copyComments, + copyEntries: () => copyEntries, + copyLeadingComments: () => copyLeadingComments, + copyProperties: () => copyProperties, + copyTrailingAsLeadingComments: () => copyTrailingAsLeadingComments, + copyTrailingComments: () => copyTrailingComments, + couldStartTrivia: () => couldStartTrivia, + countWhere: () => countWhere, + createAbstractBuilder: () => createAbstractBuilder, + createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, + createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, + createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, + createBaseNodeFactory: () => createBaseNodeFactory, + createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, + createBindingHelper: () => createBindingHelper, + createBuildInfo: () => createBuildInfo, + createBuilderProgram: () => createBuilderProgram, + createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, + createBuilderStatusReporter: () => createBuilderStatusReporter, + createCacheWithRedirects: () => createCacheWithRedirects, + createCacheableExportInfoMap: () => createCacheableExportInfoMap, + createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, + createClassNamedEvaluationHelperBlock: () => createClassNamedEvaluationHelperBlock, + createClassThisAssignmentBlock: () => createClassThisAssignmentBlock, + createClassifier: () => createClassifier, + createCommentDirectivesMap: () => createCommentDirectivesMap, + createCompilerDiagnostic: () => createCompilerDiagnostic, + createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, + createCompilerDiagnosticFromMessageChain: () => createCompilerDiagnosticFromMessageChain, + createCompilerHost: () => createCompilerHost, + createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, + createCompilerHostWorker: () => createCompilerHostWorker, + createDetachedDiagnostic: () => createDetachedDiagnostic, + createDiagnosticCollection: () => createDiagnosticCollection, + createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, + createDiagnosticForNode: () => createDiagnosticForNode, + createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, + createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, + createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, + createDiagnosticForRange: () => createDiagnosticForRange, + createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, + createDiagnosticReporter: () => createDiagnosticReporter, + createDocumentPositionMapper: () => createDocumentPositionMapper, + createDocumentRegistry: () => createDocumentRegistry, + createDocumentRegistryInternal: () => createDocumentRegistryInternal, + createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, + createEmitHelperFactory: () => createEmitHelperFactory, + createEmptyExports: () => createEmptyExports, + createExpressionForJsxElement: () => createExpressionForJsxElement, + createExpressionForJsxFragment: () => createExpressionForJsxFragment, + createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, + createExpressionForPropertyName: () => createExpressionForPropertyName, + createExpressionFromEntityName: () => createExpressionFromEntityName, + createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, + createFileDiagnostic: () => createFileDiagnostic, + createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, + createForOfBindingStatement: () => createForOfBindingStatement, + createGetCanonicalFileName: () => createGetCanonicalFileName, + createGetSourceFile: () => createGetSourceFile, + createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, + createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, + createGetSymbolWalker: () => createGetSymbolWalker, + createIncrementalCompilerHost: () => createIncrementalCompilerHost, + createIncrementalProgram: () => createIncrementalProgram, + createInputFiles: () => createInputFiles, + createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, + createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, + createJsxFactoryExpression: () => createJsxFactoryExpression, + createLanguageService: () => createLanguageService, + createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, + createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, + createModeAwareCache: () => createModeAwareCache, + createModeAwareCacheKey: () => createModeAwareCacheKey, + createModuleNotFoundChain: () => createModuleNotFoundChain, + createModuleResolutionCache: () => createModuleResolutionCache, + createModuleResolutionLoader: () => createModuleResolutionLoader, + createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache, + createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, + createMultiMap: () => createMultiMap, + createNodeConverters: () => createNodeConverters, + createNodeFactory: () => createNodeFactory, + createOptionNameMap: () => createOptionNameMap, + createOverload: () => createOverload, + createPackageJsonImportFilter: () => createPackageJsonImportFilter, + createPackageJsonInfo: () => createPackageJsonInfo, + createParenthesizerRules: () => createParenthesizerRules, + createPatternMatcher: () => createPatternMatcher, + createPrependNodes: () => createPrependNodes, + createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, + createProgram: () => createProgram, + createProgramHost: () => createProgramHost, + createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, + createQueue: () => createQueue, + createRange: () => createRange, + createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, + createResolutionCache: () => createResolutionCache, + createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, + createScanner: () => createScanner, + createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, + createSet: () => createSet, + createSolutionBuilder: () => createSolutionBuilder, + createSolutionBuilderHost: () => createSolutionBuilderHost, + createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, + createSolutionBuilderWithWatchHost: () => createSolutionBuilderWithWatchHost, + createSortedArray: () => createSortedArray, + createSourceFile: () => createSourceFile, + createSourceMapGenerator: () => createSourceMapGenerator, + createSourceMapSource: () => createSourceMapSource, + createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, + createSymbolTable: () => createSymbolTable, + createSymlinkCache: () => createSymlinkCache, + createSystemWatchFunctions: () => createSystemWatchFunctions, + createTextChange: () => createTextChange, + createTextChangeFromStartLength: () => createTextChangeFromStartLength, + createTextChangeRange: () => createTextChangeRange, + createTextRangeFromNode: () => createTextRangeFromNode, + createTextRangeFromSpan: () => createTextRangeFromSpan, + createTextSpan: () => createTextSpan, + createTextSpanFromBounds: () => createTextSpanFromBounds, + createTextSpanFromNode: () => createTextSpanFromNode, + createTextSpanFromRange: () => createTextSpanFromRange, + createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, + createTextWriter: () => createTextWriter, + createTokenRange: () => createTokenRange, + createTypeChecker: () => createTypeChecker, + createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, + createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, + createUnparsedSourceFile: () => createUnparsedSourceFile, + createWatchCompilerHost: () => createWatchCompilerHost2, + createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, + createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, + createWatchFactory: () => createWatchFactory, + createWatchHost: () => createWatchHost, + createWatchProgram: () => createWatchProgram, + createWatchStatusReporter: () => createWatchStatusReporter, + createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, + declarationNameToString: () => declarationNameToString, + decodeMappings: () => decodeMappings, + decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, + decorateHelper: () => decorateHelper, + deduplicate: () => deduplicate, + defaultIncludeSpec: () => defaultIncludeSpec, + defaultInitCompilerOptions: () => defaultInitCompilerOptions, + defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, + detectSortCaseSensitivity: () => detectSortCaseSensitivity, + diagnosticCategoryName: () => diagnosticCategoryName, + diagnosticToString: () => diagnosticToString, + directoryProbablyExists: () => directoryProbablyExists, + directorySeparator: () => directorySeparator, + displayPart: () => displayPart, + displayPartsToString: () => displayPartsToString, + disposeEmitNodes: () => disposeEmitNodes, + disposeResourcesHelper: () => disposeResourcesHelper, + documentSpansEqual: () => documentSpansEqual, + dumpTracingLegend: () => dumpTracingLegend, + elementAt: () => elementAt, + elideNodes: () => elideNodes, + emitComments: () => emitComments, + emitDetachedComments: () => emitDetachedComments, + emitFiles: () => emitFiles, + emitFilesAndReportErrors: () => emitFilesAndReportErrors, + emitFilesAndReportErrorsAndGetExitStatus: () => emitFilesAndReportErrorsAndGetExitStatus, + emitModuleKindIsNonNodeESM: () => emitModuleKindIsNonNodeESM, + emitNewLineBeforeLeadingCommentOfPosition: () => emitNewLineBeforeLeadingCommentOfPosition, + emitNewLineBeforeLeadingComments: () => emitNewLineBeforeLeadingComments, + emitNewLineBeforeLeadingCommentsOfPosition: () => emitNewLineBeforeLeadingCommentsOfPosition, + emitSkippedWithNoDiagnostics: () => emitSkippedWithNoDiagnostics, + emitUsingBuildInfo: () => emitUsingBuildInfo, + emptyArray: () => emptyArray, + emptyFileSystemEntries: () => emptyFileSystemEntries, + emptyMap: () => emptyMap, + emptyOptions: () => emptyOptions, + emptySet: () => emptySet, + endsWith: () => endsWith, + ensurePathIsNonModuleName: () => ensurePathIsNonModuleName, + ensureScriptKind: () => ensureScriptKind, + ensureTrailingDirectorySeparator: () => ensureTrailingDirectorySeparator, + entityNameToString: () => entityNameToString, + enumerateInsertsAndDeletes: () => enumerateInsertsAndDeletes, + equalOwnProperties: () => equalOwnProperties, + equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, + equateStringsCaseSensitive: () => equateStringsCaseSensitive, + equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, + escapeJsxAttributeString: () => escapeJsxAttributeString, + escapeLeadingUnderscores: () => escapeLeadingUnderscores, + escapeNonAsciiString: () => escapeNonAsciiString, + escapeSnippetText: () => escapeSnippetText, + escapeString: () => escapeString, + escapeTemplateSubstitution: () => escapeTemplateSubstitution, + every: () => every, + expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression, + explainFiles: () => explainFiles, + explainIfFileIsRedirectAndImpliedFormat: () => explainIfFileIsRedirectAndImpliedFormat, + exportAssignmentIsAlias: () => exportAssignmentIsAlias, + exportStarHelper: () => exportStarHelper, + expressionResultIsUnused: () => expressionResultIsUnused, + extend: () => extend, + extendsHelper: () => extendsHelper, + extensionFromPath: () => extensionFromPath, + extensionIsTS: () => extensionIsTS, + extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution, + externalHelpersModuleNameText: () => externalHelpersModuleNameText, + factory: () => factory, + fileExtensionIs: () => fileExtensionIs, + fileExtensionIsOneOf: () => fileExtensionIsOneOf, + fileIncludeReasonToDiagnostics: () => fileIncludeReasonToDiagnostics, + fileShouldUseJavaScriptRequire: () => fileShouldUseJavaScriptRequire, + filter: () => filter, + filterMutate: () => filterMutate, + filterSemanticDiagnostics: () => filterSemanticDiagnostics, + find: () => find, + findAncestor: () => findAncestor, + findBestPatternMatch: () => findBestPatternMatch, + findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, + findConfigFile: () => findConfigFile, + findContainingList: () => findContainingList, + findDiagnosticForNode: () => findDiagnosticForNode, + findFirstNonJsxWhitespaceToken: () => findFirstNonJsxWhitespaceToken, + findIndex: () => findIndex, + findLast: () => findLast, + findLastIndex: () => findLastIndex, + findListItemInfo: () => findListItemInfo, + findMap: () => findMap, + findModifier: () => findModifier, + findNextToken: () => findNextToken, + findPackageJson: () => findPackageJson, + findPackageJsons: () => findPackageJsons, + findPrecedingMatchingToken: () => findPrecedingMatchingToken, + findPrecedingToken: () => findPrecedingToken, + findSuperStatementIndexPath: () => findSuperStatementIndexPath, + findTokenOnLeftOfPosition: () => findTokenOnLeftOfPosition, + findUseStrictPrologue: () => findUseStrictPrologue, + first: () => first, + firstDefined: () => firstDefined, + firstDefinedIterator: () => firstDefinedIterator, + firstIterator: () => firstIterator, + firstOrOnly: () => firstOrOnly, + firstOrUndefined: () => firstOrUndefined, + firstOrUndefinedIterator: () => firstOrUndefinedIterator, + fixupCompilerOptions: () => fixupCompilerOptions, + flatMap: () => flatMap, + flatMapIterator: () => flatMapIterator, + flatMapToMutable: () => flatMapToMutable, + flatten: () => flatten, + flattenCommaList: () => flattenCommaList, + flattenDestructuringAssignment: () => flattenDestructuringAssignment, + flattenDestructuringBinding: () => flattenDestructuringBinding, + flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, + forEach: () => forEach, + forEachAncestor: () => forEachAncestor, + forEachAncestorDirectory: () => forEachAncestorDirectory, + forEachChild: () => forEachChild, + forEachChildRecursively: () => forEachChildRecursively, + forEachEmittedFile: () => forEachEmittedFile, + forEachEnclosingBlockScopeContainer: () => forEachEnclosingBlockScopeContainer, + forEachEntry: () => forEachEntry, + forEachExternalModuleToImportFrom: () => forEachExternalModuleToImportFrom, + forEachImportClauseDeclaration: () => forEachImportClauseDeclaration, + forEachKey: () => forEachKey, + forEachLeadingCommentRange: () => forEachLeadingCommentRange, + forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft, + forEachPropertyAssignment: () => forEachPropertyAssignment, + forEachResolvedProjectReference: () => forEachResolvedProjectReference, + forEachReturnStatement: () => forEachReturnStatement, + forEachRight: () => forEachRight, + forEachTrailingCommentRange: () => forEachTrailingCommentRange, + forEachTsConfigPropArray: () => forEachTsConfigPropArray, + forEachUnique: () => forEachUnique, + forEachYieldExpression: () => forEachYieldExpression, + forSomeAncestorDirectory: () => forSomeAncestorDirectory, + formatColorAndReset: () => formatColorAndReset, + formatDiagnostic: () => formatDiagnostic, + formatDiagnostics: () => formatDiagnostics, + formatDiagnosticsWithColorAndContext: () => formatDiagnosticsWithColorAndContext, + formatGeneratedName: () => formatGeneratedName, + formatGeneratedNamePart: () => formatGeneratedNamePart, + formatLocation: () => formatLocation, + formatMessage: () => formatMessage, + formatStringFromArgs: () => formatStringFromArgs, + formatting: () => ts_formatting_exports, + fullTripleSlashAMDReferencePathRegEx: () => fullTripleSlashAMDReferencePathRegEx, + fullTripleSlashReferencePathRegEx: () => fullTripleSlashReferencePathRegEx, + generateDjb2Hash: () => generateDjb2Hash, + generateTSConfig: () => generateTSConfig, + generatorHelper: () => generatorHelper, + getAdjustedReferenceLocation: () => getAdjustedReferenceLocation, + getAdjustedRenameLocation: () => getAdjustedRenameLocation, + getAliasDeclarationFromName: () => getAliasDeclarationFromName, + getAllAccessorDeclarations: () => getAllAccessorDeclarations, + getAllDecoratorsOfClass: () => getAllDecoratorsOfClass, + getAllDecoratorsOfClassElement: () => getAllDecoratorsOfClassElement, + getAllJSDocTags: () => getAllJSDocTags, + getAllJSDocTagsOfKind: () => getAllJSDocTagsOfKind, + getAllKeys: () => getAllKeys, + getAllProjectOutputs: () => getAllProjectOutputs, + getAllSuperTypeNodes: () => getAllSuperTypeNodes, + getAllUnscopedEmitHelpers: () => getAllUnscopedEmitHelpers, + getAllowJSCompilerOption: () => getAllowJSCompilerOption, + getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports, + getAncestor: () => getAncestor, + getAnyExtensionFromPath: () => getAnyExtensionFromPath, + getAreDeclarationMapsEnabled: () => getAreDeclarationMapsEnabled, + getAssignedExpandoInitializer: () => getAssignedExpandoInitializer, + getAssignedName: () => getAssignedName, + getAssignedNameOfIdentifier: () => getAssignedNameOfIdentifier, + getAssignmentDeclarationKind: () => getAssignmentDeclarationKind, + getAssignmentDeclarationPropertyAccessKind: () => getAssignmentDeclarationPropertyAccessKind, + getAssignmentTargetKind: () => getAssignmentTargetKind, + getAutomaticTypeDirectiveNames: () => getAutomaticTypeDirectiveNames, + getBaseFileName: () => getBaseFileName, + getBinaryOperatorPrecedence: () => getBinaryOperatorPrecedence, + getBuildInfo: () => getBuildInfo, + getBuildInfoFileVersionMap: () => getBuildInfoFileVersionMap, + getBuildInfoText: () => getBuildInfoText, + getBuildOrderFromAnyBuildOrder: () => getBuildOrderFromAnyBuildOrder, + getBuilderCreationParameters: () => getBuilderCreationParameters, + getBuilderFileEmit: () => getBuilderFileEmit, + getCheckFlags: () => getCheckFlags, + getClassExtendsHeritageElement: () => getClassExtendsHeritageElement, + getClassLikeDeclarationOfSymbol: () => getClassLikeDeclarationOfSymbol, + getCombinedLocalAndExportSymbolFlags: () => getCombinedLocalAndExportSymbolFlags, + getCombinedModifierFlags: () => getCombinedModifierFlags, + getCombinedNodeFlags: () => getCombinedNodeFlags, + getCombinedNodeFlagsAlwaysIncludeJSDoc: () => getCombinedNodeFlagsAlwaysIncludeJSDoc, + getCommentRange: () => getCommentRange, + getCommonSourceDirectory: () => getCommonSourceDirectory, + getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, + getCompilerOptionValue: () => getCompilerOptionValue, + getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, + getConditions: () => getConditions, + getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, + getConstantValue: () => getConstantValue, + getContainerFlags: () => getContainerFlags, + getContainerNode: () => getContainerNode, + getContainingClass: () => getContainingClass, + getContainingClassExcludingClassDecorators: () => getContainingClassExcludingClassDecorators, + getContainingClassStaticBlock: () => getContainingClassStaticBlock, + getContainingFunction: () => getContainingFunction, + getContainingFunctionDeclaration: () => getContainingFunctionDeclaration, + getContainingFunctionOrClassStaticBlock: () => getContainingFunctionOrClassStaticBlock, + getContainingNodeArray: () => getContainingNodeArray, + getContainingObjectLiteralElement: () => getContainingObjectLiteralElement, + getContextualTypeFromParent: () => getContextualTypeFromParent, + getContextualTypeFromParentOrAncestorTypeNode: () => getContextualTypeFromParentOrAncestorTypeNode, + getCurrentTime: () => getCurrentTime, + getDeclarationDiagnostics: () => getDeclarationDiagnostics, + getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath, + getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath, + getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker, + getDeclarationFileExtension: () => getDeclarationFileExtension, + getDeclarationFromName: () => getDeclarationFromName, + getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol, + getDeclarationOfKind: () => getDeclarationOfKind, + getDeclarationsOfKind: () => getDeclarationsOfKind, + getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, + getDecorators: () => getDecorators, + getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, + getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, + getDefaultLibFileName: () => getDefaultLibFileName, + getDefaultLibFilePath: () => getDefaultLibFilePath, + getDefaultLikeExportInfo: () => getDefaultLikeExportInfo, + getDiagnosticText: () => getDiagnosticText, + getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan, + getDirectoryPath: () => getDirectoryPath, + getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation, + getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot, + getDocumentPositionMapper: () => getDocumentPositionMapper, + getDocumentSpansEqualityComparer: () => getDocumentSpansEqualityComparer, + getESModuleInterop: () => getESModuleInterop, + getEditsForFileRename: () => getEditsForFileRename, + getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode, + getEffectiveConstraintOfTypeParameter: () => getEffectiveConstraintOfTypeParameter, + getEffectiveContainerForJSDocTemplateTag: () => getEffectiveContainerForJSDocTemplateTag, + getEffectiveImplementsTypeNodes: () => getEffectiveImplementsTypeNodes, + getEffectiveInitializer: () => getEffectiveInitializer, + getEffectiveJSDocHost: () => getEffectiveJSDocHost, + getEffectiveModifierFlags: () => getEffectiveModifierFlags, + getEffectiveModifierFlagsAlwaysIncludeJSDoc: () => getEffectiveModifierFlagsAlwaysIncludeJSDoc, + getEffectiveModifierFlagsNoCache: () => getEffectiveModifierFlagsNoCache, + getEffectiveReturnTypeNode: () => getEffectiveReturnTypeNode, + getEffectiveSetAccessorTypeAnnotationNode: () => getEffectiveSetAccessorTypeAnnotationNode, + getEffectiveTypeAnnotationNode: () => getEffectiveTypeAnnotationNode, + getEffectiveTypeParameterDeclarations: () => getEffectiveTypeParameterDeclarations, + getEffectiveTypeRoots: () => getEffectiveTypeRoots, + getElementOrPropertyAccessArgumentExpressionOrName: () => getElementOrPropertyAccessArgumentExpressionOrName, + getElementOrPropertyAccessName: () => getElementOrPropertyAccessName, + getElementsOfBindingOrAssignmentPattern: () => getElementsOfBindingOrAssignmentPattern, + getEmitDeclarations: () => getEmitDeclarations, + getEmitFlags: () => getEmitFlags, + getEmitHelpers: () => getEmitHelpers, + getEmitModuleDetectionKind: () => getEmitModuleDetectionKind, + getEmitModuleKind: () => getEmitModuleKind, + getEmitModuleResolutionKind: () => getEmitModuleResolutionKind, + getEmitScriptTarget: () => getEmitScriptTarget, + getEmitStandardClassFields: () => getEmitStandardClassFields, + getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer, + getEnclosingContainer: () => getEnclosingContainer, + getEncodedSemanticClassifications: () => getEncodedSemanticClassifications, + getEncodedSyntacticClassifications: () => getEncodedSyntacticClassifications, + getEndLinePosition: () => getEndLinePosition, + getEntityNameFromTypeNode: () => getEntityNameFromTypeNode, + getEntrypointsFromPackageJsonInfo: () => getEntrypointsFromPackageJsonInfo, + getErrorCountForSummary: () => getErrorCountForSummary, + getErrorSpanForNode: () => getErrorSpanForNode, + getErrorSummaryText: () => getErrorSummaryText, + getEscapedTextOfIdentifierOrLiteral: () => getEscapedTextOfIdentifierOrLiteral, + getEscapedTextOfJsxAttributeName: () => getEscapedTextOfJsxAttributeName, + getEscapedTextOfJsxNamespacedName: () => getEscapedTextOfJsxNamespacedName, + getExpandoInitializer: () => getExpandoInitializer, + getExportAssignmentExpression: () => getExportAssignmentExpression, + getExportInfoMap: () => getExportInfoMap, + getExportNeedsImportStarHelper: () => getExportNeedsImportStarHelper, + getExpressionAssociativity: () => getExpressionAssociativity, + getExpressionPrecedence: () => getExpressionPrecedence, + getExternalHelpersModuleName: () => getExternalHelpersModuleName, + getExternalModuleImportEqualsDeclarationExpression: () => getExternalModuleImportEqualsDeclarationExpression, + getExternalModuleName: () => getExternalModuleName, + getExternalModuleNameFromDeclaration: () => getExternalModuleNameFromDeclaration, + getExternalModuleNameFromPath: () => getExternalModuleNameFromPath, + getExternalModuleNameLiteral: () => getExternalModuleNameLiteral, + getExternalModuleRequireArgument: () => getExternalModuleRequireArgument, + getFallbackOptions: () => getFallbackOptions, + getFileEmitOutput: () => getFileEmitOutput, + getFileMatcherPatterns: () => getFileMatcherPatterns, + getFileNamesFromConfigSpecs: () => getFileNamesFromConfigSpecs, + getFileWatcherEventKind: () => getFileWatcherEventKind, + getFilesInErrorForSummary: () => getFilesInErrorForSummary, + getFirstConstructorWithBody: () => getFirstConstructorWithBody, + getFirstIdentifier: () => getFirstIdentifier, + getFirstNonSpaceCharacterPosition: () => getFirstNonSpaceCharacterPosition, + getFirstProjectOutput: () => getFirstProjectOutput, + getFixableErrorSpanExpression: () => getFixableErrorSpanExpression, + getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, + getFullWidth: () => getFullWidth, + getFunctionFlags: () => getFunctionFlags, + getHeritageClause: () => getHeritageClause, + getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, + getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, + getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, + getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, + getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper, + getImportNeedsImportStarHelper: () => getImportNeedsImportStarHelper, + getIndentSize: () => getIndentSize, + getIndentString: () => getIndentString, + getInferredLibraryNameResolveFrom: () => getInferredLibraryNameResolveFrom, + getInitializedVariables: () => getInitializedVariables, + getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, + getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, + getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, + getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, + getJSDocAugmentsTag: () => getJSDocAugmentsTag, + getJSDocClassTag: () => getJSDocClassTag, + getJSDocCommentRanges: () => getJSDocCommentRanges, + getJSDocCommentsAndTags: () => getJSDocCommentsAndTags, + getJSDocDeprecatedTag: () => getJSDocDeprecatedTag, + getJSDocDeprecatedTagNoCache: () => getJSDocDeprecatedTagNoCache, + getJSDocEnumTag: () => getJSDocEnumTag, + getJSDocHost: () => getJSDocHost, + getJSDocImplementsTags: () => getJSDocImplementsTags, + getJSDocOverloadTags: () => getJSDocOverloadTags, + getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache, + getJSDocParameterTags: () => getJSDocParameterTags, + getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache, + getJSDocPrivateTag: () => getJSDocPrivateTag, + getJSDocPrivateTagNoCache: () => getJSDocPrivateTagNoCache, + getJSDocProtectedTag: () => getJSDocProtectedTag, + getJSDocProtectedTagNoCache: () => getJSDocProtectedTagNoCache, + getJSDocPublicTag: () => getJSDocPublicTag, + getJSDocPublicTagNoCache: () => getJSDocPublicTagNoCache, + getJSDocReadonlyTag: () => getJSDocReadonlyTag, + getJSDocReadonlyTagNoCache: () => getJSDocReadonlyTagNoCache, + getJSDocReturnTag: () => getJSDocReturnTag, + getJSDocReturnType: () => getJSDocReturnType, + getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, + getJSDocTags: () => getJSDocTags, + getJSDocTagsNoCache: () => getJSDocTagsNoCache, + getJSDocTemplateTag: () => getJSDocTemplateTag, + getJSDocThisTag: () => getJSDocThisTag, + getJSDocType: () => getJSDocType, + getJSDocTypeAliasName: () => getJSDocTypeAliasName, + getJSDocTypeAssertionType: () => getJSDocTypeAssertionType, + getJSDocTypeParameterDeclarations: () => getJSDocTypeParameterDeclarations, + getJSDocTypeParameterTags: () => getJSDocTypeParameterTags, + getJSDocTypeParameterTagsNoCache: () => getJSDocTypeParameterTagsNoCache, + getJSDocTypeTag: () => getJSDocTypeTag, + getJSXImplicitImportBase: () => getJSXImplicitImportBase, + getJSXRuntimeImport: () => getJSXRuntimeImport, + getJSXTransformEnabled: () => getJSXTransformEnabled, + getKeyForCompilerOptions: () => getKeyForCompilerOptions, + getLanguageVariant: () => getLanguageVariant, + getLastChild: () => getLastChild, + getLeadingCommentRanges: () => getLeadingCommentRanges, + getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode, + getLeftmostAccessExpression: () => getLeftmostAccessExpression, + getLeftmostExpression: () => getLeftmostExpression, + getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName, + getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition, + getLineInfo: () => getLineInfo, + getLineOfLocalPosition: () => getLineOfLocalPosition, + getLineOfLocalPositionFromLineMap: () => getLineOfLocalPositionFromLineMap, + getLineStartPositionForPosition: () => getLineStartPositionForPosition, + getLineStarts: () => getLineStarts, + getLinesBetweenPositionAndNextNonWhitespaceCharacter: () => getLinesBetweenPositionAndNextNonWhitespaceCharacter, + getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter: () => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter, + getLinesBetweenPositions: () => getLinesBetweenPositions, + getLinesBetweenRangeEndAndRangeStart: () => getLinesBetweenRangeEndAndRangeStart, + getLinesBetweenRangeEndPositions: () => getLinesBetweenRangeEndPositions, + getLiteralText: () => getLiteralText, + getLocalNameForExternalImport: () => getLocalNameForExternalImport, + getLocalSymbolForExportDefault: () => getLocalSymbolForExportDefault, + getLocaleSpecificMessage: () => getLocaleSpecificMessage, + getLocaleTimeString: () => getLocaleTimeString, + getMappedContextSpan: () => getMappedContextSpan, + getMappedDocumentSpan: () => getMappedDocumentSpan, + getMappedLocation: () => getMappedLocation, + getMatchedFileSpec: () => getMatchedFileSpec, + getMatchedIncludeSpec: () => getMatchedIncludeSpec, + getMeaningFromDeclaration: () => getMeaningFromDeclaration, + getMeaningFromLocation: () => getMeaningFromLocation, + getMembersOfDeclaration: () => getMembersOfDeclaration, + getModeForFileReference: () => getModeForFileReference, + getModeForResolutionAtIndex: () => getModeForResolutionAtIndex, + getModeForUsageLocation: () => getModeForUsageLocation, + getModifiedTime: () => getModifiedTime, + getModifiers: () => getModifiers, + getModuleInstanceState: () => getModuleInstanceState, + getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, + getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, + getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, + getNameForExportedSymbol: () => getNameForExportedSymbol, + getNameFromImportAttribute: () => getNameFromImportAttribute, + getNameFromIndexInfo: () => getNameFromIndexInfo, + getNameFromPropertyName: () => getNameFromPropertyName, + getNameOfAccessExpression: () => getNameOfAccessExpression, + getNameOfCompilerOptionValue: () => getNameOfCompilerOptionValue, + getNameOfDeclaration: () => getNameOfDeclaration, + getNameOfExpando: () => getNameOfExpando, + getNameOfJSDocTypedef: () => getNameOfJSDocTypedef, + getNameOrArgument: () => getNameOrArgument, + getNameTable: () => getNameTable, + getNamesForExportedSymbol: () => getNamesForExportedSymbol, + getNamespaceDeclarationNode: () => getNamespaceDeclarationNode, + getNewLineCharacter: () => getNewLineCharacter, + getNewLineKind: () => getNewLineKind, + getNewLineOrDefaultFromHost: () => getNewLineOrDefaultFromHost, + getNewTargetContainer: () => getNewTargetContainer, + getNextJSDocCommentLocation: () => getNextJSDocCommentLocation, + getNodeForGeneratedName: () => getNodeForGeneratedName, + getNodeId: () => getNodeId, + getNodeKind: () => getNodeKind, + getNodeModifiers: () => getNodeModifiers, + getNodeModulePathParts: () => getNodeModulePathParts, + getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, + getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment, + getNonAugmentationDeclaration: () => getNonAugmentationDeclaration, + getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode, + getNormalizedAbsolutePath: () => getNormalizedAbsolutePath, + getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot, + getNormalizedPathComponents: () => getNormalizedPathComponents, + getObjectFlags: () => getObjectFlags, + getOperator: () => getOperator, + getOperatorAssociativity: () => getOperatorAssociativity, + getOperatorPrecedence: () => getOperatorPrecedence, + getOptionFromName: () => getOptionFromName, + getOptionsForLibraryResolution: () => getOptionsForLibraryResolution, + getOptionsNameMap: () => getOptionsNameMap, + getOrCreateEmitNode: () => getOrCreateEmitNode, + getOrCreateExternalHelpersModuleNameIfNeeded: () => getOrCreateExternalHelpersModuleNameIfNeeded, + getOrUpdate: () => getOrUpdate, + getOriginalNode: () => getOriginalNode, + getOriginalNodeId: () => getOriginalNodeId, + getOriginalSourceFile: () => getOriginalSourceFile, + getOutputDeclarationFileName: () => getOutputDeclarationFileName, + getOutputDeclarationFileNameWorker: () => getOutputDeclarationFileNameWorker, + getOutputExtension: () => getOutputExtension, + getOutputFileNames: () => getOutputFileNames, + getOutputJSFileNameWorker: () => getOutputJSFileNameWorker, + getOutputPathsFor: () => getOutputPathsFor, + getOutputPathsForBundle: () => getOutputPathsForBundle, + getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath, + getOwnKeys: () => getOwnKeys, + getOwnValues: () => getOwnValues, + getPackageJsonInfo: () => getPackageJsonInfo, + getPackageJsonTypesVersionsPaths: () => getPackageJsonTypesVersionsPaths, + getPackageJsonsVisibleToFile: () => getPackageJsonsVisibleToFile, + getPackageNameFromTypesPackageName: () => getPackageNameFromTypesPackageName, + getPackageScopeForPath: () => getPackageScopeForPath, + getParameterSymbolFromJSDoc: () => getParameterSymbolFromJSDoc, + getParameterTypeNode: () => getParameterTypeNode, + getParentNodeInSpan: () => getParentNodeInSpan, + getParseTreeNode: () => getParseTreeNode, + getParsedCommandLineOfConfigFile: () => getParsedCommandLineOfConfigFile, + getPathComponents: () => getPathComponents, + getPathComponentsRelativeTo: () => getPathComponentsRelativeTo, + getPathFromPathComponents: () => getPathFromPathComponents, + getPathUpdater: () => getPathUpdater, + getPathsBasePath: () => getPathsBasePath, + getPatternFromSpec: () => getPatternFromSpec, + getPendingEmitKind: () => getPendingEmitKind, + getPositionOfLineAndCharacter: () => getPositionOfLineAndCharacter, + getPossibleGenericSignatures: () => getPossibleGenericSignatures, + getPossibleOriginalInputExtensionForExtension: () => getPossibleOriginalInputExtensionForExtension, + getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, + getPreEmitDiagnostics: () => getPreEmitDiagnostics, + getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, + getProperties: () => getProperties, + getProperty: () => getProperty, + getPropertyArrayElementValue: () => getPropertyArrayElementValue, + getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression, + getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode, + getPropertyNameForUniqueESSymbol: () => getPropertyNameForUniqueESSymbol, + getPropertyNameFromType: () => getPropertyNameFromType, + getPropertyNameOfBindingOrAssignmentElement: () => getPropertyNameOfBindingOrAssignmentElement, + getPropertySymbolFromBindingElement: () => getPropertySymbolFromBindingElement, + getPropertySymbolsFromContextualType: () => getPropertySymbolsFromContextualType, + getQuoteFromPreference: () => getQuoteFromPreference, + getQuotePreference: () => getQuotePreference, + getRangesWhere: () => getRangesWhere, + getRefactorContextSpan: () => getRefactorContextSpan, + getReferencedFileLocation: () => getReferencedFileLocation, + getRegexFromPattern: () => getRegexFromPattern, + getRegularExpressionForWildcard: () => getRegularExpressionForWildcard, + getRegularExpressionsForWildcards: () => getRegularExpressionsForWildcards, + getRelativePathFromDirectory: () => getRelativePathFromDirectory, + getRelativePathFromFile: () => getRelativePathFromFile, + getRelativePathToDirectoryOrUrl: () => getRelativePathToDirectoryOrUrl, + getRenameLocation: () => getRenameLocation, + getReplacementSpanForContextToken: () => getReplacementSpanForContextToken, + getResolutionDiagnostic: () => getResolutionDiagnostic, + getResolutionModeOverride: () => getResolutionModeOverride, + getResolveJsonModule: () => getResolveJsonModule, + getResolvePackageJsonExports: () => getResolvePackageJsonExports, + getResolvePackageJsonImports: () => getResolvePackageJsonImports, + getResolvedExternalModuleName: () => getResolvedExternalModuleName, + getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement, + getRestParameterElementType: () => getRestParameterElementType, + getRightMostAssignedExpression: () => getRightMostAssignedExpression, + getRootDeclaration: () => getRootDeclaration, + getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache, + getRootLength: () => getRootLength, + getRootPathSplitLength: () => getRootPathSplitLength, + getScriptKind: () => getScriptKind, + getScriptKindFromFileName: () => getScriptKindFromFileName, + getScriptTargetFeatures: () => getScriptTargetFeatures, + getSelectedEffectiveModifierFlags: () => getSelectedEffectiveModifierFlags, + getSelectedSyntacticModifierFlags: () => getSelectedSyntacticModifierFlags, + getSemanticClassifications: () => getSemanticClassifications, + getSemanticJsxChildren: () => getSemanticJsxChildren, + getSetAccessorTypeAnnotationNode: () => getSetAccessorTypeAnnotationNode, + getSetAccessorValueParameter: () => getSetAccessorValueParameter, + getSetExternalModuleIndicator: () => getSetExternalModuleIndicator, + getShebang: () => getShebang, + getSingleInitializerOfVariableStatementOrPropertyDeclaration: () => getSingleInitializerOfVariableStatementOrPropertyDeclaration, + getSingleVariableOfVariableStatement: () => getSingleVariableOfVariableStatement, + getSnapshotText: () => getSnapshotText, + getSnippetElement: () => getSnippetElement, + getSourceFileOfModule: () => getSourceFileOfModule, + getSourceFileOfNode: () => getSourceFileOfNode, + getSourceFilePathInNewDir: () => getSourceFilePathInNewDir, + getSourceFilePathInNewDirWorker: () => getSourceFilePathInNewDirWorker, + getSourceFileVersionAsHashFromText: () => getSourceFileVersionAsHashFromText, + getSourceFilesToEmit: () => getSourceFilesToEmit, + getSourceMapRange: () => getSourceMapRange, + getSourceMapper: () => getSourceMapper, + getSourceTextOfNodeFromSourceFile: () => getSourceTextOfNodeFromSourceFile, + getSpanOfTokenAtPosition: () => getSpanOfTokenAtPosition, + getSpellingSuggestion: () => getSpellingSuggestion, + getStartPositionOfLine: () => getStartPositionOfLine, + getStartPositionOfRange: () => getStartPositionOfRange, + getStartsOnNewLine: () => getStartsOnNewLine, + getStaticPropertiesAndClassStaticBlock: () => getStaticPropertiesAndClassStaticBlock, + getStrictOptionValue: () => getStrictOptionValue, + getStringComparer: () => getStringComparer, + getSubPatternFromSpec: () => getSubPatternFromSpec, + getSuperCallFromStatement: () => getSuperCallFromStatement, + getSuperContainer: () => getSuperContainer, + getSupportedCodeFixes: () => getSupportedCodeFixes, + getSupportedExtensions: () => getSupportedExtensions, + getSupportedExtensionsWithJsonIfResolveJsonModule: () => getSupportedExtensionsWithJsonIfResolveJsonModule, + getSwitchedType: () => getSwitchedType, + getSymbolId: () => getSymbolId, + getSymbolNameForPrivateIdentifier: () => getSymbolNameForPrivateIdentifier, + getSymbolTarget: () => getSymbolTarget, + getSyntacticClassifications: () => getSyntacticClassifications, + getSyntacticModifierFlags: () => getSyntacticModifierFlags, + getSyntacticModifierFlagsNoCache: () => getSyntacticModifierFlagsNoCache, + getSynthesizedDeepClone: () => getSynthesizedDeepClone, + getSynthesizedDeepCloneWithReplacements: () => getSynthesizedDeepCloneWithReplacements, + getSynthesizedDeepClones: () => getSynthesizedDeepClones, + getSynthesizedDeepClonesWithReplacements: () => getSynthesizedDeepClonesWithReplacements, + getSyntheticLeadingComments: () => getSyntheticLeadingComments, + getSyntheticTrailingComments: () => getSyntheticTrailingComments, + getTargetLabel: () => getTargetLabel, + getTargetOfBindingOrAssignmentElement: () => getTargetOfBindingOrAssignmentElement, + getTemporaryModuleResolutionState: () => getTemporaryModuleResolutionState, + getTextOfConstantValue: () => getTextOfConstantValue, + getTextOfIdentifierOrLiteral: () => getTextOfIdentifierOrLiteral, + getTextOfJSDocComment: () => getTextOfJSDocComment, + getTextOfJsxAttributeName: () => getTextOfJsxAttributeName, + getTextOfJsxNamespacedName: () => getTextOfJsxNamespacedName, + getTextOfNode: () => getTextOfNode, + getTextOfNodeFromSourceText: () => getTextOfNodeFromSourceText, + getTextOfPropertyName: () => getTextOfPropertyName, + getThisContainer: () => getThisContainer, + getThisParameter: () => getThisParameter, + getTokenAtPosition: () => getTokenAtPosition, + getTokenPosOfNode: () => getTokenPosOfNode, + getTokenSourceMapRange: () => getTokenSourceMapRange, + getTouchingPropertyName: () => getTouchingPropertyName, + getTouchingToken: () => getTouchingToken, + getTrailingCommentRanges: () => getTrailingCommentRanges, + getTrailingSemicolonDeferringWriter: () => getTrailingSemicolonDeferringWriter, + getTransformFlagsSubtreeExclusions: () => getTransformFlagsSubtreeExclusions, + getTransformers: () => getTransformers, + getTsBuildInfoEmitOutputFilePath: () => getTsBuildInfoEmitOutputFilePath, + getTsConfigObjectLiteralExpression: () => getTsConfigObjectLiteralExpression, + getTsConfigPropArrayElementValue: () => getTsConfigPropArrayElementValue, + getTypeAnnotationNode: () => getTypeAnnotationNode, + getTypeArgumentOrTypeParameterList: () => getTypeArgumentOrTypeParameterList, + getTypeKeywordOfTypeOnlyImport: () => getTypeKeywordOfTypeOnlyImport, + getTypeNode: () => getTypeNode, + getTypeNodeIfAccessible: () => getTypeNodeIfAccessible, + getTypeParameterFromJsDoc: () => getTypeParameterFromJsDoc, + getTypeParameterOwner: () => getTypeParameterOwner, + getTypesPackageName: () => getTypesPackageName, + getUILocale: () => getUILocale, + getUniqueName: () => getUniqueName, + getUniqueSymbolId: () => getUniqueSymbolId, + getUseDefineForClassFields: () => getUseDefineForClassFields, + getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, + getWatchFactory: () => getWatchFactory, + group: () => group, + groupBy: () => groupBy, + guessIndentation: () => guessIndentation, + handleNoEmitOptions: () => handleNoEmitOptions, + hasAbstractModifier: () => hasAbstractModifier, + hasAccessorModifier: () => hasAccessorModifier, + hasAmbientModifier: () => hasAmbientModifier, + hasChangesInResolutions: () => hasChangesInResolutions, + hasChildOfKind: () => hasChildOfKind, + hasContextSensitiveParameters: () => hasContextSensitiveParameters, + hasDecorators: () => hasDecorators, + hasDocComment: () => hasDocComment, + hasDynamicName: () => hasDynamicName, + hasEffectiveModifier: () => hasEffectiveModifier, + hasEffectiveModifiers: () => hasEffectiveModifiers, + hasEffectiveReadonlyModifier: () => hasEffectiveReadonlyModifier, + hasExtension: () => hasExtension, + hasIndexSignature: () => hasIndexSignature, + hasInitializer: () => hasInitializer, + hasInvalidEscape: () => hasInvalidEscape, + hasJSDocNodes: () => hasJSDocNodes, + hasJSDocParameterTags: () => hasJSDocParameterTags, + hasJSFileExtension: () => hasJSFileExtension, + hasJsonModuleEmitEnabled: () => hasJsonModuleEmitEnabled, + hasOnlyExpressionInitializer: () => hasOnlyExpressionInitializer, + hasOverrideModifier: () => hasOverrideModifier, + hasPossibleExternalModuleReference: () => hasPossibleExternalModuleReference, + hasProperty: () => hasProperty, + hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName, + hasQuestionToken: () => hasQuestionToken, + hasRecordedExternalHelpers: () => hasRecordedExternalHelpers, + hasResolutionModeOverride: () => hasResolutionModeOverride, + hasRestParameter: () => hasRestParameter, + hasScopeMarker: () => hasScopeMarker, + hasStaticModifier: () => hasStaticModifier, + hasSyntacticModifier: () => hasSyntacticModifier, + hasSyntacticModifiers: () => hasSyntacticModifiers, + hasTSFileExtension: () => hasTSFileExtension, + hasTabstop: () => hasTabstop, + hasTrailingDirectorySeparator: () => hasTrailingDirectorySeparator, + hasType: () => hasType, + hasTypeArguments: () => hasTypeArguments, + hasZeroOrOneAsteriskCharacter: () => hasZeroOrOneAsteriskCharacter, + helperString: () => helperString, + hostGetCanonicalFileName: () => hostGetCanonicalFileName, + hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, + idText: () => idText, + identifierIsThisKeyword: () => identifierIsThisKeyword, + identifierToKeywordKind: () => identifierToKeywordKind, + identity: () => identity, + identitySourceMapConsumer: () => identitySourceMapConsumer, + ignoreSourceNewlines: () => ignoreSourceNewlines, + ignoredPaths: () => ignoredPaths, + importDefaultHelper: () => importDefaultHelper, + importFromModuleSpecifier: () => importFromModuleSpecifier, + importNameElisionDisabled: () => importNameElisionDisabled, + importStarHelper: () => importStarHelper, + indexOfAnyCharCode: () => indexOfAnyCharCode, + indexOfNode: () => indexOfNode, + indicesOf: () => indicesOf, + inferredTypesContainingFile: () => inferredTypesContainingFile, + injectClassNamedEvaluationHelperBlockIfMissing: () => injectClassNamedEvaluationHelperBlockIfMissing, + injectClassThisAssignmentIfMissing: () => injectClassThisAssignmentIfMissing, + insertImports: () => insertImports, + insertLeadingStatement: () => insertLeadingStatement, + insertSorted: () => insertSorted, + insertStatementAfterCustomPrologue: () => insertStatementAfterCustomPrologue, + insertStatementAfterStandardPrologue: () => insertStatementAfterStandardPrologue, + insertStatementsAfterCustomPrologue: () => insertStatementsAfterCustomPrologue, + insertStatementsAfterStandardPrologue: () => insertStatementsAfterStandardPrologue, + intersperse: () => intersperse, + intrinsicTagNameToString: () => intrinsicTagNameToString, + introducesArgumentsExoticObject: () => introducesArgumentsExoticObject, + inverseJsxOptionMap: () => inverseJsxOptionMap, + isAbstractConstructorSymbol: () => isAbstractConstructorSymbol, + isAbstractModifier: () => isAbstractModifier, + isAccessExpression: () => isAccessExpression, + isAccessibilityModifier: () => isAccessibilityModifier, + isAccessor: () => isAccessor, + isAccessorModifier: () => isAccessorModifier, + isAliasSymbolDeclaration: () => isAliasSymbolDeclaration, + isAliasableExpression: () => isAliasableExpression, + isAmbientModule: () => isAmbientModule, + isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, + isAnyDirectorySeparator: () => isAnyDirectorySeparator, + isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, + isAnyImportOrReExport: () => isAnyImportOrReExport, + isAnyImportSyntax: () => isAnyImportSyntax, + isAnySupportedFileExtension: () => isAnySupportedFileExtension, + isApplicableVersionedTypesKey: () => isApplicableVersionedTypesKey, + isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, + isArray: () => isArray, + isArrayBindingElement: () => isArrayBindingElement, + isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, + isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, + isArrayBindingPattern: () => isArrayBindingPattern, + isArrayLiteralExpression: () => isArrayLiteralExpression, + isArrayLiteralOrObjectLiteralDestructuringPattern: () => isArrayLiteralOrObjectLiteralDestructuringPattern, + isArrayTypeNode: () => isArrayTypeNode, + isArrowFunction: () => isArrowFunction, + isAsExpression: () => isAsExpression, + isAssertClause: () => isAssertClause, + isAssertEntry: () => isAssertEntry, + isAssertionExpression: () => isAssertionExpression, + isAssertsKeyword: () => isAssertsKeyword, + isAssignmentDeclaration: () => isAssignmentDeclaration, + isAssignmentExpression: () => isAssignmentExpression, + isAssignmentOperator: () => isAssignmentOperator, + isAssignmentPattern: () => isAssignmentPattern, + isAssignmentTarget: () => isAssignmentTarget, + isAsteriskToken: () => isAsteriskToken, + isAsyncFunction: () => isAsyncFunction, + isAsyncModifier: () => isAsyncModifier, + isAutoAccessorPropertyDeclaration: () => isAutoAccessorPropertyDeclaration, + isAwaitExpression: () => isAwaitExpression, + isAwaitKeyword: () => isAwaitKeyword, + isBigIntLiteral: () => isBigIntLiteral, + isBinaryExpression: () => isBinaryExpression, + isBinaryOperatorToken: () => isBinaryOperatorToken, + isBindableObjectDefinePropertyCall: () => isBindableObjectDefinePropertyCall, + isBindableStaticAccessExpression: () => isBindableStaticAccessExpression, + isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, + isBindableStaticNameExpression: () => isBindableStaticNameExpression, + isBindingElement: () => isBindingElement, + isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, + isBindingName: () => isBindingName, + isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, + isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, + isBindingPattern: () => isBindingPattern, + isBlock: () => isBlock, + isBlockOrCatchScoped: () => isBlockOrCatchScoped, + isBlockScope: () => isBlockScope, + isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel, + isBooleanLiteral: () => isBooleanLiteral, + isBreakOrContinueStatement: () => isBreakOrContinueStatement, + isBreakStatement: () => isBreakStatement, + isBuildInfoFile: () => isBuildInfoFile, + isBuilderProgram: () => isBuilderProgram2, + isBundle: () => isBundle, + isBundleFileTextLike: () => isBundleFileTextLike, + isCallChain: () => isCallChain, + isCallExpression: () => isCallExpression, + isCallExpressionTarget: () => isCallExpressionTarget, + isCallLikeExpression: () => isCallLikeExpression, + isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression, + isCallOrNewExpression: () => isCallOrNewExpression, + isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget, + isCallSignatureDeclaration: () => isCallSignatureDeclaration, + isCallToHelper: () => isCallToHelper, + isCaseBlock: () => isCaseBlock, + isCaseClause: () => isCaseClause, + isCaseKeyword: () => isCaseKeyword, + isCaseOrDefaultClause: () => isCaseOrDefaultClause, + isCatchClause: () => isCatchClause, + isCatchClauseVariableDeclaration: () => isCatchClauseVariableDeclaration, + isCatchClauseVariableDeclarationOrBindingElement: () => isCatchClauseVariableDeclarationOrBindingElement, + isCheckJsEnabledForFile: () => isCheckJsEnabledForFile, + isChildOfNodeWithKind: () => isChildOfNodeWithKind, + isCircularBuildOrder: () => isCircularBuildOrder, + isClassDeclaration: () => isClassDeclaration, + isClassElement: () => isClassElement, + isClassExpression: () => isClassExpression, + isClassInstanceProperty: () => isClassInstanceProperty, + isClassLike: () => isClassLike, + isClassMemberModifier: () => isClassMemberModifier, + isClassNamedEvaluationHelperBlock: () => isClassNamedEvaluationHelperBlock, + isClassOrTypeElement: () => isClassOrTypeElement, + isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, + isClassThisAssignmentBlock: () => isClassThisAssignmentBlock, + isCollapsedRange: () => isCollapsedRange, + isColonToken: () => isColonToken, + isCommaExpression: () => isCommaExpression, + isCommaListExpression: () => isCommaListExpression, + isCommaSequence: () => isCommaSequence, + isCommaToken: () => isCommaToken, + isComment: () => isComment, + isCommonJsExportPropertyAssignment: () => isCommonJsExportPropertyAssignment, + isCommonJsExportedExpression: () => isCommonJsExportedExpression, + isCompoundAssignment: () => isCompoundAssignment, + isComputedNonLiteralName: () => isComputedNonLiteralName, + isComputedPropertyName: () => isComputedPropertyName, + isConciseBody: () => isConciseBody, + isConditionalExpression: () => isConditionalExpression, + isConditionalTypeNode: () => isConditionalTypeNode, + isConstTypeReference: () => isConstTypeReference, + isConstructSignatureDeclaration: () => isConstructSignatureDeclaration, + isConstructorDeclaration: () => isConstructorDeclaration, + isConstructorTypeNode: () => isConstructorTypeNode, + isContextualKeyword: () => isContextualKeyword, + isContinueStatement: () => isContinueStatement, + isCustomPrologue: () => isCustomPrologue, + isDebuggerStatement: () => isDebuggerStatement, + isDeclaration: () => isDeclaration, + isDeclarationBindingElement: () => isDeclarationBindingElement, + isDeclarationFileName: () => isDeclarationFileName, + isDeclarationName: () => isDeclarationName, + isDeclarationNameOfEnumOrNamespace: () => isDeclarationNameOfEnumOrNamespace, + isDeclarationReadonly: () => isDeclarationReadonly, + isDeclarationStatement: () => isDeclarationStatement, + isDeclarationWithTypeParameterChildren: () => isDeclarationWithTypeParameterChildren, + isDeclarationWithTypeParameters: () => isDeclarationWithTypeParameters, + isDecorator: () => isDecorator, + isDecoratorTarget: () => isDecoratorTarget, + isDefaultClause: () => isDefaultClause, + isDefaultImport: () => isDefaultImport, + isDefaultModifier: () => isDefaultModifier, + isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, + isDeleteExpression: () => isDeleteExpression, + isDeleteTarget: () => isDeleteTarget, + isDeprecatedDeclaration: () => isDeprecatedDeclaration, + isDestructuringAssignment: () => isDestructuringAssignment, + isDiagnosticWithLocation: () => isDiagnosticWithLocation, + isDiskPathRoot: () => isDiskPathRoot, + isDoStatement: () => isDoStatement, + isDocumentRegistryEntry: () => isDocumentRegistryEntry, + isDotDotDotToken: () => isDotDotDotToken, + isDottedName: () => isDottedName, + isDynamicName: () => isDynamicName, + isESSymbolIdentifier: () => isESSymbolIdentifier, + isEffectiveExternalModule: () => isEffectiveExternalModule, + isEffectiveModuleDeclaration: () => isEffectiveModuleDeclaration, + isEffectiveStrictModeSourceFile: () => isEffectiveStrictModeSourceFile, + isElementAccessChain: () => isElementAccessChain, + isElementAccessExpression: () => isElementAccessExpression, + isEmittedFileOfProgram: () => isEmittedFileOfProgram, + isEmptyArrayLiteral: () => isEmptyArrayLiteral, + isEmptyBindingElement: () => isEmptyBindingElement, + isEmptyBindingPattern: () => isEmptyBindingPattern, + isEmptyObjectLiteral: () => isEmptyObjectLiteral, + isEmptyStatement: () => isEmptyStatement, + isEmptyStringLiteral: () => isEmptyStringLiteral, + isEntityName: () => isEntityName, + isEntityNameExpression: () => isEntityNameExpression, + isEnumConst: () => isEnumConst, + isEnumDeclaration: () => isEnumDeclaration, + isEnumMember: () => isEnumMember, + isEqualityOperatorKind: () => isEqualityOperatorKind, + isEqualsGreaterThanToken: () => isEqualsGreaterThanToken, + isExclamationToken: () => isExclamationToken, + isExcludedFile: () => isExcludedFile, + isExclusivelyTypeOnlyImportOrExport: () => isExclusivelyTypeOnlyImportOrExport, + isExpandoPropertyDeclaration: () => isExpandoPropertyDeclaration, + isExportAssignment: () => isExportAssignment, + isExportDeclaration: () => isExportDeclaration, + isExportModifier: () => isExportModifier, + isExportName: () => isExportName, + isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier: () => isExportOrDefaultModifier, + isExportSpecifier: () => isExportSpecifier, + isExportsIdentifier: () => isExportsIdentifier, + isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, + isExpression: () => isExpression, + isExpressionNode: () => isExpressionNode, + isExpressionOfExternalModuleImportEqualsDeclaration: () => isExpressionOfExternalModuleImportEqualsDeclaration, + isExpressionOfOptionalChainRoot: () => isExpressionOfOptionalChainRoot, + isExpressionStatement: () => isExpressionStatement, + isExpressionWithTypeArguments: () => isExpressionWithTypeArguments, + isExpressionWithTypeArgumentsInClassExtendsClause: () => isExpressionWithTypeArgumentsInClassExtendsClause, + isExternalModule: () => isExternalModule, + isExternalModuleAugmentation: () => isExternalModuleAugmentation, + isExternalModuleImportEqualsDeclaration: () => isExternalModuleImportEqualsDeclaration, + isExternalModuleIndicator: () => isExternalModuleIndicator, + isExternalModuleNameRelative: () => isExternalModuleNameRelative, + isExternalModuleReference: () => isExternalModuleReference, + isExternalModuleSymbol: () => isExternalModuleSymbol, + isExternalOrCommonJsModule: () => isExternalOrCommonJsModule, + isFileLevelReservedGeneratedIdentifier: () => isFileLevelReservedGeneratedIdentifier, + isFileLevelUniqueName: () => isFileLevelUniqueName, + isFileProbablyExternalModule: () => isFileProbablyExternalModule, + isFirstDeclarationOfSymbolParameter: () => isFirstDeclarationOfSymbolParameter, + isFixablePromiseHandler: () => isFixablePromiseHandler, + isForInOrOfStatement: () => isForInOrOfStatement, + isForInStatement: () => isForInStatement, + isForInitializer: () => isForInitializer, + isForOfStatement: () => isForOfStatement, + isForStatement: () => isForStatement, + isFunctionBlock: () => isFunctionBlock, + isFunctionBody: () => isFunctionBody, + isFunctionDeclaration: () => isFunctionDeclaration, + isFunctionExpression: () => isFunctionExpression, + isFunctionExpressionOrArrowFunction: () => isFunctionExpressionOrArrowFunction, + isFunctionLike: () => isFunctionLike, + isFunctionLikeDeclaration: () => isFunctionLikeDeclaration, + isFunctionLikeKind: () => isFunctionLikeKind, + isFunctionLikeOrClassStaticBlockDeclaration: () => isFunctionLikeOrClassStaticBlockDeclaration, + isFunctionOrConstructorTypeNode: () => isFunctionOrConstructorTypeNode, + isFunctionOrModuleBlock: () => isFunctionOrModuleBlock, + isFunctionSymbol: () => isFunctionSymbol, + isFunctionTypeNode: () => isFunctionTypeNode, + isFutureReservedKeyword: () => isFutureReservedKeyword, + isGeneratedIdentifier: () => isGeneratedIdentifier, + isGeneratedPrivateIdentifier: () => isGeneratedPrivateIdentifier, + isGetAccessor: () => isGetAccessor, + isGetAccessorDeclaration: () => isGetAccessorDeclaration, + isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, + isGlobalDeclaration: () => isGlobalDeclaration, + isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, + isGrammarError: () => isGrammarError, + isHeritageClause: () => isHeritageClause, + isHoistedFunction: () => isHoistedFunction, + isHoistedVariableStatement: () => isHoistedVariableStatement, + isIdentifier: () => isIdentifier, + isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, + isIdentifierName: () => isIdentifierName, + isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, + isIdentifierPart: () => isIdentifierPart, + isIdentifierStart: () => isIdentifierStart, + isIdentifierText: () => isIdentifierText, + isIdentifierTypePredicate: () => isIdentifierTypePredicate, + isIdentifierTypeReference: () => isIdentifierTypeReference, + isIfStatement: () => isIfStatement, + isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching, + isImplicitGlob: () => isImplicitGlob, + isImportAttribute: () => isImportAttribute, + isImportAttributeName: () => isImportAttributeName, + isImportAttributes: () => isImportAttributes, + isImportCall: () => isImportCall, + isImportClause: () => isImportClause, + isImportDeclaration: () => isImportDeclaration, + isImportEqualsDeclaration: () => isImportEqualsDeclaration, + isImportKeyword: () => isImportKeyword, + isImportMeta: () => isImportMeta, + isImportOrExportSpecifier: () => isImportOrExportSpecifier, + isImportOrExportSpecifierName: () => isImportOrExportSpecifierName, + isImportSpecifier: () => isImportSpecifier, + isImportTypeAssertionContainer: () => isImportTypeAssertionContainer, + isImportTypeNode: () => isImportTypeNode, + isImportableFile: () => isImportableFile, + isInComment: () => isInComment, + isInCompoundLikeAssignment: () => isInCompoundLikeAssignment, + isInExpressionContext: () => isInExpressionContext, + isInJSDoc: () => isInJSDoc, + isInJSFile: () => isInJSFile, + isInJSXText: () => isInJSXText, + isInJsonFile: () => isInJsonFile, + isInNonReferenceComment: () => isInNonReferenceComment, + isInReferenceComment: () => isInReferenceComment, + isInRightSideOfInternalImportEqualsDeclaration: () => isInRightSideOfInternalImportEqualsDeclaration, + isInString: () => isInString, + isInTemplateString: () => isInTemplateString, + isInTopLevelContext: () => isInTopLevelContext, + isInTypeQuery: () => isInTypeQuery, + isIncrementalCompilation: () => isIncrementalCompilation, + isIndexSignatureDeclaration: () => isIndexSignatureDeclaration, + isIndexedAccessTypeNode: () => isIndexedAccessTypeNode, + isInferTypeNode: () => isInferTypeNode, + isInfinityOrNaNString: () => isInfinityOrNaNString, + isInitializedProperty: () => isInitializedProperty, + isInitializedVariable: () => isInitializedVariable, + isInsideJsxElement: () => isInsideJsxElement, + isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, + isInsideNodeModules: () => isInsideNodeModules, + isInsideTemplateLiteral: () => isInsideTemplateLiteral, + isInstanceOfExpression: () => isInstanceOfExpression, + isInstantiatedModule: () => isInstantiatedModule, + isInterfaceDeclaration: () => isInterfaceDeclaration, + isInternalDeclaration: () => isInternalDeclaration, + isInternalModuleImportEqualsDeclaration: () => isInternalModuleImportEqualsDeclaration, + isInternalName: () => isInternalName, + isIntersectionTypeNode: () => isIntersectionTypeNode, + isIntrinsicJsxName: () => isIntrinsicJsxName, + isIterationStatement: () => isIterationStatement, + isJSDoc: () => isJSDoc, + isJSDocAllType: () => isJSDocAllType, + isJSDocAugmentsTag: () => isJSDocAugmentsTag, + isJSDocAuthorTag: () => isJSDocAuthorTag, + isJSDocCallbackTag: () => isJSDocCallbackTag, + isJSDocClassTag: () => isJSDocClassTag, + isJSDocCommentContainingNode: () => isJSDocCommentContainingNode, + isJSDocConstructSignature: () => isJSDocConstructSignature, + isJSDocDeprecatedTag: () => isJSDocDeprecatedTag, + isJSDocEnumTag: () => isJSDocEnumTag, + isJSDocFunctionType: () => isJSDocFunctionType, + isJSDocImplementsTag: () => isJSDocImplementsTag, + isJSDocIndexSignature: () => isJSDocIndexSignature, + isJSDocLikeText: () => isJSDocLikeText, + isJSDocLink: () => isJSDocLink, + isJSDocLinkCode: () => isJSDocLinkCode, + isJSDocLinkLike: () => isJSDocLinkLike, + isJSDocLinkPlain: () => isJSDocLinkPlain, + isJSDocMemberName: () => isJSDocMemberName, + isJSDocNameReference: () => isJSDocNameReference, + isJSDocNamepathType: () => isJSDocNamepathType, + isJSDocNamespaceBody: () => isJSDocNamespaceBody, + isJSDocNode: () => isJSDocNode, + isJSDocNonNullableType: () => isJSDocNonNullableType, + isJSDocNullableType: () => isJSDocNullableType, + isJSDocOptionalParameter: () => isJSDocOptionalParameter, + isJSDocOptionalType: () => isJSDocOptionalType, + isJSDocOverloadTag: () => isJSDocOverloadTag, + isJSDocOverrideTag: () => isJSDocOverrideTag, + isJSDocParameterTag: () => isJSDocParameterTag, + isJSDocPrivateTag: () => isJSDocPrivateTag, + isJSDocPropertyLikeTag: () => isJSDocPropertyLikeTag, + isJSDocPropertyTag: () => isJSDocPropertyTag, + isJSDocProtectedTag: () => isJSDocProtectedTag, + isJSDocPublicTag: () => isJSDocPublicTag, + isJSDocReadonlyTag: () => isJSDocReadonlyTag, + isJSDocReturnTag: () => isJSDocReturnTag, + isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, + isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, + isJSDocSeeTag: () => isJSDocSeeTag, + isJSDocSignature: () => isJSDocSignature, + isJSDocTag: () => isJSDocTag, + isJSDocTemplateTag: () => isJSDocTemplateTag, + isJSDocThisTag: () => isJSDocThisTag, + isJSDocThrowsTag: () => isJSDocThrowsTag, + isJSDocTypeAlias: () => isJSDocTypeAlias, + isJSDocTypeAssertion: () => isJSDocTypeAssertion, + isJSDocTypeExpression: () => isJSDocTypeExpression, + isJSDocTypeLiteral: () => isJSDocTypeLiteral, + isJSDocTypeTag: () => isJSDocTypeTag, + isJSDocTypedefTag: () => isJSDocTypedefTag, + isJSDocUnknownTag: () => isJSDocUnknownTag, + isJSDocUnknownType: () => isJSDocUnknownType, + isJSDocVariadicType: () => isJSDocVariadicType, + isJSXTagName: () => isJSXTagName, + isJsonEqual: () => isJsonEqual, + isJsonSourceFile: () => isJsonSourceFile, + isJsxAttribute: () => isJsxAttribute, + isJsxAttributeLike: () => isJsxAttributeLike, + isJsxAttributeName: () => isJsxAttributeName, + isJsxAttributes: () => isJsxAttributes, + isJsxChild: () => isJsxChild, + isJsxClosingElement: () => isJsxClosingElement, + isJsxClosingFragment: () => isJsxClosingFragment, + isJsxElement: () => isJsxElement, + isJsxExpression: () => isJsxExpression, + isJsxFragment: () => isJsxFragment, + isJsxNamespacedName: () => isJsxNamespacedName, + isJsxOpeningElement: () => isJsxOpeningElement, + isJsxOpeningFragment: () => isJsxOpeningFragment, + isJsxOpeningLikeElement: () => isJsxOpeningLikeElement, + isJsxOpeningLikeElementTagName: () => isJsxOpeningLikeElementTagName, + isJsxSelfClosingElement: () => isJsxSelfClosingElement, + isJsxSpreadAttribute: () => isJsxSpreadAttribute, + isJsxTagNameExpression: () => isJsxTagNameExpression, + isJsxText: () => isJsxText, + isJumpStatementTarget: () => isJumpStatementTarget, + isKeyword: () => isKeyword, + isKeywordOrPunctuation: () => isKeywordOrPunctuation, + isKnownSymbol: () => isKnownSymbol, + isLabelName: () => isLabelName, + isLabelOfLabeledStatement: () => isLabelOfLabeledStatement, + isLabeledStatement: () => isLabeledStatement, + isLateVisibilityPaintedStatement: () => isLateVisibilityPaintedStatement, + isLeftHandSideExpression: () => isLeftHandSideExpression, + isLeftHandSideOfAssignment: () => isLeftHandSideOfAssignment, + isLet: () => isLet, + isLineBreak: () => isLineBreak, + isLiteralComputedPropertyDeclarationName: () => isLiteralComputedPropertyDeclarationName, + isLiteralExpression: () => isLiteralExpression, + isLiteralExpressionOfObject: () => isLiteralExpressionOfObject, + isLiteralImportTypeNode: () => isLiteralImportTypeNode, + isLiteralKind: () => isLiteralKind, + isLiteralLikeAccess: () => isLiteralLikeAccess, + isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, + isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, + isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, + isLiteralTypeLiteral: () => isLiteralTypeLiteral, + isLiteralTypeNode: () => isLiteralTypeNode, + isLocalName: () => isLocalName, + isLogicalOperator: () => isLogicalOperator, + isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, + isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, + isMappedTypeNode: () => isMappedTypeNode, + isMemberName: () => isMemberName, + isMetaProperty: () => isMetaProperty, + isMethodDeclaration: () => isMethodDeclaration, + isMethodOrAccessor: () => isMethodOrAccessor, + isMethodSignature: () => isMethodSignature, + isMinusToken: () => isMinusToken, + isMissingDeclaration: () => isMissingDeclaration, + isMissingPackageJsonInfo: () => isMissingPackageJsonInfo, + isModifier: () => isModifier, + isModifierKind: () => isModifierKind, + isModifierLike: () => isModifierLike, + isModuleAugmentationExternal: () => isModuleAugmentationExternal, + isModuleBlock: () => isModuleBlock, + isModuleBody: () => isModuleBody, + isModuleDeclaration: () => isModuleDeclaration, + isModuleExportsAccessExpression: () => isModuleExportsAccessExpression, + isModuleIdentifier: () => isModuleIdentifier, + isModuleName: () => isModuleName, + isModuleOrEnumDeclaration: () => isModuleOrEnumDeclaration, + isModuleReference: () => isModuleReference, + isModuleSpecifierLike: () => isModuleSpecifierLike, + isModuleWithStringLiteralName: () => isModuleWithStringLiteralName, + isNameOfFunctionDeclaration: () => isNameOfFunctionDeclaration, + isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, + isNamedClassElement: () => isNamedClassElement, + isNamedDeclaration: () => isNamedDeclaration, + isNamedEvaluation: () => isNamedEvaluation, + isNamedEvaluationSource: () => isNamedEvaluationSource, + isNamedExportBindings: () => isNamedExportBindings, + isNamedExports: () => isNamedExports, + isNamedImportBindings: () => isNamedImportBindings, + isNamedImports: () => isNamedImports, + isNamedImportsOrExports: () => isNamedImportsOrExports, + isNamedTupleMember: () => isNamedTupleMember, + isNamespaceBody: () => isNamespaceBody, + isNamespaceExport: () => isNamespaceExport, + isNamespaceExportDeclaration: () => isNamespaceExportDeclaration, + isNamespaceImport: () => isNamespaceImport, + isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration, + isNewExpression: () => isNewExpression, + isNewExpressionTarget: () => isNewExpressionTarget, + isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral, + isNode: () => isNode, + isNodeArray: () => isNodeArray, + isNodeArrayMultiLine: () => isNodeArrayMultiLine, + isNodeDescendantOf: () => isNodeDescendantOf, + isNodeKind: () => isNodeKind, + isNodeLikeSystem: () => isNodeLikeSystem, + isNodeModulesDirectory: () => isNodeModulesDirectory, + isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, + isNonContextualKeyword: () => isNonContextualKeyword, + isNonExportDefaultModifier: () => isNonExportDefaultModifier, + isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, + isNonGlobalDeclaration: () => isNonGlobalDeclaration, + isNonNullAccess: () => isNonNullAccess, + isNonNullChain: () => isNonNullChain, + isNonNullExpression: () => isNonNullExpression, + isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName, + isNotEmittedOrPartiallyEmittedNode: () => isNotEmittedOrPartiallyEmittedNode, + isNotEmittedStatement: () => isNotEmittedStatement, + isNullishCoalesce: () => isNullishCoalesce, + isNumber: () => isNumber, + isNumericLiteral: () => isNumericLiteral, + isNumericLiteralName: () => isNumericLiteralName, + isObjectBindingElementWithoutPropertyName: () => isObjectBindingElementWithoutPropertyName, + isObjectBindingOrAssignmentElement: () => isObjectBindingOrAssignmentElement, + isObjectBindingOrAssignmentPattern: () => isObjectBindingOrAssignmentPattern, + isObjectBindingPattern: () => isObjectBindingPattern, + isObjectLiteralElement: () => isObjectLiteralElement, + isObjectLiteralElementLike: () => isObjectLiteralElementLike, + isObjectLiteralExpression: () => isObjectLiteralExpression, + isObjectLiteralMethod: () => isObjectLiteralMethod, + isObjectLiteralOrClassExpressionMethodOrAccessor: () => isObjectLiteralOrClassExpressionMethodOrAccessor, + isObjectTypeDeclaration: () => isObjectTypeDeclaration, + isOctalDigit: () => isOctalDigit, + isOmittedExpression: () => isOmittedExpression, + isOptionalChain: () => isOptionalChain, + isOptionalChainRoot: () => isOptionalChainRoot, + isOptionalDeclaration: () => isOptionalDeclaration, + isOptionalJSDocPropertyLikeTag: () => isOptionalJSDocPropertyLikeTag, + isOptionalTypeNode: () => isOptionalTypeNode, + isOuterExpression: () => isOuterExpression, + isOutermostOptionalChain: () => isOutermostOptionalChain, + isOverrideModifier: () => isOverrideModifier, + isPackageJsonInfo: () => isPackageJsonInfo, + isPackedArrayLiteral: () => isPackedArrayLiteral, + isParameter: () => isParameter, + isParameterDeclaration: () => isParameterDeclaration, + isParameterPropertyDeclaration: () => isParameterPropertyDeclaration, + isParameterPropertyModifier: () => isParameterPropertyModifier, + isParenthesizedExpression: () => isParenthesizedExpression, + isParenthesizedTypeNode: () => isParenthesizedTypeNode, + isParseTreeNode: () => isParseTreeNode, + isPartOfTypeNode: () => isPartOfTypeNode, + isPartOfTypeQuery: () => isPartOfTypeQuery, + isPartiallyEmittedExpression: () => isPartiallyEmittedExpression, + isPatternMatch: () => isPatternMatch, + isPinnedComment: () => isPinnedComment, + isPlainJsFile: () => isPlainJsFile, + isPlusToken: () => isPlusToken, + isPossiblyTypeArgumentPosition: () => isPossiblyTypeArgumentPosition, + isPostfixUnaryExpression: () => isPostfixUnaryExpression, + isPrefixUnaryExpression: () => isPrefixUnaryExpression, + isPrivateIdentifier: () => isPrivateIdentifier, + isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration, + isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression, + isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol, + isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo, + isProgramUptoDate: () => isProgramUptoDate, + isPrologueDirective: () => isPrologueDirective, + isPropertyAccessChain: () => isPropertyAccessChain, + isPropertyAccessEntityNameExpression: () => isPropertyAccessEntityNameExpression, + isPropertyAccessExpression: () => isPropertyAccessExpression, + isPropertyAccessOrQualifiedName: () => isPropertyAccessOrQualifiedName, + isPropertyAccessOrQualifiedNameOrImportTypeNode: () => isPropertyAccessOrQualifiedNameOrImportTypeNode, + isPropertyAssignment: () => isPropertyAssignment, + isPropertyDeclaration: () => isPropertyDeclaration, + isPropertyName: () => isPropertyName, + isPropertyNameLiteral: () => isPropertyNameLiteral, + isPropertySignature: () => isPropertySignature, + isProtoSetter: () => isProtoSetter, + isPrototypeAccess: () => isPrototypeAccess, + isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, + isPunctuation: () => isPunctuation, + isPushOrUnshiftIdentifier: () => isPushOrUnshiftIdentifier, + isQualifiedName: () => isQualifiedName, + isQuestionDotToken: () => isQuestionDotToken, + isQuestionOrExclamationToken: () => isQuestionOrExclamationToken, + isQuestionOrPlusOrMinusToken: () => isQuestionOrPlusOrMinusToken, + isQuestionToken: () => isQuestionToken, + isRawSourceMap: () => isRawSourceMap, + isReadonlyKeyword: () => isReadonlyKeyword, + isReadonlyKeywordOrPlusOrMinusToken: () => isReadonlyKeywordOrPlusOrMinusToken, + isRecognizedTripleSlashComment: () => isRecognizedTripleSlashComment, + isReferenceFileLocation: () => isReferenceFileLocation, + isReferencedFile: () => isReferencedFile, + isRegularExpressionLiteral: () => isRegularExpressionLiteral, + isRequireCall: () => isRequireCall, + isRequireVariableStatement: () => isRequireVariableStatement, + isRestParameter: () => isRestParameter, + isRestTypeNode: () => isRestTypeNode, + isReturnStatement: () => isReturnStatement, + isReturnStatementWithFixablePromiseHandler: () => isReturnStatementWithFixablePromiseHandler, + isRightSideOfAccessExpression: () => isRightSideOfAccessExpression, + isRightSideOfInstanceofExpression: () => isRightSideOfInstanceofExpression, + isRightSideOfPropertyAccess: () => isRightSideOfPropertyAccess, + isRightSideOfQualifiedName: () => isRightSideOfQualifiedName, + isRightSideOfQualifiedNameOrPropertyAccess: () => isRightSideOfQualifiedNameOrPropertyAccess, + isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName: () => isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName, + isRootedDiskPath: () => isRootedDiskPath, + isSameEntityName: () => isSameEntityName, + isSatisfiesExpression: () => isSatisfiesExpression, + isScopeMarker: () => isScopeMarker, + isSemicolonClassElement: () => isSemicolonClassElement, + isSetAccessor: () => isSetAccessor, + isSetAccessorDeclaration: () => isSetAccessorDeclaration, + isShebangTrivia: () => isShebangTrivia, + isShiftOperatorOrHigher: () => isShiftOperatorOrHigher, + isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol, + isShorthandPropertyAssignment: () => isShorthandPropertyAssignment, + isSignedNumericLiteral: () => isSignedNumericLiteral, + isSimpleCopiableExpression: () => isSimpleCopiableExpression, + isSimpleInlineableExpression: () => isSimpleInlineableExpression, + isSimpleParameter: () => isSimpleParameter, + isSimpleParameterList: () => isSimpleParameterList, + isSingleOrDoubleQuote: () => isSingleOrDoubleQuote, + isSourceFile: () => isSourceFile, + isSourceFileFromLibrary: () => isSourceFileFromLibrary, + isSourceFileJS: () => isSourceFileJS, + isSourceFileNotJS: () => isSourceFileNotJS, + isSourceFileNotJson: () => isSourceFileNotJson, + isSourceMapping: () => isSourceMapping, + isSpecialPropertyDeclaration: () => isSpecialPropertyDeclaration, + isSpreadAssignment: () => isSpreadAssignment, + isSpreadElement: () => isSpreadElement, + isStatement: () => isStatement, + isStatementButNotDeclaration: () => isStatementButNotDeclaration, + isStatementOrBlock: () => isStatementOrBlock, + isStatementWithLocals: () => isStatementWithLocals, + isStatic: () => isStatic, + isStaticModifier: () => isStaticModifier, + isString: () => isString, + isStringAKeyword: () => isStringAKeyword, + isStringANonContextualKeyword: () => isStringANonContextualKeyword, + isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, + isStringDoubleQuoted: () => isStringDoubleQuoted, + isStringLiteral: () => isStringLiteral, + isStringLiteralLike: () => isStringLiteralLike, + isStringLiteralOrJsxExpression: () => isStringLiteralOrJsxExpression, + isStringLiteralOrTemplate: () => isStringLiteralOrTemplate, + isStringOrNumericLiteralLike: () => isStringOrNumericLiteralLike, + isStringOrRegularExpressionOrTemplateLiteral: () => isStringOrRegularExpressionOrTemplateLiteral, + isStringTextContainingNode: () => isStringTextContainingNode, + isSuperCall: () => isSuperCall, + isSuperKeyword: () => isSuperKeyword, + isSuperOrSuperProperty: () => isSuperOrSuperProperty, + isSuperProperty: () => isSuperProperty, + isSupportedSourceFileName: () => isSupportedSourceFileName, + isSwitchStatement: () => isSwitchStatement, + isSyntaxList: () => isSyntaxList, + isSyntheticExpression: () => isSyntheticExpression, + isSyntheticReference: () => isSyntheticReference, + isTagName: () => isTagName, + isTaggedTemplateExpression: () => isTaggedTemplateExpression, + isTaggedTemplateTag: () => isTaggedTemplateTag, + isTemplateExpression: () => isTemplateExpression, + isTemplateHead: () => isTemplateHead, + isTemplateLiteral: () => isTemplateLiteral, + isTemplateLiteralKind: () => isTemplateLiteralKind, + isTemplateLiteralToken: () => isTemplateLiteralToken, + isTemplateLiteralTypeNode: () => isTemplateLiteralTypeNode, + isTemplateLiteralTypeSpan: () => isTemplateLiteralTypeSpan, + isTemplateMiddle: () => isTemplateMiddle, + isTemplateMiddleOrTemplateTail: () => isTemplateMiddleOrTemplateTail, + isTemplateSpan: () => isTemplateSpan, + isTemplateTail: () => isTemplateTail, + isTextWhiteSpaceLike: () => isTextWhiteSpaceLike, + isThis: () => isThis, + isThisContainerOrFunctionBlock: () => isThisContainerOrFunctionBlock, + isThisIdentifier: () => isThisIdentifier, + isThisInTypeQuery: () => isThisInTypeQuery, + isThisInitializedDeclaration: () => isThisInitializedDeclaration, + isThisInitializedObjectBindingExpression: () => isThisInitializedObjectBindingExpression, + isThisProperty: () => isThisProperty, + isThisTypeNode: () => isThisTypeNode, + isThisTypeParameter: () => isThisTypeParameter, + isThisTypePredicate: () => isThisTypePredicate, + isThrowStatement: () => isThrowStatement, + isToken: () => isToken, + isTokenKind: () => isTokenKind, + isTraceEnabled: () => isTraceEnabled, + isTransientSymbol: () => isTransientSymbol, + isTrivia: () => isTrivia, + isTryStatement: () => isTryStatement, + isTupleTypeNode: () => isTupleTypeNode, + isTypeAlias: () => isTypeAlias, + isTypeAliasDeclaration: () => isTypeAliasDeclaration, + isTypeAssertionExpression: () => isTypeAssertionExpression, + isTypeDeclaration: () => isTypeDeclaration, + isTypeElement: () => isTypeElement, + isTypeKeyword: () => isTypeKeyword, + isTypeKeywordToken: () => isTypeKeywordToken, + isTypeKeywordTokenOrIdentifier: () => isTypeKeywordTokenOrIdentifier, + isTypeLiteralNode: () => isTypeLiteralNode, + isTypeNode: () => isTypeNode, + isTypeNodeKind: () => isTypeNodeKind, + isTypeOfExpression: () => isTypeOfExpression, + isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, + isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, + isTypeOperatorNode: () => isTypeOperatorNode, + isTypeParameterDeclaration: () => isTypeParameterDeclaration, + isTypePredicateNode: () => isTypePredicateNode, + isTypeQueryNode: () => isTypeQueryNode, + isTypeReferenceNode: () => isTypeReferenceNode, + isTypeReferenceType: () => isTypeReferenceType, + isTypeUsableAsPropertyName: () => isTypeUsableAsPropertyName, + isUMDExportSymbol: () => isUMDExportSymbol, + isUnaryExpression: () => isUnaryExpression, + isUnaryExpressionWithWrite: () => isUnaryExpressionWithWrite, + isUnicodeIdentifierStart: () => isUnicodeIdentifierStart, + isUnionTypeNode: () => isUnionTypeNode, + isUnparsedNode: () => isUnparsedNode, + isUnparsedPrepend: () => isUnparsedPrepend, + isUnparsedSource: () => isUnparsedSource, + isUnparsedTextLike: () => isUnparsedTextLike, + isUrl: () => isUrl, + isValidBigIntString: () => isValidBigIntString, + isValidESSymbolDeclaration: () => isValidESSymbolDeclaration, + isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite, + isValueSignatureDeclaration: () => isValueSignatureDeclaration, + isVarAwaitUsing: () => isVarAwaitUsing, + isVarConst: () => isVarConst, + isVarUsing: () => isVarUsing, + isVariableDeclaration: () => isVariableDeclaration, + isVariableDeclarationInVariableStatement: () => isVariableDeclarationInVariableStatement, + isVariableDeclarationInitializedToBareOrAccessedRequire: () => isVariableDeclarationInitializedToBareOrAccessedRequire, + isVariableDeclarationInitializedToRequire: () => isVariableDeclarationInitializedToRequire, + isVariableDeclarationList: () => isVariableDeclarationList, + isVariableLike: () => isVariableLike, + isVariableLikeOrAccessor: () => isVariableLikeOrAccessor, + isVariableStatement: () => isVariableStatement, + isVoidExpression: () => isVoidExpression, + isWatchSet: () => isWatchSet, + isWhileStatement: () => isWhileStatement, + isWhiteSpaceLike: () => isWhiteSpaceLike, + isWhiteSpaceSingleLine: () => isWhiteSpaceSingleLine, + isWithStatement: () => isWithStatement, + isWriteAccess: () => isWriteAccess, + isWriteOnlyAccess: () => isWriteOnlyAccess, + isYieldExpression: () => isYieldExpression, + jsxModeNeedsExplicitImport: () => jsxModeNeedsExplicitImport, + keywordPart: () => keywordPart, + last: () => last, + lastOrUndefined: () => lastOrUndefined, + length: () => length, + libMap: () => libMap, + libs: () => libs, + lineBreakPart: () => lineBreakPart, + linkNamePart: () => linkNamePart, + linkPart: () => linkPart, + linkTextPart: () => linkTextPart, + listFiles: () => listFiles, + loadModuleFromGlobalCache: () => loadModuleFromGlobalCache, + loadWithModeAwareCache: () => loadWithModeAwareCache, + makeIdentifierFromModuleName: () => makeIdentifierFromModuleName, + makeImport: () => makeImport, + makeImportIfNecessary: () => makeImportIfNecessary, + makeStringLiteral: () => makeStringLiteral, + mangleScopedPackageName: () => mangleScopedPackageName, + map: () => map, + mapAllOrFail: () => mapAllOrFail, + mapDefined: () => mapDefined, + mapDefinedEntries: () => mapDefinedEntries, + mapDefinedIterator: () => mapDefinedIterator, + mapEntries: () => mapEntries, + mapIterator: () => mapIterator, + mapOneOrMany: () => mapOneOrMany, + mapToDisplayParts: () => mapToDisplayParts, + matchFiles: () => matchFiles, + matchPatternOrExact: () => matchPatternOrExact, + matchedText: () => matchedText, + matchesExclude: () => matchesExclude, + maybeBind: () => maybeBind, + maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, + memoize: () => memoize, + memoizeCached: () => memoizeCached, + memoizeOne: () => memoizeOne, + memoizeWeak: () => memoizeWeak, + metadataHelper: () => metadataHelper, + min: () => min, + minAndMax: () => minAndMax, + missingFileModifiedTime: () => missingFileModifiedTime, + modifierToFlag: () => modifierToFlag, + modifiersToFlags: () => modifiersToFlags, + moduleOptionDeclaration: () => moduleOptionDeclaration, + moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo, + moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter, + moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations, + moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports, + moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules, + moduleSpecifiers: () => ts_moduleSpecifiers_exports, + moveEmitHelpers: () => moveEmitHelpers, + moveRangeEnd: () => moveRangeEnd, + moveRangePastDecorators: () => moveRangePastDecorators, + moveRangePastModifiers: () => moveRangePastModifiers, + moveRangePos: () => moveRangePos, + moveSyntheticComments: () => moveSyntheticComments, + mutateMap: () => mutateMap, + mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, + needsParentheses: () => needsParentheses, + needsScopeMarker: () => needsScopeMarker, + newCaseClauseTracker: () => newCaseClauseTracker, + newPrivateEnvironment: () => newPrivateEnvironment, + noEmitNotification: () => noEmitNotification, + noEmitSubstitution: () => noEmitSubstitution, + noTransformers: () => noTransformers, + noTruncationMaximumTruncationLength: () => noTruncationMaximumTruncationLength, + nodeCanBeDecorated: () => nodeCanBeDecorated, + nodeHasName: () => nodeHasName, + nodeIsDecorated: () => nodeIsDecorated, + nodeIsMissing: () => nodeIsMissing, + nodeIsPresent: () => nodeIsPresent, + nodeIsSynthesized: () => nodeIsSynthesized, + nodeModuleNameResolver: () => nodeModuleNameResolver, + nodeModulesPathPart: () => nodeModulesPathPart, + nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver, + nodeOrChildIsDecorated: () => nodeOrChildIsDecorated, + nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd, + nodePosToString: () => nodePosToString, + nodeSeenTracker: () => nodeSeenTracker, + nodeStartsNewLexicalEnvironment: () => nodeStartsNewLexicalEnvironment, + nodeToDisplayParts: () => nodeToDisplayParts, + noop: () => noop, + noopFileWatcher: () => noopFileWatcher, + normalizePath: () => normalizePath, + normalizeSlashes: () => normalizeSlashes, + not: () => not, + notImplemented: () => notImplemented, + notImplementedResolver: () => notImplementedResolver, + nullNodeConverters: () => nullNodeConverters, + nullParenthesizerRules: () => nullParenthesizerRules, + nullTransformationContext: () => nullTransformationContext, + objectAllocator: () => objectAllocator, + operatorPart: () => operatorPart, + optionDeclarations: () => optionDeclarations, + optionMapToObject: () => optionMapToObject, + optionsAffectingProgramStructure: () => optionsAffectingProgramStructure, + optionsForBuild: () => optionsForBuild, + optionsForWatch: () => optionsForWatch, + optionsHaveChanges: () => optionsHaveChanges, + optionsHaveModuleResolutionChanges: () => optionsHaveModuleResolutionChanges, + or: () => or, + orderedRemoveItem: () => orderedRemoveItem, + orderedRemoveItemAt: () => orderedRemoveItemAt, + outFile: () => outFile, + packageIdToPackageName: () => packageIdToPackageName, + packageIdToString: () => packageIdToString, + paramHelper: () => paramHelper, + parameterIsThisKeyword: () => parameterIsThisKeyword, + parameterNamePart: () => parameterNamePart, + parseBaseNodeFactory: () => parseBaseNodeFactory, + parseBigInt: () => parseBigInt, + parseBuildCommand: () => parseBuildCommand, + parseCommandLine: () => parseCommandLine, + parseCommandLineWorker: () => parseCommandLineWorker, + parseConfigFileTextToJson: () => parseConfigFileTextToJson, + parseConfigFileWithSystem: () => parseConfigFileWithSystem, + parseConfigHostFromCompilerHostLike: () => parseConfigHostFromCompilerHostLike, + parseCustomTypeOption: () => parseCustomTypeOption, + parseIsolatedEntityName: () => parseIsolatedEntityName, + parseIsolatedJSDocComment: () => parseIsolatedJSDocComment, + parseJSDocTypeExpressionForTests: () => parseJSDocTypeExpressionForTests, + parseJsonConfigFileContent: () => parseJsonConfigFileContent, + parseJsonSourceFileConfigFileContent: () => parseJsonSourceFileConfigFileContent, + parseJsonText: () => parseJsonText, + parseListTypeOption: () => parseListTypeOption, + parseNodeFactory: () => parseNodeFactory, + parseNodeModuleFromPath: () => parseNodeModuleFromPath, + parsePackageName: () => parsePackageName, + parsePseudoBigInt: () => parsePseudoBigInt, + parseValidBigInt: () => parseValidBigInt, + patchWriteFileEnsuringDirectory: () => patchWriteFileEnsuringDirectory, + pathContainsNodeModules: () => pathContainsNodeModules, + pathIsAbsolute: () => pathIsAbsolute, + pathIsBareSpecifier: () => pathIsBareSpecifier, + pathIsRelative: () => pathIsRelative, + patternText: () => patternText, + perfLogger: () => perfLogger, + performIncrementalCompilation: () => performIncrementalCompilation, + performance: () => ts_performance_exports, + plainJSErrors: () => plainJSErrors, + positionBelongsToNode: () => positionBelongsToNode, + positionIsASICandidate: () => positionIsASICandidate, + positionIsSynthesized: () => positionIsSynthesized, + positionsAreOnSameLine: () => positionsAreOnSameLine, + preProcessFile: () => preProcessFile, + probablyUsesSemicolons: () => probablyUsesSemicolons, + processCommentPragmas: () => processCommentPragmas, + processPragmasIntoFields: () => processPragmasIntoFields, + processTaggedTemplateExpression: () => processTaggedTemplateExpression, + programContainsEsModules: () => programContainsEsModules, + programContainsModules: () => programContainsModules, + projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, + propKeyHelper: () => propKeyHelper, + propertyNamePart: () => propertyNamePart, + pseudoBigIntToString: () => pseudoBigIntToString, + punctuationPart: () => punctuationPart, + pushIfUnique: () => pushIfUnique, + quote: () => quote, + quotePreferenceFromString: () => quotePreferenceFromString, + rangeContainsPosition: () => rangeContainsPosition, + rangeContainsPositionExclusive: () => rangeContainsPositionExclusive, + rangeContainsRange: () => rangeContainsRange, + rangeContainsRangeExclusive: () => rangeContainsRangeExclusive, + rangeContainsStartEnd: () => rangeContainsStartEnd, + rangeEndIsOnSameLineAsRangeStart: () => rangeEndIsOnSameLineAsRangeStart, + rangeEndPositionsAreOnSameLine: () => rangeEndPositionsAreOnSameLine, + rangeEquals: () => rangeEquals, + rangeIsOnSingleLine: () => rangeIsOnSingleLine, + rangeOfNode: () => rangeOfNode, + rangeOfTypeParameters: () => rangeOfTypeParameters, + rangeOverlapsWithStartEnd: () => rangeOverlapsWithStartEnd, + rangeStartIsOnSameLineAsRangeEnd: () => rangeStartIsOnSameLineAsRangeEnd, + rangeStartPositionsAreOnSameLine: () => rangeStartPositionsAreOnSameLine, + readBuilderProgram: () => readBuilderProgram, + readConfigFile: () => readConfigFile, + readHelper: () => readHelper, + readJson: () => readJson, + readJsonConfigFile: () => readJsonConfigFile, + readJsonOrUndefined: () => readJsonOrUndefined, + reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange, + reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange, + reduceLeft: () => reduceLeft, + reduceLeftIterator: () => reduceLeftIterator, + reducePathComponents: () => reducePathComponents, + refactor: () => ts_refactor_exports, + regExpEscape: () => regExpEscape, + relativeComplement: () => relativeComplement, + removeAllComments: () => removeAllComments, + removeEmitHelper: () => removeEmitHelper, + removeExtension: () => removeExtension, + removeFileExtension: () => removeFileExtension, + removeIgnoredPath: () => removeIgnoredPath, + removeMinAndVersionNumbers: () => removeMinAndVersionNumbers, + removeOptionality: () => removeOptionality, + removePrefix: () => removePrefix, + removeSuffix: () => removeSuffix, + removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator, + repeatString: () => repeatString, + replaceElement: () => replaceElement, + replaceFirstStar: () => replaceFirstStar, + resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson, + resolveConfigFileProjectName: () => resolveConfigFileProjectName, + resolveJSModule: () => resolveJSModule, + resolveLibrary: () => resolveLibrary, + resolveModuleName: () => resolveModuleName, + resolveModuleNameFromCache: () => resolveModuleNameFromCache, + resolvePackageNameToPackageJson: () => resolvePackageNameToPackageJson, + resolvePath: () => resolvePath, + resolveProjectReferencePath: () => resolveProjectReferencePath, + resolveTripleslashReference: () => resolveTripleslashReference, + resolveTypeReferenceDirective: () => resolveTypeReferenceDirective, + resolvingEmptyArray: () => resolvingEmptyArray, + restHelper: () => restHelper, + returnFalse: () => returnFalse, + returnNoopFileWatcher: () => returnNoopFileWatcher, + returnTrue: () => returnTrue, + returnUndefined: () => returnUndefined, + returnsPromise: () => returnsPromise, + runInitializersHelper: () => runInitializersHelper, + sameFlatMap: () => sameFlatMap, + sameMap: () => sameMap, + sameMapping: () => sameMapping, + scanShebangTrivia: () => scanShebangTrivia, + scanTokenAtPosition: () => scanTokenAtPosition, + scanner: () => scanner, + screenStartingMessageCodes: () => screenStartingMessageCodes, + semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, + serializeCompilerOptions: () => serializeCompilerOptions, + server: () => ts_server_exports3, + servicesVersion: () => servicesVersion, + setCommentRange: () => setCommentRange, + setConfigFileInOptions: () => setConfigFileInOptions, + setConstantValue: () => setConstantValue, + setEachParent: () => setEachParent, + setEmitFlags: () => setEmitFlags, + setFunctionNameHelper: () => setFunctionNameHelper, + setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, + setIdentifierTypeArguments: () => setIdentifierTypeArguments, + setInternalEmitFlags: () => setInternalEmitFlags, + setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, + setModuleDefaultHelper: () => setModuleDefaultHelper, + setNodeFlags: () => setNodeFlags, + setObjectAllocator: () => setObjectAllocator, + setOriginalNode: () => setOriginalNode, + setParent: () => setParent, + setParentRecursive: () => setParentRecursive, + setPrivateIdentifier: () => setPrivateIdentifier, + setSnippetElement: () => setSnippetElement, + setSourceMapRange: () => setSourceMapRange, + setStackTraceLimit: () => setStackTraceLimit, + setStartsOnNewLine: () => setStartsOnNewLine, + setSyntheticLeadingComments: () => setSyntheticLeadingComments, + setSyntheticTrailingComments: () => setSyntheticTrailingComments, + setSys: () => setSys, + setSysLog: () => setSysLog, + setTextRange: () => setTextRange, + setTextRangeEnd: () => setTextRangeEnd, + setTextRangePos: () => setTextRangePos, + setTextRangePosEnd: () => setTextRangePosEnd, + setTextRangePosWidth: () => setTextRangePosWidth, + setTokenSourceMapRange: () => setTokenSourceMapRange, + setTypeNode: () => setTypeNode, + setUILocale: () => setUILocale, + setValueDeclaration: () => setValueDeclaration, + shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, + shouldPreserveConstEnums: () => shouldPreserveConstEnums, + shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, + showModuleSpecifier: () => showModuleSpecifier, + signatureHasLiteralTypes: () => signatureHasLiteralTypes, + signatureHasRestParameter: () => signatureHasRestParameter, + signatureToDisplayParts: () => signatureToDisplayParts, + single: () => single, + singleElementArray: () => singleElementArray, + singleIterator: () => singleIterator, + singleOrMany: () => singleOrMany, + singleOrUndefined: () => singleOrUndefined, + skipAlias: () => skipAlias, + skipAssertions: () => skipAssertions, + skipConstraint: () => skipConstraint, + skipOuterExpressions: () => skipOuterExpressions, + skipParentheses: () => skipParentheses, + skipPartiallyEmittedExpressions: () => skipPartiallyEmittedExpressions, + skipTrivia: () => skipTrivia, + skipTypeChecking: () => skipTypeChecking, + skipTypeParentheses: () => skipTypeParentheses, + skipWhile: () => skipWhile, + sliceAfter: () => sliceAfter, + some: () => some, + sort: () => sort, + sortAndDeduplicate: () => sortAndDeduplicate, + sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics, + sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions, + sourceFileMayBeEmitted: () => sourceFileMayBeEmitted, + sourceMapCommentRegExp: () => sourceMapCommentRegExp, + sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart, + spacePart: () => spacePart, + spanMap: () => spanMap, + spreadArrayHelper: () => spreadArrayHelper, + stableSort: () => stableSort, + startEndContainsRange: () => startEndContainsRange, + startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd, + startOnNewLine: () => startOnNewLine, + startTracing: () => startTracing, + startsWith: () => startsWith, + startsWithDirectory: () => startsWithDirectory, + startsWithUnderscore: () => startsWithUnderscore, + startsWithUseStrict: () => startsWithUseStrict, + stringContainsAt: () => stringContainsAt, + stringToToken: () => stringToToken, + stripQuotes: () => stripQuotes, + supportedDeclarationExtensions: () => supportedDeclarationExtensions, + supportedJSExtensions: () => supportedJSExtensions, + supportedJSExtensionsFlat: () => supportedJSExtensionsFlat, + supportedLocaleDirectories: () => supportedLocaleDirectories, + supportedTSExtensions: () => supportedTSExtensions, + supportedTSExtensionsFlat: () => supportedTSExtensionsFlat, + supportedTSImplementationExtensions: () => supportedTSImplementationExtensions, + suppressLeadingAndTrailingTrivia: () => suppressLeadingAndTrailingTrivia, + suppressLeadingTrivia: () => suppressLeadingTrivia, + suppressTrailingTrivia: () => suppressTrailingTrivia, + symbolEscapedNameNoDefault: () => symbolEscapedNameNoDefault, + symbolName: () => symbolName, + symbolNameNoDefault: () => symbolNameNoDefault, + symbolPart: () => symbolPart, + symbolToDisplayParts: () => symbolToDisplayParts, + syntaxMayBeASICandidate: () => syntaxMayBeASICandidate, + syntaxRequiresTrailingSemicolonOrASI: () => syntaxRequiresTrailingSemicolonOrASI, + sys: () => sys, + sysLog: () => sysLog, + tagNamesAreEquivalent: () => tagNamesAreEquivalent, + takeWhile: () => takeWhile, + targetOptionDeclaration: () => targetOptionDeclaration, + templateObjectHelper: () => templateObjectHelper, + testFormatSettings: () => testFormatSettings, + textChangeRangeIsUnchanged: () => textChangeRangeIsUnchanged, + textChangeRangeNewSpan: () => textChangeRangeNewSpan, + textChanges: () => ts_textChanges_exports, + textOrKeywordPart: () => textOrKeywordPart, + textPart: () => textPart, + textRangeContainsPositionInclusive: () => textRangeContainsPositionInclusive, + textSpanContainsPosition: () => textSpanContainsPosition, + textSpanContainsTextSpan: () => textSpanContainsTextSpan, + textSpanEnd: () => textSpanEnd, + textSpanIntersection: () => textSpanIntersection, + textSpanIntersectsWith: () => textSpanIntersectsWith, + textSpanIntersectsWithPosition: () => textSpanIntersectsWithPosition, + textSpanIntersectsWithTextSpan: () => textSpanIntersectsWithTextSpan, + textSpanIsEmpty: () => textSpanIsEmpty, + textSpanOverlap: () => textSpanOverlap, + textSpanOverlapsWith: () => textSpanOverlapsWith, + textSpansEqual: () => textSpansEqual, + textToKeywordObj: () => textToKeywordObj, + timestamp: () => timestamp, + toArray: () => toArray, + toBuilderFileEmit: () => toBuilderFileEmit, + toBuilderStateFileInfoForMultiEmit: () => toBuilderStateFileInfoForMultiEmit, + toEditorSettings: () => toEditorSettings, + toFileNameLowerCase: () => toFileNameLowerCase, + toLowerCase: () => toLowerCase, + toPath: () => toPath, + toProgramEmitPending: () => toProgramEmitPending, + tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword, + tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan, + tokenToString: () => tokenToString, + trace: () => trace, + tracing: () => tracing, + tracingEnabled: () => tracingEnabled, + transform: () => transform, + transformClassFields: () => transformClassFields, + transformDeclarations: () => transformDeclarations, + transformECMAScriptModule: () => transformECMAScriptModule, + transformES2015: () => transformES2015, + transformES2016: () => transformES2016, + transformES2017: () => transformES2017, + transformES2018: () => transformES2018, + transformES2019: () => transformES2019, + transformES2020: () => transformES2020, + transformES2021: () => transformES2021, + transformES5: () => transformES5, + transformESDecorators: () => transformESDecorators, + transformESNext: () => transformESNext, + transformGenerators: () => transformGenerators, + transformJsx: () => transformJsx, + transformLegacyDecorators: () => transformLegacyDecorators, + transformModule: () => transformModule, + transformNamedEvaluation: () => transformNamedEvaluation, + transformNodeModule: () => transformNodeModule, + transformNodes: () => transformNodes, + transformSystemModule: () => transformSystemModule, + transformTypeScript: () => transformTypeScript, + transpile: () => transpile, + transpileModule: () => transpileModule, + transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions, + tryAddToSet: () => tryAddToSet, + tryAndIgnoreErrors: () => tryAndIgnoreErrors, + tryCast: () => tryCast, + tryDirectoryExists: () => tryDirectoryExists, + tryExtractTSExtension: () => tryExtractTSExtension, + tryFileExists: () => tryFileExists, + tryGetClassExtendingExpressionWithTypeArguments: () => tryGetClassExtendingExpressionWithTypeArguments, + tryGetClassImplementingOrExtendingExpressionWithTypeArguments: () => tryGetClassImplementingOrExtendingExpressionWithTypeArguments, + tryGetDirectories: () => tryGetDirectories, + tryGetExtensionFromPath: () => tryGetExtensionFromPath2, + tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, + tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, + tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, + tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, + tryGetPropertyAccessOrIdentifierToString: () => tryGetPropertyAccessOrIdentifierToString, + tryGetPropertyNameOfBindingOrAssignmentElement: () => tryGetPropertyNameOfBindingOrAssignmentElement, + tryGetSourceMappingURL: () => tryGetSourceMappingURL, + tryGetTextOfPropertyName: () => tryGetTextOfPropertyName, + tryIOAndConsumeErrors: () => tryIOAndConsumeErrors, + tryParseJson: () => tryParseJson, + tryParsePattern: () => tryParsePattern, + tryParsePatterns: () => tryParsePatterns, + tryParseRawSourceMap: () => tryParseRawSourceMap, + tryReadDirectory: () => tryReadDirectory, + tryReadFile: () => tryReadFile, + tryRemoveDirectoryPrefix: () => tryRemoveDirectoryPrefix, + tryRemoveExtension: () => tryRemoveExtension, + tryRemovePrefix: () => tryRemovePrefix, + tryRemoveSuffix: () => tryRemoveSuffix, + typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, + typeAliasNamePart: () => typeAliasNamePart, + typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, + typeKeywords: () => typeKeywords, + typeParameterNamePart: () => typeParameterNamePart, + typeToDisplayParts: () => typeToDisplayParts, + unchangedPollThresholds: () => unchangedPollThresholds, + unchangedTextChangeRange: () => unchangedTextChangeRange, + unescapeLeadingUnderscores: () => unescapeLeadingUnderscores, + unmangleScopedPackageName: () => unmangleScopedPackageName, + unorderedRemoveItem: () => unorderedRemoveItem, + unorderedRemoveItemAt: () => unorderedRemoveItemAt, + unreachableCodeIsError: () => unreachableCodeIsError, + unusedLabelIsError: () => unusedLabelIsError, + unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, + updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, + updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, + updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, + updateResolutionField: () => updateResolutionField, + updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, + updateSourceFile: () => updateSourceFile, + updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, + usesExtensionsOnImports: () => usesExtensionsOnImports, + usingSingleLineStringWriter: () => usingSingleLineStringWriter, + utf16EncodeAsString: () => utf16EncodeAsString, + validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage, + valuesHelper: () => valuesHelper, + version: () => version, + versionMajorMinor: () => versionMajorMinor, + visitArray: () => visitArray, + visitCommaListElements: () => visitCommaListElements, + visitEachChild: () => visitEachChild, + visitFunctionBody: () => visitFunctionBody, + visitIterationBody: () => visitIterationBody, + visitLexicalEnvironment: () => visitLexicalEnvironment, + visitNode: () => visitNode, + visitNodes: () => visitNodes2, + visitParameterList: () => visitParameterList, + walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, + walkUpOuterExpressions: () => walkUpOuterExpressions, + walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, + walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, + walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, + whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp, + writeCommentRange: () => writeCommentRange, + writeFile: () => writeFile, + writeFileEnsuringDirectories: () => writeFileEnsuringDirectories, + zipWith: () => zipWith + }); + var init_ts7 = __esm({ + "src/server/_namespaces/ts.ts"() { + "use strict"; + init_ts2(); + init_ts3(); + init_ts4(); + init_ts5(); + init_ts_server3(); + } + }); + + // src/typescript/_namespaces/ts.server.ts + var ts_server_exports4 = {}; + __export(ts_server_exports4, { + ActionInvalidate: () => ActionInvalidate, + ActionPackageInstalled: () => ActionPackageInstalled, + ActionSet: () => ActionSet, + ActionWatchTypingLocations: () => ActionWatchTypingLocations, + Arguments: () => Arguments, + AutoImportProviderProject: () => AutoImportProviderProject, + AuxiliaryProject: () => AuxiliaryProject, + CharRangeSection: () => CharRangeSection, + CloseFileWatcherEvent: () => CloseFileWatcherEvent, + CommandNames: () => CommandNames, + ConfigFileDiagEvent: () => ConfigFileDiagEvent, + ConfiguredProject: () => ConfiguredProject2, + CreateDirectoryWatcherEvent: () => CreateDirectoryWatcherEvent, + CreateFileWatcherEvent: () => CreateFileWatcherEvent, + Errors: () => Errors, + EventBeginInstallTypes: () => EventBeginInstallTypes, + EventEndInstallTypes: () => EventEndInstallTypes, + EventInitializationFailed: () => EventInitializationFailed, + EventTypesRegistry: () => EventTypesRegistry, + ExternalProject: () => ExternalProject2, + GcTimer: () => GcTimer, + InferredProject: () => InferredProject2, + LargeFileReferencedEvent: () => LargeFileReferencedEvent, + LineIndex: () => LineIndex, + LineLeaf: () => LineLeaf, + LineNode: () => LineNode, + LogLevel: () => LogLevel2, + Msg: () => Msg, + OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, + Project: () => Project3, + ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, + ProjectKind: () => ProjectKind, + ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, + ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, + ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, + ProjectReferenceProjectLoadKind: () => ProjectReferenceProjectLoadKind, + ProjectService: () => ProjectService3, + ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, + ScriptInfo: () => ScriptInfo, + ScriptVersionCache: () => ScriptVersionCache, + Session: () => Session3, + TextStorage: () => TextStorage, + ThrottledOperations: () => ThrottledOperations, + TypingsCache: () => TypingsCache, + TypingsInstallerAdapter: () => TypingsInstallerAdapter, + allFilesAreJsOrDts: () => allFilesAreJsOrDts, + allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts, + asNormalizedPath: () => asNormalizedPath, + convertCompilerOptions: () => convertCompilerOptions, + convertFormatOptions: () => convertFormatOptions, + convertScriptKindName: () => convertScriptKindName, + convertTypeAcquisition: () => convertTypeAcquisition, + convertUserPreferences: () => convertUserPreferences, + convertWatchOptions: () => convertWatchOptions, + countEachFileTypes: () => countEachFileTypes, + createInstallTypingsRequest: () => createInstallTypingsRequest, + createModuleSpecifierCache: () => createModuleSpecifierCache, + createNormalizedPathMap: () => createNormalizedPathMap, + createPackageJsonCache: () => createPackageJsonCache, + createSortedArray: () => createSortedArray2, + emptyArray: () => emptyArray2, + findArgument: () => findArgument, + forEachResolvedProjectReferenceProject: () => forEachResolvedProjectReferenceProject, + formatDiagnosticToProtocol: () => formatDiagnosticToProtocol, + formatMessage: () => formatMessage2, + getBaseConfigFileName: () => getBaseConfigFileName, + getLocationInNewDocument: () => getLocationInNewDocument, + hasArgument: () => hasArgument, + hasNoTypeScriptSource: () => hasNoTypeScriptSource, + indent: () => indent2, + isBackgroundProject: () => isBackgroundProject, + isConfigFile: () => isConfigFile, + isConfiguredProject: () => isConfiguredProject, + isDynamicFileName: () => isDynamicFileName, + isExternalProject: () => isExternalProject, + isInferredProject: () => isInferredProject, + isInferredProjectName: () => isInferredProjectName, + makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, + makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, + makeInferredProjectName: () => makeInferredProjectName, + maxFileSize: () => maxFileSize, + maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, + normalizedPathToPath: () => normalizedPathToPath, + nowString: () => nowString, + nullCancellationToken: () => nullCancellationToken, + nullTypingsInstaller: () => nullTypingsInstaller, + projectContainsInfoDirectly: () => projectContainsInfoDirectly, + protocol: () => ts_server_protocol_exports, + removeSorted: () => removeSorted, + stringifyIndented: () => stringifyIndented, + toEvent: () => toEvent, + toNormalizedPath: () => toNormalizedPath, + tryConvertScriptKindName: () => tryConvertScriptKindName, + typingsInstaller: () => ts_server_typingsInstaller_exports, + updateProjectIfDirty: () => updateProjectIfDirty + }); + var init_ts_server4 = __esm({ + "src/typescript/_namespaces/ts.server.ts"() { + "use strict"; + init_ts_server(); + init_ts_server3(); + } + }); + + // src/typescript/_namespaces/ts.ts + var ts_exports3 = {}; + __export(ts_exports3, { + ANONYMOUS: () => ANONYMOUS, + AccessFlags: () => AccessFlags, + AssertionLevel: () => AssertionLevel, + AssignmentDeclarationKind: () => AssignmentDeclarationKind, + AssignmentKind: () => AssignmentKind, + Associativity: () => Associativity, + BreakpointResolver: () => ts_BreakpointResolver_exports, + BuilderFileEmit: () => BuilderFileEmit, + BuilderProgramKind: () => BuilderProgramKind, + BuilderState: () => BuilderState, + BundleFileSectionKind: () => BundleFileSectionKind, + CallHierarchy: () => ts_CallHierarchy_exports, + CharacterCodes: () => CharacterCodes, + CheckFlags: () => CheckFlags, + CheckMode: () => CheckMode, + ClassificationType: () => ClassificationType, + ClassificationTypeNames: () => ClassificationTypeNames, + CommentDirectiveType: () => CommentDirectiveType, + Comparison: () => Comparison, + CompletionInfoFlags: () => CompletionInfoFlags, + CompletionTriggerKind: () => CompletionTriggerKind, + Completions: () => ts_Completions_exports, + ContainerFlags: () => ContainerFlags, + ContextFlags: () => ContextFlags, + Debug: () => Debug, + DiagnosticCategory: () => DiagnosticCategory, + Diagnostics: () => Diagnostics, + DocumentHighlights: () => DocumentHighlights, + ElementFlags: () => ElementFlags, + EmitFlags: () => EmitFlags, + EmitHint: () => EmitHint, + EmitOnly: () => EmitOnly, + EndOfLineState: () => EndOfLineState, + EnumKind: () => EnumKind, + ExitStatus: () => ExitStatus, + ExportKind: () => ExportKind, + Extension: () => Extension, + ExternalEmitHelpers: () => ExternalEmitHelpers, + FileIncludeKind: () => FileIncludeKind, + FilePreprocessingDiagnosticsKind: () => FilePreprocessingDiagnosticsKind, + FileSystemEntryKind: () => FileSystemEntryKind, + FileWatcherEventKind: () => FileWatcherEventKind, + FindAllReferences: () => ts_FindAllReferences_exports, + FlattenLevel: () => FlattenLevel, + FlowFlags: () => FlowFlags, + ForegroundColorEscapeSequences: () => ForegroundColorEscapeSequences, + FunctionFlags: () => FunctionFlags, + GeneratedIdentifierFlags: () => GeneratedIdentifierFlags, + GetLiteralTextFlags: () => GetLiteralTextFlags, + GoToDefinition: () => ts_GoToDefinition_exports, + HighlightSpanKind: () => HighlightSpanKind, + IdentifierNameMap: () => IdentifierNameMap, + IdentifierNameMultiMap: () => IdentifierNameMultiMap, + ImportKind: () => ImportKind, + ImportsNotUsedAsValues: () => ImportsNotUsedAsValues, + IndentStyle: () => IndentStyle, + IndexFlags: () => IndexFlags, + IndexKind: () => IndexKind, + InferenceFlags: () => InferenceFlags, + InferencePriority: () => InferencePriority, + InlayHintKind: () => InlayHintKind, + InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, + InternalSymbolName: () => InternalSymbolName, + InvalidatedProjectKind: () => InvalidatedProjectKind, + JSDocParsingMode: () => JSDocParsingMode, + JsDoc: () => ts_JsDoc_exports, + JsTyping: () => ts_JsTyping_exports, + JsxEmit: () => JsxEmit, + JsxFlags: () => JsxFlags, + JsxReferenceKind: () => JsxReferenceKind, + LanguageServiceMode: () => LanguageServiceMode, + LanguageVariant: () => LanguageVariant, + LexicalEnvironmentFlags: () => LexicalEnvironmentFlags, + ListFormat: () => ListFormat, + LogLevel: () => LogLevel, + MemberOverrideStatus: () => MemberOverrideStatus, + ModifierFlags: () => ModifierFlags, + ModuleDetectionKind: () => ModuleDetectionKind, + ModuleInstanceState: () => ModuleInstanceState, + ModuleKind: () => ModuleKind, + ModuleResolutionKind: () => ModuleResolutionKind, + ModuleSpecifierEnding: () => ModuleSpecifierEnding, + NavigateTo: () => ts_NavigateTo_exports, + NavigationBar: () => ts_NavigationBar_exports, + NewLineKind: () => NewLineKind, + NodeBuilderFlags: () => NodeBuilderFlags, + NodeCheckFlags: () => NodeCheckFlags, + NodeFactoryFlags: () => NodeFactoryFlags, + NodeFlags: () => NodeFlags, + NodeResolutionFeatures: () => NodeResolutionFeatures, + ObjectFlags: () => ObjectFlags, + OperationCanceledException: () => OperationCanceledException, + OperatorPrecedence: () => OperatorPrecedence, + OrganizeImports: () => ts_OrganizeImports_exports, + OrganizeImportsMode: () => OrganizeImportsMode, + OuterExpressionKinds: () => OuterExpressionKinds, + OutliningElementsCollector: () => ts_OutliningElementsCollector_exports, + OutliningSpanKind: () => OutliningSpanKind, + OutputFileType: () => OutputFileType, + PackageJsonAutoImportPreference: () => PackageJsonAutoImportPreference, + PackageJsonDependencyGroup: () => PackageJsonDependencyGroup, + PatternMatchKind: () => PatternMatchKind, + PollingInterval: () => PollingInterval, + PollingWatchKind: () => PollingWatchKind, + PragmaKindFlags: () => PragmaKindFlags, + PrivateIdentifierKind: () => PrivateIdentifierKind, + ProcessLevel: () => ProcessLevel, + ProgramUpdateLevel: () => ProgramUpdateLevel, + QuotePreference: () => QuotePreference, + RelationComparisonResult: () => RelationComparisonResult, + Rename: () => ts_Rename_exports, + ScriptElementKind: () => ScriptElementKind, + ScriptElementKindModifier: () => ScriptElementKindModifier, + ScriptKind: () => ScriptKind, + ScriptSnapshot: () => ScriptSnapshot, + ScriptTarget: () => ScriptTarget, + SemanticClassificationFormat: () => SemanticClassificationFormat, + SemanticMeaning: () => SemanticMeaning, + SemicolonPreference: () => SemicolonPreference, + SignatureCheckMode: () => SignatureCheckMode, + SignatureFlags: () => SignatureFlags, + SignatureHelp: () => ts_SignatureHelp_exports, + SignatureKind: () => SignatureKind, + SmartSelectionRange: () => ts_SmartSelectionRange_exports, + SnippetKind: () => SnippetKind, + SortKind: () => SortKind, + StructureIsReused: () => StructureIsReused, + SymbolAccessibility: () => SymbolAccessibility, + SymbolDisplay: () => ts_SymbolDisplay_exports, + SymbolDisplayPartKind: () => SymbolDisplayPartKind, + SymbolFlags: () => SymbolFlags, + SymbolFormatFlags: () => SymbolFormatFlags, + SyntaxKind: () => SyntaxKind, + SyntheticSymbolKind: () => SyntheticSymbolKind, + Ternary: () => Ternary, + ThrottledCancellationToken: () => ThrottledCancellationToken, + TokenClass: () => TokenClass, + TokenFlags: () => TokenFlags, + TransformFlags: () => TransformFlags, + TypeFacts: () => TypeFacts, + TypeFlags: () => TypeFlags, + TypeFormatFlags: () => TypeFormatFlags, + TypeMapKind: () => TypeMapKind, + TypePredicateKind: () => TypePredicateKind, + TypeReferenceSerializationKind: () => TypeReferenceSerializationKind, + UnionReduction: () => UnionReduction, + UpToDateStatusType: () => UpToDateStatusType, + VarianceFlags: () => VarianceFlags, + Version: () => Version, + VersionRange: () => VersionRange, + WatchDirectoryFlags: () => WatchDirectoryFlags, + WatchDirectoryKind: () => WatchDirectoryKind, + WatchFileKind: () => WatchFileKind, + WatchLogLevel: () => WatchLogLevel, + WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, + addDisposableResourceHelper: () => addDisposableResourceHelper, + addEmitFlags: () => addEmitFlags, + addEmitHelper: () => addEmitHelper, + addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, + addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, + addRange: () => addRange, + addRelatedInfo: () => addRelatedInfo, + addSyntheticLeadingComment: () => addSyntheticLeadingComment, + addSyntheticTrailingComment: () => addSyntheticTrailingComment, + addToSeen: () => addToSeen, + advancedAsyncSuperHelper: () => advancedAsyncSuperHelper, + affectsDeclarationPathOptionDeclarations: () => affectsDeclarationPathOptionDeclarations, + affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations, + allKeysStartWithDot: () => allKeysStartWithDot, + altDirectorySeparator: () => altDirectorySeparator, + and: () => and, + append: () => append, + appendIfUnique: () => appendIfUnique, + arrayFrom: () => arrayFrom, + arrayIsEqualTo: () => arrayIsEqualTo, + arrayIsHomogeneous: () => arrayIsHomogeneous, + arrayIsSorted: () => arrayIsSorted, + arrayOf: () => arrayOf, + arrayReverseIterator: () => arrayReverseIterator, + arrayToMap: () => arrayToMap, + arrayToMultiMap: () => arrayToMultiMap, + arrayToNumericMap: () => arrayToNumericMap, + arraysEqual: () => arraysEqual, + assertType: () => assertType, + assign: () => assign, + assignHelper: () => assignHelper, + asyncDelegator: () => asyncDelegator, + asyncGeneratorHelper: () => asyncGeneratorHelper, + asyncSuperHelper: () => asyncSuperHelper, + asyncValues: () => asyncValues, + attachFileToDiagnostics: () => attachFileToDiagnostics, + awaitHelper: () => awaitHelper, + awaiterHelper: () => awaiterHelper, + base64decode: () => base64decode, + base64encode: () => base64encode, + binarySearch: () => binarySearch, + binarySearchKey: () => binarySearchKey, + bindSourceFile: () => bindSourceFile, + breakIntoCharacterSpans: () => breakIntoCharacterSpans, + breakIntoWordSpans: () => breakIntoWordSpans, + buildLinkParts: () => buildLinkParts, + buildOpts: () => buildOpts, + buildOverload: () => buildOverload, + bundlerModuleNameResolver: () => bundlerModuleNameResolver, + canBeConvertedToAsync: () => canBeConvertedToAsync, + canHaveDecorators: () => canHaveDecorators, + canHaveExportModifier: () => canHaveExportModifier, + canHaveFlowNode: () => canHaveFlowNode, + canHaveIllegalDecorators: () => canHaveIllegalDecorators, + canHaveIllegalModifiers: () => canHaveIllegalModifiers, + canHaveIllegalType: () => canHaveIllegalType, + canHaveIllegalTypeParameters: () => canHaveIllegalTypeParameters, + canHaveJSDoc: () => canHaveJSDoc, + canHaveLocals: () => canHaveLocals, + canHaveModifiers: () => canHaveModifiers, + canHaveSymbol: () => canHaveSymbol, + canJsonReportNoInputFiles: () => canJsonReportNoInputFiles, + canProduceDiagnostics: () => canProduceDiagnostics, + canUsePropertyAccess: () => canUsePropertyAccess, + canWatchAffectingLocation: () => canWatchAffectingLocation, + canWatchAtTypes: () => canWatchAtTypes, + canWatchDirectoryOrFile: () => canWatchDirectoryOrFile, + cartesianProduct: () => cartesianProduct, + cast: () => cast, + chainBundle: () => chainBundle, + chainDiagnosticMessages: () => chainDiagnosticMessages, + changeAnyExtension: () => changeAnyExtension, + changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache, + changeExtension: () => changeExtension, + changeFullExtension: () => changeFullExtension, + changesAffectModuleResolution: () => changesAffectModuleResolution, + changesAffectingProgramStructure: () => changesAffectingProgramStructure, + childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, + classHasClassThisAssignment: () => classHasClassThisAssignment, + classHasDeclaredOrExplicitlyAssignedName: () => classHasDeclaredOrExplicitlyAssignedName, + classHasExplicitlyAssignedName: () => classHasExplicitlyAssignedName, + classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, + classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, + classPrivateFieldInHelper: () => classPrivateFieldInHelper, + classPrivateFieldSetHelper: () => classPrivateFieldSetHelper, + classicNameResolver: () => classicNameResolver, + classifier: () => ts_classifier_exports, + cleanExtendedConfigCache: () => cleanExtendedConfigCache, + clear: () => clear, + clearMap: () => clearMap, + clearSharedExtendedConfigFileWatcher: () => clearSharedExtendedConfigFileWatcher, + climbPastPropertyAccess: () => climbPastPropertyAccess, + climbPastPropertyOrElementAccess: () => climbPastPropertyOrElementAccess, + clone: () => clone, + cloneCompilerOptions: () => cloneCompilerOptions, + closeFileWatcher: () => closeFileWatcher, + closeFileWatcherOf: () => closeFileWatcherOf, + codefix: () => ts_codefix_exports, + collapseTextChangeRangesAcrossMultipleVersions: () => collapseTextChangeRangesAcrossMultipleVersions, + collectExternalModuleInfo: () => collectExternalModuleInfo, + combine: () => combine, + combinePaths: () => combinePaths, + commentPragmas: () => commentPragmas, + commonOptionsWithBuild: () => commonOptionsWithBuild, + commonPackageFolders: () => commonPackageFolders, + compact: () => compact, + compareBooleans: () => compareBooleans, + compareDataObjects: () => compareDataObjects, + compareDiagnostics: () => compareDiagnostics, + compareDiagnosticsSkipRelatedInformation: () => compareDiagnosticsSkipRelatedInformation, + compareEmitHelpers: () => compareEmitHelpers, + compareNumberOfDirectorySeparators: () => compareNumberOfDirectorySeparators, + comparePaths: () => comparePaths, + comparePathsCaseInsensitive: () => comparePathsCaseInsensitive, + comparePathsCaseSensitive: () => comparePathsCaseSensitive, + comparePatternKeys: () => comparePatternKeys, + compareProperties: () => compareProperties, + compareStringsCaseInsensitive: () => compareStringsCaseInsensitive, + compareStringsCaseInsensitiveEslintCompatible: () => compareStringsCaseInsensitiveEslintCompatible, + compareStringsCaseSensitive: () => compareStringsCaseSensitive, + compareStringsCaseSensitiveUI: () => compareStringsCaseSensitiveUI, + compareTextSpans: () => compareTextSpans, + compareValues: () => compareValues, + compileOnSaveCommandLineOption: () => compileOnSaveCommandLineOption, + compilerOptionsAffectDeclarationPath: () => compilerOptionsAffectDeclarationPath, + compilerOptionsAffectEmit: () => compilerOptionsAffectEmit, + compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, + compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, + compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, + computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, + computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, + computeLineOfPosition: () => computeLineOfPosition, + computeLineStarts: () => computeLineStarts, + computePositionOfLineAndCharacter: () => computePositionOfLineAndCharacter, + computeSignature: () => computeSignature, + computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics, + computeSuggestionDiagnostics: () => computeSuggestionDiagnostics, + computedOptions: () => computedOptions, + concatenate: () => concatenate, + concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains, + consumesNodeCoreModules: () => consumesNodeCoreModules, + contains: () => contains, + containsIgnoredPath: () => containsIgnoredPath, + containsObjectRestOrSpread: () => containsObjectRestOrSpread, + containsParseError: () => containsParseError, + containsPath: () => containsPath, + convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, + convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, + convertJsonOption: () => convertJsonOption, + convertToBase64: () => convertToBase64, + convertToJson: () => convertToJson, + convertToObject: () => convertToObject, + convertToOptionsWithAbsolutePaths: () => convertToOptionsWithAbsolutePaths, + convertToRelativePath: () => convertToRelativePath, + convertToTSConfig: () => convertToTSConfig, + convertTypeAcquisitionFromJson: () => convertTypeAcquisitionFromJson, + copyComments: () => copyComments, + copyEntries: () => copyEntries, + copyLeadingComments: () => copyLeadingComments, + copyProperties: () => copyProperties, + copyTrailingAsLeadingComments: () => copyTrailingAsLeadingComments, + copyTrailingComments: () => copyTrailingComments, + couldStartTrivia: () => couldStartTrivia, + countWhere: () => countWhere, + createAbstractBuilder: () => createAbstractBuilder, + createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, + createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, + createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, + createBaseNodeFactory: () => createBaseNodeFactory, + createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, + createBindingHelper: () => createBindingHelper, + createBuildInfo: () => createBuildInfo, + createBuilderProgram: () => createBuilderProgram, + createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, + createBuilderStatusReporter: () => createBuilderStatusReporter, + createCacheWithRedirects: () => createCacheWithRedirects, + createCacheableExportInfoMap: () => createCacheableExportInfoMap, + createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, + createClassNamedEvaluationHelperBlock: () => createClassNamedEvaluationHelperBlock, + createClassThisAssignmentBlock: () => createClassThisAssignmentBlock, + createClassifier: () => createClassifier, + createCommentDirectivesMap: () => createCommentDirectivesMap, + createCompilerDiagnostic: () => createCompilerDiagnostic, + createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, + createCompilerDiagnosticFromMessageChain: () => createCompilerDiagnosticFromMessageChain, + createCompilerHost: () => createCompilerHost, + createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, + createCompilerHostWorker: () => createCompilerHostWorker, + createDetachedDiagnostic: () => createDetachedDiagnostic, + createDiagnosticCollection: () => createDiagnosticCollection, + createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, + createDiagnosticForNode: () => createDiagnosticForNode, + createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, + createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, + createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, + createDiagnosticForRange: () => createDiagnosticForRange, + createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, + createDiagnosticReporter: () => createDiagnosticReporter, + createDocumentPositionMapper: () => createDocumentPositionMapper, + createDocumentRegistry: () => createDocumentRegistry, + createDocumentRegistryInternal: () => createDocumentRegistryInternal, + createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, + createEmitHelperFactory: () => createEmitHelperFactory, + createEmptyExports: () => createEmptyExports, + createExpressionForJsxElement: () => createExpressionForJsxElement, + createExpressionForJsxFragment: () => createExpressionForJsxFragment, + createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, + createExpressionForPropertyName: () => createExpressionForPropertyName, + createExpressionFromEntityName: () => createExpressionFromEntityName, + createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, + createFileDiagnostic: () => createFileDiagnostic, + createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, + createForOfBindingStatement: () => createForOfBindingStatement, + createGetCanonicalFileName: () => createGetCanonicalFileName, + createGetSourceFile: () => createGetSourceFile, + createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, + createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, + createGetSymbolWalker: () => createGetSymbolWalker, + createIncrementalCompilerHost: () => createIncrementalCompilerHost, + createIncrementalProgram: () => createIncrementalProgram, + createInputFiles: () => createInputFiles, + createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, + createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, + createJsxFactoryExpression: () => createJsxFactoryExpression, + createLanguageService: () => createLanguageService, + createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, + createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, + createModeAwareCache: () => createModeAwareCache, + createModeAwareCacheKey: () => createModeAwareCacheKey, + createModuleNotFoundChain: () => createModuleNotFoundChain, + createModuleResolutionCache: () => createModuleResolutionCache, + createModuleResolutionLoader: () => createModuleResolutionLoader, + createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache, + createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, + createMultiMap: () => createMultiMap, + createNodeConverters: () => createNodeConverters, + createNodeFactory: () => createNodeFactory, + createOptionNameMap: () => createOptionNameMap, + createOverload: () => createOverload, + createPackageJsonImportFilter: () => createPackageJsonImportFilter, + createPackageJsonInfo: () => createPackageJsonInfo, + createParenthesizerRules: () => createParenthesizerRules, + createPatternMatcher: () => createPatternMatcher, + createPrependNodes: () => createPrependNodes, + createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, + createProgram: () => createProgram, + createProgramHost: () => createProgramHost, + createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, + createQueue: () => createQueue, + createRange: () => createRange, + createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, + createResolutionCache: () => createResolutionCache, + createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, + createScanner: () => createScanner, + createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, + createSet: () => createSet, + createSolutionBuilder: () => createSolutionBuilder, + createSolutionBuilderHost: () => createSolutionBuilderHost, + createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, + createSolutionBuilderWithWatchHost: () => createSolutionBuilderWithWatchHost, + createSortedArray: () => createSortedArray, + createSourceFile: () => createSourceFile, + createSourceMapGenerator: () => createSourceMapGenerator, + createSourceMapSource: () => createSourceMapSource, + createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, + createSymbolTable: () => createSymbolTable, + createSymlinkCache: () => createSymlinkCache, + createSystemWatchFunctions: () => createSystemWatchFunctions, + createTextChange: () => createTextChange, + createTextChangeFromStartLength: () => createTextChangeFromStartLength, + createTextChangeRange: () => createTextChangeRange, + createTextRangeFromNode: () => createTextRangeFromNode, + createTextRangeFromSpan: () => createTextRangeFromSpan, + createTextSpan: () => createTextSpan, + createTextSpanFromBounds: () => createTextSpanFromBounds, + createTextSpanFromNode: () => createTextSpanFromNode, + createTextSpanFromRange: () => createTextSpanFromRange, + createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, + createTextWriter: () => createTextWriter, + createTokenRange: () => createTokenRange, + createTypeChecker: () => createTypeChecker, + createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, + createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, + createUnparsedSourceFile: () => createUnparsedSourceFile, + createWatchCompilerHost: () => createWatchCompilerHost2, + createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, + createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, + createWatchFactory: () => createWatchFactory, + createWatchHost: () => createWatchHost, + createWatchProgram: () => createWatchProgram, + createWatchStatusReporter: () => createWatchStatusReporter, + createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, + declarationNameToString: () => declarationNameToString, + decodeMappings: () => decodeMappings, + decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, + decorateHelper: () => decorateHelper, + deduplicate: () => deduplicate, + defaultIncludeSpec: () => defaultIncludeSpec, + defaultInitCompilerOptions: () => defaultInitCompilerOptions, + defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, + detectSortCaseSensitivity: () => detectSortCaseSensitivity, + diagnosticCategoryName: () => diagnosticCategoryName, + diagnosticToString: () => diagnosticToString, + directoryProbablyExists: () => directoryProbablyExists, + directorySeparator: () => directorySeparator, + displayPart: () => displayPart, + displayPartsToString: () => displayPartsToString, + disposeEmitNodes: () => disposeEmitNodes, + disposeResourcesHelper: () => disposeResourcesHelper, + documentSpansEqual: () => documentSpansEqual, + dumpTracingLegend: () => dumpTracingLegend, + elementAt: () => elementAt, + elideNodes: () => elideNodes, + emitComments: () => emitComments, + emitDetachedComments: () => emitDetachedComments, + emitFiles: () => emitFiles, + emitFilesAndReportErrors: () => emitFilesAndReportErrors, + emitFilesAndReportErrorsAndGetExitStatus: () => emitFilesAndReportErrorsAndGetExitStatus, + emitModuleKindIsNonNodeESM: () => emitModuleKindIsNonNodeESM, + emitNewLineBeforeLeadingCommentOfPosition: () => emitNewLineBeforeLeadingCommentOfPosition, + emitNewLineBeforeLeadingComments: () => emitNewLineBeforeLeadingComments, + emitNewLineBeforeLeadingCommentsOfPosition: () => emitNewLineBeforeLeadingCommentsOfPosition, + emitSkippedWithNoDiagnostics: () => emitSkippedWithNoDiagnostics, + emitUsingBuildInfo: () => emitUsingBuildInfo, + emptyArray: () => emptyArray, + emptyFileSystemEntries: () => emptyFileSystemEntries, + emptyMap: () => emptyMap, + emptyOptions: () => emptyOptions, + emptySet: () => emptySet, + endsWith: () => endsWith, + ensurePathIsNonModuleName: () => ensurePathIsNonModuleName, + ensureScriptKind: () => ensureScriptKind, + ensureTrailingDirectorySeparator: () => ensureTrailingDirectorySeparator, + entityNameToString: () => entityNameToString, + enumerateInsertsAndDeletes: () => enumerateInsertsAndDeletes, + equalOwnProperties: () => equalOwnProperties, + equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, + equateStringsCaseSensitive: () => equateStringsCaseSensitive, + equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, + escapeJsxAttributeString: () => escapeJsxAttributeString, + escapeLeadingUnderscores: () => escapeLeadingUnderscores, + escapeNonAsciiString: () => escapeNonAsciiString, + escapeSnippetText: () => escapeSnippetText, + escapeString: () => escapeString, + escapeTemplateSubstitution: () => escapeTemplateSubstitution, + every: () => every, + expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression, + explainFiles: () => explainFiles, + explainIfFileIsRedirectAndImpliedFormat: () => explainIfFileIsRedirectAndImpliedFormat, + exportAssignmentIsAlias: () => exportAssignmentIsAlias, + exportStarHelper: () => exportStarHelper, + expressionResultIsUnused: () => expressionResultIsUnused, + extend: () => extend, + extendsHelper: () => extendsHelper, + extensionFromPath: () => extensionFromPath, + extensionIsTS: () => extensionIsTS, + extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution, + externalHelpersModuleNameText: () => externalHelpersModuleNameText, + factory: () => factory, + fileExtensionIs: () => fileExtensionIs, + fileExtensionIsOneOf: () => fileExtensionIsOneOf, + fileIncludeReasonToDiagnostics: () => fileIncludeReasonToDiagnostics, + fileShouldUseJavaScriptRequire: () => fileShouldUseJavaScriptRequire, + filter: () => filter, + filterMutate: () => filterMutate, + filterSemanticDiagnostics: () => filterSemanticDiagnostics, + find: () => find, + findAncestor: () => findAncestor, + findBestPatternMatch: () => findBestPatternMatch, + findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, + findConfigFile: () => findConfigFile, + findContainingList: () => findContainingList, + findDiagnosticForNode: () => findDiagnosticForNode, + findFirstNonJsxWhitespaceToken: () => findFirstNonJsxWhitespaceToken, + findIndex: () => findIndex, + findLast: () => findLast, + findLastIndex: () => findLastIndex, + findListItemInfo: () => findListItemInfo, + findMap: () => findMap, + findModifier: () => findModifier, + findNextToken: () => findNextToken, + findPackageJson: () => findPackageJson, + findPackageJsons: () => findPackageJsons, + findPrecedingMatchingToken: () => findPrecedingMatchingToken, + findPrecedingToken: () => findPrecedingToken, + findSuperStatementIndexPath: () => findSuperStatementIndexPath, + findTokenOnLeftOfPosition: () => findTokenOnLeftOfPosition, + findUseStrictPrologue: () => findUseStrictPrologue, + first: () => first, + firstDefined: () => firstDefined, + firstDefinedIterator: () => firstDefinedIterator, + firstIterator: () => firstIterator, + firstOrOnly: () => firstOrOnly, + firstOrUndefined: () => firstOrUndefined, + firstOrUndefinedIterator: () => firstOrUndefinedIterator, + fixupCompilerOptions: () => fixupCompilerOptions, + flatMap: () => flatMap, + flatMapIterator: () => flatMapIterator, + flatMapToMutable: () => flatMapToMutable, + flatten: () => flatten, + flattenCommaList: () => flattenCommaList, + flattenDestructuringAssignment: () => flattenDestructuringAssignment, + flattenDestructuringBinding: () => flattenDestructuringBinding, + flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, + forEach: () => forEach, + forEachAncestor: () => forEachAncestor, + forEachAncestorDirectory: () => forEachAncestorDirectory, + forEachChild: () => forEachChild, + forEachChildRecursively: () => forEachChildRecursively, + forEachEmittedFile: () => forEachEmittedFile, + forEachEnclosingBlockScopeContainer: () => forEachEnclosingBlockScopeContainer, + forEachEntry: () => forEachEntry, + forEachExternalModuleToImportFrom: () => forEachExternalModuleToImportFrom, + forEachImportClauseDeclaration: () => forEachImportClauseDeclaration, + forEachKey: () => forEachKey, + forEachLeadingCommentRange: () => forEachLeadingCommentRange, + forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft, + forEachPropertyAssignment: () => forEachPropertyAssignment, + forEachResolvedProjectReference: () => forEachResolvedProjectReference, + forEachReturnStatement: () => forEachReturnStatement, + forEachRight: () => forEachRight, + forEachTrailingCommentRange: () => forEachTrailingCommentRange, + forEachTsConfigPropArray: () => forEachTsConfigPropArray, + forEachUnique: () => forEachUnique, + forEachYieldExpression: () => forEachYieldExpression, + forSomeAncestorDirectory: () => forSomeAncestorDirectory, + formatColorAndReset: () => formatColorAndReset, + formatDiagnostic: () => formatDiagnostic, + formatDiagnostics: () => formatDiagnostics, + formatDiagnosticsWithColorAndContext: () => formatDiagnosticsWithColorAndContext, + formatGeneratedName: () => formatGeneratedName, + formatGeneratedNamePart: () => formatGeneratedNamePart, + formatLocation: () => formatLocation, + formatMessage: () => formatMessage, + formatStringFromArgs: () => formatStringFromArgs, + formatting: () => ts_formatting_exports, + fullTripleSlashAMDReferencePathRegEx: () => fullTripleSlashAMDReferencePathRegEx, + fullTripleSlashReferencePathRegEx: () => fullTripleSlashReferencePathRegEx, + generateDjb2Hash: () => generateDjb2Hash, + generateTSConfig: () => generateTSConfig, + generatorHelper: () => generatorHelper, + getAdjustedReferenceLocation: () => getAdjustedReferenceLocation, + getAdjustedRenameLocation: () => getAdjustedRenameLocation, + getAliasDeclarationFromName: () => getAliasDeclarationFromName, + getAllAccessorDeclarations: () => getAllAccessorDeclarations, + getAllDecoratorsOfClass: () => getAllDecoratorsOfClass, + getAllDecoratorsOfClassElement: () => getAllDecoratorsOfClassElement, + getAllJSDocTags: () => getAllJSDocTags, + getAllJSDocTagsOfKind: () => getAllJSDocTagsOfKind, + getAllKeys: () => getAllKeys, + getAllProjectOutputs: () => getAllProjectOutputs, + getAllSuperTypeNodes: () => getAllSuperTypeNodes, + getAllUnscopedEmitHelpers: () => getAllUnscopedEmitHelpers, + getAllowJSCompilerOption: () => getAllowJSCompilerOption, + getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports, + getAncestor: () => getAncestor, + getAnyExtensionFromPath: () => getAnyExtensionFromPath, + getAreDeclarationMapsEnabled: () => getAreDeclarationMapsEnabled, + getAssignedExpandoInitializer: () => getAssignedExpandoInitializer, + getAssignedName: () => getAssignedName, + getAssignedNameOfIdentifier: () => getAssignedNameOfIdentifier, + getAssignmentDeclarationKind: () => getAssignmentDeclarationKind, + getAssignmentDeclarationPropertyAccessKind: () => getAssignmentDeclarationPropertyAccessKind, + getAssignmentTargetKind: () => getAssignmentTargetKind, + getAutomaticTypeDirectiveNames: () => getAutomaticTypeDirectiveNames, + getBaseFileName: () => getBaseFileName, + getBinaryOperatorPrecedence: () => getBinaryOperatorPrecedence, + getBuildInfo: () => getBuildInfo, + getBuildInfoFileVersionMap: () => getBuildInfoFileVersionMap, + getBuildInfoText: () => getBuildInfoText, + getBuildOrderFromAnyBuildOrder: () => getBuildOrderFromAnyBuildOrder, + getBuilderCreationParameters: () => getBuilderCreationParameters, + getBuilderFileEmit: () => getBuilderFileEmit, + getCheckFlags: () => getCheckFlags, + getClassExtendsHeritageElement: () => getClassExtendsHeritageElement, + getClassLikeDeclarationOfSymbol: () => getClassLikeDeclarationOfSymbol, + getCombinedLocalAndExportSymbolFlags: () => getCombinedLocalAndExportSymbolFlags, + getCombinedModifierFlags: () => getCombinedModifierFlags, + getCombinedNodeFlags: () => getCombinedNodeFlags, + getCombinedNodeFlagsAlwaysIncludeJSDoc: () => getCombinedNodeFlagsAlwaysIncludeJSDoc, + getCommentRange: () => getCommentRange, + getCommonSourceDirectory: () => getCommonSourceDirectory, + getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, + getCompilerOptionValue: () => getCompilerOptionValue, + getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, + getConditions: () => getConditions, + getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, + getConstantValue: () => getConstantValue, + getContainerFlags: () => getContainerFlags, + getContainerNode: () => getContainerNode, + getContainingClass: () => getContainingClass, + getContainingClassExcludingClassDecorators: () => getContainingClassExcludingClassDecorators, + getContainingClassStaticBlock: () => getContainingClassStaticBlock, + getContainingFunction: () => getContainingFunction, + getContainingFunctionDeclaration: () => getContainingFunctionDeclaration, + getContainingFunctionOrClassStaticBlock: () => getContainingFunctionOrClassStaticBlock, + getContainingNodeArray: () => getContainingNodeArray, + getContainingObjectLiteralElement: () => getContainingObjectLiteralElement, + getContextualTypeFromParent: () => getContextualTypeFromParent, + getContextualTypeFromParentOrAncestorTypeNode: () => getContextualTypeFromParentOrAncestorTypeNode, + getCurrentTime: () => getCurrentTime, + getDeclarationDiagnostics: () => getDeclarationDiagnostics, + getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath, + getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath, + getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker, + getDeclarationFileExtension: () => getDeclarationFileExtension, + getDeclarationFromName: () => getDeclarationFromName, + getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol, + getDeclarationOfKind: () => getDeclarationOfKind, + getDeclarationsOfKind: () => getDeclarationsOfKind, + getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, + getDecorators: () => getDecorators, + getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, + getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, + getDefaultLibFileName: () => getDefaultLibFileName, + getDefaultLibFilePath: () => getDefaultLibFilePath, + getDefaultLikeExportInfo: () => getDefaultLikeExportInfo, + getDiagnosticText: () => getDiagnosticText, + getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan, + getDirectoryPath: () => getDirectoryPath, + getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation, + getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot, + getDocumentPositionMapper: () => getDocumentPositionMapper, + getDocumentSpansEqualityComparer: () => getDocumentSpansEqualityComparer, + getESModuleInterop: () => getESModuleInterop, + getEditsForFileRename: () => getEditsForFileRename, + getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode, + getEffectiveConstraintOfTypeParameter: () => getEffectiveConstraintOfTypeParameter, + getEffectiveContainerForJSDocTemplateTag: () => getEffectiveContainerForJSDocTemplateTag, + getEffectiveImplementsTypeNodes: () => getEffectiveImplementsTypeNodes, + getEffectiveInitializer: () => getEffectiveInitializer, + getEffectiveJSDocHost: () => getEffectiveJSDocHost, + getEffectiveModifierFlags: () => getEffectiveModifierFlags, + getEffectiveModifierFlagsAlwaysIncludeJSDoc: () => getEffectiveModifierFlagsAlwaysIncludeJSDoc, + getEffectiveModifierFlagsNoCache: () => getEffectiveModifierFlagsNoCache, + getEffectiveReturnTypeNode: () => getEffectiveReturnTypeNode, + getEffectiveSetAccessorTypeAnnotationNode: () => getEffectiveSetAccessorTypeAnnotationNode, + getEffectiveTypeAnnotationNode: () => getEffectiveTypeAnnotationNode, + getEffectiveTypeParameterDeclarations: () => getEffectiveTypeParameterDeclarations, + getEffectiveTypeRoots: () => getEffectiveTypeRoots, + getElementOrPropertyAccessArgumentExpressionOrName: () => getElementOrPropertyAccessArgumentExpressionOrName, + getElementOrPropertyAccessName: () => getElementOrPropertyAccessName, + getElementsOfBindingOrAssignmentPattern: () => getElementsOfBindingOrAssignmentPattern, + getEmitDeclarations: () => getEmitDeclarations, + getEmitFlags: () => getEmitFlags, + getEmitHelpers: () => getEmitHelpers, + getEmitModuleDetectionKind: () => getEmitModuleDetectionKind, + getEmitModuleKind: () => getEmitModuleKind, + getEmitModuleResolutionKind: () => getEmitModuleResolutionKind, + getEmitScriptTarget: () => getEmitScriptTarget, + getEmitStandardClassFields: () => getEmitStandardClassFields, + getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer, + getEnclosingContainer: () => getEnclosingContainer, + getEncodedSemanticClassifications: () => getEncodedSemanticClassifications, + getEncodedSyntacticClassifications: () => getEncodedSyntacticClassifications, + getEndLinePosition: () => getEndLinePosition, + getEntityNameFromTypeNode: () => getEntityNameFromTypeNode, + getEntrypointsFromPackageJsonInfo: () => getEntrypointsFromPackageJsonInfo, + getErrorCountForSummary: () => getErrorCountForSummary, + getErrorSpanForNode: () => getErrorSpanForNode, + getErrorSummaryText: () => getErrorSummaryText, + getEscapedTextOfIdentifierOrLiteral: () => getEscapedTextOfIdentifierOrLiteral, + getEscapedTextOfJsxAttributeName: () => getEscapedTextOfJsxAttributeName, + getEscapedTextOfJsxNamespacedName: () => getEscapedTextOfJsxNamespacedName, + getExpandoInitializer: () => getExpandoInitializer, + getExportAssignmentExpression: () => getExportAssignmentExpression, + getExportInfoMap: () => getExportInfoMap, + getExportNeedsImportStarHelper: () => getExportNeedsImportStarHelper, + getExpressionAssociativity: () => getExpressionAssociativity, + getExpressionPrecedence: () => getExpressionPrecedence, + getExternalHelpersModuleName: () => getExternalHelpersModuleName, + getExternalModuleImportEqualsDeclarationExpression: () => getExternalModuleImportEqualsDeclarationExpression, + getExternalModuleName: () => getExternalModuleName, + getExternalModuleNameFromDeclaration: () => getExternalModuleNameFromDeclaration, + getExternalModuleNameFromPath: () => getExternalModuleNameFromPath, + getExternalModuleNameLiteral: () => getExternalModuleNameLiteral, + getExternalModuleRequireArgument: () => getExternalModuleRequireArgument, + getFallbackOptions: () => getFallbackOptions, + getFileEmitOutput: () => getFileEmitOutput, + getFileMatcherPatterns: () => getFileMatcherPatterns, + getFileNamesFromConfigSpecs: () => getFileNamesFromConfigSpecs, + getFileWatcherEventKind: () => getFileWatcherEventKind, + getFilesInErrorForSummary: () => getFilesInErrorForSummary, + getFirstConstructorWithBody: () => getFirstConstructorWithBody, + getFirstIdentifier: () => getFirstIdentifier, + getFirstNonSpaceCharacterPosition: () => getFirstNonSpaceCharacterPosition, + getFirstProjectOutput: () => getFirstProjectOutput, + getFixableErrorSpanExpression: () => getFixableErrorSpanExpression, + getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, + getFullWidth: () => getFullWidth, + getFunctionFlags: () => getFunctionFlags, + getHeritageClause: () => getHeritageClause, + getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, + getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, + getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, + getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, + getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper, + getImportNeedsImportStarHelper: () => getImportNeedsImportStarHelper, + getIndentSize: () => getIndentSize, + getIndentString: () => getIndentString, + getInferredLibraryNameResolveFrom: () => getInferredLibraryNameResolveFrom, + getInitializedVariables: () => getInitializedVariables, + getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, + getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, + getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, + getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, + getJSDocAugmentsTag: () => getJSDocAugmentsTag, + getJSDocClassTag: () => getJSDocClassTag, + getJSDocCommentRanges: () => getJSDocCommentRanges, + getJSDocCommentsAndTags: () => getJSDocCommentsAndTags, + getJSDocDeprecatedTag: () => getJSDocDeprecatedTag, + getJSDocDeprecatedTagNoCache: () => getJSDocDeprecatedTagNoCache, + getJSDocEnumTag: () => getJSDocEnumTag, + getJSDocHost: () => getJSDocHost, + getJSDocImplementsTags: () => getJSDocImplementsTags, + getJSDocOverloadTags: () => getJSDocOverloadTags, + getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache, + getJSDocParameterTags: () => getJSDocParameterTags, + getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache, + getJSDocPrivateTag: () => getJSDocPrivateTag, + getJSDocPrivateTagNoCache: () => getJSDocPrivateTagNoCache, + getJSDocProtectedTag: () => getJSDocProtectedTag, + getJSDocProtectedTagNoCache: () => getJSDocProtectedTagNoCache, + getJSDocPublicTag: () => getJSDocPublicTag, + getJSDocPublicTagNoCache: () => getJSDocPublicTagNoCache, + getJSDocReadonlyTag: () => getJSDocReadonlyTag, + getJSDocReadonlyTagNoCache: () => getJSDocReadonlyTagNoCache, + getJSDocReturnTag: () => getJSDocReturnTag, + getJSDocReturnType: () => getJSDocReturnType, + getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, + getJSDocTags: () => getJSDocTags, + getJSDocTagsNoCache: () => getJSDocTagsNoCache, + getJSDocTemplateTag: () => getJSDocTemplateTag, + getJSDocThisTag: () => getJSDocThisTag, + getJSDocType: () => getJSDocType, + getJSDocTypeAliasName: () => getJSDocTypeAliasName, + getJSDocTypeAssertionType: () => getJSDocTypeAssertionType, + getJSDocTypeParameterDeclarations: () => getJSDocTypeParameterDeclarations, + getJSDocTypeParameterTags: () => getJSDocTypeParameterTags, + getJSDocTypeParameterTagsNoCache: () => getJSDocTypeParameterTagsNoCache, + getJSDocTypeTag: () => getJSDocTypeTag, + getJSXImplicitImportBase: () => getJSXImplicitImportBase, + getJSXRuntimeImport: () => getJSXRuntimeImport, + getJSXTransformEnabled: () => getJSXTransformEnabled, + getKeyForCompilerOptions: () => getKeyForCompilerOptions, + getLanguageVariant: () => getLanguageVariant, + getLastChild: () => getLastChild, + getLeadingCommentRanges: () => getLeadingCommentRanges, + getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode, + getLeftmostAccessExpression: () => getLeftmostAccessExpression, + getLeftmostExpression: () => getLeftmostExpression, + getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName, + getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition, + getLineInfo: () => getLineInfo, + getLineOfLocalPosition: () => getLineOfLocalPosition, + getLineOfLocalPositionFromLineMap: () => getLineOfLocalPositionFromLineMap, + getLineStartPositionForPosition: () => getLineStartPositionForPosition, + getLineStarts: () => getLineStarts, + getLinesBetweenPositionAndNextNonWhitespaceCharacter: () => getLinesBetweenPositionAndNextNonWhitespaceCharacter, + getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter: () => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter, + getLinesBetweenPositions: () => getLinesBetweenPositions, + getLinesBetweenRangeEndAndRangeStart: () => getLinesBetweenRangeEndAndRangeStart, + getLinesBetweenRangeEndPositions: () => getLinesBetweenRangeEndPositions, + getLiteralText: () => getLiteralText, + getLocalNameForExternalImport: () => getLocalNameForExternalImport, + getLocalSymbolForExportDefault: () => getLocalSymbolForExportDefault, + getLocaleSpecificMessage: () => getLocaleSpecificMessage, + getLocaleTimeString: () => getLocaleTimeString, + getMappedContextSpan: () => getMappedContextSpan, + getMappedDocumentSpan: () => getMappedDocumentSpan, + getMappedLocation: () => getMappedLocation, + getMatchedFileSpec: () => getMatchedFileSpec, + getMatchedIncludeSpec: () => getMatchedIncludeSpec, + getMeaningFromDeclaration: () => getMeaningFromDeclaration, + getMeaningFromLocation: () => getMeaningFromLocation, + getMembersOfDeclaration: () => getMembersOfDeclaration, + getModeForFileReference: () => getModeForFileReference, + getModeForResolutionAtIndex: () => getModeForResolutionAtIndex, + getModeForUsageLocation: () => getModeForUsageLocation, + getModifiedTime: () => getModifiedTime, + getModifiers: () => getModifiers, + getModuleInstanceState: () => getModuleInstanceState, + getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, + getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, + getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, + getNameForExportedSymbol: () => getNameForExportedSymbol, + getNameFromImportAttribute: () => getNameFromImportAttribute, + getNameFromIndexInfo: () => getNameFromIndexInfo, + getNameFromPropertyName: () => getNameFromPropertyName, + getNameOfAccessExpression: () => getNameOfAccessExpression, + getNameOfCompilerOptionValue: () => getNameOfCompilerOptionValue, + getNameOfDeclaration: () => getNameOfDeclaration, + getNameOfExpando: () => getNameOfExpando, + getNameOfJSDocTypedef: () => getNameOfJSDocTypedef, + getNameOrArgument: () => getNameOrArgument, + getNameTable: () => getNameTable, + getNamesForExportedSymbol: () => getNamesForExportedSymbol, + getNamespaceDeclarationNode: () => getNamespaceDeclarationNode, + getNewLineCharacter: () => getNewLineCharacter, + getNewLineKind: () => getNewLineKind, + getNewLineOrDefaultFromHost: () => getNewLineOrDefaultFromHost, + getNewTargetContainer: () => getNewTargetContainer, + getNextJSDocCommentLocation: () => getNextJSDocCommentLocation, + getNodeForGeneratedName: () => getNodeForGeneratedName, + getNodeId: () => getNodeId, + getNodeKind: () => getNodeKind, + getNodeModifiers: () => getNodeModifiers, + getNodeModulePathParts: () => getNodeModulePathParts, + getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, + getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment, + getNonAugmentationDeclaration: () => getNonAugmentationDeclaration, + getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode, + getNormalizedAbsolutePath: () => getNormalizedAbsolutePath, + getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot, + getNormalizedPathComponents: () => getNormalizedPathComponents, + getObjectFlags: () => getObjectFlags, + getOperator: () => getOperator, + getOperatorAssociativity: () => getOperatorAssociativity, + getOperatorPrecedence: () => getOperatorPrecedence, + getOptionFromName: () => getOptionFromName, + getOptionsForLibraryResolution: () => getOptionsForLibraryResolution, + getOptionsNameMap: () => getOptionsNameMap, + getOrCreateEmitNode: () => getOrCreateEmitNode, + getOrCreateExternalHelpersModuleNameIfNeeded: () => getOrCreateExternalHelpersModuleNameIfNeeded, + getOrUpdate: () => getOrUpdate, + getOriginalNode: () => getOriginalNode, + getOriginalNodeId: () => getOriginalNodeId, + getOriginalSourceFile: () => getOriginalSourceFile, + getOutputDeclarationFileName: () => getOutputDeclarationFileName, + getOutputDeclarationFileNameWorker: () => getOutputDeclarationFileNameWorker, + getOutputExtension: () => getOutputExtension, + getOutputFileNames: () => getOutputFileNames, + getOutputJSFileNameWorker: () => getOutputJSFileNameWorker, + getOutputPathsFor: () => getOutputPathsFor, + getOutputPathsForBundle: () => getOutputPathsForBundle, + getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath, + getOwnKeys: () => getOwnKeys, + getOwnValues: () => getOwnValues, + getPackageJsonInfo: () => getPackageJsonInfo, + getPackageJsonTypesVersionsPaths: () => getPackageJsonTypesVersionsPaths, + getPackageJsonsVisibleToFile: () => getPackageJsonsVisibleToFile, + getPackageNameFromTypesPackageName: () => getPackageNameFromTypesPackageName, + getPackageScopeForPath: () => getPackageScopeForPath, + getParameterSymbolFromJSDoc: () => getParameterSymbolFromJSDoc, + getParameterTypeNode: () => getParameterTypeNode, + getParentNodeInSpan: () => getParentNodeInSpan, + getParseTreeNode: () => getParseTreeNode, + getParsedCommandLineOfConfigFile: () => getParsedCommandLineOfConfigFile, + getPathComponents: () => getPathComponents, + getPathComponentsRelativeTo: () => getPathComponentsRelativeTo, + getPathFromPathComponents: () => getPathFromPathComponents, + getPathUpdater: () => getPathUpdater, + getPathsBasePath: () => getPathsBasePath, + getPatternFromSpec: () => getPatternFromSpec, + getPendingEmitKind: () => getPendingEmitKind, + getPositionOfLineAndCharacter: () => getPositionOfLineAndCharacter, + getPossibleGenericSignatures: () => getPossibleGenericSignatures, + getPossibleOriginalInputExtensionForExtension: () => getPossibleOriginalInputExtensionForExtension, + getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, + getPreEmitDiagnostics: () => getPreEmitDiagnostics, + getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, + getProperties: () => getProperties, + getProperty: () => getProperty, + getPropertyArrayElementValue: () => getPropertyArrayElementValue, + getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression, + getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode, + getPropertyNameForUniqueESSymbol: () => getPropertyNameForUniqueESSymbol, + getPropertyNameFromType: () => getPropertyNameFromType, + getPropertyNameOfBindingOrAssignmentElement: () => getPropertyNameOfBindingOrAssignmentElement, + getPropertySymbolFromBindingElement: () => getPropertySymbolFromBindingElement, + getPropertySymbolsFromContextualType: () => getPropertySymbolsFromContextualType, + getQuoteFromPreference: () => getQuoteFromPreference, + getQuotePreference: () => getQuotePreference, + getRangesWhere: () => getRangesWhere, + getRefactorContextSpan: () => getRefactorContextSpan, + getReferencedFileLocation: () => getReferencedFileLocation, + getRegexFromPattern: () => getRegexFromPattern, + getRegularExpressionForWildcard: () => getRegularExpressionForWildcard, + getRegularExpressionsForWildcards: () => getRegularExpressionsForWildcards, + getRelativePathFromDirectory: () => getRelativePathFromDirectory, + getRelativePathFromFile: () => getRelativePathFromFile, + getRelativePathToDirectoryOrUrl: () => getRelativePathToDirectoryOrUrl, + getRenameLocation: () => getRenameLocation, + getReplacementSpanForContextToken: () => getReplacementSpanForContextToken, + getResolutionDiagnostic: () => getResolutionDiagnostic, + getResolutionModeOverride: () => getResolutionModeOverride, + getResolveJsonModule: () => getResolveJsonModule, + getResolvePackageJsonExports: () => getResolvePackageJsonExports, + getResolvePackageJsonImports: () => getResolvePackageJsonImports, + getResolvedExternalModuleName: () => getResolvedExternalModuleName, + getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement, + getRestParameterElementType: () => getRestParameterElementType, + getRightMostAssignedExpression: () => getRightMostAssignedExpression, + getRootDeclaration: () => getRootDeclaration, + getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache, + getRootLength: () => getRootLength, + getRootPathSplitLength: () => getRootPathSplitLength, + getScriptKind: () => getScriptKind, + getScriptKindFromFileName: () => getScriptKindFromFileName, + getScriptTargetFeatures: () => getScriptTargetFeatures, + getSelectedEffectiveModifierFlags: () => getSelectedEffectiveModifierFlags, + getSelectedSyntacticModifierFlags: () => getSelectedSyntacticModifierFlags, + getSemanticClassifications: () => getSemanticClassifications, + getSemanticJsxChildren: () => getSemanticJsxChildren, + getSetAccessorTypeAnnotationNode: () => getSetAccessorTypeAnnotationNode, + getSetAccessorValueParameter: () => getSetAccessorValueParameter, + getSetExternalModuleIndicator: () => getSetExternalModuleIndicator, + getShebang: () => getShebang, + getSingleInitializerOfVariableStatementOrPropertyDeclaration: () => getSingleInitializerOfVariableStatementOrPropertyDeclaration, + getSingleVariableOfVariableStatement: () => getSingleVariableOfVariableStatement, + getSnapshotText: () => getSnapshotText, + getSnippetElement: () => getSnippetElement, + getSourceFileOfModule: () => getSourceFileOfModule, + getSourceFileOfNode: () => getSourceFileOfNode, + getSourceFilePathInNewDir: () => getSourceFilePathInNewDir, + getSourceFilePathInNewDirWorker: () => getSourceFilePathInNewDirWorker, + getSourceFileVersionAsHashFromText: () => getSourceFileVersionAsHashFromText, + getSourceFilesToEmit: () => getSourceFilesToEmit, + getSourceMapRange: () => getSourceMapRange, + getSourceMapper: () => getSourceMapper, + getSourceTextOfNodeFromSourceFile: () => getSourceTextOfNodeFromSourceFile, + getSpanOfTokenAtPosition: () => getSpanOfTokenAtPosition, + getSpellingSuggestion: () => getSpellingSuggestion, + getStartPositionOfLine: () => getStartPositionOfLine, + getStartPositionOfRange: () => getStartPositionOfRange, + getStartsOnNewLine: () => getStartsOnNewLine, + getStaticPropertiesAndClassStaticBlock: () => getStaticPropertiesAndClassStaticBlock, + getStrictOptionValue: () => getStrictOptionValue, + getStringComparer: () => getStringComparer, + getSubPatternFromSpec: () => getSubPatternFromSpec, + getSuperCallFromStatement: () => getSuperCallFromStatement, + getSuperContainer: () => getSuperContainer, + getSupportedCodeFixes: () => getSupportedCodeFixes, + getSupportedExtensions: () => getSupportedExtensions, getSupportedExtensionsWithJsonIfResolveJsonModule: () => getSupportedExtensionsWithJsonIfResolveJsonModule, getSwitchedType: () => getSwitchedType, getSymbolId: () => getSymbolId, @@ -440208,6 +460105,7 @@ ${options.prefix}` : "\n" : options.prefix hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName, hasQuestionToken: () => hasQuestionToken, hasRecordedExternalHelpers: () => hasRecordedExternalHelpers, + hasResolutionModeOverride: () => hasResolutionModeOverride, hasRestParameter: () => hasRestParameter, hasScopeMarker: () => hasScopeMarker, hasStaticModifier: () => hasStaticModifier, @@ -440237,6 +460135,8 @@ ${options.prefix}` : "\n" : options.prefix indexOfNode: () => indexOfNode, indicesOf: () => indicesOf, inferredTypesContainingFile: () => inferredTypesContainingFile, + injectClassNamedEvaluationHelperBlockIfMissing: () => injectClassNamedEvaluationHelperBlockIfMissing, + injectClassThisAssignmentIfMissing: () => injectClassThisAssignmentIfMissing, insertImports: () => insertImports, insertLeadingStatement: () => insertLeadingStatement, insertSorted: () => insertSorted, @@ -440279,7 +460179,6 @@ ${options.prefix}` : "\n" : options.prefix isAssertClause: () => isAssertClause, isAssertEntry: () => isAssertEntry, isAssertionExpression: () => isAssertionExpression, - isAssertionKey: () => isAssertionKey, isAssertsKeyword: () => isAssertsKeyword, isAssignmentDeclaration: () => isAssignmentDeclaration, isAssignmentExpression: () => isAssignmentExpression, @@ -440320,6 +460219,7 @@ ${options.prefix}` : "\n" : options.prefix isCallExpression: () => isCallExpression, isCallExpressionTarget: () => isCallExpressionTarget, isCallLikeExpression: () => isCallLikeExpression, + isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression, isCallOrNewExpression: () => isCallOrNewExpression, isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget, isCallSignatureDeclaration: () => isCallSignatureDeclaration, @@ -440337,10 +460237,13 @@ ${options.prefix}` : "\n" : options.prefix isClassDeclaration: () => isClassDeclaration, isClassElement: () => isClassElement, isClassExpression: () => isClassExpression, + isClassInstanceProperty: () => isClassInstanceProperty, isClassLike: () => isClassLike, isClassMemberModifier: () => isClassMemberModifier, + isClassNamedEvaluationHelperBlock: () => isClassNamedEvaluationHelperBlock, isClassOrTypeElement: () => isClassOrTypeElement, isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, + isClassThisAssignmentBlock: () => isClassThisAssignmentBlock, isCollapsedRange: () => isCollapsedRange, isColonToken: () => isColonToken, isCommaExpression: () => isCommaExpression, @@ -440386,6 +460289,7 @@ ${options.prefix}` : "\n" : options.prefix isDiagnosticWithLocation: () => isDiagnosticWithLocation, isDiskPathRoot: () => isDiskPathRoot, isDoStatement: () => isDoStatement, + isDocumentRegistryEntry: () => isDocumentRegistryEntry, isDotDotDotToken: () => isDotDotDotToken, isDottedName: () => isDottedName, isDynamicName: () => isDynamicName, @@ -440412,6 +460316,7 @@ ${options.prefix}` : "\n" : options.prefix isExclamationToken: () => isExclamationToken, isExcludedFile: () => isExcludedFile, isExclusivelyTypeOnlyImportOrExport: () => isExclusivelyTypeOnlyImportOrExport, + isExpandoPropertyDeclaration: () => isExpandoPropertyDeclaration, isExportAssignment: () => isExportAssignment, isExportDeclaration: () => isExportDeclaration, isExportModifier: () => isExportModifier, @@ -440436,6 +460341,7 @@ ${options.prefix}` : "\n" : options.prefix isExternalModuleReference: () => isExternalModuleReference, isExternalModuleSymbol: () => isExternalModuleSymbol, isExternalOrCommonJsModule: () => isExternalOrCommonJsModule, + isFileLevelReservedGeneratedIdentifier: () => isFileLevelReservedGeneratedIdentifier, isFileLevelUniqueName: () => isFileLevelUniqueName, isFileProbablyExternalModule: () => isFileProbablyExternalModule, isFirstDeclarationOfSymbolParameter: () => isFirstDeclarationOfSymbolParameter, @@ -440482,6 +460388,9 @@ ${options.prefix}` : "\n" : options.prefix isIfStatement: () => isIfStatement, isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching, isImplicitGlob: () => isImplicitGlob, + isImportAttribute: () => isImportAttribute, + isImportAttributeName: () => isImportAttributeName, + isImportAttributes: () => isImportAttributes, isImportCall: () => isImportCall, isImportClause: () => isImportClause, isImportDeclaration: () => isImportDeclaration, @@ -440495,6 +460404,7 @@ ${options.prefix}` : "\n" : options.prefix isImportTypeNode: () => isImportTypeNode, isImportableFile: () => isImportableFile, isInComment: () => isInComment, + isInCompoundLikeAssignment: () => isInCompoundLikeAssignment, isInExpressionContext: () => isInExpressionContext, isInJSDoc: () => isInJSDoc, isInJSFile: () => isInJSFile, @@ -440506,6 +460416,7 @@ ${options.prefix}` : "\n" : options.prefix isInString: () => isInString, isInTemplateString: () => isInTemplateString, isInTopLevelContext: () => isInTopLevelContext, + isInTypeQuery: () => isInTypeQuery, isIncrementalCompilation: () => isIncrementalCompilation, isIndexSignatureDeclaration: () => isIndexSignatureDeclaration, isIndexedAccessTypeNode: () => isIndexedAccessTypeNode, @@ -440517,6 +460428,7 @@ ${options.prefix}` : "\n" : options.prefix isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, isInsideNodeModules: () => isInsideNodeModules, isInsideTemplateLiteral: () => isInsideTemplateLiteral, + isInstanceOfExpression: () => isInstanceOfExpression, isInstantiatedModule: () => isInstantiatedModule, isInterfaceDeclaration: () => isInterfaceDeclaration, isInternalDeclaration: () => isInternalDeclaration, @@ -440638,6 +460550,7 @@ ${options.prefix}` : "\n" : options.prefix isMethodSignature: () => isMethodSignature, isMinusToken: () => isMinusToken, isMissingDeclaration: () => isMissingDeclaration, + isMissingPackageJsonInfo: () => isMissingPackageJsonInfo, isModifier: () => isModifier, isModifierKind: () => isModifierKind, isModifierLike: () => isModifierLike, @@ -440671,7 +460584,6 @@ ${options.prefix}` : "\n" : options.prefix isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration, isNewExpression: () => isNewExpression, isNewExpressionTarget: () => isNewExpressionTarget, - isNightly: () => isNightly, isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral, isNode: () => isNode, isNodeArray: () => isNodeArray, @@ -440715,10 +460627,10 @@ ${options.prefix}` : "\n" : options.prefix isOuterExpression: () => isOuterExpression, isOutermostOptionalChain: () => isOutermostOptionalChain, isOverrideModifier: () => isOverrideModifier, + isPackageJsonInfo: () => isPackageJsonInfo, isPackedArrayLiteral: () => isPackedArrayLiteral, isParameter: () => isParameter, isParameterDeclaration: () => isParameterDeclaration, - isParameterOrCatchClauseVariable: () => isParameterOrCatchClauseVariable, isParameterPropertyDeclaration: () => isParameterPropertyDeclaration, isParameterPropertyModifier: () => isParameterPropertyModifier, isParenthesizedExpression: () => isParenthesizedExpression, @@ -440775,6 +460687,7 @@ ${options.prefix}` : "\n" : options.prefix isReturnStatement: () => isReturnStatement, isReturnStatementWithFixablePromiseHandler: () => isReturnStatementWithFixablePromiseHandler, isRightSideOfAccessExpression: () => isRightSideOfAccessExpression, + isRightSideOfInstanceofExpression: () => isRightSideOfInstanceofExpression, isRightSideOfPropertyAccess: () => isRightSideOfPropertyAccess, isRightSideOfQualifiedName: () => isRightSideOfQualifiedName, isRightSideOfQualifiedNameOrPropertyAccess: () => isRightSideOfQualifiedNameOrPropertyAccess, @@ -440787,11 +460700,14 @@ ${options.prefix}` : "\n" : options.prefix isSetAccessor: () => isSetAccessor, isSetAccessorDeclaration: () => isSetAccessorDeclaration, isShebangTrivia: () => isShebangTrivia, + isShiftOperatorOrHigher: () => isShiftOperatorOrHigher, isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol, isShorthandPropertyAssignment: () => isShorthandPropertyAssignment, isSignedNumericLiteral: () => isSignedNumericLiteral, isSimpleCopiableExpression: () => isSimpleCopiableExpression, isSimpleInlineableExpression: () => isSimpleInlineableExpression, + isSimpleParameter: () => isSimpleParameter, + isSimpleParameterList: () => isSimpleParameterList, isSingleOrDoubleQuote: () => isSingleOrDoubleQuote, isSourceFile: () => isSourceFile, isSourceFileFromLibrary: () => isSourceFileFromLibrary, @@ -440883,6 +460799,7 @@ ${options.prefix}` : "\n" : options.prefix isTypeQueryNode: () => isTypeQueryNode, isTypeReferenceNode: () => isTypeReferenceNode, isTypeReferenceType: () => isTypeReferenceType, + isTypeUsableAsPropertyName: () => isTypeUsableAsPropertyName, isUMDExportSymbol: () => isUMDExportSymbol, isUnaryExpression: () => isUnaryExpression, isUnaryExpressionWithWrite: () => isUnaryExpressionWithWrite, @@ -440897,7 +460814,9 @@ ${options.prefix}` : "\n" : options.prefix isValidESSymbolDeclaration: () => isValidESSymbolDeclaration, isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite, isValueSignatureDeclaration: () => isValueSignatureDeclaration, + isVarAwaitUsing: () => isVarAwaitUsing, isVarConst: () => isVarConst, + isVarUsing: () => isVarUsing, isVariableDeclaration: () => isVariableDeclaration, isVariableDeclarationInVariableStatement: () => isVariableDeclarationInVariableStatement, isVariableDeclarationInitializedToBareOrAccessedRequire: () => isVariableDeclarationInitializedToBareOrAccessedRequire, @@ -441022,8 +460941,6 @@ ${options.prefix}` : "\n" : options.prefix outFile: () => outFile, packageIdToPackageName: () => packageIdToPackageName, packageIdToString: () => packageIdToString, - padLeft: () => padLeft, - padRight: () => padRight, paramHelper: () => paramHelper, parameterIsThisKeyword: () => parameterIsThisKeyword, parameterNamePart: () => parameterNamePart, @@ -441097,7 +461014,6 @@ ${options.prefix}` : "\n" : options.prefix readJson: () => readJson, readJsonConfigFile: () => readJsonConfigFile, readJsonOrUndefined: () => readJsonOrUndefined, - realizeDiagnostics: () => realizeDiagnostics, reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange, reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange, reduceLeft: () => reduceLeft, @@ -441118,6 +461034,7 @@ ${options.prefix}` : "\n" : options.prefix removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator, repeatString: () => repeatString, replaceElement: () => replaceElement, + replaceFirstStar: () => replaceFirstStar, resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson, resolveConfigFileProjectName: () => resolveConfigFileProjectName, resolveJSModule: () => resolveJSModule, @@ -441146,7 +461063,7 @@ ${options.prefix}` : "\n" : options.prefix screenStartingMessageCodes: () => screenStartingMessageCodes, semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, serializeCompilerOptions: () => serializeCompilerOptions, - server: () => ts_server_exports, + server: () => ts_server_exports4, servicesVersion: () => servicesVersion, setCommentRange: () => setCommentRange, setConfigFileInOptions: () => setConfigFileInOptions, @@ -441167,8 +461084,6 @@ ${options.prefix}` : "\n" : options.prefix setParent: () => setParent, setParentRecursive: () => setParentRecursive, setPrivateIdentifier: () => setPrivateIdentifier, - setResolvedModule: () => setResolvedModule, - setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective, setSnippetElement: () => setSnippetElement, setSourceMapRange: () => setSourceMapRange, setStackTraceLimit: () => setStackTraceLimit, @@ -441188,7 +461103,6 @@ ${options.prefix}` : "\n" : options.prefix setValueDeclaration: () => setValueDeclaration, shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, shouldPreserveConstEnums: () => shouldPreserveConstEnums, - shouldResolveJsRequire: () => shouldResolveJsRequire, shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, showModuleSpecifier: () => showModuleSpecifier, signatureHasLiteralTypes: () => signatureHasLiteralTypes, @@ -441230,7 +461144,6 @@ ${options.prefix}` : "\n" : options.prefix startsWithDirectory: () => startsWithDirectory, startsWithUnderscore: () => startsWithUnderscore, startsWithUseStrict: () => startsWithUseStrict, - stringContains: () => stringContains, stringContainsAt: () => stringContainsAt, stringToToken: () => stringToToken, stripQuotes: () => stripQuotes, @@ -441309,6 +461222,7 @@ ${options.prefix}` : "\n" : options.prefix transformJsx: () => transformJsx, transformLegacyDecorators: () => transformLegacyDecorators, transformModule: () => transformModule, + transformNamedEvaluation: () => transformNamedEvaluation, transformNodeModule: () => transformNodeModule, transformNodes: () => transformNodes, transformSystemModule: () => transformSystemModule, @@ -441316,9 +461230,6 @@ ${options.prefix}` : "\n" : options.prefix transpile: () => transpile, transpileModule: () => transpileModule, transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions, - trimString: () => trimString, - trimStringEnd: () => trimStringEnd, - trimStringStart: () => trimStringStart, tryAddToSet: () => tryAddToSet, tryAndIgnoreErrors: () => tryAndIgnoreErrors, tryCast: () => tryCast, @@ -441339,6 +461250,7 @@ ${options.prefix}` : "\n" : options.prefix tryGetSourceMappingURL: () => tryGetSourceMappingURL, tryGetTextOfPropertyName: () => tryGetTextOfPropertyName, tryIOAndConsumeErrors: () => tryIOAndConsumeErrors, + tryParseJson: () => tryParseJson, tryParsePattern: () => tryParsePattern, tryParsePatterns: () => tryParsePatterns, tryParseRawSourceMap: () => tryParseRawSourceMap, @@ -441353,7 +461265,6 @@ ${options.prefix}` : "\n" : options.prefix typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, typeKeywords: () => typeKeywords, typeParameterNamePart: () => typeParameterNamePart, - typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter, typeToDisplayParts: () => typeToDisplayParts, unchangedPollThresholds: () => unchangedPollThresholds, unchangedTextChangeRange: () => unchangedTextChangeRange, @@ -441367,7 +461278,6 @@ ${options.prefix}` : "\n" : options.prefix updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, - updatePackageJsonWatch: () => updatePackageJsonWatch, updateResolutionField: () => updateResolutionField, updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, updateSourceFile: () => updateSourceFile, @@ -441398,48 +461308,21993 @@ ${options.prefix}` : "\n" : options.prefix writeCommentRange: () => writeCommentRange, writeFile: () => writeFile, writeFileEnsuringDirectories: () => writeFileEnsuringDirectories, - zipToModeAwareCache: () => zipToModeAwareCache, zipWith: () => zipWith }); - var init_ts6 = __esm({ + var init_ts8 = __esm({ "src/typescript/_namespaces/ts.ts"() { "use strict"; init_ts2(); init_ts3(); init_ts4(); - init_ts5(); + init_ts7(); + init_ts_server4(); + } + }); + + // src/typescript/typescript.ts + var require_typescript = __commonJS({ + "src/typescript/typescript.ts"(exports, module2) { + init_ts8(); + init_ts8(); + if (typeof console !== "undefined") { + Debug.loggingHost = { + log(level, s) { + switch (level) { + case 1 /* Error */: + return console.error(s); + case 2 /* Warning */: + return console.warn(s); + case 3 /* Info */: + return console.log(s); + case 4 /* Verbose */: + return console.log(s); + } + } + }; + } + module2.exports = ts_exports3; + } + }); + return require_typescript(); +})(); + +if ( true && module.exports) { module.exports = ts; } +//# sourceMappingURL=typescript.js.map + + +/***/ }), + +/***/ 41773: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Client = __nccwpck_require__(33598) +const Dispatcher = __nccwpck_require__(60412) +const errors = __nccwpck_require__(48045) +const Pool = __nccwpck_require__(4634) +const BalancedPool = __nccwpck_require__(37931) +const Agent = __nccwpck_require__(7890) +const util = __nccwpck_require__(83983) +const { InvalidArgumentError } = errors +const api = __nccwpck_require__(44059) +const buildConnector = __nccwpck_require__(82067) +const MockClient = __nccwpck_require__(58687) +const MockAgent = __nccwpck_require__(66771) +const MockPool = __nccwpck_require__(26193) +const mockErrors = __nccwpck_require__(50888) +const ProxyAgent = __nccwpck_require__(97858) +const RetryHandler = __nccwpck_require__(82286) +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(21892) +const DecoratorHandler = __nccwpck_require__(46930) +const RedirectHandler = __nccwpck_require__(72860) +const createRedirectInterceptor = __nccwpck_require__(38861) + +let hasCrypto +try { + __nccwpck_require__(6113) + hasCrypto = true +} catch { + hasCrypto = false +} + +Object.assign(Dispatcher.prototype, api) + +module.exports.Dispatcher = Dispatcher +module.exports.Client = Client +module.exports.Pool = Pool +module.exports.BalancedPool = BalancedPool +module.exports.Agent = Agent +module.exports.ProxyAgent = ProxyAgent +module.exports.RetryHandler = RetryHandler + +module.exports.DecoratorHandler = DecoratorHandler +module.exports.RedirectHandler = RedirectHandler +module.exports.createRedirectInterceptor = createRedirectInterceptor + +module.exports.buildConnector = buildConnector +module.exports.errors = errors + +function makeDispatcher (fn) { + return (url, opts, handler) => { + if (typeof opts === 'function') { + handler = opts + opts = null + } + + if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) { + throw new InvalidArgumentError('invalid url') + } + + if (opts != null && typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (opts && opts.path != null) { + if (typeof opts.path !== 'string') { + throw new InvalidArgumentError('invalid opts.path') + } + + let path = opts.path + if (!opts.path.startsWith('/')) { + path = `/${path}` + } + + url = new URL(util.parseOrigin(url).origin + path) + } else { + if (!opts) { + opts = typeof url === 'object' ? url : {} + } + + url = util.parseURL(url) + } + + const { agent, dispatcher = getGlobalDispatcher() } = opts + + if (agent) { + throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?') + } + + return fn.call(dispatcher, { + ...opts, + origin: url.origin, + path: url.search ? `${url.pathname}${url.search}` : url.pathname, + method: opts.method || (opts.body ? 'PUT' : 'GET') + }, handler) + } +} + +module.exports.setGlobalDispatcher = setGlobalDispatcher +module.exports.getGlobalDispatcher = getGlobalDispatcher + +if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) { + let fetchImpl = null + module.exports.fetch = async function fetch (resource) { + if (!fetchImpl) { + fetchImpl = (__nccwpck_require__(74881).fetch) + } + + try { + return await fetchImpl(...arguments) + } catch (err) { + if (typeof err === 'object') { + Error.captureStackTrace(err, this) + } + + throw err + } + } + module.exports.Headers = __nccwpck_require__(10554).Headers + module.exports.Response = __nccwpck_require__(27823).Response + module.exports.Request = __nccwpck_require__(48359).Request + module.exports.FormData = __nccwpck_require__(72015).FormData + module.exports.File = __nccwpck_require__(78511).File + module.exports.FileReader = __nccwpck_require__(1446).FileReader + + const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(71246) + + module.exports.setGlobalOrigin = setGlobalOrigin + module.exports.getGlobalOrigin = getGlobalOrigin + + const { CacheStorage } = __nccwpck_require__(37907) + const { kConstruct } = __nccwpck_require__(29174) + + // Cache & CacheStorage are tightly coupled with fetch. Even if it may run + // in an older version of Node, it doesn't have any use without fetch. + module.exports.caches = new CacheStorage(kConstruct) +} + +if (util.nodeMajor >= 16) { + const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(41724) + + module.exports.deleteCookie = deleteCookie + module.exports.getCookies = getCookies + module.exports.getSetCookies = getSetCookies + module.exports.setCookie = setCookie + + const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685) + + module.exports.parseMIMEType = parseMIMEType + module.exports.serializeAMimeType = serializeAMimeType +} + +if (util.nodeMajor >= 18 && hasCrypto) { + const { WebSocket } = __nccwpck_require__(54284) + + module.exports.WebSocket = WebSocket +} + +module.exports.request = makeDispatcher(api.request) +module.exports.stream = makeDispatcher(api.stream) +module.exports.pipeline = makeDispatcher(api.pipeline) +module.exports.connect = makeDispatcher(api.connect) +module.exports.upgrade = makeDispatcher(api.upgrade) + +module.exports.MockClient = MockClient +module.exports.MockPool = MockPool +module.exports.MockAgent = MockAgent +module.exports.mockErrors = mockErrors + + +/***/ }), + +/***/ 7890: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { InvalidArgumentError } = __nccwpck_require__(48045) +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(72785) +const DispatcherBase = __nccwpck_require__(74839) +const Pool = __nccwpck_require__(4634) +const Client = __nccwpck_require__(33598) +const util = __nccwpck_require__(83983) +const createRedirectInterceptor = __nccwpck_require__(38861) +const { WeakRef, FinalizationRegistry } = __nccwpck_require__(56436)() + +const kOnConnect = Symbol('onConnect') +const kOnDisconnect = Symbol('onDisconnect') +const kOnConnectionError = Symbol('onConnectionError') +const kMaxRedirections = Symbol('maxRedirections') +const kOnDrain = Symbol('onDrain') +const kFactory = Symbol('factory') +const kFinalizer = Symbol('finalizer') +const kOptions = Symbol('options') + +function defaultFactory (origin, opts) { + return opts && opts.connections === 1 + ? new Client(origin, opts) + : new Pool(origin, opts) +} + +class Agent extends DispatcherBase { + constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { + super() + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } + + if (connect && typeof connect !== 'function') { + connect = { ...connect } + } + + this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent) + ? options.interceptors.Agent + : [createRedirectInterceptor({ maxRedirections })] + + this[kOptions] = { ...util.deepClone(options), connect } + this[kOptions].interceptors = options.interceptors + ? { ...options.interceptors } + : undefined + this[kMaxRedirections] = maxRedirections + this[kFactory] = factory + this[kClients] = new Map() + this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => { + const ref = this[kClients].get(key) + if (ref !== undefined && ref.deref() === undefined) { + this[kClients].delete(key) + } + }) + + const agent = this + + this[kOnDrain] = (origin, targets) => { + agent.emit('drain', origin, [agent, ...targets]) + } + + this[kOnConnect] = (origin, targets) => { + agent.emit('connect', origin, [agent, ...targets]) + } + + this[kOnDisconnect] = (origin, targets, err) => { + agent.emit('disconnect', origin, [agent, ...targets], err) + } + + this[kOnConnectionError] = (origin, targets, err) => { + agent.emit('connectionError', origin, [agent, ...targets], err) + } + } + + get [kRunning] () { + let ret = 0 + for (const ref of this[kClients].values()) { + const client = ref.deref() + /* istanbul ignore next: gc is undeterministic */ + if (client) { + ret += client[kRunning] + } + } + return ret + } + + [kDispatch] (opts, handler) { + let key + if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) { + key = String(opts.origin) + } else { + throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.') + } + + const ref = this[kClients].get(key) + + let dispatcher = ref ? ref.deref() : null + if (!dispatcher) { + dispatcher = this[kFactory](opts.origin, this[kOptions]) + .on('drain', this[kOnDrain]) + .on('connect', this[kOnConnect]) + .on('disconnect', this[kOnDisconnect]) + .on('connectionError', this[kOnConnectionError]) + + this[kClients].set(key, new WeakRef(dispatcher)) + this[kFinalizer].register(dispatcher, key) + } + + return dispatcher.dispatch(opts, handler) + } + + async [kClose] () { + const closePromises = [] + for (const ref of this[kClients].values()) { + const client = ref.deref() + /* istanbul ignore else: gc is undeterministic */ + if (client) { + closePromises.push(client.close()) + } + } + + await Promise.all(closePromises) + } + + async [kDestroy] (err) { + const destroyPromises = [] + for (const ref of this[kClients].values()) { + const client = ref.deref() + /* istanbul ignore else: gc is undeterministic */ + if (client) { + destroyPromises.push(client.destroy(err)) + } + } + + await Promise.all(destroyPromises) + } +} + +module.exports = Agent + + +/***/ }), + +/***/ 7032: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const { addAbortListener } = __nccwpck_require__(83983) +const { RequestAbortedError } = __nccwpck_require__(48045) + +const kListener = Symbol('kListener') +const kSignal = Symbol('kSignal') + +function abort (self) { + if (self.abort) { + self.abort() + } else { + self.onError(new RequestAbortedError()) + } +} + +function addSignal (self, signal) { + self[kSignal] = null + self[kListener] = null + + if (!signal) { + return + } + + if (signal.aborted) { + abort(self) + return + } + + self[kSignal] = signal + self[kListener] = () => { + abort(self) + } + + addAbortListener(self[kSignal], self[kListener]) +} + +function removeSignal (self) { + if (!self[kSignal]) { + return + } + + if ('removeEventListener' in self[kSignal]) { + self[kSignal].removeEventListener('abort', self[kListener]) + } else { + self[kSignal].removeListener('abort', self[kListener]) + } + + self[kSignal] = null + self[kListener] = null +} + +module.exports = { + addSignal, + removeSignal +} + + +/***/ }), + +/***/ 29744: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { AsyncResource } = __nccwpck_require__(50852) +const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { addSignal, removeSignal } = __nccwpck_require__(7032) + +class ConnectHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + const { signal, opaque, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + super('UNDICI_CONNECT') + + this.opaque = opaque || null + this.responseHeaders = responseHeaders || null + this.callback = callback + this.abort = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = context + } + + onHeaders () { + throw new SocketError('bad connect', null) + } + + onUpgrade (statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this + + removeSignal(this) + + this.callback = null + + let headers = rawHeaders + // Indicates is an HTTP2Session + if (headers != null) { + headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + } + + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + socket, + opaque, + context + }) + } + + onError (err) { + const { callback, opaque } = this + + removeSignal(this) + + if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + } +} + +function connect (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + connect.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + const connectHandler = new ConnectHandler(opts, callback) + this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = connect + + +/***/ }), + +/***/ 28752: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + Readable, + Duplex, + PassThrough +} = __nccwpck_require__(12781) +const { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError +} = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { AsyncResource } = __nccwpck_require__(50852) +const { addSignal, removeSignal } = __nccwpck_require__(7032) +const assert = __nccwpck_require__(39491) + +const kResume = Symbol('resume') + +class PipelineRequest extends Readable { + constructor () { + super({ autoDestroy: true }) + + this[kResume] = null + } + + _read () { + const { [kResume]: resume } = this + + if (resume) { + this[kResume] = null + resume() + } + } + + _destroy (err, callback) { + this._read() + + callback(err) + } +} + +class PipelineResponse extends Readable { + constructor (resume) { + super({ autoDestroy: true }) + this[kResume] = resume + } + + _read () { + this[kResume]() + } + + _destroy (err, callback) { + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError() + } + + callback(err) + } +} + +class PipelineHandler extends AsyncResource { + constructor (opts, handler) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof handler !== 'function') { + throw new InvalidArgumentError('invalid handler') + } + + const { signal, method, opaque, onInfo, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_PIPELINE') + + this.opaque = opaque || null + this.responseHeaders = responseHeaders || null + this.handler = handler + this.abort = null + this.context = null + this.onInfo = onInfo || null + + this.req = new PipelineRequest().on('error', util.nop) + + this.ret = new Duplex({ + readableObjectMode: opts.objectMode, + autoDestroy: true, + read: () => { + const { body } = this + + if (body && body.resume) { + body.resume() + } + }, + write: (chunk, encoding, callback) => { + const { req } = this + + if (req.push(chunk, encoding) || req._readableState.destroyed) { + callback() + } else { + req[kResume] = callback + } + }, + destroy: (err, callback) => { + const { body, req, res, ret, abort } = this + + if (!err && !ret._readableState.endEmitted) { + err = new RequestAbortedError() + } + + if (abort && err) { + abort() + } + + util.destroy(body, err) + util.destroy(req, err) + util.destroy(res, err) + + removeSignal(this) + + callback(err) + } + }).on('prefinish', () => { + const { req } = this + + // Node < 15 does not call _final in same tick. + req.push(null) + }) + + this.res = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + const { ret, res } = this + + assert(!res, 'pipeline cannot be retried') + + if (ret.destroyed) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume) { + const { opaque, handler, context } = this + + if (statusCode < 200) { + if (this.onInfo) { + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + this.onInfo({ statusCode, headers }) + } + return + } + + this.res = new PipelineResponse(resume) + + let body + try { + this.handler = null + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + body = this.runInAsyncScope(handler, null, { + statusCode, + headers, + opaque, + body: this.res, + context + }) + } catch (err) { + this.res.on('error', util.nop) + throw err + } + + if (!body || typeof body.on !== 'function') { + throw new InvalidReturnValueError('expected Readable') + } + + body + .on('data', (chunk) => { + const { ret, body } = this + + if (!ret.push(chunk) && body.pause) { + body.pause() + } + }) + .on('error', (err) => { + const { ret } = this + + util.destroy(ret, err) + }) + .on('end', () => { + const { ret } = this + + ret.push(null) + }) + .on('close', () => { + const { ret } = this + + if (!ret._readableState.ended) { + util.destroy(ret, new RequestAbortedError()) + } + }) + + this.body = body + } + + onData (chunk) { + const { res } = this + return res.push(chunk) + } + + onComplete (trailers) { + const { res } = this + res.push(null) + } + + onError (err) { + const { ret } = this + this.handler = null + util.destroy(ret, err) + } +} + +function pipeline (opts, handler) { + try { + const pipelineHandler = new PipelineHandler(opts, handler) + this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler) + return pipelineHandler.ret + } catch (err) { + return new PassThrough().destroy(err) + } +} + +module.exports = pipeline + + +/***/ }), + +/***/ 55448: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Readable = __nccwpck_require__(73858) +const { + InvalidArgumentError, + RequestAbortedError +} = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { getResolveErrorBodyCallback } = __nccwpck_require__(77474) +const { AsyncResource } = __nccwpck_require__(50852) +const { addSignal, removeSignal } = __nccwpck_require__(7032) + +class RequestHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts + + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { + throw new InvalidArgumentError('invalid highWaterMark') + } + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_REQUEST') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err + } + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.callback = callback + this.res = null + this.abort = null + this.body = body + this.trailers = {} + this.context = null + this.onInfo = onInfo || null + this.throwOnError = throwOnError + this.highWaterMark = highWaterMark + + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this + + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return + } + + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + const body = new Readable({ resume, abort, contentType, highWaterMark }) + + this.callback = null + this.res = body + if (callback !== null) { + if (this.throwOnError && statusCode >= 400) { + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body, contentType, statusCode, statusMessage, headers } + ) + } else { + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + trailers: this.trailers, + opaque, + body, + context + }) + } + } + } + + onData (chunk) { + const { res } = this + return res.push(chunk) + } + + onComplete (trailers) { + const { res } = this + + removeSignal(this) + + util.parseHeaders(trailers, this.trailers) + + res.push(null) + } + + onError (err) { + const { res, callback, body, opaque } = this + + removeSignal(this) + + if (callback) { + // TODO: Does this need queueMicrotask? + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + + if (res) { + this.res = null + // Ensure all queued handlers are invoked before destroying res. + queueMicrotask(() => { + util.destroy(res, err) + }) + } + + if (body) { + this.body = null + util.destroy(body, err) + } + } +} + +function request (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + request.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + this.dispatch(opts, new RequestHandler(opts, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = request +module.exports.RequestHandler = RequestHandler + + +/***/ }), + +/***/ 75395: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { finished, PassThrough } = __nccwpck_require__(12781) +const { + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError +} = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { getResolveErrorBodyCallback } = __nccwpck_require__(77474) +const { AsyncResource } = __nccwpck_require__(50852) +const { addSignal, removeSignal } = __nccwpck_require__(7032) + +class StreamHandler extends AsyncResource { + constructor (opts, factory, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts + + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('invalid factory') + } + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_STREAM') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err + } + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.factory = factory + this.callback = callback + this.res = null + this.abort = null + this.context = null + this.trailers = null + this.body = body + this.onInfo = onInfo || null + this.throwOnError = throwOnError || false + + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { factory, opaque, context, callback, responseHeaders } = this + + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return + } + + this.factory = null + + let res + + if (this.throwOnError && statusCode >= 400) { + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + res = new PassThrough() + + this.callback = null + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body: res, contentType, statusCode, statusMessage, headers } + ) + } else { + if (factory === null) { + return + } + + res = this.runInAsyncScope(factory, null, { + statusCode, + headers, + opaque, + context + }) + + if ( + !res || + typeof res.write !== 'function' || + typeof res.end !== 'function' || + typeof res.on !== 'function' + ) { + throw new InvalidReturnValueError('expected Writable') + } + + // TODO: Avoid finished. It registers an unnecessary amount of listeners. + finished(res, { readable: false }, (err) => { + const { callback, res, opaque, trailers, abort } = this + + this.res = null + if (err || !res.readable) { + util.destroy(res, err) + } + + this.callback = null + this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) + + if (err) { + abort() + } + }) + } + + res.on('drain', resume) + + this.res = res + + const needDrain = res.writableNeedDrain !== undefined + ? res.writableNeedDrain + : res._writableState && res._writableState.needDrain + + return needDrain !== true + } + + onData (chunk) { + const { res } = this + + return res ? res.write(chunk) : true + } + + onComplete (trailers) { + const { res } = this + + removeSignal(this) + + if (!res) { + return + } + + this.trailers = util.parseHeaders(trailers) + + res.end() + } + + onError (err) { + const { res, callback, opaque, body } = this + + removeSignal(this) + + this.factory = null + + if (res) { + this.res = null + util.destroy(res, err) + } else if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + + if (body) { + this.body = null + util.destroy(body, err) + } + } +} + +function stream (opts, factory, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + stream.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + this.dispatch(opts, new StreamHandler(opts, factory, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = stream + + +/***/ }), + +/***/ 36923: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(48045) +const { AsyncResource } = __nccwpck_require__(50852) +const util = __nccwpck_require__(83983) +const { addSignal, removeSignal } = __nccwpck_require__(7032) +const assert = __nccwpck_require__(39491) + +class UpgradeHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + const { signal, opaque, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + super('UNDICI_UPGRADE') + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.callback = callback + this.abort = null + this.context = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (!this.callback) { + throw new RequestAbortedError() + } + + this.abort = abort + this.context = null + } + + onHeaders () { + throw new SocketError('bad upgrade', null) + } + + onUpgrade (statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this + + assert.strictEqual(statusCode, 101) + + removeSignal(this) + + this.callback = null + const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + this.runInAsyncScope(callback, null, null, { + headers, + socket, + opaque, + context + }) + } + + onError (err) { + const { callback, opaque } = this + + removeSignal(this) + + if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + } +} + +function upgrade (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + upgrade.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + const upgradeHandler = new UpgradeHandler(opts, callback) + this.dispatch({ + ...opts, + method: opts.method || 'GET', + upgrade: opts.protocol || 'Websocket' + }, upgradeHandler) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts && opts.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = upgrade + + +/***/ }), + +/***/ 44059: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports.request = __nccwpck_require__(55448) +module.exports.stream = __nccwpck_require__(75395) +module.exports.pipeline = __nccwpck_require__(28752) +module.exports.upgrade = __nccwpck_require__(36923) +module.exports.connect = __nccwpck_require__(29744) + + +/***/ }), + +/***/ 73858: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// Ported from https://github.com/nodejs/undici/pull/907 + + + +const assert = __nccwpck_require__(39491) +const { Readable } = __nccwpck_require__(12781) +const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(83983) + +let Blob + +const kConsume = Symbol('kConsume') +const kReading = Symbol('kReading') +const kBody = Symbol('kBody') +const kAbort = Symbol('abort') +const kContentType = Symbol('kContentType') + +const noop = () => {} + +module.exports = class BodyReadable extends Readable { + constructor ({ + resume, + abort, + contentType = '', + highWaterMark = 64 * 1024 // Same as nodejs fs streams. + }) { + super({ + autoDestroy: true, + read: resume, + highWaterMark + }) + + this._readableState.dataEmitted = false + + this[kAbort] = abort + this[kConsume] = null + this[kBody] = null + this[kContentType] = contentType + + // Is stream being consumed through Readable API? + // This is an optimization so that we avoid checking + // for 'data' and 'readable' listeners in the hot path + // inside push(). + this[kReading] = false + } + + destroy (err) { + if (this.destroyed) { + // Node < 16 + return this + } + + if (!err && !this._readableState.endEmitted) { + err = new RequestAbortedError() + } + + if (err) { + this[kAbort]() + } + + return super.destroy(err) + } + + emit (ev, ...args) { + if (ev === 'data') { + // Node < 16.7 + this._readableState.dataEmitted = true + } else if (ev === 'error') { + // Node < 16 + this._readableState.errorEmitted = true + } + return super.emit(ev, ...args) + } + + on (ev, ...args) { + if (ev === 'data' || ev === 'readable') { + this[kReading] = true + } + return super.on(ev, ...args) + } + + addListener (ev, ...args) { + return this.on(ev, ...args) + } + + off (ev, ...args) { + const ret = super.off(ev, ...args) + if (ev === 'data' || ev === 'readable') { + this[kReading] = ( + this.listenerCount('data') > 0 || + this.listenerCount('readable') > 0 + ) + } + return ret + } + + removeListener (ev, ...args) { + return this.off(ev, ...args) + } + + push (chunk) { + if (this[kConsume] && chunk !== null && this.readableLength === 0) { + consumePush(this[kConsume], chunk) + return this[kReading] ? super.push(chunk) : true + } + return super.push(chunk) + } + + // https://fetch.spec.whatwg.org/#dom-body-text + async text () { + return consume(this, 'text') + } + + // https://fetch.spec.whatwg.org/#dom-body-json + async json () { + return consume(this, 'json') + } + + // https://fetch.spec.whatwg.org/#dom-body-blob + async blob () { + return consume(this, 'blob') + } + + // https://fetch.spec.whatwg.org/#dom-body-arraybuffer + async arrayBuffer () { + return consume(this, 'arrayBuffer') + } + + // https://fetch.spec.whatwg.org/#dom-body-formdata + async formData () { + // TODO: Implement. + throw new NotSupportedError() + } + + // https://fetch.spec.whatwg.org/#dom-body-bodyused + get bodyUsed () { + return util.isDisturbed(this) + } + + // https://fetch.spec.whatwg.org/#dom-body-body + get body () { + if (!this[kBody]) { + this[kBody] = ReadableStreamFrom(this) + if (this[kConsume]) { + // TODO: Is this the best way to force a lock? + this[kBody].getReader() // Ensure stream is locked. + assert(this[kBody].locked) + } + } + return this[kBody] + } + + dump (opts) { + let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144 + const signal = opts && opts.signal + + if (signal) { + try { + if (typeof signal !== 'object' || !('aborted' in signal)) { + throw new InvalidArgumentError('signal must be an AbortSignal') + } + util.throwIfAborted(signal) + } catch (err) { + return Promise.reject(err) + } + } + + if (this.closed) { + return Promise.resolve(null) + } + + return new Promise((resolve, reject) => { + const signalListenerCleanup = signal + ? util.addAbortListener(signal, () => { + this.destroy() + }) + : noop + + this + .on('close', function () { + signalListenerCleanup() + if (signal && signal.aborted) { + reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' })) + } else { + resolve(null) + } + }) + .on('error', noop) + .on('data', function (chunk) { + limit -= chunk.length + if (limit <= 0) { + this.destroy() + } + }) + .resume() + }) + } +} + +// https://streams.spec.whatwg.org/#readablestream-locked +function isLocked (self) { + // Consume is an implicit lock. + return (self[kBody] && self[kBody].locked === true) || self[kConsume] +} + +// https://fetch.spec.whatwg.org/#body-unusable +function isUnusable (self) { + return util.isDisturbed(self) || isLocked(self) +} + +async function consume (stream, type) { + if (isUnusable(stream)) { + throw new TypeError('unusable') + } + + assert(!stream[kConsume]) + + return new Promise((resolve, reject) => { + stream[kConsume] = { + type, + stream, + resolve, + reject, + length: 0, + body: [] + } + + stream + .on('error', function (err) { + consumeFinish(this[kConsume], err) + }) + .on('close', function () { + if (this[kConsume].body !== null) { + consumeFinish(this[kConsume], new RequestAbortedError()) + } + }) + + process.nextTick(consumeStart, stream[kConsume]) + }) +} + +function consumeStart (consume) { + if (consume.body === null) { + return + } + + const { _readableState: state } = consume.stream + + for (const chunk of state.buffer) { + consumePush(consume, chunk) + } + + if (state.endEmitted) { + consumeEnd(this[kConsume]) + } else { + consume.stream.on('end', function () { + consumeEnd(this[kConsume]) + }) + } + + consume.stream.resume() + + while (consume.stream.read() != null) { + // Loop + } +} + +function consumeEnd (consume) { + const { type, body, resolve, stream, length } = consume + + try { + if (type === 'text') { + resolve(toUSVString(Buffer.concat(body))) + } else if (type === 'json') { + resolve(JSON.parse(Buffer.concat(body))) + } else if (type === 'arrayBuffer') { + const dst = new Uint8Array(length) + + let pos = 0 + for (const buf of body) { + dst.set(buf, pos) + pos += buf.byteLength + } + + resolve(dst.buffer) + } else if (type === 'blob') { + if (!Blob) { + Blob = (__nccwpck_require__(14300).Blob) + } + resolve(new Blob(body, { type: stream[kContentType] })) + } + + consumeFinish(consume) + } catch (err) { + stream.destroy(err) + } +} + +function consumePush (consume, chunk) { + consume.length += chunk.length + consume.body.push(chunk) +} + +function consumeFinish (consume, err) { + if (consume.body === null) { + return + } + + if (err) { + consume.reject(err) + } else { + consume.resolve() + } + + consume.type = null + consume.stream = null + consume.resolve = null + consume.reject = null + consume.length = 0 + consume.body = null +} + + +/***/ }), + +/***/ 77474: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const assert = __nccwpck_require__(39491) +const { + ResponseStatusCodeError +} = __nccwpck_require__(48045) +const { toUSVString } = __nccwpck_require__(83983) + +async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { + assert(body) + + let chunks = [] + let limit = 0 + + for await (const chunk of body) { + chunks.push(chunk) + limit += chunk.length + if (limit > 128 * 1024) { + chunks = null + break + } + } + + if (statusCode === 204 || !contentType || !chunks) { + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) + return + } + + try { + if (contentType.startsWith('application/json')) { + const payload = JSON.parse(toUSVString(Buffer.concat(chunks))) + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) + return + } + + if (contentType.startsWith('text/')) { + const payload = toUSVString(Buffer.concat(chunks)) + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload)) + return + } + } catch (err) { + // Process in a fallback if error + } + + process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers)) +} + +module.exports = { getResolveErrorBodyCallback } + + +/***/ }), + +/***/ 37931: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + BalancedPoolMissingUpstreamError, + InvalidArgumentError +} = __nccwpck_require__(48045) +const { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher +} = __nccwpck_require__(73198) +const Pool = __nccwpck_require__(4634) +const { kUrl, kInterceptors } = __nccwpck_require__(72785) +const { parseOrigin } = __nccwpck_require__(83983) +const kFactory = Symbol('factory') + +const kOptions = Symbol('options') +const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor') +const kCurrentWeight = Symbol('kCurrentWeight') +const kIndex = Symbol('kIndex') +const kWeight = Symbol('kWeight') +const kMaxWeightPerServer = Symbol('kMaxWeightPerServer') +const kErrorPenalty = Symbol('kErrorPenalty') + +function getGreatestCommonDivisor (a, b) { + if (b === 0) return a + return getGreatestCommonDivisor(b, a % b) +} + +function defaultFactory (origin, opts) { + return new Pool(origin, opts) +} + +class BalancedPool extends PoolBase { + constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) { + super() + + this[kOptions] = opts + this[kIndex] = -1 + this[kCurrentWeight] = 0 + + this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100 + this[kErrorPenalty] = this[kOptions].errorPenalty || 15 + + if (!Array.isArray(upstreams)) { + upstreams = [upstreams] + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) + ? opts.interceptors.BalancedPool + : [] + this[kFactory] = factory + + for (const upstream of upstreams) { + this.addUpstream(upstream) + } + this._updateBalancedPoolStats() + } + + addUpstream (upstream) { + const upstreamOrigin = parseOrigin(upstream).origin + + if (this[kClients].find((pool) => ( + pool[kUrl].origin === upstreamOrigin && + pool.closed !== true && + pool.destroyed !== true + ))) { + return this + } + const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])) + + this[kAddClient](pool) + pool.on('connect', () => { + pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]) + }) + + pool.on('connectionError', () => { + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) + this._updateBalancedPoolStats() + }) + + pool.on('disconnect', (...args) => { + const err = args[2] + if (err && err.code === 'UND_ERR_SOCKET') { + // decrease the weight of the pool. + pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) + this._updateBalancedPoolStats() + } + }) + + for (const client of this[kClients]) { + client[kWeight] = this[kMaxWeightPerServer] + } + + this._updateBalancedPoolStats() + + return this + } + + _updateBalancedPoolStats () { + this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0) + } + + removeUpstream (upstream) { + const upstreamOrigin = parseOrigin(upstream).origin + + const pool = this[kClients].find((pool) => ( + pool[kUrl].origin === upstreamOrigin && + pool.closed !== true && + pool.destroyed !== true + )) + + if (pool) { + this[kRemoveClient](pool) + } + + return this + } + + get upstreams () { + return this[kClients] + .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true) + .map((p) => p[kUrl].origin) + } + + [kGetDispatcher] () { + // We validate that pools is greater than 0, + // otherwise we would have to wait until an upstream + // is added, which might never happen. + if (this[kClients].length === 0) { + throw new BalancedPoolMissingUpstreamError() + } + + const dispatcher = this[kClients].find(dispatcher => ( + !dispatcher[kNeedDrain] && + dispatcher.closed !== true && + dispatcher.destroyed !== true + )) + + if (!dispatcher) { + return + } + + const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true) + + if (allClientsBusy) { + return + } + + let counter = 0 + + let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain]) + + while (counter++ < this[kClients].length) { + this[kIndex] = (this[kIndex] + 1) % this[kClients].length + const pool = this[kClients][this[kIndex]] + + // find pool index with the largest weight + if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { + maxWeightIndex = this[kIndex] + } + + // decrease the current weight every `this[kClients].length`. + if (this[kIndex] === 0) { + // Set the current weight to the next lower weight. + this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor] + + if (this[kCurrentWeight] <= 0) { + this[kCurrentWeight] = this[kMaxWeightPerServer] + } + } + if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) { + return pool + } + } + + this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight] + this[kIndex] = maxWeightIndex + return this[kClients][maxWeightIndex] + } +} + +module.exports = BalancedPool + + +/***/ }), + +/***/ 66101: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kConstruct } = __nccwpck_require__(29174) +const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(82396) +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(83983) +const { kHeadersList } = __nccwpck_require__(72785) +const { webidl } = __nccwpck_require__(21744) +const { Response, cloneResponse } = __nccwpck_require__(27823) +const { Request } = __nccwpck_require__(48359) +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(15861) +const { fetching } = __nccwpck_require__(74881) +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(52538) +const assert = __nccwpck_require__(39491) +const { getGlobalDispatcher } = __nccwpck_require__(21892) + +/** + * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation + * @typedef {Object} CacheBatchOperation + * @property {'delete' | 'put'} type + * @property {any} request + * @property {any} response + * @property {import('../../types/cache').CacheQueryOptions} options + */ + +/** + * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list + * @typedef {[any, any][]} requestResponseList + */ + +class Cache { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list + * @type {requestResponseList} + */ + #relevantRequestResponseList + + constructor () { + if (arguments[0] !== kConstruct) { + webidl.illegalConstructor() + } + + this.#relevantRequestResponseList = arguments[1] + } + + async match (request, options = {}) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' }) + + request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) + + const p = await this.matchAll(request, options) + + if (p.length === 0) { + return + } + + return p[0] + } + + async matchAll (request = undefined, options = {}) { + webidl.brandCheck(this, Cache) + + if (request !== undefined) request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) + + // 1. + let r = null + + // 2. + if (request !== undefined) { + if (request instanceof Request) { + // 2.1.1 + r = request[kState] + + // 2.1.2 + if (r.method !== 'GET' && !options.ignoreMethod) { + return [] + } + } else if (typeof request === 'string') { + // 2.2.1 + r = new Request(request)[kState] + } + } + + // 5. + // 5.1 + const responses = [] + + // 5.2 + if (request === undefined) { + // 5.2.1 + for (const requestResponse of this.#relevantRequestResponseList) { + responses.push(requestResponse[1]) + } + } else { // 5.3 + // 5.3.1 + const requestResponses = this.#queryCache(r, options) + + // 5.3.2 + for (const requestResponse of requestResponses) { + responses.push(requestResponse[1]) + } + } + + // 5.4 + // We don't implement CORs so we don't need to loop over the responses, yay! + + // 5.5.1 + const responseList = [] + + // 5.5.2 + for (const response of responses) { + // 5.5.2.1 + const responseObject = new Response(response.body?.source ?? null) + const body = responseObject[kState].body + responseObject[kState] = response + responseObject[kState].body = body + responseObject[kHeaders][kHeadersList] = response.headersList + responseObject[kHeaders][kGuard] = 'immutable' + + responseList.push(responseObject) + } + + // 6. + return Object.freeze(responseList) + } + + async add (request) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' }) + + request = webidl.converters.RequestInfo(request) + + // 1. + const requests = [request] + + // 2. + const responseArrayPromise = this.addAll(requests) + + // 3. + return await responseArrayPromise + } + + async addAll (requests) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' }) + + requests = webidl.converters['sequence'](requests) + + // 1. + const responsePromises = [] + + // 2. + const requestList = [] + + // 3. + for (const request of requests) { + if (typeof request === 'string') { + continue + } + + // 3.1 + const r = request[kState] + + // 3.2 + if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') { + throw webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Expected http/s scheme when method is not GET.' + }) + } + } + + // 4. + /** @type {ReturnType[]} */ + const fetchControllers = [] + + // 5. + for (const request of requests) { + // 5.1 + const r = new Request(request)[kState] + + // 5.2 + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Expected http/s scheme.' + }) + } + + // 5.4 + r.initiator = 'fetch' + r.destination = 'subresource' + + // 5.5 + requestList.push(r) + + // 5.6 + const responsePromise = createDeferredPromise() + + // 5.7 + fetchControllers.push(fetching({ + request: r, + dispatcher: getGlobalDispatcher(), + processResponse (response) { + // 1. + if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) { + responsePromise.reject(webidl.errors.exception({ + header: 'Cache.addAll', + message: 'Received an invalid status code or the request failed.' + })) + } else if (response.headersList.contains('vary')) { // 2. + // 2.1 + const fieldValues = getFieldValues(response.headersList.get('vary')) + + // 2.2 + for (const fieldValue of fieldValues) { + // 2.2.1 + if (fieldValue === '*') { + responsePromise.reject(webidl.errors.exception({ + header: 'Cache.addAll', + message: 'invalid vary field value' + })) + + for (const controller of fetchControllers) { + controller.abort() + } + + return + } + } + } + }, + processResponseEndOfBody (response) { + // 1. + if (response.aborted) { + responsePromise.reject(new DOMException('aborted', 'AbortError')) + return + } + + // 2. + responsePromise.resolve(response) + } + })) + + // 5.8 + responsePromises.push(responsePromise.promise) + } + + // 6. + const p = Promise.all(responsePromises) + + // 7. + const responses = await p + + // 7.1 + const operations = [] + + // 7.2 + let index = 0 + + // 7.3 + for (const response of responses) { + // 7.3.1 + /** @type {CacheBatchOperation} */ + const operation = { + type: 'put', // 7.3.2 + request: requestList[index], // 7.3.3 + response // 7.3.4 + } + + operations.push(operation) // 7.3.5 + + index++ // 7.3.6 + } + + // 7.5 + const cacheJobPromise = createDeferredPromise() + + // 7.6.1 + let errorData = null + + // 7.6.2 + try { + this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } + + // 7.6.3 + queueMicrotask(() => { + // 7.6.3.1 + if (errorData === null) { + cacheJobPromise.resolve(undefined) + } else { + // 7.6.3.2 + cacheJobPromise.reject(errorData) + } + }) + + // 7.7 + return cacheJobPromise.promise + } + + async put (request, response) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' }) + + request = webidl.converters.RequestInfo(request) + response = webidl.converters.Response(response) + + // 1. + let innerRequest = null + + // 2. + if (request instanceof Request) { + innerRequest = request[kState] + } else { // 3. + innerRequest = new Request(request)[kState] + } + + // 4. + if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Expected an http/s scheme when method is not GET' + }) + } + + // 5. + const innerResponse = response[kState] + + // 6. + if (innerResponse.status === 206) { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Got 206 status' + }) + } + + // 7. + if (innerResponse.headersList.contains('vary')) { + // 7.1. + const fieldValues = getFieldValues(innerResponse.headersList.get('vary')) + + // 7.2. + for (const fieldValue of fieldValues) { + // 7.2.1 + if (fieldValue === '*') { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Got * vary field value' + }) + } + } + } + + // 8. + if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { + throw webidl.errors.exception({ + header: 'Cache.put', + message: 'Response body is locked or disturbed' + }) + } + + // 9. + const clonedResponse = cloneResponse(innerResponse) + + // 10. + const bodyReadPromise = createDeferredPromise() + + // 11. + if (innerResponse.body != null) { + // 11.1 + const stream = innerResponse.body.stream + + // 11.2 + const reader = stream.getReader() + + // 11.3 + readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject) + } else { + bodyReadPromise.resolve(undefined) + } + + // 12. + /** @type {CacheBatchOperation[]} */ + const operations = [] + + // 13. + /** @type {CacheBatchOperation} */ + const operation = { + type: 'put', // 14. + request: innerRequest, // 15. + response: clonedResponse // 16. + } + + // 17. + operations.push(operation) + + // 19. + const bytes = await bodyReadPromise.promise + + if (clonedResponse.body != null) { + clonedResponse.body.source = bytes + } + + // 19.1 + const cacheJobPromise = createDeferredPromise() + + // 19.2.1 + let errorData = null + + // 19.2.2 + try { + this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } + + // 19.2.3 + queueMicrotask(() => { + // 19.2.3.1 + if (errorData === null) { + cacheJobPromise.resolve() + } else { // 19.2.3.2 + cacheJobPromise.reject(errorData) + } + }) + + return cacheJobPromise.promise + } + + async delete (request, options = {}) { + webidl.brandCheck(this, Cache) + webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' }) + + request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) + + /** + * @type {Request} + */ + let r = null + + if (request instanceof Request) { + r = request[kState] + + if (r.method !== 'GET' && !options.ignoreMethod) { + return false + } + } else { + assert(typeof request === 'string') + + r = new Request(request)[kState] + } + + /** @type {CacheBatchOperation[]} */ + const operations = [] + + /** @type {CacheBatchOperation} */ + const operation = { + type: 'delete', + request: r, + options + } + + operations.push(operation) + + const cacheJobPromise = createDeferredPromise() + + let errorData = null + let requestResponses + + try { + requestResponses = this.#batchCacheOperations(operations) + } catch (e) { + errorData = e + } + + queueMicrotask(() => { + if (errorData === null) { + cacheJobPromise.resolve(!!requestResponses?.length) + } else { + cacheJobPromise.reject(errorData) + } + }) + + return cacheJobPromise.promise + } + + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys + * @param {any} request + * @param {import('../../types/cache').CacheQueryOptions} options + * @returns {readonly Request[]} + */ + async keys (request = undefined, options = {}) { + webidl.brandCheck(this, Cache) + + if (request !== undefined) request = webidl.converters.RequestInfo(request) + options = webidl.converters.CacheQueryOptions(options) + + // 1. + let r = null + + // 2. + if (request !== undefined) { + // 2.1 + if (request instanceof Request) { + // 2.1.1 + r = request[kState] + + // 2.1.2 + if (r.method !== 'GET' && !options.ignoreMethod) { + return [] + } + } else if (typeof request === 'string') { // 2.2 + r = new Request(request)[kState] + } + } + + // 4. + const promise = createDeferredPromise() + + // 5. + // 5.1 + const requests = [] + + // 5.2 + if (request === undefined) { + // 5.2.1 + for (const requestResponse of this.#relevantRequestResponseList) { + // 5.2.1.1 + requests.push(requestResponse[0]) + } + } else { // 5.3 + // 5.3.1 + const requestResponses = this.#queryCache(r, options) + + // 5.3.2 + for (const requestResponse of requestResponses) { + // 5.3.2.1 + requests.push(requestResponse[0]) + } + } + + // 5.4 + queueMicrotask(() => { + // 5.4.1 + const requestList = [] + + // 5.4.2 + for (const request of requests) { + const requestObject = new Request('https://a') + requestObject[kState] = request + requestObject[kHeaders][kHeadersList] = request.headersList + requestObject[kHeaders][kGuard] = 'immutable' + requestObject[kRealm] = request.client + + // 5.4.2.1 + requestList.push(requestObject) + } + + // 5.4.3 + promise.resolve(Object.freeze(requestList)) + }) + + return promise.promise + } + + /** + * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm + * @param {CacheBatchOperation[]} operations + * @returns {requestResponseList} + */ + #batchCacheOperations (operations) { + // 1. + const cache = this.#relevantRequestResponseList + + // 2. + const backupCache = [...cache] + + // 3. + const addedItems = [] + + // 4.1 + const resultList = [] + + try { + // 4.2 + for (const operation of operations) { + // 4.2.1 + if (operation.type !== 'delete' && operation.type !== 'put') { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'operation type does not match "delete" or "put"' + }) + } + + // 4.2.2 + if (operation.type === 'delete' && operation.response != null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'delete operation should not have an associated response' + }) + } + + // 4.2.3 + if (this.#queryCache(operation.request, operation.options, addedItems).length) { + throw new DOMException('???', 'InvalidStateError') + } + + // 4.2.4 + let requestResponses + + // 4.2.5 + if (operation.type === 'delete') { + // 4.2.5.1 + requestResponses = this.#queryCache(operation.request, operation.options) + + // TODO: the spec is wrong, this is needed to pass WPTs + if (requestResponses.length === 0) { + return [] + } + + // 4.2.5.2 + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse) + assert(idx !== -1) + + // 4.2.5.2.1 + cache.splice(idx, 1) + } + } else if (operation.type === 'put') { // 4.2.6 + // 4.2.6.1 + if (operation.response == null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'put operation should have an associated response' + }) + } + + // 4.2.6.2 + const r = operation.request + + // 4.2.6.3 + if (!urlIsHttpHttpsScheme(r.url)) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'expected http or https scheme' + }) + } + + // 4.2.6.4 + if (r.method !== 'GET') { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'not get method' + }) + } + + // 4.2.6.5 + if (operation.options != null) { + throw webidl.errors.exception({ + header: 'Cache.#batchCacheOperations', + message: 'options must not be defined' + }) + } + + // 4.2.6.6 + requestResponses = this.#queryCache(operation.request) + + // 4.2.6.7 + for (const requestResponse of requestResponses) { + const idx = cache.indexOf(requestResponse) + assert(idx !== -1) + + // 4.2.6.7.1 + cache.splice(idx, 1) + } + + // 4.2.6.8 + cache.push([operation.request, operation.response]) + + // 4.2.6.10 + addedItems.push([operation.request, operation.response]) + } + + // 4.2.7 + resultList.push([operation.request, operation.response]) + } + + // 4.3 + return resultList + } catch (e) { // 5. + // 5.1 + this.#relevantRequestResponseList.length = 0 + + // 5.2 + this.#relevantRequestResponseList = backupCache + + // 5.3 + throw e + } + } + + /** + * @see https://w3c.github.io/ServiceWorker/#query-cache + * @param {any} requestQuery + * @param {import('../../types/cache').CacheQueryOptions} options + * @param {requestResponseList} targetStorage + * @returns {requestResponseList} + */ + #queryCache (requestQuery, options, targetStorage) { + /** @type {requestResponseList} */ + const resultList = [] + + const storage = targetStorage ?? this.#relevantRequestResponseList + + for (const requestResponse of storage) { + const [cachedRequest, cachedResponse] = requestResponse + if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { + resultList.push(requestResponse) + } + } + + return resultList + } + + /** + * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm + * @param {any} requestQuery + * @param {any} request + * @param {any | null} response + * @param {import('../../types/cache').CacheQueryOptions | undefined} options + * @returns {boolean} + */ + #requestMatchesCachedItem (requestQuery, request, response = null, options) { + // if (options?.ignoreMethod === false && request.method === 'GET') { + // return false + // } + + const queryURL = new URL(requestQuery.url) + + const cachedURL = new URL(request.url) + + if (options?.ignoreSearch) { + cachedURL.search = '' + + queryURL.search = '' + } + + if (!urlEquals(queryURL, cachedURL, true)) { + return false + } + + if ( + response == null || + options?.ignoreVary || + !response.headersList.contains('vary') + ) { + return true + } + + const fieldValues = getFieldValues(response.headersList.get('vary')) + + for (const fieldValue of fieldValues) { + if (fieldValue === '*') { + return false + } + + const requestValue = request.headersList.get(fieldValue) + const queryValue = requestQuery.headersList.get(fieldValue) + + // If one has the header and the other doesn't, or one has + // a different value than the other, return false + if (requestValue !== queryValue) { + return false + } + } + + return true + } +} + +Object.defineProperties(Cache.prototype, { + [Symbol.toStringTag]: { + value: 'Cache', + configurable: true + }, + match: kEnumerableProperty, + matchAll: kEnumerableProperty, + add: kEnumerableProperty, + addAll: kEnumerableProperty, + put: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty +}) + +const cacheQueryOptionConverters = [ + { + key: 'ignoreSearch', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'ignoreMethod', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'ignoreVary', + converter: webidl.converters.boolean, + defaultValue: false + } +] + +webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters) + +webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ + ...cacheQueryOptionConverters, + { + key: 'cacheName', + converter: webidl.converters.DOMString + } +]) + +webidl.converters.Response = webidl.interfaceConverter(Response) + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.RequestInfo +) + +module.exports = { + Cache +} + + +/***/ }), + +/***/ 37907: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kConstruct } = __nccwpck_require__(29174) +const { Cache } = __nccwpck_require__(66101) +const { webidl } = __nccwpck_require__(21744) +const { kEnumerableProperty } = __nccwpck_require__(83983) + +class CacheStorage { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map + * @type {Map} + */ + async has (cacheName) { + webidl.brandCheck(this, CacheStorage) + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' }) + + cacheName = webidl.converters.DOMString(cacheName) + + // 2.1.1 + // 2.2 + return this.#caches.has(cacheName) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open + * @param {string} cacheName + * @returns {Promise} + */ + async open (cacheName) { + webidl.brandCheck(this, CacheStorage) + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' }) + + cacheName = webidl.converters.DOMString(cacheName) + + // 2.1 + if (this.#caches.has(cacheName)) { + // await caches.open('v1') !== await caches.open('v1') + + // 2.1.1 + const cache = this.#caches.get(cacheName) + + // 2.1.1.1 + return new Cache(kConstruct, cache) + } + + // 2.2 + const cache = [] + + // 2.3 + this.#caches.set(cacheName, cache) + + // 2.4 + return new Cache(kConstruct, cache) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete + * @param {string} cacheName + * @returns {Promise} + */ + async delete (cacheName) { + webidl.brandCheck(this, CacheStorage) + webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' }) + + cacheName = webidl.converters.DOMString(cacheName) + + return this.#caches.delete(cacheName) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys + * @returns {string[]} + */ + async keys () { + webidl.brandCheck(this, CacheStorage) + + // 2.1 + const keys = this.#caches.keys() + + // 2.2 + return [...keys] + } +} + +Object.defineProperties(CacheStorage.prototype, { + [Symbol.toStringTag]: { + value: 'CacheStorage', + configurable: true + }, + match: kEnumerableProperty, + has: kEnumerableProperty, + open: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty +}) + +module.exports = { + CacheStorage +} + + +/***/ }), + +/***/ 29174: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +module.exports = { + kConstruct: (__nccwpck_require__(72785).kConstruct) +} + + +/***/ }), + +/***/ 82396: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const assert = __nccwpck_require__(39491) +const { URLSerializer } = __nccwpck_require__(685) +const { isValidHeaderName } = __nccwpck_require__(52538) + +/** + * @see https://url.spec.whatwg.org/#concept-url-equals + * @param {URL} A + * @param {URL} B + * @param {boolean | undefined} excludeFragment + * @returns {boolean} + */ +function urlEquals (A, B, excludeFragment = false) { + const serializedA = URLSerializer(A, excludeFragment) + + const serializedB = URLSerializer(B, excludeFragment) + + return serializedA === serializedB +} + +/** + * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 + * @param {string} header + */ +function fieldValues (header) { + assert(header !== null) + + const values = [] + + for (let value of header.split(',')) { + value = value.trim() + + if (!value.length) { + continue + } else if (!isValidHeaderName(value)) { + continue + } + + values.push(value) + } + + return values +} + +module.exports = { + urlEquals, + fieldValues +} + + +/***/ }), + +/***/ 33598: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// @ts-check + + + +/* global WebAssembly */ + +const assert = __nccwpck_require__(39491) +const net = __nccwpck_require__(41808) +const http = __nccwpck_require__(13685) +const { pipeline } = __nccwpck_require__(12781) +const util = __nccwpck_require__(83983) +const timers = __nccwpck_require__(29459) +const Request = __nccwpck_require__(62905) +const DispatcherBase = __nccwpck_require__(74839) +const { + RequestContentLengthMismatchError, + ResponseContentLengthMismatchError, + InvalidArgumentError, + RequestAbortedError, + HeadersTimeoutError, + HeadersOverflowError, + SocketError, + InformationalError, + BodyTimeoutError, + HTTPParserError, + ResponseExceededMaxSizeError, + ClientDestroyedError +} = __nccwpck_require__(48045) +const buildConnector = __nccwpck_require__(82067) +const { + kUrl, + kReset, + kServerName, + kClient, + kBusy, + kParser, + kConnect, + kBlocking, + kResuming, + kRunning, + kPending, + kSize, + kWriting, + kQueue, + kConnected, + kConnecting, + kNeedDrain, + kNoRef, + kKeepAliveDefaultTimeout, + kHostHeader, + kPendingIdx, + kRunningIdx, + kError, + kPipelining, + kSocket, + kKeepAliveTimeoutValue, + kMaxHeadersSize, + kKeepAliveMaxTimeout, + kKeepAliveTimeoutThreshold, + kHeadersTimeout, + kBodyTimeout, + kStrictContentLength, + kConnector, + kMaxRedirections, + kMaxRequests, + kCounter, + kClose, + kDestroy, + kDispatch, + kInterceptors, + kLocalAddress, + kMaxResponseSize, + kHTTPConnVersion, + // HTTP2 + kHost, + kHTTP2Session, + kHTTP2SessionState, + kHTTP2BuildRequest, + kHTTP2CopyHeaders, + kHTTP1BuildRequest +} = __nccwpck_require__(72785) + +/** @type {import('http2')} */ +let http2 +try { + http2 = __nccwpck_require__(85158) +} catch { + // @ts-ignore + http2 = { constants: {} } +} + +const { + constants: { + HTTP2_HEADER_AUTHORITY, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_CONTENT_LENGTH, + HTTP2_HEADER_EXPECT, + HTTP2_HEADER_STATUS + } +} = http2 + +// Experimental +let h2ExperimentalWarned = false + +const FastBuffer = Buffer[Symbol.species] + +const kClosedResolve = Symbol('kClosedResolve') + +const channels = {} + +try { + const diagnosticsChannel = __nccwpck_require__(67643) + channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders') + channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect') + channels.connectError = diagnosticsChannel.channel('undici:client:connectError') + channels.connected = diagnosticsChannel.channel('undici:client:connected') +} catch { + channels.sendHeaders = { hasSubscribers: false } + channels.beforeConnect = { hasSubscribers: false } + channels.connectError = { hasSubscribers: false } + channels.connected = { hasSubscribers: false } +} + +/** + * @type {import('../types/client').default} + */ +class Client extends DispatcherBase { + /** + * + * @param {string|URL} url + * @param {import('../types/client').Client.Options} options + */ + constructor (url, { + interceptors, + maxHeaderSize, + headersTimeout, + socketTimeout, + requestTimeout, + connectTimeout, + bodyTimeout, + idleTimeout, + keepAlive, + keepAliveTimeout, + maxKeepAliveTimeout, + keepAliveMaxTimeout, + keepAliveTimeoutThreshold, + socketPath, + pipelining, + tls, + strictContentLength, + maxCachedSessions, + maxRedirections, + connect, + maxRequestsPerClient, + localAddress, + maxResponseSize, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + // h2 + allowH2, + maxConcurrentStreams + } = {}) { + super() + + if (keepAlive !== undefined) { + throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead') + } + + if (socketTimeout !== undefined) { + throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead') + } + + if (requestTimeout !== undefined) { + throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead') + } + + if (idleTimeout !== undefined) { + throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead') + } + + if (maxKeepAliveTimeout !== undefined) { + throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead') + } + + if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { + throw new InvalidArgumentError('invalid maxHeaderSize') + } + + if (socketPath != null && typeof socketPath !== 'string') { + throw new InvalidArgumentError('invalid socketPath') + } + + if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { + throw new InvalidArgumentError('invalid connectTimeout') + } + + if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { + throw new InvalidArgumentError('invalid keepAliveTimeout') + } + + if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { + throw new InvalidArgumentError('invalid keepAliveMaxTimeout') + } + + if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { + throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold') + } + + if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError('headersTimeout must be a positive integer or zero') + } + + if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } + + if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { + throw new InvalidArgumentError('maxRequestsPerClient must be a positive number') + } + + if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) { + throw new InvalidArgumentError('localAddress must be valid string IP address') + } + + if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { + throw new InvalidArgumentError('maxResponseSize must be a positive number') + } + + if ( + autoSelectFamilyAttemptTimeout != null && + (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1) + ) { + throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number') + } + + // h2 + if (allowH2 != null && typeof allowH2 !== 'boolean') { + throw new InvalidArgumentError('allowH2 must be a valid boolean value') + } + + if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) { + throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0') + } + + if (typeof connect !== 'function') { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), + ...connect + }) + } + + this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) + ? interceptors.Client + : [createRedirectInterceptor({ maxRedirections })] + this[kUrl] = util.parseOrigin(url) + this[kConnector] = connect + this[kSocket] = null + this[kPipelining] = pipelining != null ? pipelining : 1 + this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize + this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout + this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout + this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold + this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout] + this[kServerName] = null + this[kLocalAddress] = localAddress != null ? localAddress : null + this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming + this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming + this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` + this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 + this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 + this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength + this[kMaxRedirections] = maxRedirections + this[kMaxRequests] = maxRequestsPerClient + this[kClosedResolve] = null + this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1 + this[kHTTPConnVersion] = 'h1' + + // HTTP/2 + this[kHTTP2Session] = null + this[kHTTP2SessionState] = !allowH2 + ? null + : { + // streams: null, // Fixed queue of streams - For future support of `push` + openStreams: 0, // Keep track of them to decide wether or not unref the session + maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server + } + this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}` + + // kQueue is built up of 3 sections separated by + // the kRunningIdx and kPendingIdx indices. + // | complete | running | pending | + // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length + // kRunningIdx points to the first running element. + // kPendingIdx points to the first pending element. + // This implements a fast queue with an amortized + // time of O(1). + + this[kQueue] = [] + this[kRunningIdx] = 0 + this[kPendingIdx] = 0 + } + + get pipelining () { + return this[kPipelining] + } + + set pipelining (value) { + this[kPipelining] = value + resume(this, true) + } + + get [kPending] () { + return this[kQueue].length - this[kPendingIdx] + } + + get [kRunning] () { + return this[kPendingIdx] - this[kRunningIdx] + } + + get [kSize] () { + return this[kQueue].length - this[kRunningIdx] + } + + get [kConnected] () { + return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed + } + + get [kBusy] () { + const socket = this[kSocket] + return ( + (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) || + (this[kSize] >= (this[kPipelining] || 1)) || + this[kPending] > 0 + ) + } + + /* istanbul ignore: only used for test */ + [kConnect] (cb) { + connect(this) + this.once('connect', cb) + } + + [kDispatch] (opts, handler) { + const origin = opts.origin || this[kUrl].origin + + const request = this[kHTTPConnVersion] === 'h2' + ? Request[kHTTP2BuildRequest](origin, opts, handler) + : Request[kHTTP1BuildRequest](origin, opts, handler) + + this[kQueue].push(request) + if (this[kResuming]) { + // Do nothing. + } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { + // Wait a tick in case stream/iterator is ended in the same tick. + this[kResuming] = 1 + process.nextTick(resume, this) + } else { + resume(this, true) + } + + if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { + this[kNeedDrain] = 2 + } + + return this[kNeedDrain] < 2 + } + + async [kClose] () { + // TODO: for H2 we need to gracefully flush the remaining enqueued + // request and close each stream. + return new Promise((resolve) => { + if (!this[kSize]) { + resolve(null) + } else { + this[kClosedResolve] = resolve + } + }) + } + + async [kDestroy] (err) { + return new Promise((resolve) => { + const requests = this[kQueue].splice(this[kPendingIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(this, request, err) + } + + const callback = () => { + if (this[kClosedResolve]) { + // TODO (fix): Should we error here with ClientDestroyedError? + this[kClosedResolve]() + this[kClosedResolve] = null + } + resolve() + } + + if (this[kHTTP2Session] != null) { + util.destroy(this[kHTTP2Session], err) + this[kHTTP2Session] = null + this[kHTTP2SessionState] = null + } + + if (!this[kSocket]) { + queueMicrotask(callback) + } else { + util.destroy(this[kSocket].on('close', callback), err) + } + + resume(this) + }) + } +} + +function onHttp2SessionError (err) { + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') + + this[kSocket][kError] = err + + onError(this[kClient], err) +} + +function onHttp2FrameError (type, code, id) { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) + + if (id === 0) { + this[kSocket][kError] = err + onError(this[kClient], err) + } +} + +function onHttp2SessionEnd () { + util.destroy(this, new SocketError('other side closed')) + util.destroy(this[kSocket], new SocketError('other side closed')) +} + +function onHTTP2GoAway (code) { + const client = this[kClient] + const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`) + client[kSocket] = null + client[kHTTP2Session] = null + + if (client.destroyed) { + assert(this[kPending] === 0) + + // Fail entire queue. + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(this, request, err) + } + } else if (client[kRunning] > 0) { + // Fail head of pipeline. + const request = client[kQueue][client[kRunningIdx]] + client[kQueue][client[kRunningIdx]++] = null + + errorRequest(client, request, err) + } + + client[kPendingIdx] = client[kRunningIdx] + + assert(client[kRunning] === 0) + + client.emit('disconnect', + client[kUrl], + [client], + err + ) + + resume(client) +} + +const constants = __nccwpck_require__(30953) +const createRedirectInterceptor = __nccwpck_require__(38861) +const EMPTY_BUF = Buffer.alloc(0) + +async function lazyllhttp () { + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(61145) : undefined + + let mod + try { + mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(95627), 'base64')) + } catch (e) { + /* istanbul ignore next */ + + // We could check if the error was caused by the simd option not + // being enabled, but the occurring of this other error + // * https://github.com/emscripten-core/emscripten/issues/11495 + // got me to remove that check to avoid breaking Node 12. + mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(61145), 'base64')) + } + + return await WebAssembly.instantiate(mod, { + env: { + /* eslint-disable camelcase */ + + wasm_on_url: (p, at, len) => { + /* istanbul ignore next */ + return 0 + }, + wasm_on_status: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_message_begin: (p) => { + assert.strictEqual(currentParser.ptr, p) + return currentParser.onMessageBegin() || 0 + }, + wasm_on_header_field: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_header_value: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { + assert.strictEqual(currentParser.ptr, p) + return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0 + }, + wasm_on_body: (p, at, len) => { + assert.strictEqual(currentParser.ptr, p) + const start = at - currentBufferPtr + currentBufferRef.byteOffset + return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 + }, + wasm_on_message_complete: (p) => { + assert.strictEqual(currentParser.ptr, p) + return currentParser.onMessageComplete() || 0 + } + + /* eslint-enable camelcase */ + } + }) +} + +let llhttpInstance = null +let llhttpPromise = lazyllhttp() +llhttpPromise.catch() + +let currentParser = null +let currentBufferRef = null +let currentBufferSize = 0 +let currentBufferPtr = null + +const TIMEOUT_HEADERS = 1 +const TIMEOUT_BODY = 2 +const TIMEOUT_IDLE = 3 + +class Parser { + constructor (client, socket, { exports }) { + assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0) + + this.llhttp = exports + this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE) + this.client = client + this.socket = socket + this.timeout = null + this.timeoutValue = null + this.timeoutType = null + this.statusCode = null + this.statusText = '' + this.upgrade = false + this.headers = [] + this.headersSize = 0 + this.headersMaxSize = client[kMaxHeadersSize] + this.shouldKeepAlive = false + this.paused = false + this.resume = this.resume.bind(this) + + this.bytesRead = 0 + + this.keepAlive = '' + this.contentLength = '' + this.connection = '' + this.maxResponseSize = client[kMaxResponseSize] + } + + setTimeout (value, type) { + this.timeoutType = type + if (value !== this.timeoutValue) { + timers.clearTimeout(this.timeout) + if (value) { + this.timeout = timers.setTimeout(onParserTimeout, value, this) + // istanbul ignore else: only for jest + if (this.timeout.unref) { + this.timeout.unref() + } + } else { + this.timeout = null + } + this.timeoutValue = value + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + } + + resume () { + if (this.socket.destroyed || !this.paused) { + return + } + + assert(this.ptr != null) + assert(currentParser == null) + + this.llhttp.llhttp_resume(this.ptr) + + assert(this.timeoutType === TIMEOUT_BODY) + if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + this.paused = false + this.execute(this.socket.read() || EMPTY_BUF) // Flush parser. + this.readMore() + } + + readMore () { + while (!this.paused && this.ptr) { + const chunk = this.socket.read() + if (chunk === null) { + break + } + this.execute(chunk) + } + } + + execute (data) { + assert(this.ptr != null) + assert(currentParser == null) + assert(!this.paused) + + const { socket, llhttp } = this + + if (data.length > currentBufferSize) { + if (currentBufferPtr) { + llhttp.free(currentBufferPtr) + } + currentBufferSize = Math.ceil(data.length / 4096) * 4096 + currentBufferPtr = llhttp.malloc(currentBufferSize) + } + + new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data) + + // Call `execute` on the wasm parser. + // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data, + // and finally the length of bytes to parse. + // The return value is an error code or `constants.ERROR.OK`. + try { + let ret + + try { + currentBufferRef = data + currentParser = this + ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length) + /* eslint-disable-next-line no-useless-catch */ + } catch (err) { + /* istanbul ignore next: difficult to make a test case for */ + throw err + } finally { + currentParser = null + currentBufferRef = null + } + + const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr + + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(data.slice(offset)) + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true + socket.unshift(data.slice(offset)) + } else if (ret !== constants.ERROR.OK) { + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + /* istanbul ignore else: difficult to make a test case for */ + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + } + } catch (err) { + util.destroy(socket, err) + } + } + + destroy () { + assert(this.ptr != null) + assert(currentParser == null) + + this.llhttp.llhttp_free(this.ptr) + this.ptr = null + + timers.clearTimeout(this.timeout) + this.timeout = null + this.timeoutValue = null + this.timeoutType = null + + this.paused = false + } + + onStatus (buf) { + this.statusText = buf.toString() + } + + onMessageBegin () { + const { socket, client } = this + + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) { + return -1 + } + + const request = client[kQueue][client[kRunningIdx]] + if (!request) { + return -1 + } + } + + onHeaderField (buf) { + const len = this.headers.length + + if ((len & 1) === 0) { + this.headers.push(buf) + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) + } + + this.trackHeader(buf.length) + } + + onHeaderValue (buf) { + let len = this.headers.length + + if ((len & 1) === 1) { + this.headers.push(buf) + len += 1 + } else { + this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) + } + + const key = this.headers[len - 2] + if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') { + this.keepAlive += buf.toString() + } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') { + this.connection += buf.toString() + } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') { + this.contentLength += buf.toString() + } + + this.trackHeader(buf.length) + } + + trackHeader (len) { + this.headersSize += len + if (this.headersSize >= this.headersMaxSize) { + util.destroy(this.socket, new HeadersOverflowError()) + } + } + + onUpgrade (head) { + const { upgrade, client, socket, headers, statusCode } = this + + assert(upgrade) + + const request = client[kQueue][client[kRunningIdx]] + assert(request) + + assert(!socket.destroyed) + assert(socket === client[kSocket]) + assert(!this.paused) + assert(request.upgrade || request.method === 'CONNECT') + + this.statusCode = null + this.statusText = '' + this.shouldKeepAlive = null + + assert(this.headers.length % 2 === 0) + this.headers = [] + this.headersSize = 0 + + socket.unshift(head) + + socket[kParser].destroy() + socket[kParser] = null + + socket[kClient] = null + socket[kError] = null + socket + .removeListener('error', onSocketError) + .removeListener('readable', onSocketReadable) + .removeListener('end', onSocketEnd) + .removeListener('close', onSocketClose) + + client[kSocket] = null + client[kQueue][client[kRunningIdx]++] = null + client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade')) + + try { + request.onUpgrade(statusCode, headers, socket) + } catch (err) { + util.destroy(socket, err) + } + + resume(client) + } + + onHeadersComplete (statusCode, upgrade, shouldKeepAlive) { + const { client, socket, headers, statusText } = this + + /* istanbul ignore next: difficult to make a test case for */ + if (socket.destroyed) { + return -1 + } + + const request = client[kQueue][client[kRunningIdx]] + + /* istanbul ignore next: difficult to make a test case for */ + if (!request) { + return -1 + } + + assert(!this.upgrade) + assert(this.statusCode < 200) + + if (statusCode === 100) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + + /* this can only happen if server is misbehaving */ + if (upgrade && !request.upgrade) { + util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket))) + return -1 + } + + assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS) + + this.statusCode = statusCode + this.shouldKeepAlive = ( + shouldKeepAlive || + // Override llhttp value which does not allow keepAlive for HEAD. + (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive') + ) + + if (this.statusCode >= 200) { + const bodyTimeout = request.bodyTimeout != null + ? request.bodyTimeout + : client[kBodyTimeout] + this.setTimeout(bodyTimeout, TIMEOUT_BODY) + } else if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + if (request.method === 'CONNECT') { + assert(client[kRunning] === 1) + this.upgrade = true + return 2 + } + + if (upgrade) { + assert(client[kRunning] === 1) + this.upgrade = true + return 2 + } + + assert(this.headers.length % 2 === 0) + this.headers = [] + this.headersSize = 0 + + if (this.shouldKeepAlive && client[kPipelining]) { + const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null + + if (keepAliveTimeout != null) { + const timeout = Math.min( + keepAliveTimeout - client[kKeepAliveTimeoutThreshold], + client[kKeepAliveMaxTimeout] + ) + if (timeout <= 0) { + socket[kReset] = true + } else { + client[kKeepAliveTimeoutValue] = timeout + } + } else { + client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout] + } + } else { + // Stop more requests from being dispatched. + socket[kReset] = true + } + + const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false + + if (request.aborted) { + return -1 + } + + if (request.method === 'HEAD') { + return 1 + } + + if (statusCode < 200) { + return 1 + } + + if (socket[kBlocking]) { + socket[kBlocking] = false + resume(client) + } + + return pause ? constants.ERROR.PAUSED : 0 + } + + onBody (buf) { + const { client, socket, statusCode, maxResponseSize } = this + + if (socket.destroyed) { + return -1 + } + + const request = client[kQueue][client[kRunningIdx]] + assert(request) + + assert.strictEqual(this.timeoutType, TIMEOUT_BODY) + if (this.timeout) { + // istanbul ignore else: only for jest + if (this.timeout.refresh) { + this.timeout.refresh() + } + } + + assert(statusCode >= 200) + + if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { + util.destroy(socket, new ResponseExceededMaxSizeError()) + return -1 + } + + this.bytesRead += buf.length + + if (request.onData(buf) === false) { + return constants.ERROR.PAUSED + } + } + + onMessageComplete () { + const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this + + if (socket.destroyed && (!statusCode || shouldKeepAlive)) { + return -1 + } + + if (upgrade) { + return + } + + const request = client[kQueue][client[kRunningIdx]] + assert(request) + + assert(statusCode >= 100) + + this.statusCode = null + this.statusText = '' + this.bytesRead = 0 + this.contentLength = '' + this.keepAlive = '' + this.connection = '' + + assert(this.headers.length % 2 === 0) + this.headers = [] + this.headersSize = 0 + + if (statusCode < 200) { + return + } + + /* istanbul ignore next: should be handled by llhttp? */ + if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) { + util.destroy(socket, new ResponseContentLengthMismatchError()) + return -1 + } + + request.onComplete(headers) + + client[kQueue][client[kRunningIdx]++] = null + + if (socket[kWriting]) { + assert.strictEqual(client[kRunning], 0) + // Response completed before request. + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (!shouldKeepAlive) { + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (socket[kReset] && client[kRunning] === 0) { + // Destroy socket once all requests have completed. + // The request at the tail of the pipeline is the one + // that requested reset and no further requests should + // have been queued since then. + util.destroy(socket, new InformationalError('reset')) + return constants.ERROR.PAUSED + } else if (client[kPipelining] === 1) { + // We must wait a full event loop cycle to reuse this socket to make sure + // that non-spec compliant servers are not closing the connection even if they + // said they won't. + setImmediate(resume, client) + } else { + resume(client) + } + } +} + +function onParserTimeout (parser) { + const { socket, timeoutType, client } = parser + + /* istanbul ignore else */ + if (timeoutType === TIMEOUT_HEADERS) { + if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { + assert(!parser.paused, 'cannot be paused while waiting for headers') + util.destroy(socket, new HeadersTimeoutError()) + } + } else if (timeoutType === TIMEOUT_BODY) { + if (!parser.paused) { + util.destroy(socket, new BodyTimeoutError()) + } + } else if (timeoutType === TIMEOUT_IDLE) { + assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]) + util.destroy(socket, new InformationalError('socket idle timeout')) + } +} + +function onSocketReadable () { + const { [kParser]: parser } = this + if (parser) { + parser.readMore() + } +} + +function onSocketError (err) { + const { [kClient]: client, [kParser]: parser } = this + + assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') + + if (client[kHTTPConnVersion] !== 'h2') { + // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded + // to the user. + if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so for as a valid response. + parser.onMessageComplete() + return + } + } + + this[kError] = err + + onError(this[kClient], err) +} + +function onError (client, err) { + if ( + client[kRunning] === 0 && + err.code !== 'UND_ERR_INFO' && + err.code !== 'UND_ERR_SOCKET' + ) { + // Error is not caused by running request and not a recoverable + // socket error. + + assert(client[kPendingIdx] === client[kRunningIdx]) + + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(client, request, err) + } + assert(client[kSize] === 0) + } +} + +function onSocketEnd () { + const { [kParser]: parser, [kClient]: client } = this + + if (client[kHTTPConnVersion] !== 'h2') { + if (parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so far as a valid response. + parser.onMessageComplete() + return + } + } + + util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) +} + +function onSocketClose () { + const { [kClient]: client, [kParser]: parser } = this + + if (client[kHTTPConnVersion] === 'h1' && parser) { + if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { + // We treat all incoming data so far as a valid response. + parser.onMessageComplete() + } + + this[kParser].destroy() + this[kParser] = null + } + + const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) + + client[kSocket] = null + + if (client.destroyed) { + assert(client[kPending] === 0) + + // Fail entire queue. + const requests = client[kQueue].splice(client[kRunningIdx]) + for (let i = 0; i < requests.length; i++) { + const request = requests[i] + errorRequest(client, request, err) + } + } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') { + // Fail head of pipeline. + const request = client[kQueue][client[kRunningIdx]] + client[kQueue][client[kRunningIdx]++] = null + + errorRequest(client, request, err) + } + + client[kPendingIdx] = client[kRunningIdx] + + assert(client[kRunning] === 0) + + client.emit('disconnect', client[kUrl], [client], err) + + resume(client) +} + +async function connect (client) { + assert(!client[kConnecting]) + assert(!client[kSocket]) + + let { host, hostname, protocol, port } = client[kUrl] + + // Resolve ipv6 + if (hostname[0] === '[') { + const idx = hostname.indexOf(']') + + assert(idx !== -1) + const ip = hostname.substring(1, idx) + + assert(net.isIP(ip)) + hostname = ip + } + + client[kConnecting] = true + + if (channels.beforeConnect.hasSubscribers) { + channels.beforeConnect.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector] + }) + } + + try { + const socket = await new Promise((resolve, reject) => { + client[kConnector]({ + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, (err, socket) => { + if (err) { + reject(err) + } else { + resolve(socket) + } + }) + }) + + if (client.destroyed) { + util.destroy(socket.on('error', () => {}), new ClientDestroyedError()) + return + } + + client[kConnecting] = false + + assert(socket) + + const isH2 = socket.alpnProtocol === 'h2' + if (isH2) { + if (!h2ExperimentalWarned) { + h2ExperimentalWarned = true + process.emitWarning('H2 support is experimental, expect them to change at any time.', { + code: 'UNDICI-H2' + }) + } + + const session = http2.connect(client[kUrl], { + createConnection: () => socket, + peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams + }) + + client[kHTTPConnVersion] = 'h2' + session[kClient] = client + session[kSocket] = socket + session.on('error', onHttp2SessionError) + session.on('frameError', onHttp2FrameError) + session.on('end', onHttp2SessionEnd) + session.on('goaway', onHTTP2GoAway) + session.on('close', onSocketClose) + session.unref() + + client[kHTTP2Session] = session + socket[kHTTP2Session] = session + } else { + if (!llhttpInstance) { + llhttpInstance = await llhttpPromise + llhttpPromise = null + } + + socket[kNoRef] = false + socket[kWriting] = false + socket[kReset] = false + socket[kBlocking] = false + socket[kParser] = new Parser(client, socket, llhttpInstance) + } + + socket[kCounter] = 0 + socket[kMaxRequests] = client[kMaxRequests] + socket[kClient] = client + socket[kError] = null + + socket + .on('error', onSocketError) + .on('readable', onSocketReadable) + .on('end', onSocketEnd) + .on('close', onSocketClose) + + client[kSocket] = socket + + if (channels.connected.hasSubscribers) { + channels.connected.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + socket + }) + } + client.emit('connect', client[kUrl], [client]) + } catch (err) { + if (client.destroyed) { + return + } + + client[kConnecting] = false + + if (channels.connectError.hasSubscribers) { + channels.connectError.publish({ + connectParams: { + host, + hostname, + protocol, + port, + servername: client[kServerName], + localAddress: client[kLocalAddress] + }, + connector: client[kConnector], + error: err + }) + } + + if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { + assert(client[kRunning] === 0) + while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { + const request = client[kQueue][client[kPendingIdx]++] + errorRequest(client, request, err) + } + } else { + onError(client, err) + } + + client.emit('connectionError', client[kUrl], [client], err) + } + + resume(client) +} + +function emitDrain (client) { + client[kNeedDrain] = 0 + client.emit('drain', client[kUrl], [client]) +} + +function resume (client, sync) { + if (client[kResuming] === 2) { + return + } + + client[kResuming] = 2 + + _resume(client, sync) + client[kResuming] = 0 + + if (client[kRunningIdx] > 256) { + client[kQueue].splice(0, client[kRunningIdx]) + client[kPendingIdx] -= client[kRunningIdx] + client[kRunningIdx] = 0 + } +} + +function _resume (client, sync) { + while (true) { + if (client.destroyed) { + assert(client[kPending] === 0) + return + } + + if (client[kClosedResolve] && !client[kSize]) { + client[kClosedResolve]() + client[kClosedResolve] = null + return + } + + const socket = client[kSocket] + + if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') { + if (client[kSize] === 0) { + if (!socket[kNoRef] && socket.unref) { + socket.unref() + socket[kNoRef] = true + } + } else if (socket[kNoRef] && socket.ref) { + socket.ref() + socket[kNoRef] = false + } + + if (client[kSize] === 0) { + if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { + socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE) + } + } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { + if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { + const request = client[kQueue][client[kRunningIdx]] + const headersTimeout = request.headersTimeout != null + ? request.headersTimeout + : client[kHeadersTimeout] + socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS) + } + } + } + + if (client[kBusy]) { + client[kNeedDrain] = 2 + } else if (client[kNeedDrain] === 2) { + if (sync) { + client[kNeedDrain] = 1 + process.nextTick(emitDrain, client) + } else { + emitDrain(client) + } + continue + } + + if (client[kPending] === 0) { + return + } + + if (client[kRunning] >= (client[kPipelining] || 1)) { + return + } + + const request = client[kQueue][client[kPendingIdx]] + + if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) { + if (client[kRunning] > 0) { + return + } + + client[kServerName] = request.servername + + if (socket && socket.servername !== request.servername) { + util.destroy(socket, new InformationalError('servername changed')) + return + } + } + + if (client[kConnecting]) { + return + } + + if (!socket && !client[kHTTP2Session]) { + connect(client) + return + } + + if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) { + return + } + + if (client[kRunning] > 0 && !request.idempotent) { + // Non-idempotent request cannot be retried. + // Ensure that no other requests are inflight and + // could cause failure. + return + } + + if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) { + // Don't dispatch an upgrade until all preceding requests have completed. + // A misbehaving server might upgrade the connection before all pipelined + // request has completed. + return + } + + if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && + (util.isStream(request.body) || util.isAsyncIterable(request.body))) { + // Request with stream or iterator body can error while other requests + // are inflight and indirectly error those as well. + // Ensure this doesn't happen by waiting for inflight + // to complete before dispatching. + + // Request with stream or iterator body cannot be retried. + // Ensure that no other requests are inflight and + // could cause failure. + return + } + + if (!request.aborted && write(client, request)) { + client[kPendingIdx]++ + } else { + client[kQueue].splice(client[kPendingIdx], 1) + } + } +} + +// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 +function shouldSendContentLength (method) { + return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' +} + +function write (client, request) { + if (client[kHTTPConnVersion] === 'h2') { + writeH2(client, client[kHTTP2Session], request) + return + } + + const { body, method, path, host, upgrade, headers, blocking, reset } = request + + // https://tools.ietf.org/html/rfc7231#section-4.3.1 + // https://tools.ietf.org/html/rfc7231#section-4.3.2 + // https://tools.ietf.org/html/rfc7231#section-4.3.5 + + // Sending a payload body on a request that does not + // expect it can cause undefined behavior on some + // servers and corrupt connection state. Do not + // re-use the connection for further requests. + + const expectsPayload = ( + method === 'PUT' || + method === 'POST' || + method === 'PATCH' + ) + + if (body && typeof body.read === 'function') { + // Try to read EOF in order to get length. + body.read(0) + } + + const bodyLength = util.bodyLength(body) + + let contentLength = bodyLength + + if (contentLength === null) { + contentLength = request.contentLength + } + + if (contentLength === 0 && !expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD NOT send a Content-Length header field when + // the request message does not contain a payload body and the method + // semantics do not anticipate such a body. + + contentLength = null + } + + // https://github.com/nodejs/undici/issues/2046 + // A user agent may send a Content-Length header with 0 value, this should be allowed. + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + errorRequest(client, request, new RequestContentLengthMismatchError()) + return false + } + + process.emitWarning(new RequestContentLengthMismatchError()) + } + + const socket = client[kSocket] + + try { + request.onConnect((err) => { + if (request.aborted || request.completed) { + return + } + + errorRequest(client, request, err || new RequestAbortedError()) + + util.destroy(socket, new InformationalError('aborted')) + }) + } catch (err) { + errorRequest(client, request, err) + } + + if (request.aborted) { + return false + } + + if (method === 'HEAD') { + // https://github.com/mcollina/undici/issues/258 + // Close after a HEAD request to interop with misbehaving servers + // that may send a body in the response. + + socket[kReset] = true + } + + if (upgrade || method === 'CONNECT') { + // On CONNECT or upgrade, block pipeline from dispatching further + // requests on this connection. + + socket[kReset] = true + } + + if (reset != null) { + socket[kReset] = reset + } + + if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { + socket[kReset] = true + } + + if (blocking) { + socket[kBlocking] = true + } + + let header = `${method} ${path} HTTP/1.1\r\n` + + if (typeof host === 'string') { + header += `host: ${host}\r\n` + } else { + header += client[kHostHeader] + } + + if (upgrade) { + header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` + } else if (client[kPipelining] && !socket[kReset]) { + header += 'connection: keep-alive\r\n' + } else { + header += 'connection: close\r\n' + } + + if (headers) { + header += headers + } + + if (channels.sendHeaders.hasSubscribers) { + channels.sendHeaders.publish({ request, headers: header, socket }) + } + + /* istanbul ignore else: assertion */ + if (!body || bodyLength === 0) { + if (contentLength === 0) { + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') + } else { + assert(contentLength === null, 'no body must not have content length') + socket.write(`${header}\r\n`, 'latin1') + } + request.onRequestSent() + } else if (util.isBuffer(body)) { + assert(contentLength === body.byteLength, 'buffer body must have content length') + + socket.cork() + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + socket.write(body) + socket.uncork() + request.onBodySent(body) + request.onRequestSent() + if (!expectsPayload) { + socket[kReset] = true + } + } else if (util.isBlobLike(body)) { + if (typeof body.stream === 'function') { + writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload }) + } else { + writeBlob({ body, client, request, socket, contentLength, header, expectsPayload }) + } + } else if (util.isStream(body)) { + writeStream({ body, client, request, socket, contentLength, header, expectsPayload }) + } else if (util.isIterable(body)) { + writeIterable({ body, client, request, socket, contentLength, header, expectsPayload }) + } else { + assert(false) + } + + return true +} + +function writeH2 (client, session, request) { + const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request + + let headers + if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()) + else headers = reqHeaders + + if (upgrade) { + errorRequest(client, request, new Error('Upgrade not supported for H2')) + return false + } + + try { + // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event? + request.onConnect((err) => { + if (request.aborted || request.completed) { + return + } + + errorRequest(client, request, err || new RequestAbortedError()) + }) + } catch (err) { + errorRequest(client, request, err) + } + + if (request.aborted) { + return false + } + + /** @type {import('node:http2').ClientHttp2Stream} */ + let stream + const h2State = client[kHTTP2SessionState] + + headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost] + headers[HTTP2_HEADER_METHOD] = method + + if (method === 'CONNECT') { + session.ref() + // we are already connected, streams are pending, first request + // will create a new stream. We trigger a request to create the stream and wait until + // `ready` event is triggered + // We disabled endStream to allow the user to write to the stream + stream = session.request(headers, { endStream: false, signal }) + + if (stream.id && !stream.pending) { + request.onUpgrade(null, null, stream) + ++h2State.openStreams + } else { + stream.once('ready', () => { + request.onUpgrade(null, null, stream) + ++h2State.openStreams + }) + } + + stream.once('close', () => { + h2State.openStreams -= 1 + // TODO(HTTP/2): unref only if current streams count is 0 + if (h2State.openStreams === 0) session.unref() + }) + + return true + } + + // https://tools.ietf.org/html/rfc7540#section-8.3 + // :path and :scheme headers must be omited when sending CONNECT + + headers[HTTP2_HEADER_PATH] = path + headers[HTTP2_HEADER_SCHEME] = 'https' + + // https://tools.ietf.org/html/rfc7231#section-4.3.1 + // https://tools.ietf.org/html/rfc7231#section-4.3.2 + // https://tools.ietf.org/html/rfc7231#section-4.3.5 + + // Sending a payload body on a request that does not + // expect it can cause undefined behavior on some + // servers and corrupt connection state. Do not + // re-use the connection for further requests. + + const expectsPayload = ( + method === 'PUT' || + method === 'POST' || + method === 'PATCH' + ) + + if (body && typeof body.read === 'function') { + // Try to read EOF in order to get length. + body.read(0) + } + + let contentLength = util.bodyLength(body) + + if (contentLength == null) { + contentLength = request.contentLength + } + + if (contentLength === 0 || !expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD NOT send a Content-Length header field when + // the request message does not contain a payload body and the method + // semantics do not anticipate such a body. + + contentLength = null + } + + // https://github.com/nodejs/undici/issues/2046 + // A user agent may send a Content-Length header with 0 value, this should be allowed. + if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { + if (client[kStrictContentLength]) { + errorRequest(client, request, new RequestContentLengthMismatchError()) + return false + } + + process.emitWarning(new RequestContentLengthMismatchError()) + } + + if (contentLength != null) { + assert(body, 'no body must not have content length') + headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}` + } + + session.ref() + + const shouldEndStream = method === 'GET' || method === 'HEAD' + if (expectContinue) { + headers[HTTP2_HEADER_EXPECT] = '100-continue' + stream = session.request(headers, { endStream: shouldEndStream, signal }) + + stream.once('continue', writeBodyH2) + } else { + stream = session.request(headers, { + endStream: shouldEndStream, + signal + }) + writeBodyH2() + } + + // Increment counter as we have new several streams open + ++h2State.openStreams + + stream.once('response', headers => { + const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers + + if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) { + stream.pause() + } + }) + + stream.once('end', () => { + request.onComplete([]) + }) + + stream.on('data', (chunk) => { + if (request.onData(chunk) === false) { + stream.pause() + } + }) + + stream.once('close', () => { + h2State.openStreams -= 1 + // TODO(HTTP/2): unref only if current streams count is 0 + if (h2State.openStreams === 0) { + session.unref() + } + }) + + stream.once('error', function (err) { + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1 + util.destroy(stream, err) + } + }) + + stream.once('frameError', (type, code) => { + const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) + errorRequest(client, request, err) + + if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { + h2State.streams -= 1 + util.destroy(stream, err) + } + }) + + // stream.on('aborted', () => { + // // TODO(HTTP/2): Support aborted + // }) + + // stream.on('timeout', () => { + // // TODO(HTTP/2): Support timeout + // }) + + // stream.on('push', headers => { + // // TODO(HTTP/2): Suppor push + // }) + + // stream.on('trailers', headers => { + // // TODO(HTTP/2): Support trailers + // }) + + return true + + function writeBodyH2 () { + /* istanbul ignore else: assertion */ + if (!body) { + request.onRequestSent() + } else if (util.isBuffer(body)) { + assert(contentLength === body.byteLength, 'buffer body must have content length') + stream.cork() + stream.write(body) + stream.uncork() + stream.end() + request.onBodySent(body) + request.onRequestSent() + } else if (util.isBlobLike(body)) { + if (typeof body.stream === 'function') { + writeIterable({ + client, + request, + contentLength, + h2stream: stream, + expectsPayload, + body: body.stream(), + socket: client[kSocket], + header: '' + }) + } else { + writeBlob({ + body, + client, + request, + contentLength, + expectsPayload, + h2stream: stream, + header: '', + socket: client[kSocket] + }) + } + } else if (util.isStream(body)) { + writeStream({ + body, + client, + request, + contentLength, + expectsPayload, + socket: client[kSocket], + h2stream: stream, + header: '' + }) + } else if (util.isIterable(body)) { + writeIterable({ + body, + client, + request, + contentLength, + expectsPayload, + header: '', + h2stream: stream, + socket: client[kSocket] + }) + } else { + assert(false) + } + } +} + +function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { + assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') + + if (client[kHTTPConnVersion] === 'h2') { + // For HTTP/2, is enough to pipe the stream + const pipe = pipeline( + body, + h2stream, + (err) => { + if (err) { + util.destroy(body, err) + util.destroy(h2stream, err) + } else { + request.onRequestSent() + } + } + ) + + pipe.on('data', onPipeData) + pipe.once('end', () => { + pipe.removeListener('data', onPipeData) + util.destroy(pipe) + }) + + function onPipeData (chunk) { + request.onBodySent(chunk) + } + + return + } + + let finished = false + + const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) + + const onData = function (chunk) { + if (finished) { + return + } + + try { + if (!writer.write(chunk) && this.pause) { + this.pause() + } + } catch (err) { + util.destroy(this, err) + } + } + const onDrain = function () { + if (finished) { + return + } + + if (body.resume) { + body.resume() + } + } + const onAbort = function () { + if (finished) { + return + } + const err = new RequestAbortedError() + queueMicrotask(() => onFinished(err)) + } + const onFinished = function (err) { + if (finished) { + return + } + + finished = true + + assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1)) + + socket + .off('drain', onDrain) + .off('error', onFinished) + + body + .removeListener('data', onData) + .removeListener('end', onFinished) + .removeListener('error', onFinished) + .removeListener('close', onAbort) + + if (!err) { + try { + writer.end() + } catch (er) { + err = er + } + } + + writer.destroy(err) + + if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) { + util.destroy(body, err) + } else { + util.destroy(body) + } + } + + body + .on('data', onData) + .on('end', onFinished) + .on('error', onFinished) + .on('close', onAbort) + + if (body.resume) { + body.resume() + } + + socket + .on('drain', onDrain) + .on('error', onFinished) +} + +async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { + assert(contentLength === body.size, 'blob body must have content length') + + const isH2 = client[kHTTPConnVersion] === 'h2' + try { + if (contentLength != null && contentLength !== body.size) { + throw new RequestContentLengthMismatchError() + } + + const buffer = Buffer.from(await body.arrayBuffer()) + + if (isH2) { + h2stream.cork() + h2stream.write(buffer) + h2stream.uncork() + } else { + socket.cork() + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + socket.write(buffer) + socket.uncork() + } + + request.onBodySent(buffer) + request.onRequestSent() + + if (!expectsPayload) { + socket[kReset] = true + } + + resume(client) + } catch (err) { + util.destroy(isH2 ? h2stream : socket, err) + } +} + +async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { + assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') + + let callback = null + function onDrain () { + if (callback) { + const cb = callback + callback = null + cb() + } + } + + const waitForDrain = () => new Promise((resolve, reject) => { + assert(callback === null) + + if (socket[kError]) { + reject(socket[kError]) + } else { + callback = resolve + } + }) + + if (client[kHTTPConnVersion] === 'h2') { + h2stream + .on('close', onDrain) + .on('drain', onDrain) + + try { + // It's up to the user to somehow abort the async iterable. + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError] + } + + const res = h2stream.write(chunk) + request.onBodySent(chunk) + if (!res) { + await waitForDrain() + } + } + } catch (err) { + h2stream.destroy(err) + } finally { + request.onRequestSent() + h2stream.end() + h2stream + .off('close', onDrain) + .off('drain', onDrain) + } + + return + } + + socket + .on('close', onDrain) + .on('drain', onDrain) + + const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header }) + try { + // It's up to the user to somehow abort the async iterable. + for await (const chunk of body) { + if (socket[kError]) { + throw socket[kError] + } + + if (!writer.write(chunk)) { + await waitForDrain() + } + } + + writer.end() + } catch (err) { + writer.destroy(err) + } finally { + socket + .off('close', onDrain) + .off('drain', onDrain) + } +} + +class AsyncWriter { + constructor ({ socket, request, contentLength, client, expectsPayload, header }) { + this.socket = socket + this.request = request + this.contentLength = contentLength + this.client = client + this.bytesWritten = 0 + this.expectsPayload = expectsPayload + this.header = header + + socket[kWriting] = true + } + + write (chunk) { + const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this + + if (socket[kError]) { + throw socket[kError] + } + + if (socket.destroyed) { + return false + } + + const len = Buffer.byteLength(chunk) + if (!len) { + return true + } + + // We should defer writing chunks. + if (contentLength !== null && bytesWritten + len > contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError() + } + + process.emitWarning(new RequestContentLengthMismatchError()) + } + + socket.cork() + + if (bytesWritten === 0) { + if (!expectsPayload) { + socket[kReset] = true + } + + if (contentLength === null) { + socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1') + } else { + socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') + } + } + + if (contentLength === null) { + socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1') + } + + this.bytesWritten += len + + const ret = socket.write(chunk) + + socket.uncork() + + request.onBodySent(chunk) + + if (!ret) { + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh() + } + } + } + + return ret + } + + end () { + const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this + request.onRequestSent() + + socket[kWriting] = false + + if (socket[kError]) { + throw socket[kError] + } + + if (socket.destroyed) { + return + } + + if (bytesWritten === 0) { + if (expectsPayload) { + // https://tools.ietf.org/html/rfc7230#section-3.3.2 + // A user agent SHOULD send a Content-Length in a request message when + // no Transfer-Encoding is sent and the request method defines a meaning + // for an enclosed payload body. + + socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') + } else { + socket.write(`${header}\r\n`, 'latin1') + } + } else if (contentLength === null) { + socket.write('\r\n0\r\n\r\n', 'latin1') + } + + if (contentLength !== null && bytesWritten !== contentLength) { + if (client[kStrictContentLength]) { + throw new RequestContentLengthMismatchError() + } else { + process.emitWarning(new RequestContentLengthMismatchError()) + } + } + + if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { + // istanbul ignore else: only for jest + if (socket[kParser].timeout.refresh) { + socket[kParser].timeout.refresh() + } + } + + resume(client) + } + + destroy (err) { + const { socket, client } = this + + socket[kWriting] = false + + if (err) { + assert(client[kRunning] <= 1, 'pipeline should only contain this request') + util.destroy(socket, err) + } + } +} + +function errorRequest (client, request, err) { + try { + request.onError(err) + assert(request.aborted) + } catch (err) { + client.emit('error', err) + } +} + +module.exports = Client + + +/***/ }), + +/***/ 56436: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/* istanbul ignore file: only for Node 12 */ + +const { kConnected, kSize } = __nccwpck_require__(72785) + +class CompatWeakRef { + constructor (value) { + this.value = value + } + + deref () { + return this.value[kConnected] === 0 && this.value[kSize] === 0 + ? undefined + : this.value + } +} + +class CompatFinalizer { + constructor (finalizer) { + this.finalizer = finalizer + } + + register (dispatcher, key) { + if (dispatcher.on) { + dispatcher.on('disconnect', () => { + if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { + this.finalizer(key) + } + }) + } + } +} + +module.exports = function () { + // FIXME: remove workaround when the Node bug is fixed + // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 + if (process.env.NODE_V8_COVERAGE) { + return { + WeakRef: CompatWeakRef, + FinalizationRegistry: CompatFinalizer + } + } + return { + WeakRef: global.WeakRef || CompatWeakRef, + FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer + } +} + + +/***/ }), + +/***/ 20663: +/***/ ((module) => { + +"use strict"; + + +// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size +const maxAttributeValueSize = 1024 + +// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size +const maxNameValuePairSize = 4096 + +module.exports = { + maxAttributeValueSize, + maxNameValuePairSize +} + + +/***/ }), + +/***/ 41724: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { parseSetCookie } = __nccwpck_require__(24408) +const { stringify, getHeadersList } = __nccwpck_require__(43121) +const { webidl } = __nccwpck_require__(21744) +const { Headers } = __nccwpck_require__(10554) + +/** + * @typedef {Object} Cookie + * @property {string} name + * @property {string} value + * @property {Date|number|undefined} expires + * @property {number|undefined} maxAge + * @property {string|undefined} domain + * @property {string|undefined} path + * @property {boolean|undefined} secure + * @property {boolean|undefined} httpOnly + * @property {'Strict'|'Lax'|'None'} sameSite + * @property {string[]} unparsed + */ + +/** + * @param {Headers} headers + * @returns {Record} + */ +function getCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookie = headers.get('cookie') + const out = {} + + if (!cookie) { + return out + } + + for (const piece of cookie.split(';')) { + const [name, ...value] = piece.split('=') + + out[name.trim()] = value.join('=') + } + + return out +} + +/** + * @param {Headers} headers + * @param {string} name + * @param {{ path?: string, domain?: string }|undefined} attributes + * @returns {void} + */ +function deleteCookie (headers, name, attributes) { + webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + name = webidl.converters.DOMString(name) + attributes = webidl.converters.DeleteCookieAttributes(attributes) + + // Matches behavior of + // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278 + setCookie(headers, { + name, + value: '', + expires: new Date(0), + ...attributes + }) +} + +/** + * @param {Headers} headers + * @returns {Cookie[]} + */ +function getSetCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookies = getHeadersList(headers).cookies + + if (!cookies) { + return [] + } + + // In older versions of undici, cookies is a list of name:value. + return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)) +} + +/** + * @param {Headers} headers + * @param {Cookie} cookie + * @returns {void} + */ +function setCookie (headers, cookie) { + webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' }) + + webidl.brandCheck(headers, Headers, { strict: false }) + + cookie = webidl.converters.Cookie(cookie) + + const str = stringify(cookie) + + if (str) { + headers.append('Set-Cookie', stringify(cookie)) + } +} + +webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: null + } +]) + +webidl.converters.Cookie = webidl.dictionaryConverter([ + { + converter: webidl.converters.DOMString, + key: 'name' + }, + { + converter: webidl.converters.DOMString, + key: 'value' + }, + { + converter: webidl.nullableConverter((value) => { + if (typeof value === 'number') { + return webidl.converters['unsigned long long'](value) + } + + return new Date(value) + }), + key: 'expires', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters['long long']), + key: 'maxAge', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'secure', + defaultValue: null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'httpOnly', + defaultValue: null + }, + { + converter: webidl.converters.USVString, + key: 'sameSite', + allowedValues: ['Strict', 'Lax', 'None'] + }, + { + converter: webidl.sequenceConverter(webidl.converters.DOMString), + key: 'unparsed', + defaultValue: [] + } +]) + +module.exports = { + getCookies, + deleteCookie, + getSetCookies, + setCookie +} + + +/***/ }), + +/***/ 24408: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(20663) +const { isCTLExcludingHtab } = __nccwpck_require__(43121) +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685) +const assert = __nccwpck_require__(39491) + +/** + * @description Parses the field-value attributes of a set-cookie header string. + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} header + * @returns if the header is invalid, null will be returned + */ +function parseSetCookie (header) { + // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F + // character (CTL characters excluding HTAB): Abort these steps and + // ignore the set-cookie-string entirely. + if (isCTLExcludingHtab(header)) { + return null + } + + let nameValuePair = '' + let unparsedAttributes = '' + let name = '' + let value = '' + + // 2. If the set-cookie-string contains a %x3B (";") character: + if (header.includes(';')) { + // 1. The name-value-pair string consists of the characters up to, + // but not including, the first %x3B (";"), and the unparsed- + // attributes consist of the remainder of the set-cookie-string + // (including the %x3B (";") in question). + const position = { position: 0 } + + nameValuePair = collectASequenceOfCodePointsFast(';', header, position) + unparsedAttributes = header.slice(position.position) + } else { + // Otherwise: + + // 1. The name-value-pair string consists of all the characters + // contained in the set-cookie-string, and the unparsed- + // attributes is the empty string. + nameValuePair = header + } + + // 3. If the name-value-pair string lacks a %x3D ("=") character, then + // the name string is empty, and the value string is the value of + // name-value-pair. + if (!nameValuePair.includes('=')) { + value = nameValuePair + } else { + // Otherwise, the name string consists of the characters up to, but + // not including, the first %x3D ("=") character, and the (possibly + // empty) value string consists of the characters after the first + // %x3D ("=") character. + const position = { position: 0 } + name = collectASequenceOfCodePointsFast( + '=', + nameValuePair, + position + ) + value = nameValuePair.slice(position.position + 1) + } + + // 4. Remove any leading or trailing WSP characters from the name + // string and the value string. + name = name.trim() + value = value.trim() + + // 5. If the sum of the lengths of the name string and the value string + // is more than 4096 octets, abort these steps and ignore the set- + // cookie-string entirely. + if (name.length + value.length > maxNameValuePairSize) { + return null + } + + // 6. The cookie-name is the name string, and the cookie-value is the + // value string. + return { + name, value, ...parseUnparsedAttributes(unparsedAttributes) + } +} + +/** + * Parses the remaining attributes of a set-cookie header + * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 + * @param {string} unparsedAttributes + * @param {[Object.]={}} cookieAttributeList + */ +function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) { + // 1. If the unparsed-attributes string is empty, skip the rest of + // these steps. + if (unparsedAttributes.length === 0) { + return cookieAttributeList + } + + // 2. Discard the first character of the unparsed-attributes (which + // will be a %x3B (";") character). + assert(unparsedAttributes[0] === ';') + unparsedAttributes = unparsedAttributes.slice(1) + + let cookieAv = '' + + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + if (unparsedAttributes.includes(';')) { + // 1. Consume the characters of the unparsed-attributes up to, but + // not including, the first %x3B (";") character. + cookieAv = collectASequenceOfCodePointsFast( + ';', + unparsedAttributes, + { position: 0 } + ) + unparsedAttributes = unparsedAttributes.slice(cookieAv.length) + } else { + // Otherwise: + + // 1. Consume the remainder of the unparsed-attributes. + cookieAv = unparsedAttributes + unparsedAttributes = '' + } + + // Let the cookie-av string be the characters consumed in this step. + + let attributeName = '' + let attributeValue = '' + + // 4. If the cookie-av string contains a %x3D ("=") character: + if (cookieAv.includes('=')) { + // 1. The (possibly empty) attribute-name string consists of the + // characters up to, but not including, the first %x3D ("=") + // character, and the (possibly empty) attribute-value string + // consists of the characters after the first %x3D ("=") + // character. + const position = { position: 0 } + + attributeName = collectASequenceOfCodePointsFast( + '=', + cookieAv, + position + ) + attributeValue = cookieAv.slice(position.position + 1) + } else { + // Otherwise: + + // 1. The attribute-name string consists of the entire cookie-av + // string, and the attribute-value string is empty. + attributeName = cookieAv + } + + // 5. Remove any leading or trailing WSP characters from the attribute- + // name string and the attribute-value string. + attributeName = attributeName.trim() + attributeValue = attributeValue.trim() + + // 6. If the attribute-value is longer than 1024 octets, ignore the + // cookie-av string and return to Step 1 of this algorithm. + if (attributeValue.length > maxAttributeValueSize) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + } + + // 7. Process the attribute-name and attribute-value according to the + // requirements in the following subsections. (Notice that + // attributes with unrecognized attribute-names are ignored.) + const attributeNameLowercase = attributeName.toLowerCase() + + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1 + // If the attribute-name case-insensitively matches the string + // "Expires", the user agent MUST process the cookie-av as follows. + if (attributeNameLowercase === 'expires') { + // 1. Let the expiry-time be the result of parsing the attribute-value + // as cookie-date (see Section 5.1.1). + const expiryTime = new Date(attributeValue) + + // 2. If the attribute-value failed to parse as a cookie date, ignore + // the cookie-av. + + cookieAttributeList.expires = expiryTime + } else if (attributeNameLowercase === 'max-age') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2 + // If the attribute-name case-insensitively matches the string "Max- + // Age", the user agent MUST process the cookie-av as follows. + + // 1. If the first character of the attribute-value is not a DIGIT or a + // "-" character, ignore the cookie-av. + const charCode = attributeValue.charCodeAt(0) + + if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + } + + // 2. If the remainder of attribute-value contains a non-DIGIT + // character, ignore the cookie-av. + if (!/^\d+$/.test(attributeValue)) { + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) + } + + // 3. Let delta-seconds be the attribute-value converted to an integer. + const deltaSeconds = Number(attributeValue) + + // 4. Let cookie-age-limit be the maximum age of the cookie (which + // SHOULD be 400 days or less, see Section 4.1.2.2). + + // 5. Set delta-seconds to the smaller of its present value and cookie- + // age-limit. + // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs) + + // 6. If delta-seconds is less than or equal to zero (0), let expiry- + // time be the earliest representable date and time. Otherwise, let + // the expiry-time be the current date and time plus delta-seconds + // seconds. + // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds + + // 7. Append an attribute to the cookie-attribute-list with an + // attribute-name of Max-Age and an attribute-value of expiry-time. + cookieAttributeList.maxAge = deltaSeconds + } else if (attributeNameLowercase === 'domain') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3 + // If the attribute-name case-insensitively matches the string "Domain", + // the user agent MUST process the cookie-av as follows. + + // 1. Let cookie-domain be the attribute-value. + let cookieDomain = attributeValue + + // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be + // cookie-domain without its leading %x2E ("."). + if (cookieDomain[0] === '.') { + cookieDomain = cookieDomain.slice(1) + } + + // 3. Convert the cookie-domain to lower case. + cookieDomain = cookieDomain.toLowerCase() + + // 4. Append an attribute to the cookie-attribute-list with an + // attribute-name of Domain and an attribute-value of cookie-domain. + cookieAttributeList.domain = cookieDomain + } else if (attributeNameLowercase === 'path') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4 + // If the attribute-name case-insensitively matches the string "Path", + // the user agent MUST process the cookie-av as follows. + + // 1. If the attribute-value is empty or if the first character of the + // attribute-value is not %x2F ("/"): + let cookiePath = '' + if (attributeValue.length === 0 || attributeValue[0] !== '/') { + // 1. Let cookie-path be the default-path. + cookiePath = '/' + } else { + // Otherwise: + + // 1. Let cookie-path be the attribute-value. + cookiePath = attributeValue + } + + // 2. Append an attribute to the cookie-attribute-list with an + // attribute-name of Path and an attribute-value of cookie-path. + cookieAttributeList.path = cookiePath + } else if (attributeNameLowercase === 'secure') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5 + // If the attribute-name case-insensitively matches the string "Secure", + // the user agent MUST append an attribute to the cookie-attribute-list + // with an attribute-name of Secure and an empty attribute-value. + + cookieAttributeList.secure = true + } else if (attributeNameLowercase === 'httponly') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6 + // If the attribute-name case-insensitively matches the string + // "HttpOnly", the user agent MUST append an attribute to the cookie- + // attribute-list with an attribute-name of HttpOnly and an empty + // attribute-value. + + cookieAttributeList.httpOnly = true + } else if (attributeNameLowercase === 'samesite') { + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7 + // If the attribute-name case-insensitively matches the string + // "SameSite", the user agent MUST process the cookie-av as follows: + + // 1. Let enforcement be "Default". + let enforcement = 'Default' + + const attributeValueLowercase = attributeValue.toLowerCase() + // 2. If cookie-av's attribute-value is a case-insensitive match for + // "None", set enforcement to "None". + if (attributeValueLowercase.includes('none')) { + enforcement = 'None' + } + + // 3. If cookie-av's attribute-value is a case-insensitive match for + // "Strict", set enforcement to "Strict". + if (attributeValueLowercase.includes('strict')) { + enforcement = 'Strict' + } + + // 4. If cookie-av's attribute-value is a case-insensitive match for + // "Lax", set enforcement to "Lax". + if (attributeValueLowercase.includes('lax')) { + enforcement = 'Lax' + } + + // 5. Append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of + // enforcement. + cookieAttributeList.sameSite = enforcement + } else { + cookieAttributeList.unparsed ??= [] + + cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`) + } + + // 8. Return to Step 1 of this algorithm. + return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) +} + +module.exports = { + parseSetCookie, + parseUnparsedAttributes +} + + +/***/ }), + +/***/ 43121: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const assert = __nccwpck_require__(39491) +const { kHeadersList } = __nccwpck_require__(72785) + +function isCTLExcludingHtab (value) { + if (value.length === 0) { + return false + } + + for (const char of value) { + const code = char.charCodeAt(0) + + if ( + (code >= 0x00 || code <= 0x08) || + (code >= 0x0A || code <= 0x1F) || + code === 0x7F + ) { + return false + } + } +} + +/** + CHAR = + token = 1* + separators = "(" | ")" | "<" | ">" | "@" + | "," | ";" | ":" | "\" | <"> + | "/" | "[" | "]" | "?" | "=" + | "{" | "}" | SP | HT + * @param {string} name + */ +function validateCookieName (name) { + for (const char of name) { + const code = char.charCodeAt(0) + + if ( + (code <= 0x20 || code > 0x7F) || + char === '(' || + char === ')' || + char === '>' || + char === '<' || + char === '@' || + char === ',' || + char === ';' || + char === ':' || + char === '\\' || + char === '"' || + char === '/' || + char === '[' || + char === ']' || + char === '?' || + char === '=' || + char === '{' || + char === '}' + ) { + throw new Error('Invalid cookie name') + } + } +} + +/** + cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) + cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E + ; US-ASCII characters excluding CTLs, + ; whitespace DQUOTE, comma, semicolon, + ; and backslash + * @param {string} value + */ +function validateCookieValue (value) { + for (const char of value) { + const code = char.charCodeAt(0) + + if ( + code < 0x21 || // exclude CTLs (0-31) + code === 0x22 || + code === 0x2C || + code === 0x3B || + code === 0x5C || + code > 0x7E // non-ascii + ) { + throw new Error('Invalid header value') + } + } +} + +/** + * path-value = + * @param {string} path + */ +function validateCookiePath (path) { + for (const char of path) { + const code = char.charCodeAt(0) + + if (code < 0x21 || char === ';') { + throw new Error('Invalid cookie path') + } + } +} + +/** + * I have no idea why these values aren't allowed to be honest, + * but Deno tests these. - Khafra + * @param {string} domain + */ +function validateCookieDomain (domain) { + if ( + domain.startsWith('-') || + domain.endsWith('.') || + domain.endsWith('-') + ) { + throw new Error('Invalid cookie domain') + } +} + +/** + * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1 + * @param {number|Date} date + IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT + ; fixed length/zone/capitalization subset of the format + ; see Section 3.3 of [RFC5322] + + day-name = %x4D.6F.6E ; "Mon", case-sensitive + / %x54.75.65 ; "Tue", case-sensitive + / %x57.65.64 ; "Wed", case-sensitive + / %x54.68.75 ; "Thu", case-sensitive + / %x46.72.69 ; "Fri", case-sensitive + / %x53.61.74 ; "Sat", case-sensitive + / %x53.75.6E ; "Sun", case-sensitive + date1 = day SP month SP year + ; e.g., 02 Jun 1982 + + day = 2DIGIT + month = %x4A.61.6E ; "Jan", case-sensitive + / %x46.65.62 ; "Feb", case-sensitive + / %x4D.61.72 ; "Mar", case-sensitive + / %x41.70.72 ; "Apr", case-sensitive + / %x4D.61.79 ; "May", case-sensitive + / %x4A.75.6E ; "Jun", case-sensitive + / %x4A.75.6C ; "Jul", case-sensitive + / %x41.75.67 ; "Aug", case-sensitive + / %x53.65.70 ; "Sep", case-sensitive + / %x4F.63.74 ; "Oct", case-sensitive + / %x4E.6F.76 ; "Nov", case-sensitive + / %x44.65.63 ; "Dec", case-sensitive + year = 4DIGIT + + GMT = %x47.4D.54 ; "GMT", case-sensitive + + time-of-day = hour ":" minute ":" second + ; 00:00:00 - 23:59:60 (leap second) + + hour = 2DIGIT + minute = 2DIGIT + second = 2DIGIT + */ +function toIMFDate (date) { + if (typeof date === 'number') { + date = new Date(date) + } + + const days = [ + 'Sun', 'Mon', 'Tue', 'Wed', + 'Thu', 'Fri', 'Sat' + ] + + const months = [ + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' + ] + + const dayName = days[date.getUTCDay()] + const day = date.getUTCDate().toString().padStart(2, '0') + const month = months[date.getUTCMonth()] + const year = date.getUTCFullYear() + const hour = date.getUTCHours().toString().padStart(2, '0') + const minute = date.getUTCMinutes().toString().padStart(2, '0') + const second = date.getUTCSeconds().toString().padStart(2, '0') + + return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT` +} + +/** + max-age-av = "Max-Age=" non-zero-digit *DIGIT + ; In practice, both expires-av and max-age-av + ; are limited to dates representable by the + ; user agent. + * @param {number} maxAge + */ +function validateCookieMaxAge (maxAge) { + if (maxAge < 0) { + throw new Error('Invalid cookie max-age') + } +} + +/** + * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1 + * @param {import('./index').Cookie} cookie + */ +function stringify (cookie) { + if (cookie.name.length === 0) { + return null + } + + validateCookieName(cookie.name) + validateCookieValue(cookie.value) + + const out = [`${cookie.name}=${cookie.value}`] + + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1 + // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2 + if (cookie.name.startsWith('__Secure-')) { + cookie.secure = true + } + + if (cookie.name.startsWith('__Host-')) { + cookie.secure = true + cookie.domain = null + cookie.path = '/' + } + + if (cookie.secure) { + out.push('Secure') + } + + if (cookie.httpOnly) { + out.push('HttpOnly') + } + + if (typeof cookie.maxAge === 'number') { + validateCookieMaxAge(cookie.maxAge) + out.push(`Max-Age=${cookie.maxAge}`) + } + + if (cookie.domain) { + validateCookieDomain(cookie.domain) + out.push(`Domain=${cookie.domain}`) + } + + if (cookie.path) { + validateCookiePath(cookie.path) + out.push(`Path=${cookie.path}`) + } + + if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') { + out.push(`Expires=${toIMFDate(cookie.expires)}`) + } + + if (cookie.sameSite) { + out.push(`SameSite=${cookie.sameSite}`) + } + + for (const part of cookie.unparsed) { + if (!part.includes('=')) { + throw new Error('Invalid unparsed') + } + + const [key, ...value] = part.split('=') + + out.push(`${key.trim()}=${value.join('=')}`) + } + + return out.join('; ') +} + +let kHeadersListNode + +function getHeadersList (headers) { + if (headers[kHeadersList]) { + return headers[kHeadersList] + } + + if (!kHeadersListNode) { + kHeadersListNode = Object.getOwnPropertySymbols(headers).find( + (symbol) => symbol.description === 'headers list' + ) + + assert(kHeadersListNode, 'Headers cannot be parsed') + } + + const headersList = headers[kHeadersListNode] + assert(headersList) + + return headersList +} + +module.exports = { + isCTLExcludingHtab, + stringify, + getHeadersList +} + + +/***/ }), + +/***/ 82067: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const net = __nccwpck_require__(41808) +const assert = __nccwpck_require__(39491) +const util = __nccwpck_require__(83983) +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(48045) + +let tls // include tls conditionally since it is not always available + +// TODO: session re-use does not wait for the first +// connection to resolve the session and might therefore +// resolve the same servername multiple times even when +// re-use is enabled. + +let SessionCache +// FIXME: remove workaround when the Node bug is fixed +// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 +if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) { + SessionCache = class WeakSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + this._sessionRegistry = new global.FinalizationRegistry((key) => { + if (this._sessionCache.size < this._maxCachedSessions) { + return + } + + const ref = this._sessionCache.get(key) + if (ref !== undefined && ref.deref() === undefined) { + this._sessionCache.delete(key) + } + }) + } + + get (sessionKey) { + const ref = this._sessionCache.get(sessionKey) + return ref ? ref.deref() : null + } + + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } + + this._sessionCache.set(sessionKey, new WeakRef(session)) + this._sessionRegistry.register(session, sessionKey) + } + } +} else { + SessionCache = class SimpleSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + } + + get (sessionKey) { + return this._sessionCache.get(sessionKey) + } + + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } + + if (this._sessionCache.size >= this._maxCachedSessions) { + // remove the oldest session + const { value: oldestKey } = this._sessionCache.keys().next() + this._sessionCache.delete(oldestKey) + } + + this._sessionCache.set(sessionKey, session) + } + } +} + +function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { + throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero') + } + + const options = { path: socketPath, ...opts } + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions) + timeout = timeout == null ? 10e3 : timeout + allowH2 = allowH2 != null ? allowH2 : false + return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + let socket + if (protocol === 'https:') { + if (!tls) { + tls = __nccwpck_require__(24404) + } + servername = servername || options.servername || util.getServerName(host) || null + + const sessionKey = servername || hostname + const session = sessionCache.get(sessionKey) || null + + assert(sessionKey) + + socket = tls.connect({ + highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... + ...options, + servername, + session, + localAddress, + // TODO(HTTP/2): Add support for h2c + ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'], + socket: httpSocket, // upgrade socket connection + port: port || 443, + host: hostname + }) + + socket + .on('session', function (session) { + // TODO (fix): Can a session become invalid once established? Don't think so? + sessionCache.set(sessionKey, session) + }) + } else { + assert(!httpSocket, 'httpSocket can only be sent on TLS update') + socket = net.connect({ + highWaterMark: 64 * 1024, // Same as nodejs fs streams. + ...options, + localAddress, + port: port || 80, + host: hostname + }) + } + + // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket + if (options.keepAlive == null || options.keepAlive) { + const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay + socket.setKeepAlive(true, keepAliveInitialDelay) + } + + const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout) + + socket + .setNoDelay(true) + .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () { + cancelTimeout() + + if (callback) { + const cb = callback + callback = null + cb(null, this) + } + }) + .on('error', function (err) { + cancelTimeout() + + if (callback) { + const cb = callback + callback = null + cb(err) + } + }) + + return socket + } +} + +function setupTimeout (onConnectTimeout, timeout) { + if (!timeout) { + return () => {} + } + + let s1 = null + let s2 = null + const timeoutId = setTimeout(() => { + // setImmediate is added to make sure that we priotorise socket error events over timeouts + s1 = setImmediate(() => { + if (process.platform === 'win32') { + // Windows needs an extra setImmediate probably due to implementation differences in the socket logic + s2 = setImmediate(() => onConnectTimeout()) + } else { + onConnectTimeout() + } + }) + }, timeout) + return () => { + clearTimeout(timeoutId) + clearImmediate(s1) + clearImmediate(s2) + } +} + +function onConnectTimeout (socket) { + util.destroy(socket, new ConnectTimeoutError()) +} + +module.exports = buildConnector + + +/***/ }), + +/***/ 48045: +/***/ ((module) => { + +"use strict"; + + +class UndiciError extends Error { + constructor (message) { + super(message) + this.name = 'UndiciError' + this.code = 'UND_ERR' + } +} + +class ConnectTimeoutError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ConnectTimeoutError) + this.name = 'ConnectTimeoutError' + this.message = message || 'Connect Timeout Error' + this.code = 'UND_ERR_CONNECT_TIMEOUT' + } +} + +class HeadersTimeoutError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, HeadersTimeoutError) + this.name = 'HeadersTimeoutError' + this.message = message || 'Headers Timeout Error' + this.code = 'UND_ERR_HEADERS_TIMEOUT' + } +} + +class HeadersOverflowError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, HeadersOverflowError) + this.name = 'HeadersOverflowError' + this.message = message || 'Headers Overflow Error' + this.code = 'UND_ERR_HEADERS_OVERFLOW' + } +} + +class BodyTimeoutError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, BodyTimeoutError) + this.name = 'BodyTimeoutError' + this.message = message || 'Body Timeout Error' + this.code = 'UND_ERR_BODY_TIMEOUT' + } +} + +class ResponseStatusCodeError extends UndiciError { + constructor (message, statusCode, headers, body) { + super(message) + Error.captureStackTrace(this, ResponseStatusCodeError) + this.name = 'ResponseStatusCodeError' + this.message = message || 'Response Status Code Error' + this.code = 'UND_ERR_RESPONSE_STATUS_CODE' + this.body = body + this.status = statusCode + this.statusCode = statusCode + this.headers = headers + } +} + +class InvalidArgumentError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, InvalidArgumentError) + this.name = 'InvalidArgumentError' + this.message = message || 'Invalid Argument Error' + this.code = 'UND_ERR_INVALID_ARG' + } +} + +class InvalidReturnValueError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, InvalidReturnValueError) + this.name = 'InvalidReturnValueError' + this.message = message || 'Invalid Return Value Error' + this.code = 'UND_ERR_INVALID_RETURN_VALUE' + } +} + +class RequestAbortedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, RequestAbortedError) + this.name = 'AbortError' + this.message = message || 'Request aborted' + this.code = 'UND_ERR_ABORTED' + } +} + +class InformationalError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, InformationalError) + this.name = 'InformationalError' + this.message = message || 'Request information' + this.code = 'UND_ERR_INFO' + } +} + +class RequestContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, RequestContentLengthMismatchError) + this.name = 'RequestContentLengthMismatchError' + this.message = message || 'Request body length does not match content-length header' + this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' + } +} + +class ResponseContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ResponseContentLengthMismatchError) + this.name = 'ResponseContentLengthMismatchError' + this.message = message || 'Response body length does not match content-length header' + this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' + } +} + +class ClientDestroyedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ClientDestroyedError) + this.name = 'ClientDestroyedError' + this.message = message || 'The client is destroyed' + this.code = 'UND_ERR_DESTROYED' + } +} + +class ClientClosedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ClientClosedError) + this.name = 'ClientClosedError' + this.message = message || 'The client is closed' + this.code = 'UND_ERR_CLOSED' + } +} + +class SocketError extends UndiciError { + constructor (message, socket) { + super(message) + Error.captureStackTrace(this, SocketError) + this.name = 'SocketError' + this.message = message || 'Socket error' + this.code = 'UND_ERR_SOCKET' + this.socket = socket + } +} + +class NotSupportedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, NotSupportedError) + this.name = 'NotSupportedError' + this.message = message || 'Not supported error' + this.code = 'UND_ERR_NOT_SUPPORTED' + } +} + +class BalancedPoolMissingUpstreamError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, NotSupportedError) + this.name = 'MissingUpstreamError' + this.message = message || 'No upstream has been added to the BalancedPool' + this.code = 'UND_ERR_BPL_MISSING_UPSTREAM' + } +} + +class HTTPParserError extends Error { + constructor (message, code, data) { + super(message) + Error.captureStackTrace(this, HTTPParserError) + this.name = 'HTTPParserError' + this.code = code ? `HPE_${code}` : undefined + this.data = data ? data.toString() : undefined + } +} + +class ResponseExceededMaxSizeError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, ResponseExceededMaxSizeError) + this.name = 'ResponseExceededMaxSizeError' + this.message = message || 'Response content exceeded max size' + this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE' + } +} + +class RequestRetryError extends UndiciError { + constructor (message, code, { headers, data }) { + super(message) + Error.captureStackTrace(this, RequestRetryError) + this.name = 'RequestRetryError' + this.message = message || 'Request retry error' + this.code = 'UND_ERR_REQ_RETRY' + this.statusCode = code + this.data = data + this.headers = headers + } +} + +module.exports = { + HTTPParserError, + UndiciError, + HeadersTimeoutError, + HeadersOverflowError, + BodyTimeoutError, + RequestContentLengthMismatchError, + ConnectTimeoutError, + ResponseStatusCodeError, + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError, + ClientDestroyedError, + ClientClosedError, + InformationalError, + SocketError, + NotSupportedError, + ResponseContentLengthMismatchError, + BalancedPoolMissingUpstreamError, + ResponseExceededMaxSizeError, + RequestRetryError +} + + +/***/ }), + +/***/ 62905: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + InvalidArgumentError, + NotSupportedError +} = __nccwpck_require__(48045) +const assert = __nccwpck_require__(39491) +const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(72785) +const util = __nccwpck_require__(83983) + +// tokenRegExp and headerCharRegex have been lifted from +// https://github.com/nodejs/node/blob/main/lib/_http_common.js + +/** + * Verifies that the given val is a valid HTTP token + * per the rules defined in RFC 7230 + * See https://tools.ietf.org/html/rfc7230#section-3.2.6 + */ +const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/ + +/** + * Matches if val contains an invalid field-vchar + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + */ +const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/ + +// Verifies that a given path is valid does not contain control chars \x00 to \x20 +const invalidPathRegex = /[^\u0021-\u00ff]/ + +const kHandler = Symbol('handler') + +const channels = {} + +let extractBody + +try { + const diagnosticsChannel = __nccwpck_require__(67643) + channels.create = diagnosticsChannel.channel('undici:request:create') + channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent') + channels.headers = diagnosticsChannel.channel('undici:request:headers') + channels.trailers = diagnosticsChannel.channel('undici:request:trailers') + channels.error = diagnosticsChannel.channel('undici:request:error') +} catch { + channels.create = { hasSubscribers: false } + channels.bodySent = { hasSubscribers: false } + channels.headers = { hasSubscribers: false } + channels.trailers = { hasSubscribers: false } + channels.error = { hasSubscribers: false } +} + +class Request { + constructor (origin, { + path, + method, + body, + headers, + query, + idempotent, + blocking, + upgrade, + headersTimeout, + bodyTimeout, + reset, + throwOnError, + expectContinue + }, handler) { + if (typeof path !== 'string') { + throw new InvalidArgumentError('path must be a string') + } else if ( + path[0] !== '/' && + !(path.startsWith('http://') || path.startsWith('https://')) && + method !== 'CONNECT' + ) { + throw new InvalidArgumentError('path must be an absolute URL or start with a slash') + } else if (invalidPathRegex.exec(path) !== null) { + throw new InvalidArgumentError('invalid request path') + } + + if (typeof method !== 'string') { + throw new InvalidArgumentError('method must be a string') + } else if (tokenRegExp.exec(method) === null) { + throw new InvalidArgumentError('invalid request method') + } + + if (upgrade && typeof upgrade !== 'string') { + throw new InvalidArgumentError('upgrade must be a string') + } + + if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { + throw new InvalidArgumentError('invalid headersTimeout') + } + + if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { + throw new InvalidArgumentError('invalid bodyTimeout') + } + + if (reset != null && typeof reset !== 'boolean') { + throw new InvalidArgumentError('invalid reset') + } + + if (expectContinue != null && typeof expectContinue !== 'boolean') { + throw new InvalidArgumentError('invalid expectContinue') + } + + this.headersTimeout = headersTimeout + + this.bodyTimeout = bodyTimeout + + this.throwOnError = throwOnError === true + + this.method = method + + this.abort = null + + if (body == null) { + this.body = null + } else if (util.isStream(body)) { + this.body = body + + const rState = this.body._readableState + if (!rState || !rState.autoDestroy) { + this.endHandler = function autoDestroy () { + util.destroy(this) + } + this.body.on('end', this.endHandler) + } + + this.errorHandler = err => { + if (this.abort) { + this.abort(err) + } else { + this.error = err + } + } + this.body.on('error', this.errorHandler) + } else if (util.isBuffer(body)) { + this.body = body.byteLength ? body : null + } else if (ArrayBuffer.isView(body)) { + this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null + } else if (body instanceof ArrayBuffer) { + this.body = body.byteLength ? Buffer.from(body) : null + } else if (typeof body === 'string') { + this.body = body.length ? Buffer.from(body) : null + } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) { + this.body = body + } else { + throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable') + } + + this.completed = false + + this.aborted = false + + this.upgrade = upgrade || null + + this.path = query ? util.buildURL(path, query) : path + + this.origin = origin + + this.idempotent = idempotent == null + ? method === 'HEAD' || method === 'GET' + : idempotent + + this.blocking = blocking == null ? false : blocking + + this.reset = reset == null ? null : reset + + this.host = null + + this.contentLength = null + + this.contentType = null + + this.headers = '' + + // Only for H2 + this.expectContinue = expectContinue != null ? expectContinue : false + + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError('headers array must be even') + } + for (let i = 0; i < headers.length; i += 2) { + processHeader(this, headers[i], headers[i + 1]) + } + } else if (headers && typeof headers === 'object') { + const keys = Object.keys(headers) + for (let i = 0; i < keys.length; i++) { + const key = keys[i] + processHeader(this, key, headers[key]) + } + } else if (headers != null) { + throw new InvalidArgumentError('headers must be an object or an array') + } + + if (util.isFormDataLike(this.body)) { + if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) { + throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.') + } + + if (!extractBody) { + extractBody = (__nccwpck_require__(41472).extractBody) + } + + const [bodyStream, contentType] = extractBody(body) + if (this.contentType == null) { + this.contentType = contentType + this.headers += `content-type: ${contentType}\r\n` + } + this.body = bodyStream.stream + this.contentLength = bodyStream.length + } else if (util.isBlobLike(body) && this.contentType == null && body.type) { + this.contentType = body.type + this.headers += `content-type: ${body.type}\r\n` + } + + util.validateHandler(handler, method, upgrade) + + this.servername = util.getServerName(this.host) + + this[kHandler] = handler + + if (channels.create.hasSubscribers) { + channels.create.publish({ request: this }) + } + } + + onBodySent (chunk) { + if (this[kHandler].onBodySent) { + try { + return this[kHandler].onBodySent(chunk) + } catch (err) { + this.abort(err) + } + } + } + + onRequestSent () { + if (channels.bodySent.hasSubscribers) { + channels.bodySent.publish({ request: this }) + } + + if (this[kHandler].onRequestSent) { + try { + return this[kHandler].onRequestSent() + } catch (err) { + this.abort(err) + } + } + } + + onConnect (abort) { + assert(!this.aborted) + assert(!this.completed) + + if (this.error) { + abort(this.error) + } else { + this.abort = abort + return this[kHandler].onConnect(abort) + } + } + + onHeaders (statusCode, headers, resume, statusText) { + assert(!this.aborted) + assert(!this.completed) + + if (channels.headers.hasSubscribers) { + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) + } + + try { + return this[kHandler].onHeaders(statusCode, headers, resume, statusText) + } catch (err) { + this.abort(err) + } + } + + onData (chunk) { + assert(!this.aborted) + assert(!this.completed) + + try { + return this[kHandler].onData(chunk) + } catch (err) { + this.abort(err) + return false + } + } + + onUpgrade (statusCode, headers, socket) { + assert(!this.aborted) + assert(!this.completed) + + return this[kHandler].onUpgrade(statusCode, headers, socket) + } + + onComplete (trailers) { + this.onFinally() + + assert(!this.aborted) + + this.completed = true + if (channels.trailers.hasSubscribers) { + channels.trailers.publish({ request: this, trailers }) + } + + try { + return this[kHandler].onComplete(trailers) + } catch (err) { + // TODO (fix): This might be a bad idea? + this.onError(err) + } + } + + onError (error) { + this.onFinally() + + if (channels.error.hasSubscribers) { + channels.error.publish({ request: this, error }) + } + + if (this.aborted) { + return + } + this.aborted = true + + return this[kHandler].onError(error) + } + + onFinally () { + if (this.errorHandler) { + this.body.off('error', this.errorHandler) + this.errorHandler = null + } + + if (this.endHandler) { + this.body.off('end', this.endHandler) + this.endHandler = null + } + } + + // TODO: adjust to support H2 + addHeader (key, value) { + processHeader(this, key, value) + return this + } + + static [kHTTP1BuildRequest] (origin, opts, handler) { + // TODO: Migrate header parsing here, to make Requests + // HTTP agnostic + return new Request(origin, opts, handler) + } + + static [kHTTP2BuildRequest] (origin, opts, handler) { + const headers = opts.headers + opts = { ...opts, headers: null } + + const request = new Request(origin, opts, handler) + + request.headers = {} + + if (Array.isArray(headers)) { + if (headers.length % 2 !== 0) { + throw new InvalidArgumentError('headers array must be even') + } + for (let i = 0; i < headers.length; i += 2) { + processHeader(request, headers[i], headers[i + 1], true) + } + } else if (headers && typeof headers === 'object') { + const keys = Object.keys(headers) + for (let i = 0; i < keys.length; i++) { + const key = keys[i] + processHeader(request, key, headers[key], true) + } + } else if (headers != null) { + throw new InvalidArgumentError('headers must be an object or an array') + } + + return request + } + + static [kHTTP2CopyHeaders] (raw) { + const rawHeaders = raw.split('\r\n') + const headers = {} + + for (const header of rawHeaders) { + const [key, value] = header.split(': ') + + if (value == null || value.length === 0) continue + + if (headers[key]) headers[key] += `,${value}` + else headers[key] = value + } + + return headers + } +} + +function processHeaderValue (key, val, skipAppend) { + if (val && typeof val === 'object') { + throw new InvalidArgumentError(`invalid ${key} header`) + } + + val = val != null ? `${val}` : '' + + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError(`invalid ${key} header`) + } + + return skipAppend ? val : `${key}: ${val}\r\n` +} + +function processHeader (request, key, val, skipAppend = false) { + if (val && (typeof val === 'object' && !Array.isArray(val))) { + throw new InvalidArgumentError(`invalid ${key} header`) + } else if (val === undefined) { + return + } + + if ( + request.host === null && + key.length === 4 && + key.toLowerCase() === 'host' + ) { + if (headerCharRegex.exec(val) !== null) { + throw new InvalidArgumentError(`invalid ${key} header`) + } + // Consumed by Client + request.host = val + } else if ( + request.contentLength === null && + key.length === 14 && + key.toLowerCase() === 'content-length' + ) { + request.contentLength = parseInt(val, 10) + if (!Number.isFinite(request.contentLength)) { + throw new InvalidArgumentError('invalid content-length header') + } + } else if ( + request.contentType === null && + key.length === 12 && + key.toLowerCase() === 'content-type' + ) { + request.contentType = val + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) + else request.headers += processHeaderValue(key, val) + } else if ( + key.length === 17 && + key.toLowerCase() === 'transfer-encoding' + ) { + throw new InvalidArgumentError('invalid transfer-encoding header') + } else if ( + key.length === 10 && + key.toLowerCase() === 'connection' + ) { + const value = typeof val === 'string' ? val.toLowerCase() : null + if (value !== 'close' && value !== 'keep-alive') { + throw new InvalidArgumentError('invalid connection header') + } else if (value === 'close') { + request.reset = true + } + } else if ( + key.length === 10 && + key.toLowerCase() === 'keep-alive' + ) { + throw new InvalidArgumentError('invalid keep-alive header') + } else if ( + key.length === 7 && + key.toLowerCase() === 'upgrade' + ) { + throw new InvalidArgumentError('invalid upgrade header') + } else if ( + key.length === 6 && + key.toLowerCase() === 'expect' + ) { + throw new NotSupportedError('expect header not supported') + } else if (tokenRegExp.exec(key) === null) { + throw new InvalidArgumentError('invalid header key') + } else { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { + if (skipAppend) { + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}` + else request.headers[key] = processHeaderValue(key, val[i], skipAppend) + } else { + request.headers += processHeaderValue(key, val[i]) + } + } + } else { + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend) + else request.headers += processHeaderValue(key, val) + } + } +} + +module.exports = Request + + +/***/ }), + +/***/ 72785: +/***/ ((module) => { + +module.exports = { + kClose: Symbol('close'), + kDestroy: Symbol('destroy'), + kDispatch: Symbol('dispatch'), + kUrl: Symbol('url'), + kWriting: Symbol('writing'), + kResuming: Symbol('resuming'), + kQueue: Symbol('queue'), + kConnect: Symbol('connect'), + kConnecting: Symbol('connecting'), + kHeadersList: Symbol('headers list'), + kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), + kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), + kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), + kKeepAliveTimeoutValue: Symbol('keep alive timeout'), + kKeepAlive: Symbol('keep alive'), + kHeadersTimeout: Symbol('headers timeout'), + kBodyTimeout: Symbol('body timeout'), + kServerName: Symbol('server name'), + kLocalAddress: Symbol('local address'), + kHost: Symbol('host'), + kNoRef: Symbol('no ref'), + kBodyUsed: Symbol('used'), + kRunning: Symbol('running'), + kBlocking: Symbol('blocking'), + kPending: Symbol('pending'), + kSize: Symbol('size'), + kBusy: Symbol('busy'), + kQueued: Symbol('queued'), + kFree: Symbol('free'), + kConnected: Symbol('connected'), + kClosed: Symbol('closed'), + kNeedDrain: Symbol('need drain'), + kReset: Symbol('reset'), + kDestroyed: Symbol.for('nodejs.stream.destroyed'), + kMaxHeadersSize: Symbol('max headers size'), + kRunningIdx: Symbol('running index'), + kPendingIdx: Symbol('pending index'), + kError: Symbol('error'), + kClients: Symbol('clients'), + kClient: Symbol('client'), + kParser: Symbol('parser'), + kOnDestroyed: Symbol('destroy callbacks'), + kPipelining: Symbol('pipelining'), + kSocket: Symbol('socket'), + kHostHeader: Symbol('host header'), + kConnector: Symbol('connector'), + kStrictContentLength: Symbol('strict content length'), + kMaxRedirections: Symbol('maxRedirections'), + kMaxRequests: Symbol('maxRequestsPerClient'), + kProxy: Symbol('proxy agent options'), + kCounter: Symbol('socket request counter'), + kInterceptors: Symbol('dispatch interceptors'), + kMaxResponseSize: Symbol('max response size'), + kHTTP2Session: Symbol('http2Session'), + kHTTP2SessionState: Symbol('http2Session state'), + kHTTP2BuildRequest: Symbol('http2 build request'), + kHTTP1BuildRequest: Symbol('http1 build request'), + kHTTP2CopyHeaders: Symbol('http2 copy headers'), + kHTTPConnVersion: Symbol('http connection version'), + kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), + kConstruct: Symbol('constructable') +} + + +/***/ }), + +/***/ 83983: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const assert = __nccwpck_require__(39491) +const { kDestroyed, kBodyUsed } = __nccwpck_require__(72785) +const { IncomingMessage } = __nccwpck_require__(13685) +const stream = __nccwpck_require__(12781) +const net = __nccwpck_require__(41808) +const { InvalidArgumentError } = __nccwpck_require__(48045) +const { Blob } = __nccwpck_require__(14300) +const nodeUtil = __nccwpck_require__(73837) +const { stringify } = __nccwpck_require__(63477) + +const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) + +function nop () {} + +function isStream (obj) { + return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function' +} + +// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License) +function isBlobLike (object) { + return (Blob && object instanceof Blob) || ( + object && + typeof object === 'object' && + (typeof object.stream === 'function' || + typeof object.arrayBuffer === 'function') && + /^(Blob|File)$/.test(object[Symbol.toStringTag]) + ) +} + +function buildURL (url, queryParams) { + if (url.includes('?') || url.includes('#')) { + throw new Error('Query params cannot be passed when url already contains "?" or "#".') + } + + const stringified = stringify(queryParams) + + if (stringified) { + url += '?' + stringified + } + + return url +} + +function parseURL (url) { + if (typeof url === 'string') { + url = new URL(url) + + if (!/^https?:/.test(url.origin || url.protocol)) { + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') + } + + return url + } + + if (!url || typeof url !== 'object') { + throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.') + } + + if (!/^https?:/.test(url.origin || url.protocol)) { + throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') + } + + if (!(url instanceof URL)) { + if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) { + throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.') + } + + if (url.path != null && typeof url.path !== 'string') { + throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.') + } + + if (url.pathname != null && typeof url.pathname !== 'string') { + throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.') + } + + if (url.hostname != null && typeof url.hostname !== 'string') { + throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.') + } + + if (url.origin != null && typeof url.origin !== 'string') { + throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.') + } + + const port = url.port != null + ? url.port + : (url.protocol === 'https:' ? 443 : 80) + let origin = url.origin != null + ? url.origin + : `${url.protocol}//${url.hostname}:${port}` + let path = url.path != null + ? url.path + : `${url.pathname || ''}${url.search || ''}` + + if (origin.endsWith('/')) { + origin = origin.substring(0, origin.length - 1) + } + + if (path && !path.startsWith('/')) { + path = `/${path}` + } + // new URL(path, origin) is unsafe when `path` contains an absolute URL + // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL: + // If first parameter is a relative URL, second param is required, and will be used as the base URL. + // If first parameter is an absolute URL, a given second param will be ignored. + url = new URL(origin + path) + } + + return url +} + +function parseOrigin (url) { + url = parseURL(url) + + if (url.pathname !== '/' || url.search || url.hash) { + throw new InvalidArgumentError('invalid url') + } + + return url +} + +function getHostname (host) { + if (host[0] === '[') { + const idx = host.indexOf(']') + + assert(idx !== -1) + return host.substring(1, idx) + } + + const idx = host.indexOf(':') + if (idx === -1) return host + + return host.substring(0, idx) +} + +// IP addresses are not valid server names per RFC6066 +// > Currently, the only server names supported are DNS hostnames +function getServerName (host) { + if (!host) { + return null + } + + assert.strictEqual(typeof host, 'string') + + const servername = getHostname(host) + if (net.isIP(servername)) { + return '' + } + + return servername +} + +function deepClone (obj) { + return JSON.parse(JSON.stringify(obj)) +} + +function isAsyncIterable (obj) { + return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function') +} + +function isIterable (obj) { + return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function')) +} + +function bodyLength (body) { + if (body == null) { + return 0 + } else if (isStream(body)) { + const state = body._readableState + return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) + ? state.length + : null + } else if (isBlobLike(body)) { + return body.size != null ? body.size : null + } else if (isBuffer(body)) { + return body.byteLength + } + + return null +} + +function isDestroyed (stream) { + return !stream || !!(stream.destroyed || stream[kDestroyed]) +} + +function isReadableAborted (stream) { + const state = stream && stream._readableState + return isDestroyed(stream) && state && !state.endEmitted +} + +function destroy (stream, err) { + if (stream == null || !isStream(stream) || isDestroyed(stream)) { + return + } + + if (typeof stream.destroy === 'function') { + if (Object.getPrototypeOf(stream).constructor === IncomingMessage) { + // See: https://github.com/nodejs/node/pull/38505/files + stream.socket = null + } + + stream.destroy(err) + } else if (err) { + process.nextTick((stream, err) => { + stream.emit('error', err) + }, stream, err) + } + + if (stream.destroyed !== true) { + stream[kDestroyed] = true + } +} + +const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/ +function parseKeepAliveTimeout (val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR) + return m ? parseInt(m[1], 10) * 1000 : null +} + +function parseHeaders (headers, obj = {}) { + // For H2 support + if (!Array.isArray(headers)) return headers + + for (let i = 0; i < headers.length; i += 2) { + const key = headers[i].toString().toLowerCase() + let val = obj[key] + + if (!val) { + if (Array.isArray(headers[i + 1])) { + obj[key] = headers[i + 1].map(x => x.toString('utf8')) + } else { + obj[key] = headers[i + 1].toString('utf8') + } + } else { + if (!Array.isArray(val)) { + val = [val] + obj[key] = val + } + val.push(headers[i + 1].toString('utf8')) + } + } + + // See https://github.com/nodejs/node/pull/46528 + if ('content-length' in obj && 'content-disposition' in obj) { + obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1') + } + + return obj +} + +function parseRawHeaders (headers) { + const ret = [] + let hasContentLength = false + let contentDispositionIdx = -1 + + for (let n = 0; n < headers.length; n += 2) { + const key = headers[n + 0].toString() + const val = headers[n + 1].toString('utf8') + + if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) { + ret.push(key, val) + hasContentLength = true + } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) { + contentDispositionIdx = ret.push(key, val) - 1 + } else { + ret.push(key, val) + } + } + + // See https://github.com/nodejs/node/pull/46528 + if (hasContentLength && contentDispositionIdx !== -1) { + ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1') + } + + return ret +} + +function isBuffer (buffer) { + // See, https://github.com/mcollina/undici/pull/319 + return buffer instanceof Uint8Array || Buffer.isBuffer(buffer) +} + +function validateHandler (handler, method, upgrade) { + if (!handler || typeof handler !== 'object') { + throw new InvalidArgumentError('handler must be an object') + } + + if (typeof handler.onConnect !== 'function') { + throw new InvalidArgumentError('invalid onConnect method') + } + + if (typeof handler.onError !== 'function') { + throw new InvalidArgumentError('invalid onError method') + } + + if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) { + throw new InvalidArgumentError('invalid onBodySent method') + } + + if (upgrade || method === 'CONNECT') { + if (typeof handler.onUpgrade !== 'function') { + throw new InvalidArgumentError('invalid onUpgrade method') + } + } else { + if (typeof handler.onHeaders !== 'function') { + throw new InvalidArgumentError('invalid onHeaders method') + } + + if (typeof handler.onData !== 'function') { + throw new InvalidArgumentError('invalid onData method') + } + + if (typeof handler.onComplete !== 'function') { + throw new InvalidArgumentError('invalid onComplete method') + } + } +} + +// A body is disturbed if it has been read from and it cannot +// be re-used without losing state or data. +function isDisturbed (body) { + return !!(body && ( + stream.isDisturbed + ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed? + : body[kBodyUsed] || + body.readableDidRead || + (body._readableState && body._readableState.dataEmitted) || + isReadableAborted(body) + )) +} + +function isErrored (body) { + return !!(body && ( + stream.isErrored + ? stream.isErrored(body) + : /state: 'errored'/.test(nodeUtil.inspect(body) + ))) +} + +function isReadable (body) { + return !!(body && ( + stream.isReadable + ? stream.isReadable(body) + : /state: 'readable'/.test(nodeUtil.inspect(body) + ))) +} + +function getSocketInfo (socket) { + return { + localAddress: socket.localAddress, + localPort: socket.localPort, + remoteAddress: socket.remoteAddress, + remotePort: socket.remotePort, + remoteFamily: socket.remoteFamily, + timeout: socket.timeout, + bytesWritten: socket.bytesWritten, + bytesRead: socket.bytesRead + } +} + +async function * convertIterableToBuffer (iterable) { + for await (const chunk of iterable) { + yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk) + } +} + +let ReadableStream +function ReadableStreamFrom (iterable) { + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + if (ReadableStream.from) { + return ReadableStream.from(convertIterableToBuffer(iterable)) + } + + let iterator + return new ReadableStream( + { + async start () { + iterator = iterable[Symbol.asyncIterator]() + }, + async pull (controller) { + const { done, value } = await iterator.next() + if (done) { + queueMicrotask(() => { + controller.close() + }) + } else { + const buf = Buffer.isBuffer(value) ? value : Buffer.from(value) + controller.enqueue(new Uint8Array(buf)) + } + return controller.desiredSize > 0 + }, + async cancel (reason) { + await iterator.return() + } + }, + 0 + ) +} + +// The chunk should be a FormData instance and contains +// all the required methods. +function isFormDataLike (object) { + return ( + object && + typeof object === 'object' && + typeof object.append === 'function' && + typeof object.delete === 'function' && + typeof object.get === 'function' && + typeof object.getAll === 'function' && + typeof object.has === 'function' && + typeof object.set === 'function' && + object[Symbol.toStringTag] === 'FormData' + ) +} + +function throwIfAborted (signal) { + if (!signal) { return } + if (typeof signal.throwIfAborted === 'function') { + signal.throwIfAborted() + } else { + if (signal.aborted) { + // DOMException not available < v17.0.0 + const err = new Error('The operation was aborted') + err.name = 'AbortError' + throw err + } + } +} + +function addAbortListener (signal, listener) { + if ('addEventListener' in signal) { + signal.addEventListener('abort', listener, { once: true }) + return () => signal.removeEventListener('abort', listener) + } + signal.addListener('abort', listener) + return () => signal.removeListener('abort', listener) +} + +const hasToWellFormed = !!String.prototype.toWellFormed + +/** + * @param {string} val + */ +function toUSVString (val) { + if (hasToWellFormed) { + return `${val}`.toWellFormed() + } else if (nodeUtil.toUSVString) { + return nodeUtil.toUSVString(val) + } + + return `${val}` +} + +// Parsed accordingly to RFC 9110 +// https://www.rfc-editor.org/rfc/rfc9110#field.content-range +function parseRangeHeader (range) { + if (range == null || range === '') return { start: 0, end: null, size: null } + + const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null + return m + ? { + start: parseInt(m[1]), + end: m[2] ? parseInt(m[2]) : null, + size: m[3] ? parseInt(m[3]) : null + } + : null +} + +const kEnumerableProperty = Object.create(null) +kEnumerableProperty.enumerable = true + +module.exports = { + kEnumerableProperty, + nop, + isDisturbed, + isErrored, + isReadable, + toUSVString, + isReadableAborted, + isBlobLike, + parseOrigin, + parseURL, + getServerName, + isStream, + isIterable, + isAsyncIterable, + isDestroyed, + parseRawHeaders, + parseHeaders, + parseKeepAliveTimeout, + destroy, + bodyLength, + deepClone, + ReadableStreamFrom, + isBuffer, + validateHandler, + getSocketInfo, + isFormDataLike, + buildURL, + throwIfAborted, + addAbortListener, + parseRangeHeader, + nodeMajor, + nodeMinor, + nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13), + safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'] +} + + +/***/ }), + +/***/ 74839: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Dispatcher = __nccwpck_require__(60412) +const { + ClientDestroyedError, + ClientClosedError, + InvalidArgumentError +} = __nccwpck_require__(48045) +const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(72785) + +const kDestroyed = Symbol('destroyed') +const kClosed = Symbol('closed') +const kOnDestroyed = Symbol('onDestroyed') +const kOnClosed = Symbol('onClosed') +const kInterceptedDispatch = Symbol('Intercepted Dispatch') + +class DispatcherBase extends Dispatcher { + constructor () { + super() + + this[kDestroyed] = false + this[kOnDestroyed] = null + this[kClosed] = false + this[kOnClosed] = [] + } + + get destroyed () { + return this[kDestroyed] + } + + get closed () { + return this[kClosed] + } + + get interceptors () { + return this[kInterceptors] + } + + set interceptors (newInterceptors) { + if (newInterceptors) { + for (let i = newInterceptors.length - 1; i >= 0; i--) { + const interceptor = this[kInterceptors][i] + if (typeof interceptor !== 'function') { + throw new InvalidArgumentError('interceptor must be an function') + } + } + } + + this[kInterceptors] = newInterceptors + } + + close (callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + this.close((err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (this[kDestroyed]) { + queueMicrotask(() => callback(new ClientDestroyedError(), null)) + return + } + + if (this[kClosed]) { + if (this[kOnClosed]) { + this[kOnClosed].push(callback) + } else { + queueMicrotask(() => callback(null, null)) + } + return + } + + this[kClosed] = true + this[kOnClosed].push(callback) + + const onClosed = () => { + const callbacks = this[kOnClosed] + this[kOnClosed] = null + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null) + } + } + + // Should not error. + this[kClose]() + .then(() => this.destroy()) + .then(() => { + queueMicrotask(onClosed) + }) + } + + destroy (err, callback) { + if (typeof err === 'function') { + callback = err + err = null + } + + if (callback === undefined) { + return new Promise((resolve, reject) => { + this.destroy(err, (err, data) => { + return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data) + }) + }) + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (this[kDestroyed]) { + if (this[kOnDestroyed]) { + this[kOnDestroyed].push(callback) + } else { + queueMicrotask(() => callback(null, null)) + } + return + } + + if (!err) { + err = new ClientDestroyedError() + } + + this[kDestroyed] = true + this[kOnDestroyed] = this[kOnDestroyed] || [] + this[kOnDestroyed].push(callback) + + const onDestroyed = () => { + const callbacks = this[kOnDestroyed] + this[kOnDestroyed] = null + for (let i = 0; i < callbacks.length; i++) { + callbacks[i](null, null) + } + } + + // Should not error. + this[kDestroy](err).then(() => { + queueMicrotask(onDestroyed) + }) + } + + [kInterceptedDispatch] (opts, handler) { + if (!this[kInterceptors] || this[kInterceptors].length === 0) { + this[kInterceptedDispatch] = this[kDispatch] + return this[kDispatch](opts, handler) + } + + let dispatch = this[kDispatch].bind(this) + for (let i = this[kInterceptors].length - 1; i >= 0; i--) { + dispatch = this[kInterceptors][i](dispatch) + } + this[kInterceptedDispatch] = dispatch + return dispatch(opts, handler) + } + + dispatch (opts, handler) { + if (!handler || typeof handler !== 'object') { + throw new InvalidArgumentError('handler must be an object') + } + + try { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('opts must be an object.') + } + + if (this[kDestroyed] || this[kOnDestroyed]) { + throw new ClientDestroyedError() + } + + if (this[kClosed]) { + throw new ClientClosedError() + } + + return this[kInterceptedDispatch](opts, handler) + } catch (err) { + if (typeof handler.onError !== 'function') { + throw new InvalidArgumentError('invalid onError method') + } + + handler.onError(err) + + return false + } + } +} + +module.exports = DispatcherBase + + +/***/ }), + +/***/ 60412: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const EventEmitter = __nccwpck_require__(82361) + +class Dispatcher extends EventEmitter { + dispatch () { + throw new Error('not implemented') + } + + close () { + throw new Error('not implemented') + } + + destroy () { + throw new Error('not implemented') + } +} + +module.exports = Dispatcher + + +/***/ }), + +/***/ 41472: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Busboy = __nccwpck_require__(50727) +const util = __nccwpck_require__(83983) +const { + ReadableStreamFrom, + isBlobLike, + isReadableStreamLike, + readableStreamClose, + createDeferredPromise, + fullyReadBody +} = __nccwpck_require__(52538) +const { FormData } = __nccwpck_require__(72015) +const { kState } = __nccwpck_require__(15861) +const { webidl } = __nccwpck_require__(21744) +const { DOMException, structuredClone } = __nccwpck_require__(41037) +const { Blob, File: NativeFile } = __nccwpck_require__(14300) +const { kBodyUsed } = __nccwpck_require__(72785) +const assert = __nccwpck_require__(39491) +const { isErrored } = __nccwpck_require__(83983) +const { isUint8Array, isArrayBuffer } = __nccwpck_require__(29830) +const { File: UndiciFile } = __nccwpck_require__(78511) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685) + +let ReadableStream = globalThis.ReadableStream + +/** @type {globalThis['File']} */ +const File = NativeFile ?? UndiciFile +const textEncoder = new TextEncoder() +const textDecoder = new TextDecoder() + +// https://fetch.spec.whatwg.org/#concept-bodyinit-extract +function extractBody (object, keepalive = false) { + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + // 1. Let stream be null. + let stream = null + + // 2. If object is a ReadableStream object, then set stream to object. + if (object instanceof ReadableStream) { + stream = object + } else if (isBlobLike(object)) { + // 3. Otherwise, if object is a Blob object, set stream to the + // result of running object’s get stream. + stream = object.stream() + } else { + // 4. Otherwise, set stream to a new ReadableStream object, and set + // up stream. + stream = new ReadableStream({ + async pull (controller) { + controller.enqueue( + typeof source === 'string' ? textEncoder.encode(source) : source + ) + queueMicrotask(() => readableStreamClose(controller)) + }, + start () {}, + type: undefined + }) + } + + // 5. Assert: stream is a ReadableStream object. + assert(isReadableStreamLike(stream)) + + // 6. Let action be null. + let action = null + + // 7. Let source be null. + let source = null + + // 8. Let length be null. + let length = null + + // 9. Let type be null. + let type = null + + // 10. Switch on object: + if (typeof object === 'string') { + // Set source to the UTF-8 encoding of object. + // Note: setting source to a Uint8Array here breaks some mocking assumptions. + source = object + + // Set type to `text/plain;charset=UTF-8`. + type = 'text/plain;charset=UTF-8' + } else if (object instanceof URLSearchParams) { + // URLSearchParams + + // spec says to run application/x-www-form-urlencoded on body.list + // this is implemented in Node.js as apart of an URLSearchParams instance toString method + // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490 + // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100 + + // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list. + source = object.toString() + + // Set type to `application/x-www-form-urlencoded;charset=UTF-8`. + type = 'application/x-www-form-urlencoded;charset=UTF-8' + } else if (isArrayBuffer(object)) { + // BufferSource/ArrayBuffer + + // Set source to a copy of the bytes held by object. + source = new Uint8Array(object.slice()) + } else if (ArrayBuffer.isView(object)) { + // BufferSource/ArrayBufferView + + // Set source to a copy of the bytes held by object. + source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)) + } else if (util.isFormDataLike(object)) { + const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}` + const prefix = `--${boundary}\r\nContent-Disposition: form-data` + + /*! formdata-polyfill. MIT License. Jimmy Wärting */ + const escape = (str) => + str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22') + const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n') + + // Set action to this step: run the multipart/form-data + // encoding algorithm, with object’s entry list and UTF-8. + // - This ensures that the body is immutable and can't be changed afterwords + // - That the content-length is calculated in advance. + // - And that all parts are pre-encoded and ready to be sent. + + const blobParts = [] + const rn = new Uint8Array([13, 10]) // '\r\n' + length = 0 + let hasUnknownSizeValue = false + + for (const [name, value] of object) { + if (typeof value === 'string') { + const chunk = textEncoder.encode(prefix + + `; name="${escape(normalizeLinefeeds(name))}"` + + `\r\n\r\n${normalizeLinefeeds(value)}\r\n`) + blobParts.push(chunk) + length += chunk.byteLength + } else { + const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + + (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' + + `Content-Type: ${ + value.type || 'application/octet-stream' + }\r\n\r\n`) + blobParts.push(chunk, value, rn) + if (typeof value.size === 'number') { + length += chunk.byteLength + value.size + rn.byteLength + } else { + hasUnknownSizeValue = true + } + } + } + + const chunk = textEncoder.encode(`--${boundary}--`) + blobParts.push(chunk) + length += chunk.byteLength + if (hasUnknownSizeValue) { + length = null + } + + // Set source to object. + source = object + + action = async function * () { + for (const part of blobParts) { + if (part.stream) { + yield * part.stream() + } else { + yield part + } + } + } + + // Set type to `multipart/form-data; boundary=`, + // followed by the multipart/form-data boundary string generated + // by the multipart/form-data encoding algorithm. + type = 'multipart/form-data; boundary=' + boundary + } else if (isBlobLike(object)) { + // Blob + + // Set source to object. + source = object + + // Set length to object’s size. + length = object.size + + // If object’s type attribute is not the empty byte sequence, set + // type to its value. + if (object.type) { + type = object.type + } + } else if (typeof object[Symbol.asyncIterator] === 'function') { + // If keepalive is true, then throw a TypeError. + if (keepalive) { + throw new TypeError('keepalive') + } + + // If object is disturbed or locked, then throw a TypeError. + if (util.isDisturbed(object) || object.locked) { + throw new TypeError( + 'Response body object should not be disturbed or locked' + ) + } + + stream = + object instanceof ReadableStream ? object : ReadableStreamFrom(object) + } + + // 11. If source is a byte sequence, then set action to a + // step that returns source and length to source’s length. + if (typeof source === 'string' || util.isBuffer(source)) { + length = Buffer.byteLength(source) + } + + // 12. If action is non-null, then run these steps in in parallel: + if (action != null) { + // Run action. + let iterator + stream = new ReadableStream({ + async start () { + iterator = action(object)[Symbol.asyncIterator]() + }, + async pull (controller) { + const { value, done } = await iterator.next() + if (done) { + // When running action is done, close stream. + queueMicrotask(() => { + controller.close() + }) + } else { + // Whenever one or more bytes are available and stream is not errored, + // enqueue a Uint8Array wrapping an ArrayBuffer containing the available + // bytes into stream. + if (!isErrored(stream)) { + controller.enqueue(new Uint8Array(value)) + } + } + return controller.desiredSize > 0 + }, + async cancel (reason) { + await iterator.return() + }, + type: undefined + }) + } + + // 13. Let body be a body whose stream is stream, source is source, + // and length is length. + const body = { stream, source, length } + + // 14. Return (body, type). + return [body, type] +} + +// https://fetch.spec.whatwg.org/#bodyinit-safely-extract +function safelyExtractBody (object, keepalive = false) { + if (!ReadableStream) { + // istanbul ignore next + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + // To safely extract a body and a `Content-Type` value from + // a byte sequence or BodyInit object object, run these steps: + + // 1. If object is a ReadableStream object, then: + if (object instanceof ReadableStream) { + // Assert: object is neither disturbed nor locked. + // istanbul ignore next + assert(!util.isDisturbed(object), 'The body has already been consumed.') + // istanbul ignore next + assert(!object.locked, 'The stream is locked.') + } + + // 2. Return the results of extracting object. + return extractBody(object, keepalive) +} + +function cloneBody (body) { + // To clone a body body, run these steps: + + // https://fetch.spec.whatwg.org/#concept-body-clone + + // 1. Let « out1, out2 » be the result of teeing body’s stream. + const [out1, out2] = body.stream.tee() + const out2Clone = structuredClone(out2, { transfer: [out2] }) + // This, for whatever reasons, unrefs out2Clone which allows + // the process to exit by itself. + const [, finalClone] = out2Clone.tee() + + // 2. Set body’s stream to out1. + body.stream = out1 + + // 3. Return a body whose stream is out2 and other members are copied from body. + return { + stream: finalClone, + length: body.length, + source: body.source + } +} + +async function * consumeBody (body) { + if (body) { + if (isUint8Array(body)) { + yield body + } else { + const stream = body.stream + + if (util.isDisturbed(stream)) { + throw new TypeError('The body has already been consumed.') + } + + if (stream.locked) { + throw new TypeError('The stream is locked.') + } + + // Compat. + stream[kBodyUsed] = true + + yield * stream + } + } +} + +function throwIfAborted (state) { + if (state.aborted) { + throw new DOMException('The operation was aborted.', 'AbortError') + } +} + +function bodyMixinMethods (instance) { + const methods = { + blob () { + // The blob() method steps are to return the result of + // running consume body with this and the following step + // given a byte sequence bytes: return a Blob whose + // contents are bytes and whose type attribute is this’s + // MIME type. + return specConsumeBody(this, (bytes) => { + let mimeType = bodyMimeType(this) + + if (mimeType === 'failure') { + mimeType = '' + } else if (mimeType) { + mimeType = serializeAMimeType(mimeType) + } + + // Return a Blob whose contents are bytes and type attribute + // is mimeType. + return new Blob([bytes], { type: mimeType }) + }, instance) + }, + + arrayBuffer () { + // The arrayBuffer() method steps are to return the result + // of running consume body with this and the following step + // given a byte sequence bytes: return a new ArrayBuffer + // whose contents are bytes. + return specConsumeBody(this, (bytes) => { + return new Uint8Array(bytes).buffer + }, instance) + }, + + text () { + // The text() method steps are to return the result of running + // consume body with this and UTF-8 decode. + return specConsumeBody(this, utf8DecodeBytes, instance) + }, + + json () { + // The json() method steps are to return the result of running + // consume body with this and parse JSON from bytes. + return specConsumeBody(this, parseJSONFromBytes, instance) + }, + + async formData () { + webidl.brandCheck(this, instance) + + throwIfAborted(this[kState]) + + const contentType = this.headers.get('Content-Type') + + // If mimeType’s essence is "multipart/form-data", then: + if (/multipart\/form-data/.test(contentType)) { + const headers = {} + for (const [key, value] of this.headers) headers[key.toLowerCase()] = value + + const responseFormData = new FormData() + + let busboy + + try { + busboy = new Busboy({ + headers, + preservePath: true + }) + } catch (err) { + throw new DOMException(`${err}`, 'AbortError') + } + + busboy.on('field', (name, value) => { + responseFormData.append(name, value) + }) + busboy.on('file', (name, value, filename, encoding, mimeType) => { + const chunks = [] + + if (encoding === 'base64' || encoding.toLowerCase() === 'base64') { + let base64chunk = '' + + value.on('data', (chunk) => { + base64chunk += chunk.toString().replace(/[\r\n]/gm, '') + + const end = base64chunk.length - base64chunk.length % 4 + chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64')) + + base64chunk = base64chunk.slice(end) + }) + value.on('end', () => { + chunks.push(Buffer.from(base64chunk, 'base64')) + responseFormData.append(name, new File(chunks, filename, { type: mimeType })) + }) + } else { + value.on('data', (chunk) => { + chunks.push(chunk) + }) + value.on('end', () => { + responseFormData.append(name, new File(chunks, filename, { type: mimeType })) + }) + } + }) + + const busboyResolve = new Promise((resolve, reject) => { + busboy.on('finish', resolve) + busboy.on('error', (err) => reject(new TypeError(err))) + }) + + if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk) + busboy.end() + await busboyResolve + + return responseFormData + } else if (/application\/x-www-form-urlencoded/.test(contentType)) { + // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then: + + // 1. Let entries be the result of parsing bytes. + let entries + try { + let text = '' + // application/x-www-form-urlencoded parser will keep the BOM. + // https://url.spec.whatwg.org/#concept-urlencoded-parser + // Note that streaming decoder is stateful and cannot be reused + const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true }) + + for await (const chunk of consumeBody(this[kState].body)) { + if (!isUint8Array(chunk)) { + throw new TypeError('Expected Uint8Array chunk') + } + text += streamingDecoder.decode(chunk, { stream: true }) + } + text += streamingDecoder.decode() + entries = new URLSearchParams(text) + } catch (err) { + // istanbul ignore next: Unclear when new URLSearchParams can fail on a string. + // 2. If entries is failure, then throw a TypeError. + throw Object.assign(new TypeError(), { cause: err }) + } + + // 3. Return a new FormData object whose entries are entries. + const formData = new FormData() + for (const [name, value] of entries) { + formData.append(name, value) + } + return formData + } else { + // Wait a tick before checking if the request has been aborted. + // Otherwise, a TypeError can be thrown when an AbortError should. + await Promise.resolve() + + throwIfAborted(this[kState]) + + // Otherwise, throw a TypeError. + throw webidl.errors.exception({ + header: `${instance.name}.formData`, + message: 'Could not parse content as FormData.' + }) + } + } + } + + return methods +} + +function mixinBody (prototype) { + Object.assign(prototype.prototype, bodyMixinMethods(prototype)) +} + +/** + * @see https://fetch.spec.whatwg.org/#concept-body-consume-body + * @param {Response|Request} object + * @param {(value: unknown) => unknown} convertBytesToJSValue + * @param {Response|Request} instance + */ +async function specConsumeBody (object, convertBytesToJSValue, instance) { + webidl.brandCheck(object, instance) + + throwIfAborted(object[kState]) + + // 1. If object is unusable, then return a promise rejected + // with a TypeError. + if (bodyUnusable(object[kState].body)) { + throw new TypeError('Body is unusable') + } + + // 2. Let promise be a new promise. + const promise = createDeferredPromise() + + // 3. Let errorSteps given error be to reject promise with error. + const errorSteps = (error) => promise.reject(error) + + // 4. Let successSteps given a byte sequence data be to resolve + // promise with the result of running convertBytesToJSValue + // with data. If that threw an exception, then run errorSteps + // with that exception. + const successSteps = (data) => { + try { + promise.resolve(convertBytesToJSValue(data)) + } catch (e) { + errorSteps(e) + } + } + + // 5. If object’s body is null, then run successSteps with an + // empty byte sequence. + if (object[kState].body == null) { + successSteps(new Uint8Array()) + return promise.promise + } + + // 6. Otherwise, fully read object’s body given successSteps, + // errorSteps, and object’s relevant global object. + await fullyReadBody(object[kState].body, successSteps, errorSteps) + + // 7. Return promise. + return promise.promise +} + +// https://fetch.spec.whatwg.org/#body-unusable +function bodyUnusable (body) { + // An object including the Body interface mixin is + // said to be unusable if its body is non-null and + // its body’s stream is disturbed or locked. + return body != null && (body.stream.locked || util.isDisturbed(body.stream)) +} + +/** + * @see https://encoding.spec.whatwg.org/#utf-8-decode + * @param {Buffer} buffer + */ +function utf8DecodeBytes (buffer) { + if (buffer.length === 0) { + return '' + } + + // 1. Let buffer be the result of peeking three bytes from + // ioQueue, converted to a byte sequence. + + // 2. If buffer is 0xEF 0xBB 0xBF, then read three + // bytes from ioQueue. (Do nothing with those bytes.) + if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { + buffer = buffer.subarray(3) + } + + // 3. Process a queue with an instance of UTF-8’s + // decoder, ioQueue, output, and "replacement". + const output = textDecoder.decode(buffer) + + // 4. Return output. + return output +} + +/** + * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value + * @param {Uint8Array} bytes + */ +function parseJSONFromBytes (bytes) { + return JSON.parse(utf8DecodeBytes(bytes)) +} + +/** + * @see https://fetch.spec.whatwg.org/#concept-body-mime-type + * @param {import('./response').Response|import('./request').Request} object + */ +function bodyMimeType (object) { + const { headersList } = object[kState] + const contentType = headersList.get('content-type') + + if (contentType === null) { + return 'failure' + } + + return parseMIMEType(contentType) +} + +module.exports = { + extractBody, + safelyExtractBody, + cloneBody, + mixinBody +} + + +/***/ }), + +/***/ 41037: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(71267) + +const corsSafeListedMethods = ['GET', 'HEAD', 'POST'] +const corsSafeListedMethodsSet = new Set(corsSafeListedMethods) + +const nullBodyStatus = [101, 204, 205, 304] + +const redirectStatus = [301, 302, 303, 307, 308] +const redirectStatusSet = new Set(redirectStatus) + +// https://fetch.spec.whatwg.org/#block-bad-port +const badPorts = [ + '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79', + '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137', + '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532', + '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723', + '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697', + '10080' +] + +const badPortsSet = new Set(badPorts) + +// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies +const referrerPolicy = [ + '', + 'no-referrer', + 'no-referrer-when-downgrade', + 'same-origin', + 'origin', + 'strict-origin', + 'origin-when-cross-origin', + 'strict-origin-when-cross-origin', + 'unsafe-url' +] +const referrerPolicySet = new Set(referrerPolicy) + +const requestRedirect = ['follow', 'manual', 'error'] + +const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE'] +const safeMethodsSet = new Set(safeMethods) + +const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors'] + +const requestCredentials = ['omit', 'same-origin', 'include'] + +const requestCache = [ + 'default', + 'no-store', + 'reload', + 'no-cache', + 'force-cache', + 'only-if-cached' +] + +// https://fetch.spec.whatwg.org/#request-body-header-name +const requestBodyHeader = [ + 'content-encoding', + 'content-language', + 'content-location', + 'content-type', + // See https://github.com/nodejs/undici/issues/2021 + // 'Content-Length' is a forbidden header name, which is typically + // removed in the Headers implementation. However, undici doesn't + // filter out headers, so we add it here. + 'content-length' +] + +// https://fetch.spec.whatwg.org/#enumdef-requestduplex +const requestDuplex = [ + 'half' +] + +// http://fetch.spec.whatwg.org/#forbidden-method +const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK'] +const forbiddenMethodsSet = new Set(forbiddenMethods) + +const subresource = [ + 'audio', + 'audioworklet', + 'font', + 'image', + 'manifest', + 'paintworklet', + 'script', + 'style', + 'track', + 'video', + 'xslt', + '' +] +const subresourceSet = new Set(subresource) + +/** @type {globalThis['DOMException']} */ +const DOMException = globalThis.DOMException ?? (() => { + // DOMException was only made a global in Node v17.0.0, + // but fetch supports >= v16.8. + try { + atob('~') + } catch (err) { + return Object.getPrototypeOf(err).constructor + } +})() + +let channel + +/** @type {globalThis['structuredClone']} */ +const structuredClone = + globalThis.structuredClone ?? + // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js + // structuredClone was added in v17.0.0, but fetch supports v16.8 + function structuredClone (value, options = undefined) { + if (arguments.length === 0) { + throw new TypeError('missing argument') + } + + if (!channel) { + channel = new MessageChannel() + } + channel.port1.unref() + channel.port2.unref() + channel.port1.postMessage(value, options?.transfer) + return receiveMessageOnPort(channel.port2).message + } + +module.exports = { + DOMException, + structuredClone, + subresource, + forbiddenMethods, + requestBodyHeader, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + redirectStatus, + corsSafeListedMethods, + nullBodyStatus, + safeMethods, + badPorts, + requestDuplex, + subresourceSet, + badPortsSet, + redirectStatusSet, + corsSafeListedMethodsSet, + safeMethodsSet, + forbiddenMethodsSet, + referrerPolicySet +} + + +/***/ }), + +/***/ 685: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const assert = __nccwpck_require__(39491) +const { atob } = __nccwpck_require__(14300) +const { isomorphicDecode } = __nccwpck_require__(52538) + +const encoder = new TextEncoder() + +/** + * @see https://mimesniff.spec.whatwg.org/#http-token-code-point + */ +const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/ +const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line +/** + * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point + */ +const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line + +// https://fetch.spec.whatwg.org/#data-url-processor +/** @param {URL} dataURL */ +function dataURLProcessor (dataURL) { + // 1. Assert: dataURL’s scheme is "data". + assert(dataURL.protocol === 'data:') + + // 2. Let input be the result of running the URL + // serializer on dataURL with exclude fragment + // set to true. + let input = URLSerializer(dataURL, true) + + // 3. Remove the leading "data:" string from input. + input = input.slice(5) + + // 4. Let position point at the start of input. + const position = { position: 0 } + + // 5. Let mimeType be the result of collecting a + // sequence of code points that are not equal + // to U+002C (,), given position. + let mimeType = collectASequenceOfCodePointsFast( + ',', + input, + position + ) + + // 6. Strip leading and trailing ASCII whitespace + // from mimeType. + // Undici implementation note: we need to store the + // length because if the mimetype has spaces removed, + // the wrong amount will be sliced from the input in + // step #9 + const mimeTypeLength = mimeType.length + mimeType = removeASCIIWhitespace(mimeType, true, true) + + // 7. If position is past the end of input, then + // return failure + if (position.position >= input.length) { + return 'failure' + } + + // 8. Advance position by 1. + position.position++ + + // 9. Let encodedBody be the remainder of input. + const encodedBody = input.slice(mimeTypeLength + 1) + + // 10. Let body be the percent-decoding of encodedBody. + let body = stringPercentDecode(encodedBody) + + // 11. If mimeType ends with U+003B (;), followed by + // zero or more U+0020 SPACE, followed by an ASCII + // case-insensitive match for "base64", then: + if (/;(\u0020){0,}base64$/i.test(mimeType)) { + // 1. Let stringBody be the isomorphic decode of body. + const stringBody = isomorphicDecode(body) + + // 2. Set body to the forgiving-base64 decode of + // stringBody. + body = forgivingBase64(stringBody) + + // 3. If body is failure, then return failure. + if (body === 'failure') { + return 'failure' + } + + // 4. Remove the last 6 code points from mimeType. + mimeType = mimeType.slice(0, -6) + + // 5. Remove trailing U+0020 SPACE code points from mimeType, + // if any. + mimeType = mimeType.replace(/(\u0020)+$/, '') + + // 6. Remove the last U+003B (;) code point from mimeType. + mimeType = mimeType.slice(0, -1) + } + + // 12. If mimeType starts with U+003B (;), then prepend + // "text/plain" to mimeType. + if (mimeType.startsWith(';')) { + mimeType = 'text/plain' + mimeType + } + + // 13. Let mimeTypeRecord be the result of parsing + // mimeType. + let mimeTypeRecord = parseMIMEType(mimeType) + + // 14. If mimeTypeRecord is failure, then set + // mimeTypeRecord to text/plain;charset=US-ASCII. + if (mimeTypeRecord === 'failure') { + mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII') + } + + // 15. Return a new data: URL struct whose MIME + // type is mimeTypeRecord and body is body. + // https://fetch.spec.whatwg.org/#data-url-struct + return { mimeType: mimeTypeRecord, body } +} + +// https://url.spec.whatwg.org/#concept-url-serializer +/** + * @param {URL} url + * @param {boolean} excludeFragment + */ +function URLSerializer (url, excludeFragment = false) { + if (!excludeFragment) { + return url.href + } + + const href = url.href + const hashLength = url.hash.length + + return hashLength === 0 ? href : href.substring(0, href.length - hashLength) +} + +// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points +/** + * @param {(char: string) => boolean} condition + * @param {string} input + * @param {{ position: number }} position + */ +function collectASequenceOfCodePoints (condition, input, position) { + // 1. Let result be the empty string. + let result = '' + + // 2. While position doesn’t point past the end of input and the + // code point at position within input meets the condition condition: + while (position.position < input.length && condition(input[position.position])) { + // 1. Append that code point to the end of result. + result += input[position.position] + + // 2. Advance position by 1. + position.position++ + } + + // 3. Return result. + return result +} + +/** + * A faster collectASequenceOfCodePoints that only works when comparing a single character. + * @param {string} char + * @param {string} input + * @param {{ position: number }} position + */ +function collectASequenceOfCodePointsFast (char, input, position) { + const idx = input.indexOf(char, position.position) + const start = position.position + + if (idx === -1) { + position.position = input.length + return input.slice(start) + } + + position.position = idx + return input.slice(start, position.position) +} + +// https://url.spec.whatwg.org/#string-percent-decode +/** @param {string} input */ +function stringPercentDecode (input) { + // 1. Let bytes be the UTF-8 encoding of input. + const bytes = encoder.encode(input) + + // 2. Return the percent-decoding of bytes. + return percentDecode(bytes) +} + +// https://url.spec.whatwg.org/#percent-decode +/** @param {Uint8Array} input */ +function percentDecode (input) { + // 1. Let output be an empty byte sequence. + /** @type {number[]} */ + const output = [] + + // 2. For each byte byte in input: + for (let i = 0; i < input.length; i++) { + const byte = input[i] + + // 1. If byte is not 0x25 (%), then append byte to output. + if (byte !== 0x25) { + output.push(byte) + + // 2. Otherwise, if byte is 0x25 (%) and the next two bytes + // after byte in input are not in the ranges + // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F), + // and 0x61 (a) to 0x66 (f), all inclusive, append byte + // to output. + } else if ( + byte === 0x25 && + !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2])) + ) { + output.push(0x25) + + // 3. Otherwise: + } else { + // 1. Let bytePoint be the two bytes after byte in input, + // decoded, and then interpreted as hexadecimal number. + const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2]) + const bytePoint = Number.parseInt(nextTwoBytes, 16) + + // 2. Append a byte whose value is bytePoint to output. + output.push(bytePoint) + + // 3. Skip the next two bytes in input. + i += 2 + } + } + + // 3. Return output. + return Uint8Array.from(output) +} + +// https://mimesniff.spec.whatwg.org/#parse-a-mime-type +/** @param {string} input */ +function parseMIMEType (input) { + // 1. Remove any leading and trailing HTTP whitespace + // from input. + input = removeHTTPWhitespace(input, true, true) + + // 2. Let position be a position variable for input, + // initially pointing at the start of input. + const position = { position: 0 } + + // 3. Let type be the result of collecting a sequence + // of code points that are not U+002F (/) from + // input, given position. + const type = collectASequenceOfCodePointsFast( + '/', + input, + position + ) + + // 4. If type is the empty string or does not solely + // contain HTTP token code points, then return failure. + // https://mimesniff.spec.whatwg.org/#http-token-code-point + if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { + return 'failure' + } + + // 5. If position is past the end of input, then return + // failure + if (position.position > input.length) { + return 'failure' + } + + // 6. Advance position by 1. (This skips past U+002F (/).) + position.position++ + + // 7. Let subtype be the result of collecting a sequence of + // code points that are not U+003B (;) from input, given + // position. + let subtype = collectASequenceOfCodePointsFast( + ';', + input, + position + ) + + // 8. Remove any trailing HTTP whitespace from subtype. + subtype = removeHTTPWhitespace(subtype, false, true) + + // 9. If subtype is the empty string or does not solely + // contain HTTP token code points, then return failure. + if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { + return 'failure' + } + + const typeLowercase = type.toLowerCase() + const subtypeLowercase = subtype.toLowerCase() + + // 10. Let mimeType be a new MIME type record whose type + // is type, in ASCII lowercase, and subtype is subtype, + // in ASCII lowercase. + // https://mimesniff.spec.whatwg.org/#mime-type + const mimeType = { + type: typeLowercase, + subtype: subtypeLowercase, + /** @type {Map} */ + parameters: new Map(), + // https://mimesniff.spec.whatwg.org/#mime-type-essence + essence: `${typeLowercase}/${subtypeLowercase}` + } + + // 11. While position is not past the end of input: + while (position.position < input.length) { + // 1. Advance position by 1. (This skips past U+003B (;).) + position.position++ + + // 2. Collect a sequence of code points that are HTTP + // whitespace from input given position. + collectASequenceOfCodePoints( + // https://fetch.spec.whatwg.org/#http-whitespace + char => HTTP_WHITESPACE_REGEX.test(char), + input, + position + ) + + // 3. Let parameterName be the result of collecting a + // sequence of code points that are not U+003B (;) + // or U+003D (=) from input, given position. + let parameterName = collectASequenceOfCodePoints( + (char) => char !== ';' && char !== '=', + input, + position + ) + + // 4. Set parameterName to parameterName, in ASCII + // lowercase. + parameterName = parameterName.toLowerCase() + + // 5. If position is not past the end of input, then: + if (position.position < input.length) { + // 1. If the code point at position within input is + // U+003B (;), then continue. + if (input[position.position] === ';') { + continue + } + + // 2. Advance position by 1. (This skips past U+003D (=).) + position.position++ + } + + // 6. If position is past the end of input, then break. + if (position.position > input.length) { + break + } + + // 7. Let parameterValue be null. + let parameterValue = null + + // 8. If the code point at position within input is + // U+0022 ("), then: + if (input[position.position] === '"') { + // 1. Set parameterValue to the result of collecting + // an HTTP quoted string from input, given position + // and the extract-value flag. + parameterValue = collectAnHTTPQuotedString(input, position, true) + + // 2. Collect a sequence of code points that are not + // U+003B (;) from input, given position. + collectASequenceOfCodePointsFast( + ';', + input, + position + ) + + // 9. Otherwise: + } else { + // 1. Set parameterValue to the result of collecting + // a sequence of code points that are not U+003B (;) + // from input, given position. + parameterValue = collectASequenceOfCodePointsFast( + ';', + input, + position + ) + + // 2. Remove any trailing HTTP whitespace from parameterValue. + parameterValue = removeHTTPWhitespace(parameterValue, false, true) + + // 3. If parameterValue is the empty string, then continue. + if (parameterValue.length === 0) { + continue + } + } + + // 10. If all of the following are true + // - parameterName is not the empty string + // - parameterName solely contains HTTP token code points + // - parameterValue solely contains HTTP quoted-string token code points + // - mimeType’s parameters[parameterName] does not exist + // then set mimeType’s parameters[parameterName] to parameterValue. + if ( + parameterName.length !== 0 && + HTTP_TOKEN_CODEPOINTS.test(parameterName) && + (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && + !mimeType.parameters.has(parameterName) + ) { + mimeType.parameters.set(parameterName, parameterValue) + } + } + + // 12. Return mimeType. + return mimeType +} + +// https://infra.spec.whatwg.org/#forgiving-base64-decode +/** @param {string} data */ +function forgivingBase64 (data) { + // 1. Remove all ASCII whitespace from data. + data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line + + // 2. If data’s code point length divides by 4 leaving + // no remainder, then: + if (data.length % 4 === 0) { + // 1. If data ends with one or two U+003D (=) code points, + // then remove them from data. + data = data.replace(/=?=$/, '') + } + + // 3. If data’s code point length divides by 4 leaving + // a remainder of 1, then return failure. + if (data.length % 4 === 1) { + return 'failure' + } + + // 4. If data contains a code point that is not one of + // U+002B (+) + // U+002F (/) + // ASCII alphanumeric + // then return failure. + if (/[^+/0-9A-Za-z]/.test(data)) { + return 'failure' + } + + const binary = atob(data) + const bytes = new Uint8Array(binary.length) + + for (let byte = 0; byte < binary.length; byte++) { + bytes[byte] = binary.charCodeAt(byte) + } + + return bytes +} + +// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string +// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string +/** + * @param {string} input + * @param {{ position: number }} position + * @param {boolean?} extractValue + */ +function collectAnHTTPQuotedString (input, position, extractValue) { + // 1. Let positionStart be position. + const positionStart = position.position + + // 2. Let value be the empty string. + let value = '' + + // 3. Assert: the code point at position within input + // is U+0022 ("). + assert(input[position.position] === '"') + + // 4. Advance position by 1. + position.position++ + + // 5. While true: + while (true) { + // 1. Append the result of collecting a sequence of code points + // that are not U+0022 (") or U+005C (\) from input, given + // position, to value. + value += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== '\\', + input, + position + ) + + // 2. If position is past the end of input, then break. + if (position.position >= input.length) { + break + } + + // 3. Let quoteOrBackslash be the code point at position within + // input. + const quoteOrBackslash = input[position.position] + + // 4. Advance position by 1. + position.position++ + + // 5. If quoteOrBackslash is U+005C (\), then: + if (quoteOrBackslash === '\\') { + // 1. If position is past the end of input, then append + // U+005C (\) to value and break. + if (position.position >= input.length) { + value += '\\' + break + } + + // 2. Append the code point at position within input to value. + value += input[position.position] + + // 3. Advance position by 1. + position.position++ + + // 6. Otherwise: + } else { + // 1. Assert: quoteOrBackslash is U+0022 ("). + assert(quoteOrBackslash === '"') + + // 2. Break. + break + } + } + + // 6. If the extract-value flag is set, then return value. + if (extractValue) { + return value + } + + // 7. Return the code points from positionStart to position, + // inclusive, within input. + return input.slice(positionStart, position.position) +} + +/** + * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type + */ +function serializeAMimeType (mimeType) { + assert(mimeType !== 'failure') + const { parameters, essence } = mimeType + + // 1. Let serialization be the concatenation of mimeType’s + // type, U+002F (/), and mimeType’s subtype. + let serialization = essence + + // 2. For each name → value of mimeType’s parameters: + for (let [name, value] of parameters.entries()) { + // 1. Append U+003B (;) to serialization. + serialization += ';' + + // 2. Append name to serialization. + serialization += name + + // 3. Append U+003D (=) to serialization. + serialization += '=' + + // 4. If value does not solely contain HTTP token code + // points or value is the empty string, then: + if (!HTTP_TOKEN_CODEPOINTS.test(value)) { + // 1. Precede each occurence of U+0022 (") or + // U+005C (\) in value with U+005C (\). + value = value.replace(/(\\|")/g, '\\$1') + + // 2. Prepend U+0022 (") to value. + value = '"' + value + + // 3. Append U+0022 (") to value. + value += '"' + } + + // 5. Append value to serialization. + serialization += value + } + + // 3. Return serialization. + return serialization +} + +/** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {string} char + */ +function isHTTPWhiteSpace (char) { + return char === '\r' || char === '\n' || char === '\t' || char === ' ' +} + +/** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {string} str + */ +function removeHTTPWhitespace (str, leading = true, trailing = true) { + let lead = 0 + let trail = str.length - 1 + + if (leading) { + for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++); + } + + if (trailing) { + for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--); + } + + return str.slice(lead, trail + 1) +} + +/** + * @see https://infra.spec.whatwg.org/#ascii-whitespace + * @param {string} char + */ +function isASCIIWhitespace (char) { + return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' ' +} + +/** + * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace + */ +function removeASCIIWhitespace (str, leading = true, trailing = true) { + let lead = 0 + let trail = str.length - 1 + + if (leading) { + for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++); + } + + if (trailing) { + for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--); + } + + return str.slice(lead, trail + 1) +} + +module.exports = { + dataURLProcessor, + URLSerializer, + collectASequenceOfCodePoints, + collectASequenceOfCodePointsFast, + stringPercentDecode, + parseMIMEType, + collectAnHTTPQuotedString, + serializeAMimeType +} + + +/***/ }), + +/***/ 78511: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { Blob, File: NativeFile } = __nccwpck_require__(14300) +const { types } = __nccwpck_require__(73837) +const { kState } = __nccwpck_require__(15861) +const { isBlobLike } = __nccwpck_require__(52538) +const { webidl } = __nccwpck_require__(21744) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685) +const { kEnumerableProperty } = __nccwpck_require__(83983) +const encoder = new TextEncoder() + +class File extends Blob { + constructor (fileBits, fileName, options = {}) { + // The File constructor is invoked with two or three parameters, depending + // on whether the optional dictionary parameter is used. When the File() + // constructor is invoked, user agents must run the following steps: + webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' }) + + fileBits = webidl.converters['sequence'](fileBits) + fileName = webidl.converters.USVString(fileName) + options = webidl.converters.FilePropertyBag(options) + + // 1. Let bytes be the result of processing blob parts given fileBits and + // options. + // Note: Blob handles this for us + + // 2. Let n be the fileName argument to the constructor. + const n = fileName + + // 3. Process FilePropertyBag dictionary argument by running the following + // substeps: + + // 1. If the type member is provided and is not the empty string, let t + // be set to the type dictionary member. If t contains any characters + // outside the range U+0020 to U+007E, then set t to the empty string + // and return from these substeps. + // 2. Convert every character in t to ASCII lowercase. + let t = options.type + let d + + // eslint-disable-next-line no-labels + substep: { + if (t) { + t = parseMIMEType(t) + + if (t === 'failure') { + t = '' + // eslint-disable-next-line no-labels + break substep + } + + t = serializeAMimeType(t).toLowerCase() + } + + // 3. If the lastModified member is provided, let d be set to the + // lastModified dictionary member. If it is not provided, set d to the + // current date and time represented as the number of milliseconds since + // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). + d = options.lastModified + } + + // 4. Return a new File object F such that: + // F refers to the bytes byte sequence. + // F.size is set to the number of total bytes in bytes. + // F.name is set to n. + // F.type is set to t. + // F.lastModified is set to d. + + super(processBlobParts(fileBits, options), { type: t }) + this[kState] = { + name: n, + lastModified: d, + type: t + } + } + + get name () { + webidl.brandCheck(this, File) + + return this[kState].name + } + + get lastModified () { + webidl.brandCheck(this, File) + + return this[kState].lastModified + } + + get type () { + webidl.brandCheck(this, File) + + return this[kState].type + } +} + +class FileLike { + constructor (blobLike, fileName, options = {}) { + // TODO: argument idl type check + + // The File constructor is invoked with two or three parameters, depending + // on whether the optional dictionary parameter is used. When the File() + // constructor is invoked, user agents must run the following steps: + + // 1. Let bytes be the result of processing blob parts given fileBits and + // options. + + // 2. Let n be the fileName argument to the constructor. + const n = fileName + + // 3. Process FilePropertyBag dictionary argument by running the following + // substeps: + + // 1. If the type member is provided and is not the empty string, let t + // be set to the type dictionary member. If t contains any characters + // outside the range U+0020 to U+007E, then set t to the empty string + // and return from these substeps. + // TODO + const t = options.type + + // 2. Convert every character in t to ASCII lowercase. + // TODO + + // 3. If the lastModified member is provided, let d be set to the + // lastModified dictionary member. If it is not provided, set d to the + // current date and time represented as the number of milliseconds since + // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]). + const d = options.lastModified ?? Date.now() + + // 4. Return a new File object F such that: + // F refers to the bytes byte sequence. + // F.size is set to the number of total bytes in bytes. + // F.name is set to n. + // F.type is set to t. + // F.lastModified is set to d. + + this[kState] = { + blobLike, + name: n, + type: t, + lastModified: d + } + } + + stream (...args) { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.stream(...args) + } + + arrayBuffer (...args) { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.arrayBuffer(...args) + } + + slice (...args) { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.slice(...args) + } + + text (...args) { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.text(...args) + } + + get size () { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.size + } + + get type () { + webidl.brandCheck(this, FileLike) + + return this[kState].blobLike.type + } + + get name () { + webidl.brandCheck(this, FileLike) + + return this[kState].name + } + + get lastModified () { + webidl.brandCheck(this, FileLike) + + return this[kState].lastModified + } + + get [Symbol.toStringTag] () { + return 'File' + } +} + +Object.defineProperties(File.prototype, { + [Symbol.toStringTag]: { + value: 'File', + configurable: true + }, + name: kEnumerableProperty, + lastModified: kEnumerableProperty +}) + +webidl.converters.Blob = webidl.interfaceConverter(Blob) + +webidl.converters.BlobPart = function (V, opts) { + if (webidl.util.Type(V) === 'Object') { + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }) + } + + if ( + ArrayBuffer.isView(V) || + types.isAnyArrayBuffer(V) + ) { + return webidl.converters.BufferSource(V, opts) + } + } + + return webidl.converters.USVString(V, opts) +} + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.BlobPart +) + +// https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag +webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ + { + key: 'lastModified', + converter: webidl.converters['long long'], + get defaultValue () { + return Date.now() + } + }, + { + key: 'type', + converter: webidl.converters.DOMString, + defaultValue: '' + }, + { + key: 'endings', + converter: (value) => { + value = webidl.converters.DOMString(value) + value = value.toLowerCase() + + if (value !== 'native') { + value = 'transparent' + } + + return value + }, + defaultValue: 'transparent' + } +]) + +/** + * @see https://www.w3.org/TR/FileAPI/#process-blob-parts + * @param {(NodeJS.TypedArray|Blob|string)[]} parts + * @param {{ type: string, endings: string }} options + */ +function processBlobParts (parts, options) { + // 1. Let bytes be an empty sequence of bytes. + /** @type {NodeJS.TypedArray[]} */ + const bytes = [] + + // 2. For each element in parts: + for (const element of parts) { + // 1. If element is a USVString, run the following substeps: + if (typeof element === 'string') { + // 1. Let s be element. + let s = element + + // 2. If the endings member of options is "native", set s + // to the result of converting line endings to native + // of element. + if (options.endings === 'native') { + s = convertLineEndingsNative(s) + } + + // 3. Append the result of UTF-8 encoding s to bytes. + bytes.push(encoder.encode(s)) + } else if ( + types.isAnyArrayBuffer(element) || + types.isTypedArray(element) + ) { + // 2. If element is a BufferSource, get a copy of the + // bytes held by the buffer source, and append those + // bytes to bytes. + if (!element.buffer) { // ArrayBuffer + bytes.push(new Uint8Array(element)) + } else { + bytes.push( + new Uint8Array(element.buffer, element.byteOffset, element.byteLength) + ) + } + } else if (isBlobLike(element)) { + // 3. If element is a Blob, append the bytes it represents + // to bytes. + bytes.push(element) + } + } + + // 3. Return bytes. + return bytes +} + +/** + * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native + * @param {string} s + */ +function convertLineEndingsNative (s) { + // 1. Let native line ending be be the code point U+000A LF. + let nativeLineEnding = '\n' + + // 2. If the underlying platform’s conventions are to + // represent newlines as a carriage return and line feed + // sequence, set native line ending to the code point + // U+000D CR followed by the code point U+000A LF. + if (process.platform === 'win32') { + nativeLineEnding = '\r\n' + } + + return s.replace(/\r?\n/g, nativeLineEnding) +} + +// If this function is moved to ./util.js, some tools (such as +// rollup) will warn about circular dependencies. See: +// https://github.com/nodejs/undici/issues/1629 +function isFileLike (object) { + return ( + (NativeFile && object instanceof NativeFile) || + object instanceof File || ( + object && + (typeof object.stream === 'function' || + typeof object.arrayBuffer === 'function') && + object[Symbol.toStringTag] === 'File' + ) + ) +} + +module.exports = { File, FileLike, isFileLike } + + +/***/ }), + +/***/ 72015: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(52538) +const { kState } = __nccwpck_require__(15861) +const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(78511) +const { webidl } = __nccwpck_require__(21744) +const { Blob, File: NativeFile } = __nccwpck_require__(14300) + +/** @type {globalThis['File']} */ +const File = NativeFile ?? UndiciFile + +// https://xhr.spec.whatwg.org/#formdata +class FormData { + constructor (form) { + if (form !== undefined) { + throw webidl.errors.conversionFailed({ + prefix: 'FormData constructor', + argument: 'Argument 1', + types: ['undefined'] + }) + } + + this[kState] = [] + } + + append (name, value, filename = undefined) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' }) + + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" + ) + } + + // 1. Let value be value if given; otherwise blobValue. + + name = webidl.converters.USVString(name) + value = isBlobLike(value) + ? webidl.converters.Blob(value, { strict: false }) + : webidl.converters.USVString(value) + filename = arguments.length === 3 + ? webidl.converters.USVString(filename) + : undefined + + // 2. Let entry be the result of creating an entry with + // name, value, and filename if given. + const entry = makeEntry(name, value, filename) + + // 3. Append entry to this’s entry list. + this[kState].push(entry) + } + + delete (name) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' }) + + name = webidl.converters.USVString(name) + + // The delete(name) method steps are to remove all entries whose name + // is name from this’s entry list. + this[kState] = this[kState].filter(entry => entry.name !== name) + } + + get (name) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' }) + + name = webidl.converters.USVString(name) + + // 1. If there is no entry whose name is name in this’s entry list, + // then return null. + const idx = this[kState].findIndex((entry) => entry.name === name) + if (idx === -1) { + return null + } + + // 2. Return the value of the first entry whose name is name from + // this’s entry list. + return this[kState][idx].value + } + + getAll (name) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' }) + + name = webidl.converters.USVString(name) + + // 1. If there is no entry whose name is name in this’s entry list, + // then return the empty list. + // 2. Return the values of all entries whose name is name, in order, + // from this’s entry list. + return this[kState] + .filter((entry) => entry.name === name) + .map((entry) => entry.value) + } + + has (name) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' }) + + name = webidl.converters.USVString(name) + + // The has(name) method steps are to return true if there is an entry + // whose name is name in this’s entry list; otherwise false. + return this[kState].findIndex((entry) => entry.name === name) !== -1 + } + + set (name, value, filename = undefined) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' }) + + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" + ) + } + + // The set(name, value) and set(name, blobValue, filename) method steps + // are: + + // 1. Let value be value if given; otherwise blobValue. + + name = webidl.converters.USVString(name) + value = isBlobLike(value) + ? webidl.converters.Blob(value, { strict: false }) + : webidl.converters.USVString(value) + filename = arguments.length === 3 + ? toUSVString(filename) + : undefined + + // 2. Let entry be the result of creating an entry with name, value, and + // filename if given. + const entry = makeEntry(name, value, filename) + + // 3. If there are entries in this’s entry list whose name is name, then + // replace the first such entry with entry and remove the others. + const idx = this[kState].findIndex((entry) => entry.name === name) + if (idx !== -1) { + this[kState] = [ + ...this[kState].slice(0, idx), + entry, + ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name) + ] + } else { + // 4. Otherwise, append entry to this’s entry list. + this[kState].push(entry) + } + } + + entries () { + webidl.brandCheck(this, FormData) + + return makeIterator( + () => this[kState].map(pair => [pair.name, pair.value]), + 'FormData', + 'key+value' + ) + } + + keys () { + webidl.brandCheck(this, FormData) + + return makeIterator( + () => this[kState].map(pair => [pair.name, pair.value]), + 'FormData', + 'key' + ) + } + + values () { + webidl.brandCheck(this, FormData) + + return makeIterator( + () => this[kState].map(pair => [pair.name, pair.value]), + 'FormData', + 'value' + ) + } + + /** + * @param {(value: string, key: string, self: FormData) => void} callbackFn + * @param {unknown} thisArg + */ + forEach (callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, FormData) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' }) + + if (typeof callbackFn !== 'function') { + throw new TypeError( + "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." + ) + } + + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]) + } + } +} + +FormData.prototype[Symbol.iterator] = FormData.prototype.entries + +Object.defineProperties(FormData.prototype, { + [Symbol.toStringTag]: { + value: 'FormData', + configurable: true + } +}) + +/** + * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry + * @param {string} name + * @param {string|Blob} value + * @param {?string} filename + * @returns + */ +function makeEntry (name, value, filename) { + // 1. Set name to the result of converting name into a scalar value string. + // "To convert a string into a scalar value string, replace any surrogates + // with U+FFFD." + // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end + name = Buffer.from(name).toString('utf8') + + // 2. If value is a string, then set value to the result of converting + // value into a scalar value string. + if (typeof value === 'string') { + value = Buffer.from(value).toString('utf8') + } else { + // 3. Otherwise: + + // 1. If value is not a File object, then set value to a new File object, + // representing the same bytes, whose name attribute value is "blob" + if (!isFileLike(value)) { + value = value instanceof Blob + ? new File([value], 'blob', { type: value.type }) + : new FileLike(value, 'blob', { type: value.type }) + } + + // 2. If filename is given, then set value to a new File object, + // representing the same bytes, whose name attribute is filename. + if (filename !== undefined) { + /** @type {FilePropertyBag} */ + const options = { + type: value.type, + lastModified: value.lastModified + } + + value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile + ? new File([value], filename, options) + : new FileLike(value, filename, options) + } + } + + // 4. Return an entry whose name is name and whose value is value. + return { name, value } +} + +module.exports = { FormData } + + +/***/ }), + +/***/ 71246: +/***/ ((module) => { + +"use strict"; + + +// In case of breaking changes, increase the version +// number to avoid conflicts. +const globalOrigin = Symbol.for('undici.globalOrigin.1') + +function getGlobalOrigin () { + return globalThis[globalOrigin] +} + +function setGlobalOrigin (newOrigin) { + if (newOrigin === undefined) { + Object.defineProperty(globalThis, globalOrigin, { + value: undefined, + writable: true, + enumerable: false, + configurable: false + }) + + return + } + + const parsedURL = new URL(newOrigin) + + if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') { + throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`) + } + + Object.defineProperty(globalThis, globalOrigin, { + value: parsedURL, + writable: true, + enumerable: false, + configurable: false + }) +} + +module.exports = { + getGlobalOrigin, + setGlobalOrigin +} + + +/***/ }), + +/***/ 10554: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// https://github.com/Ethan-Arrowood/undici-fetch + + + +const { kHeadersList, kConstruct } = __nccwpck_require__(72785) +const { kGuard } = __nccwpck_require__(15861) +const { kEnumerableProperty } = __nccwpck_require__(83983) +const { + makeIterator, + isValidHeaderName, + isValidHeaderValue +} = __nccwpck_require__(52538) +const { webidl } = __nccwpck_require__(21744) +const assert = __nccwpck_require__(39491) + +const kHeadersMap = Symbol('headers map') +const kHeadersSortedMap = Symbol('headers map sorted') + +/** + * @param {number} code + */ +function isHTTPWhiteSpaceCharCode (code) { + return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020 +} + +/** + * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize + * @param {string} potentialValue + */ +function headerValueNormalize (potentialValue) { + // To normalize a byte sequence potentialValue, remove + // any leading and trailing HTTP whitespace bytes from + // potentialValue. + let i = 0; let j = potentialValue.length + + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j + while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i + + return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j) +} + +function fill (headers, object) { + // To fill a Headers object headers with a given object object, run these steps: + + // 1. If object is a sequence, then for each header in object: + // Note: webidl conversion to array has already been done. + if (Array.isArray(object)) { + for (let i = 0; i < object.length; ++i) { + const header = object[i] + // 1. If header does not contain exactly two items, then throw a TypeError. + if (header.length !== 2) { + throw webidl.errors.exception({ + header: 'Headers constructor', + message: `expected name/value pair to be length 2, found ${header.length}.` + }) + } + + // 2. Append (header’s first item, header’s second item) to headers. + appendHeader(headers, header[0], header[1]) + } + } else if (typeof object === 'object' && object !== null) { + // Note: null should throw + + // 2. Otherwise, object is a record, then for each key → value in object, + // append (key, value) to headers + const keys = Object.keys(object) + for (let i = 0; i < keys.length; ++i) { + appendHeader(headers, keys[i], object[keys[i]]) + } + } else { + throw webidl.errors.conversionFailed({ + prefix: 'Headers constructor', + argument: 'Argument 1', + types: ['sequence>', 'record'] + }) + } +} + +/** + * @see https://fetch.spec.whatwg.org/#concept-headers-append + */ +function appendHeader (headers, name, value) { + // 1. Normalize value. + value = headerValueNormalize(value) + + // 2. If name is not a header name or value is not a + // header value, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.append', + value: name, + type: 'header name' + }) + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.append', + value, + type: 'header value' + }) + } + + // 3. If headers’s guard is "immutable", then throw a TypeError. + // 4. Otherwise, if headers’s guard is "request" and name is a + // forbidden header name, return. + // Note: undici does not implement forbidden header names + if (headers[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (headers[kGuard] === 'request-no-cors') { + // 5. Otherwise, if headers’s guard is "request-no-cors": + // TODO + } + + // 6. Otherwise, if headers’s guard is "response" and name is a + // forbidden response-header name, return. + + // 7. Append (name, value) to headers’s header list. + return headers[kHeadersList].append(name, value) + + // 8. If headers’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from headers +} + +class HeadersList { + /** @type {[string, string][]|null} */ + cookies = null + + constructor (init) { + if (init instanceof HeadersList) { + this[kHeadersMap] = new Map(init[kHeadersMap]) + this[kHeadersSortedMap] = init[kHeadersSortedMap] + this.cookies = init.cookies === null ? null : [...init.cookies] + } else { + this[kHeadersMap] = new Map(init) + this[kHeadersSortedMap] = null + } + } + + // https://fetch.spec.whatwg.org/#header-list-contains + contains (name) { + // A header list list contains a header name name if list + // contains a header whose name is a byte-case-insensitive + // match for name. + name = name.toLowerCase() + + return this[kHeadersMap].has(name) + } + + clear () { + this[kHeadersMap].clear() + this[kHeadersSortedMap] = null + this.cookies = null + } + + // https://fetch.spec.whatwg.org/#concept-header-list-append + append (name, value) { + this[kHeadersSortedMap] = null + + // 1. If list contains name, then set name to the first such + // header’s name. + const lowercaseName = name.toLowerCase() + const exists = this[kHeadersMap].get(lowercaseName) + + // 2. Append (name, value) to list. + if (exists) { + const delimiter = lowercaseName === 'cookie' ? '; ' : ', ' + this[kHeadersMap].set(lowercaseName, { + name: exists.name, + value: `${exists.value}${delimiter}${value}` + }) + } else { + this[kHeadersMap].set(lowercaseName, { name, value }) + } + + if (lowercaseName === 'set-cookie') { + this.cookies ??= [] + this.cookies.push(value) + } + } + + // https://fetch.spec.whatwg.org/#concept-header-list-set + set (name, value) { + this[kHeadersSortedMap] = null + const lowercaseName = name.toLowerCase() + + if (lowercaseName === 'set-cookie') { + this.cookies = [value] + } + + // 1. If list contains name, then set the value of + // the first such header to value and remove the + // others. + // 2. Otherwise, append header (name, value) to list. + this[kHeadersMap].set(lowercaseName, { name, value }) + } + + // https://fetch.spec.whatwg.org/#concept-header-list-delete + delete (name) { + this[kHeadersSortedMap] = null + + name = name.toLowerCase() + + if (name === 'set-cookie') { + this.cookies = null + } + + this[kHeadersMap].delete(name) + } + + // https://fetch.spec.whatwg.org/#concept-header-list-get + get (name) { + const value = this[kHeadersMap].get(name.toLowerCase()) + + // 1. If list does not contain name, then return null. + // 2. Return the values of all headers in list whose name + // is a byte-case-insensitive match for name, + // separated from each other by 0x2C 0x20, in order. + return value === undefined ? null : value.value + } + + * [Symbol.iterator] () { + // use the lowercased name + for (const [name, { value }] of this[kHeadersMap]) { + yield [name, value] + } + } + + get entries () { + const headers = {} + + if (this[kHeadersMap].size) { + for (const { name, value } of this[kHeadersMap].values()) { + headers[name] = value + } + } + + return headers + } +} + +// https://fetch.spec.whatwg.org/#headers-class +class Headers { + constructor (init = undefined) { + if (init === kConstruct) { + return + } + this[kHeadersList] = new HeadersList() + + // The new Headers(init) constructor steps are: + + // 1. Set this’s guard to "none". + this[kGuard] = 'none' + + // 2. If init is given, then fill this with init. + if (init !== undefined) { + init = webidl.converters.HeadersInit(init) + fill(this, init) + } + } + + // https://fetch.spec.whatwg.org/#dom-headers-append + append (name, value) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' }) + + name = webidl.converters.ByteString(name) + value = webidl.converters.ByteString(value) + + return appendHeader(this, name, value) + } + + // https://fetch.spec.whatwg.org/#dom-headers-delete + delete (name) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' }) + + name = webidl.converters.ByteString(name) + + // 1. If name is not a header name, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.delete', + value: name, + type: 'header name' + }) + } + + // 2. If this’s guard is "immutable", then throw a TypeError. + // 3. Otherwise, if this’s guard is "request" and name is a + // forbidden header name, return. + // 4. Otherwise, if this’s guard is "request-no-cors", name + // is not a no-CORS-safelisted request-header name, and + // name is not a privileged no-CORS request-header name, + // return. + // 5. Otherwise, if this’s guard is "response" and name is + // a forbidden response-header name, return. + // Note: undici does not implement forbidden header names + if (this[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (this[kGuard] === 'request-no-cors') { + // TODO + } + + // 6. If this’s header list does not contain name, then + // return. + if (!this[kHeadersList].contains(name)) { + return + } + + // 7. Delete name from this’s header list. + // 8. If this’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from this. + this[kHeadersList].delete(name) + } + + // https://fetch.spec.whatwg.org/#dom-headers-get + get (name) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' }) + + name = webidl.converters.ByteString(name) + + // 1. If name is not a header name, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.get', + value: name, + type: 'header name' + }) + } + + // 2. Return the result of getting name from this’s header + // list. + return this[kHeadersList].get(name) + } + + // https://fetch.spec.whatwg.org/#dom-headers-has + has (name) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' }) + + name = webidl.converters.ByteString(name) + + // 1. If name is not a header name, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.has', + value: name, + type: 'header name' + }) + } + + // 2. Return true if this’s header list contains name; + // otherwise false. + return this[kHeadersList].contains(name) + } + + // https://fetch.spec.whatwg.org/#dom-headers-set + set (name, value) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' }) + + name = webidl.converters.ByteString(name) + value = webidl.converters.ByteString(value) + + // 1. Normalize value. + value = headerValueNormalize(value) + + // 2. If name is not a header name or value is not a + // header value, then throw a TypeError. + if (!isValidHeaderName(name)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.set', + value: name, + type: 'header name' + }) + } else if (!isValidHeaderValue(value)) { + throw webidl.errors.invalidArgument({ + prefix: 'Headers.set', + value, + type: 'header value' + }) + } + + // 3. If this’s guard is "immutable", then throw a TypeError. + // 4. Otherwise, if this’s guard is "request" and name is a + // forbidden header name, return. + // 5. Otherwise, if this’s guard is "request-no-cors" and + // name/value is not a no-CORS-safelisted request-header, + // return. + // 6. Otherwise, if this’s guard is "response" and name is a + // forbidden response-header name, return. + // Note: undici does not implement forbidden header names + if (this[kGuard] === 'immutable') { + throw new TypeError('immutable') + } else if (this[kGuard] === 'request-no-cors') { + // TODO + } + + // 7. Set (name, value) in this’s header list. + // 8. If this’s guard is "request-no-cors", then remove + // privileged no-CORS request headers from this + this[kHeadersList].set(name, value) + } + + // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie + getSetCookie () { + webidl.brandCheck(this, Headers) + + // 1. If this’s header list does not contain `Set-Cookie`, then return « ». + // 2. Return the values of all headers in this’s header list whose name is + // a byte-case-insensitive match for `Set-Cookie`, in order. + + const list = this[kHeadersList].cookies + + if (list) { + return [...list] + } + + return [] + } + + // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine + get [kHeadersSortedMap] () { + if (this[kHeadersList][kHeadersSortedMap]) { + return this[kHeadersList][kHeadersSortedMap] + } + + // 1. Let headers be an empty list of headers with the key being the name + // and value the value. + const headers = [] + + // 2. Let names be the result of convert header names to a sorted-lowercase + // set with all the names of the headers in list. + const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1) + const cookies = this[kHeadersList].cookies + + // 3. For each name of names: + for (let i = 0; i < names.length; ++i) { + const [name, value] = names[i] + // 1. If name is `set-cookie`, then: + if (name === 'set-cookie') { + // 1. Let values be a list of all values of headers in list whose name + // is a byte-case-insensitive match for name, in order. + + // 2. For each value of values: + // 1. Append (name, value) to headers. + for (let j = 0; j < cookies.length; ++j) { + headers.push([name, cookies[j]]) + } + } else { + // 2. Otherwise: + + // 1. Let value be the result of getting name from list. + + // 2. Assert: value is non-null. + assert(value !== null) + + // 3. Append (name, value) to headers. + headers.push([name, value]) + } + } + + this[kHeadersList][kHeadersSortedMap] = headers + + // 4. Return headers. + return headers + } + + keys () { + webidl.brandCheck(this, Headers) + + if (this[kGuard] === 'immutable') { + const value = this[kHeadersSortedMap] + return makeIterator(() => value, 'Headers', + 'key') + } + + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + 'Headers', + 'key' + ) + } + + values () { + webidl.brandCheck(this, Headers) + + if (this[kGuard] === 'immutable') { + const value = this[kHeadersSortedMap] + return makeIterator(() => value, 'Headers', + 'value') + } + + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + 'Headers', + 'value' + ) + } + + entries () { + webidl.brandCheck(this, Headers) + + if (this[kGuard] === 'immutable') { + const value = this[kHeadersSortedMap] + return makeIterator(() => value, 'Headers', + 'key+value') + } + + return makeIterator( + () => [...this[kHeadersSortedMap].values()], + 'Headers', + 'key+value' + ) + } + + /** + * @param {(value: string, key: string, self: Headers) => void} callbackFn + * @param {unknown} thisArg + */ + forEach (callbackFn, thisArg = globalThis) { + webidl.brandCheck(this, Headers) + + webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' }) + + if (typeof callbackFn !== 'function') { + throw new TypeError( + "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." + ) + } + + for (const [key, value] of this) { + callbackFn.apply(thisArg, [value, key, this]) + } + } + + [Symbol.for('nodejs.util.inspect.custom')] () { + webidl.brandCheck(this, Headers) + + return this[kHeadersList] + } +} + +Headers.prototype[Symbol.iterator] = Headers.prototype.entries + +Object.defineProperties(Headers.prototype, { + append: kEnumerableProperty, + delete: kEnumerableProperty, + get: kEnumerableProperty, + has: kEnumerableProperty, + set: kEnumerableProperty, + getSetCookie: kEnumerableProperty, + keys: kEnumerableProperty, + values: kEnumerableProperty, + entries: kEnumerableProperty, + forEach: kEnumerableProperty, + [Symbol.iterator]: { enumerable: false }, + [Symbol.toStringTag]: { + value: 'Headers', + configurable: true + } +}) + +webidl.converters.HeadersInit = function (V) { + if (webidl.util.Type(V) === 'Object') { + if (V[Symbol.iterator]) { + return webidl.converters['sequence>'](V) + } + + return webidl.converters['record'](V) + } + + throw webidl.errors.conversionFailed({ + prefix: 'Headers constructor', + argument: 'Argument 1', + types: ['sequence>', 'record'] + }) +} + +module.exports = { + fill, + Headers, + HeadersList +} + + +/***/ }), + +/***/ 74881: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +// https://github.com/Ethan-Arrowood/undici-fetch + + + +const { + Response, + makeNetworkError, + makeAppropriateNetworkError, + filterResponse, + makeResponse +} = __nccwpck_require__(27823) +const { Headers } = __nccwpck_require__(10554) +const { Request, makeRequest } = __nccwpck_require__(48359) +const zlib = __nccwpck_require__(59796) +const { + bytesMatch, + makePolicyContainer, + clonePolicyContainer, + requestBadPort, + TAOCheck, + appendRequestOriginHeader, + responseLocationURL, + requestCurrentURL, + setRequestReferrerPolicyOnRedirect, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + createOpaqueTimingInfo, + appendFetchMetadata, + corsCheck, + crossOriginResourcePolicyCheck, + determineRequestsReferrer, + coarsenedSharedCurrentTime, + createDeferredPromise, + isBlobLike, + sameOrigin, + isCancelled, + isAborted, + isErrorLike, + fullyReadBody, + readableStreamClose, + isomorphicEncode, + urlIsLocal, + urlIsHttpHttpsScheme, + urlHasHttpsScheme +} = __nccwpck_require__(52538) +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(15861) +const assert = __nccwpck_require__(39491) +const { safelyExtractBody } = __nccwpck_require__(41472) +const { + redirectStatusSet, + nullBodyStatus, + safeMethodsSet, + requestBodyHeader, + subresourceSet, + DOMException +} = __nccwpck_require__(41037) +const { kHeadersList } = __nccwpck_require__(72785) +const EE = __nccwpck_require__(82361) +const { Readable, pipeline } = __nccwpck_require__(12781) +const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(83983) +const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685) +const { TransformStream } = __nccwpck_require__(35356) +const { getGlobalDispatcher } = __nccwpck_require__(21892) +const { webidl } = __nccwpck_require__(21744) +const { STATUS_CODES } = __nccwpck_require__(13685) +const GET_OR_HEAD = ['GET', 'HEAD'] + +/** @type {import('buffer').resolveObjectURL} */ +let resolveObjectURL +let ReadableStream = globalThis.ReadableStream + +class Fetch extends EE { + constructor (dispatcher) { + super() + + this.dispatcher = dispatcher + this.connection = null + this.dump = false + this.state = 'ongoing' + // 2 terminated listeners get added per request, + // but only 1 gets removed. If there are 20 redirects, + // 21 listeners will be added. + // See https://github.com/nodejs/undici/issues/1711 + // TODO (fix): Find and fix root cause for leaked listener. + this.setMaxListeners(21) + } + + terminate (reason) { + if (this.state !== 'ongoing') { + return + } + + this.state = 'terminated' + this.connection?.destroy(reason) + this.emit('terminated', reason) + } + + // https://fetch.spec.whatwg.org/#fetch-controller-abort + abort (error) { + if (this.state !== 'ongoing') { + return + } + + // 1. Set controller’s state to "aborted". + this.state = 'aborted' + + // 2. Let fallbackError be an "AbortError" DOMException. + // 3. Set error to fallbackError if it is not given. + if (!error) { + error = new DOMException('The operation was aborted.', 'AbortError') + } + + // 4. Let serializedError be StructuredSerialize(error). + // If that threw an exception, catch it, and let + // serializedError be StructuredSerialize(fallbackError). + + // 5. Set controller’s serialized abort reason to serializedError. + this.serializedAbortReason = error + + this.connection?.destroy(error) + this.emit('terminated', error) + } +} + +// https://fetch.spec.whatwg.org/#fetch-method +function fetch (input, init = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' }) + + // 1. Let p be a new promise. + const p = createDeferredPromise() + + // 2. Let requestObject be the result of invoking the initial value of + // Request as constructor with input and init as arguments. If this throws + // an exception, reject p with it and return p. + let requestObject + + try { + requestObject = new Request(input, init) + } catch (e) { + p.reject(e) + return p.promise + } + + // 3. Let request be requestObject’s request. + const request = requestObject[kState] + + // 4. If requestObject’s signal’s aborted flag is set, then: + if (requestObject.signal.aborted) { + // 1. Abort the fetch() call with p, request, null, and + // requestObject’s signal’s abort reason. + abortFetch(p, request, null, requestObject.signal.reason) + + // 2. Return p. + return p.promise + } + + // 5. Let globalObject be request’s client’s global object. + const globalObject = request.client.globalObject + + // 6. If globalObject is a ServiceWorkerGlobalScope object, then set + // request’s service-workers mode to "none". + if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') { + request.serviceWorkers = 'none' + } + + // 7. Let responseObject be null. + let responseObject = null + + // 8. Let relevantRealm be this’s relevant Realm. + const relevantRealm = null + + // 9. Let locallyAborted be false. + let locallyAborted = false + + // 10. Let controller be null. + let controller = null + + // 11. Add the following abort steps to requestObject’s signal: + addAbortListener( + requestObject.signal, + () => { + // 1. Set locallyAborted to true. + locallyAborted = true + + // 2. Assert: controller is non-null. + assert(controller != null) + + // 3. Abort controller with requestObject’s signal’s abort reason. + controller.abort(requestObject.signal.reason) + + // 4. Abort the fetch() call with p, request, responseObject, + // and requestObject’s signal’s abort reason. + abortFetch(p, request, responseObject, requestObject.signal.reason) + } + ) + + // 12. Let handleFetchDone given response response be to finalize and + // report timing with response, globalObject, and "fetch". + const handleFetchDone = (response) => + finalizeAndReportTiming(response, 'fetch') + + // 13. Set controller to the result of calling fetch given request, + // with processResponseEndOfBody set to handleFetchDone, and processResponse + // given response being these substeps: + + const processResponse = (response) => { + // 1. If locallyAborted is true, terminate these substeps. + if (locallyAborted) { + return Promise.resolve() + } + + // 2. If response’s aborted flag is set, then: + if (response.aborted) { + // 1. Let deserializedError be the result of deserialize a serialized + // abort reason given controller’s serialized abort reason and + // relevantRealm. + + // 2. Abort the fetch() call with p, request, responseObject, and + // deserializedError. + + abortFetch(p, request, responseObject, controller.serializedAbortReason) + return Promise.resolve() + } + + // 3. If response is a network error, then reject p with a TypeError + // and terminate these substeps. + if (response.type === 'error') { + p.reject( + Object.assign(new TypeError('fetch failed'), { cause: response.error }) + ) + return Promise.resolve() + } + + // 4. Set responseObject to the result of creating a Response object, + // given response, "immutable", and relevantRealm. + responseObject = new Response() + responseObject[kState] = response + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kHeadersList] = response.headersList + responseObject[kHeaders][kGuard] = 'immutable' + responseObject[kHeaders][kRealm] = relevantRealm + + // 5. Resolve p with responseObject. + p.resolve(responseObject) + } + + controller = fetching({ + request, + processResponseEndOfBody: handleFetchDone, + processResponse, + dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici + }) + + // 14. Return p. + return p.promise +} + +// https://fetch.spec.whatwg.org/#finalize-and-report-timing +function finalizeAndReportTiming (response, initiatorType = 'other') { + // 1. If response is an aborted network error, then return. + if (response.type === 'error' && response.aborted) { + return + } + + // 2. If response’s URL list is null or empty, then return. + if (!response.urlList?.length) { + return + } + + // 3. Let originalURL be response’s URL list[0]. + const originalURL = response.urlList[0] + + // 4. Let timingInfo be response’s timing info. + let timingInfo = response.timingInfo + + // 5. Let cacheState be response’s cache state. + let cacheState = response.cacheState + + // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return. + if (!urlIsHttpHttpsScheme(originalURL)) { + return + } + + // 7. If timingInfo is null, then return. + if (timingInfo === null) { + return + } + + // 8. If response’s timing allow passed flag is not set, then: + if (!response.timingAllowPassed) { + // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo. + timingInfo = createOpaqueTimingInfo({ + startTime: timingInfo.startTime + }) + + // 2. Set cacheState to the empty string. + cacheState = '' + } + + // 9. Set timingInfo’s end time to the coarsened shared current time + // given global’s relevant settings object’s cross-origin isolated + // capability. + // TODO: given global’s relevant settings object’s cross-origin isolated + // capability? + timingInfo.endTime = coarsenedSharedCurrentTime() + + // 10. Set response’s timing info to timingInfo. + response.timingInfo = timingInfo + + // 11. Mark resource timing for timingInfo, originalURL, initiatorType, + // global, and cacheState. + markResourceTiming( + timingInfo, + originalURL, + initiatorType, + globalThis, + cacheState + ) +} + +// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing +function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) { + if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) { + performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState) + } +} + +// https://fetch.spec.whatwg.org/#abort-fetch +function abortFetch (p, request, responseObject, error) { + // Note: AbortSignal.reason was added in node v17.2.0 + // which would give us an undefined error to reject with. + // Remove this once node v16 is no longer supported. + if (!error) { + error = new DOMException('The operation was aborted.', 'AbortError') + } + + // 1. Reject promise with error. + p.reject(error) + + // 2. If request’s body is not null and is readable, then cancel request’s + // body with error. + if (request.body != null && isReadable(request.body?.stream)) { + request.body.stream.cancel(error).catch((err) => { + if (err.code === 'ERR_INVALID_STATE') { + // Node bug? + return + } + throw err + }) + } + + // 3. If responseObject is null, then return. + if (responseObject == null) { + return + } + + // 4. Let response be responseObject’s response. + const response = responseObject[kState] + + // 5. If response’s body is not null and is readable, then error response’s + // body with error. + if (response.body != null && isReadable(response.body?.stream)) { + response.body.stream.cancel(error).catch((err) => { + if (err.code === 'ERR_INVALID_STATE') { + // Node bug? + return + } + throw err + }) + } +} + +// https://fetch.spec.whatwg.org/#fetching +function fetching ({ + request, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseEndOfBody, + processResponseConsumeBody, + useParallelQueue = false, + dispatcher // undici +}) { + // 1. Let taskDestination be null. + let taskDestination = null + + // 2. Let crossOriginIsolatedCapability be false. + let crossOriginIsolatedCapability = false + + // 3. If request’s client is non-null, then: + if (request.client != null) { + // 1. Set taskDestination to request’s client’s global object. + taskDestination = request.client.globalObject + + // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin + // isolated capability. + crossOriginIsolatedCapability = + request.client.crossOriginIsolatedCapability + } + + // 4. If useParallelQueue is true, then set taskDestination to the result of + // starting a new parallel queue. + // TODO + + // 5. Let timingInfo be a new fetch timing info whose start time and + // post-redirect start time are the coarsened shared current time given + // crossOriginIsolatedCapability. + const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability) + const timingInfo = createOpaqueTimingInfo({ + startTime: currenTime + }) + + // 6. Let fetchParams be a new fetch params whose + // request is request, + // timing info is timingInfo, + // process request body chunk length is processRequestBodyChunkLength, + // process request end-of-body is processRequestEndOfBody, + // process response is processResponse, + // process response consume body is processResponseConsumeBody, + // process response end-of-body is processResponseEndOfBody, + // task destination is taskDestination, + // and cross-origin isolated capability is crossOriginIsolatedCapability. + const fetchParams = { + controller: new Fetch(dispatcher), + request, + timingInfo, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseConsumeBody, + processResponseEndOfBody, + taskDestination, + crossOriginIsolatedCapability + } + + // 7. If request’s body is a byte sequence, then set request’s body to + // request’s body as a body. + // NOTE: Since fetching is only called from fetch, body should already be + // extracted. + assert(!request.body || request.body.stream) + + // 8. If request’s window is "client", then set request’s window to request’s + // client, if request’s client’s global object is a Window object; otherwise + // "no-window". + if (request.window === 'client') { + // TODO: What if request.client is null? + request.window = + request.client?.globalObject?.constructor?.name === 'Window' + ? request.client + : 'no-window' + } + + // 9. If request’s origin is "client", then set request’s origin to request’s + // client’s origin. + if (request.origin === 'client') { + // TODO: What if request.client is null? + request.origin = request.client?.origin + } + + // 10. If all of the following conditions are true: + // TODO + + // 11. If request’s policy container is "client", then: + if (request.policyContainer === 'client') { + // 1. If request’s client is non-null, then set request’s policy + // container to a clone of request’s client’s policy container. [HTML] + if (request.client != null) { + request.policyContainer = clonePolicyContainer( + request.client.policyContainer + ) + } else { + // 2. Otherwise, set request’s policy container to a new policy + // container. + request.policyContainer = makePolicyContainer() + } + } + + // 12. If request’s header list does not contain `Accept`, then: + if (!request.headersList.contains('accept')) { + // 1. Let value be `*/*`. + const value = '*/*' + + // 2. A user agent should set value to the first matching statement, if + // any, switching on request’s destination: + // "document" + // "frame" + // "iframe" + // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8` + // "image" + // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5` + // "style" + // `text/css,*/*;q=0.1` + // TODO + + // 3. Append `Accept`/value to request’s header list. + request.headersList.append('accept', value) + } + + // 13. If request’s header list does not contain `Accept-Language`, then + // user agents should append `Accept-Language`/an appropriate value to + // request’s header list. + if (!request.headersList.contains('accept-language')) { + request.headersList.append('accept-language', '*') + } + + // 14. If request’s priority is null, then use request’s initiator and + // destination appropriately in setting request’s priority to a + // user-agent-defined object. + if (request.priority === null) { + // TODO + } + + // 15. If request is a subresource request, then: + if (subresourceSet.has(request.destination)) { + // TODO + } + + // 16. Run main fetch given fetchParams. + mainFetch(fetchParams) + .catch(err => { + fetchParams.controller.terminate(err) + }) + + // 17. Return fetchParam's controller + return fetchParams.controller +} + +// https://fetch.spec.whatwg.org/#concept-main-fetch +async function mainFetch (fetchParams, recursive = false) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let response be null. + let response = null + + // 3. If request’s local-URLs-only flag is set and request’s current URL is + // not local, then set response to a network error. + if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) { + response = makeNetworkError('local URLs only') + } + + // 4. Run report Content Security Policy violations for request. + // TODO + + // 5. Upgrade request to a potentially trustworthy URL, if appropriate. + tryUpgradeRequestToAPotentiallyTrustworthyURL(request) + + // 6. If should request be blocked due to a bad port, should fetching request + // be blocked as mixed content, or should request be blocked by Content + // Security Policy returns blocked, then set response to a network error. + if (requestBadPort(request) === 'blocked') { + response = makeNetworkError('bad port') + } + // TODO: should fetching request be blocked as mixed content? + // TODO: should request be blocked by Content Security Policy? + + // 7. If request’s referrer policy is the empty string, then set request’s + // referrer policy to request’s policy container’s referrer policy. + if (request.referrerPolicy === '') { + request.referrerPolicy = request.policyContainer.referrerPolicy + } + + // 8. If request’s referrer is not "no-referrer", then set request’s + // referrer to the result of invoking determine request’s referrer. + if (request.referrer !== 'no-referrer') { + request.referrer = determineRequestsReferrer(request) + } + + // 9. Set request’s current URL’s scheme to "https" if all of the following + // conditions are true: + // - request’s current URL’s scheme is "http" + // - request’s current URL’s host is a domain + // - Matching request’s current URL’s host per Known HSTS Host Domain Name + // Matching results in either a superdomain match with an asserted + // includeSubDomains directive or a congruent match (with or without an + // asserted includeSubDomains directive). [HSTS] + // TODO + + // 10. If recursive is false, then run the remaining steps in parallel. + // TODO + + // 11. If response is null, then set response to the result of running + // the steps corresponding to the first matching statement: + if (response === null) { + response = await (async () => { + const currentURL = requestCurrentURL(request) + + if ( + // - request’s current URL’s origin is same origin with request’s origin, + // and request’s response tainting is "basic" + (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') || + // request’s current URL’s scheme is "data" + (currentURL.protocol === 'data:') || + // - request’s mode is "navigate" or "websocket" + (request.mode === 'navigate' || request.mode === 'websocket') + ) { + // 1. Set request’s response tainting to "basic". + request.responseTainting = 'basic' + + // 2. Return the result of running scheme fetch given fetchParams. + return await schemeFetch(fetchParams) + } + + // request’s mode is "same-origin" + if (request.mode === 'same-origin') { + // 1. Return a network error. + return makeNetworkError('request mode cannot be "same-origin"') + } + + // request’s mode is "no-cors" + if (request.mode === 'no-cors') { + // 1. If request’s redirect mode is not "follow", then return a network + // error. + if (request.redirect !== 'follow') { + return makeNetworkError( + 'redirect mode cannot be "follow" for "no-cors" request' + ) + } + + // 2. Set request’s response tainting to "opaque". + request.responseTainting = 'opaque' + + // 3. Return the result of running scheme fetch given fetchParams. + return await schemeFetch(fetchParams) + } + + // request’s current URL’s scheme is not an HTTP(S) scheme + if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) { + // Return a network error. + return makeNetworkError('URL scheme must be a HTTP(S) scheme') + } + + // - request’s use-CORS-preflight flag is set + // - request’s unsafe-request flag is set and either request’s method is + // not a CORS-safelisted method or CORS-unsafe request-header names with + // request’s header list is not empty + // 1. Set request’s response tainting to "cors". + // 2. Let corsWithPreflightResponse be the result of running HTTP fetch + // given fetchParams and true. + // 3. If corsWithPreflightResponse is a network error, then clear cache + // entries using request. + // 4. Return corsWithPreflightResponse. + // TODO + + // Otherwise + // 1. Set request’s response tainting to "cors". + request.responseTainting = 'cors' + + // 2. Return the result of running HTTP fetch given fetchParams. + return await httpFetch(fetchParams) + })() + } + + // 12. If recursive is true, then return response. + if (recursive) { + return response + } + + // 13. If response is not a network error and response is not a filtered + // response, then: + if (response.status !== 0 && !response.internalResponse) { + // If request’s response tainting is "cors", then: + if (request.responseTainting === 'cors') { + // 1. Let headerNames be the result of extracting header list values + // given `Access-Control-Expose-Headers` and response’s header list. + // TODO + // 2. If request’s credentials mode is not "include" and headerNames + // contains `*`, then set response’s CORS-exposed header-name list to + // all unique header names in response’s header list. + // TODO + // 3. Otherwise, if headerNames is not null or failure, then set + // response’s CORS-exposed header-name list to headerNames. + // TODO + } + + // Set response to the following filtered response with response as its + // internal response, depending on request’s response tainting: + if (request.responseTainting === 'basic') { + response = filterResponse(response, 'basic') + } else if (request.responseTainting === 'cors') { + response = filterResponse(response, 'cors') + } else if (request.responseTainting === 'opaque') { + response = filterResponse(response, 'opaque') + } else { + assert(false) + } + } + + // 14. Let internalResponse be response, if response is a network error, + // and response’s internal response otherwise. + let internalResponse = + response.status === 0 ? response : response.internalResponse + + // 15. If internalResponse’s URL list is empty, then set it to a clone of + // request’s URL list. + if (internalResponse.urlList.length === 0) { + internalResponse.urlList.push(...request.urlList) + } + + // 16. If request’s timing allow failed flag is unset, then set + // internalResponse’s timing allow passed flag. + if (!request.timingAllowFailed) { + response.timingAllowPassed = true + } + + // 17. If response is not a network error and any of the following returns + // blocked + // - should internalResponse to request be blocked as mixed content + // - should internalResponse to request be blocked by Content Security Policy + // - should internalResponse to request be blocked due to its MIME type + // - should internalResponse to request be blocked due to nosniff + // TODO + + // 18. If response’s type is "opaque", internalResponse’s status is 206, + // internalResponse’s range-requested flag is set, and request’s header + // list does not contain `Range`, then set response and internalResponse + // to a network error. + if ( + response.type === 'opaque' && + internalResponse.status === 206 && + internalResponse.rangeRequested && + !request.headers.contains('range') + ) { + response = internalResponse = makeNetworkError() + } + + // 19. If response is not a network error and either request’s method is + // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status, + // set internalResponse’s body to null and disregard any enqueuing toward + // it (if any). + if ( + response.status !== 0 && + (request.method === 'HEAD' || + request.method === 'CONNECT' || + nullBodyStatus.includes(internalResponse.status)) + ) { + internalResponse.body = null + fetchParams.controller.dump = true + } + + // 20. If request’s integrity metadata is not the empty string, then: + if (request.integrity) { + // 1. Let processBodyError be this step: run fetch finale given fetchParams + // and a network error. + const processBodyError = (reason) => + fetchFinale(fetchParams, makeNetworkError(reason)) + + // 2. If request’s response tainting is "opaque", or response’s body is null, + // then run processBodyError and abort these steps. + if (request.responseTainting === 'opaque' || response.body == null) { + processBodyError(response.error) + return + } + + // 3. Let processBody given bytes be these steps: + const processBody = (bytes) => { + // 1. If bytes do not match request’s integrity metadata, + // then run processBodyError and abort these steps. [SRI] + if (!bytesMatch(bytes, request.integrity)) { + processBodyError('integrity mismatch') + return + } + + // 2. Set response’s body to bytes as a body. + response.body = safelyExtractBody(bytes)[0] + + // 3. Run fetch finale given fetchParams and response. + fetchFinale(fetchParams, response) + } + + // 4. Fully read response’s body given processBody and processBodyError. + await fullyReadBody(response.body, processBody, processBodyError) + } else { + // 21. Otherwise, run fetch finale given fetchParams and response. + fetchFinale(fetchParams, response) + } +} + +// https://fetch.spec.whatwg.org/#concept-scheme-fetch +// given a fetch params fetchParams +function schemeFetch (fetchParams) { + // Note: since the connection is destroyed on redirect, which sets fetchParams to a + // cancelled state, we do not want this condition to trigger *unless* there have been + // no redirects. See https://github.com/nodejs/undici/issues/1776 + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { + return Promise.resolve(makeAppropriateNetworkError(fetchParams)) + } + + // 2. Let request be fetchParams’s request. + const { request } = fetchParams + + const { protocol: scheme } = requestCurrentURL(request) + + // 3. Switch on request’s current URL’s scheme and run the associated steps: + switch (scheme) { + case 'about:': { + // If request’s current URL’s path is the string "blank", then return a new response + // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) », + // and body is the empty byte sequence as a body. + + // Otherwise, return a network error. + return Promise.resolve(makeNetworkError('about scheme is not supported')) + } + case 'blob:': { + if (!resolveObjectURL) { + resolveObjectURL = (__nccwpck_require__(14300).resolveObjectURL) + } + + // 1. Let blobURLEntry be request’s current URL’s blob URL entry. + const blobURLEntry = requestCurrentURL(request) + + // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56 + // Buffer.resolveObjectURL does not ignore URL queries. + if (blobURLEntry.search.length !== 0) { + return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.')) + } + + const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString()) + + // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s + // object is not a Blob object, then return a network error. + if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) { + return Promise.resolve(makeNetworkError('invalid method')) + } + + // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object. + const bodyWithType = safelyExtractBody(blobURLEntryObject) + + // 4. Let body be bodyWithType’s body. + const body = bodyWithType[0] + + // 5. Let length be body’s length, serialized and isomorphic encoded. + const length = isomorphicEncode(`${body.length}`) + + // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence. + const type = bodyWithType[1] ?? '' + + // 7. Return a new response whose status message is `OK`, header list is + // « (`Content-Length`, length), (`Content-Type`, type) », and body is body. + const response = makeResponse({ + statusText: 'OK', + headersList: [ + ['content-length', { name: 'Content-Length', value: length }], + ['content-type', { name: 'Content-Type', value: type }] + ] + }) + + response.body = body + + return Promise.resolve(response) + } + case 'data:': { + // 1. Let dataURLStruct be the result of running the + // data: URL processor on request’s current URL. + const currentURL = requestCurrentURL(request) + const dataURLStruct = dataURLProcessor(currentURL) + + // 2. If dataURLStruct is failure, then return a + // network error. + if (dataURLStruct === 'failure') { + return Promise.resolve(makeNetworkError('failed to fetch the data URL')) + } + + // 3. Let mimeType be dataURLStruct’s MIME type, serialized. + const mimeType = serializeAMimeType(dataURLStruct.mimeType) + + // 4. Return a response whose status message is `OK`, + // header list is « (`Content-Type`, mimeType) », + // and body is dataURLStruct’s body as a body. + return Promise.resolve(makeResponse({ + statusText: 'OK', + headersList: [ + ['content-type', { name: 'Content-Type', value: mimeType }] + ], + body: safelyExtractBody(dataURLStruct.body)[0] + })) + } + case 'file:': { + // For now, unfortunate as it is, file URLs are left as an exercise for the reader. + // When in doubt, return a network error. + return Promise.resolve(makeNetworkError('not implemented... yet...')) + } + case 'http:': + case 'https:': { + // Return the result of running HTTP fetch given fetchParams. + + return httpFetch(fetchParams) + .catch((err) => makeNetworkError(err)) + } + default: { + return Promise.resolve(makeNetworkError('unknown scheme')) + } + } +} + +// https://fetch.spec.whatwg.org/#finalize-response +function finalizeResponse (fetchParams, response) { + // 1. Set fetchParams’s request’s done flag. + fetchParams.request.done = true + + // 2, If fetchParams’s process response done is not null, then queue a fetch + // task to run fetchParams’s process response done given response, with + // fetchParams’s task destination. + if (fetchParams.processResponseDone != null) { + queueMicrotask(() => fetchParams.processResponseDone(response)) + } +} + +// https://fetch.spec.whatwg.org/#fetch-finale +function fetchFinale (fetchParams, response) { + // 1. If response is a network error, then: + if (response.type === 'error') { + // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ». + response.urlList = [fetchParams.request.urlList[0]] + + // 2. Set response’s timing info to the result of creating an opaque timing + // info for fetchParams’s timing info. + response.timingInfo = createOpaqueTimingInfo({ + startTime: fetchParams.timingInfo.startTime + }) + } + + // 2. Let processResponseEndOfBody be the following steps: + const processResponseEndOfBody = () => { + // 1. Set fetchParams’s request’s done flag. + fetchParams.request.done = true + + // If fetchParams’s process response end-of-body is not null, + // then queue a fetch task to run fetchParams’s process response + // end-of-body given response with fetchParams’s task destination. + if (fetchParams.processResponseEndOfBody != null) { + queueMicrotask(() => fetchParams.processResponseEndOfBody(response)) + } + } + + // 3. If fetchParams’s process response is non-null, then queue a fetch task + // to run fetchParams’s process response given response, with fetchParams’s + // task destination. + if (fetchParams.processResponse != null) { + queueMicrotask(() => fetchParams.processResponse(response)) + } + + // 4. If response’s body is null, then run processResponseEndOfBody. + if (response.body == null) { + processResponseEndOfBody() + } else { + // 5. Otherwise: + + // 1. Let transformStream be a new a TransformStream. + + // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, + // enqueues chunk in transformStream. + const identityTransformAlgorithm = (chunk, controller) => { + controller.enqueue(chunk) + } + + // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm + // and flushAlgorithm set to processResponseEndOfBody. + const transformStream = new TransformStream({ + start () {}, + transform: identityTransformAlgorithm, + flush: processResponseEndOfBody + }, { + size () { + return 1 + } + }, { + size () { + return 1 + } + }) + + // 4. Set response’s body to the result of piping response’s body through transformStream. + response.body = { stream: response.body.stream.pipeThrough(transformStream) } + } + + // 6. If fetchParams’s process response consume body is non-null, then: + if (fetchParams.processResponseConsumeBody != null) { + // 1. Let processBody given nullOrBytes be this step: run fetchParams’s + // process response consume body given response and nullOrBytes. + const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes) + + // 2. Let processBodyError be this step: run fetchParams’s process + // response consume body given response and failure. + const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure) + + // 3. If response’s body is null, then queue a fetch task to run processBody + // given null, with fetchParams’s task destination. + if (response.body == null) { + queueMicrotask(() => processBody(null)) + } else { + // 4. Otherwise, fully read response’s body given processBody, processBodyError, + // and fetchParams’s task destination. + return fullyReadBody(response.body, processBody, processBodyError) + } + return Promise.resolve() + } +} + +// https://fetch.spec.whatwg.org/#http-fetch +async function httpFetch (fetchParams) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let response be null. + let response = null + + // 3. Let actualResponse be null. + let actualResponse = null + + // 4. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo + + // 5. If request’s service-workers mode is "all", then: + if (request.serviceWorkers === 'all') { + // TODO + } + + // 6. If response is null, then: + if (response === null) { + // 1. If makeCORSPreflight is true and one of these conditions is true: + // TODO + + // 2. If request’s redirect mode is "follow", then set request’s + // service-workers mode to "none". + if (request.redirect === 'follow') { + request.serviceWorkers = 'none' + } + + // 3. Set response and actualResponse to the result of running + // HTTP-network-or-cache fetch given fetchParams. + actualResponse = response = await httpNetworkOrCacheFetch(fetchParams) + + // 4. If request’s response tainting is "cors" and a CORS check + // for request and response returns failure, then return a network error. + if ( + request.responseTainting === 'cors' && + corsCheck(request, response) === 'failure' + ) { + return makeNetworkError('cors failure') + } + + // 5. If the TAO check for request and response returns failure, then set + // request’s timing allow failed flag. + if (TAOCheck(request, response) === 'failure') { + request.timingAllowFailed = true + } + } + + // 7. If either request’s response tainting or response’s type + // is "opaque", and the cross-origin resource policy check with + // request’s origin, request’s client, request’s destination, + // and actualResponse returns blocked, then return a network error. + if ( + (request.responseTainting === 'opaque' || response.type === 'opaque') && + crossOriginResourcePolicyCheck( + request.origin, + request.client, + request.destination, + actualResponse + ) === 'blocked' + ) { + return makeNetworkError('blocked') + } + + // 8. If actualResponse’s status is a redirect status, then: + if (redirectStatusSet.has(actualResponse.status)) { + // 1. If actualResponse’s status is not 303, request’s body is not null, + // and the connection uses HTTP/2, then user agents may, and are even + // encouraged to, transmit an RST_STREAM frame. + // See, https://github.com/whatwg/fetch/issues/1288 + if (request.redirect !== 'manual') { + fetchParams.controller.connection.destroy() + } + + // 2. Switch on request’s redirect mode: + if (request.redirect === 'error') { + // Set response to a network error. + response = makeNetworkError('unexpected redirect') + } else if (request.redirect === 'manual') { + // Set response to an opaque-redirect filtered response whose internal + // response is actualResponse. + // NOTE(spec): On the web this would return an `opaqueredirect` response, + // but that doesn't make sense server side. + // See https://github.com/nodejs/undici/issues/1193. + response = actualResponse + } else if (request.redirect === 'follow') { + // Set response to the result of running HTTP-redirect fetch given + // fetchParams and response. + response = await httpRedirectFetch(fetchParams, response) + } else { + assert(false) + } + } + + // 9. Set response’s timing info to timingInfo. + response.timingInfo = timingInfo + + // 10. Return response. + return response +} + +// https://fetch.spec.whatwg.org/#http-redirect-fetch +function httpRedirectFetch (fetchParams, response) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let actualResponse be response, if response is not a filtered response, + // and response’s internal response otherwise. + const actualResponse = response.internalResponse + ? response.internalResponse + : response + + // 3. Let locationURL be actualResponse’s location URL given request’s current + // URL’s fragment. + let locationURL + + try { + locationURL = responseLocationURL( + actualResponse, + requestCurrentURL(request).hash + ) + + // 4. If locationURL is null, then return response. + if (locationURL == null) { + return response + } + } catch (err) { + // 5. If locationURL is failure, then return a network error. + return Promise.resolve(makeNetworkError(err)) + } + + // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network + // error. + if (!urlIsHttpHttpsScheme(locationURL)) { + return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme')) + } + + // 7. If request’s redirect count is 20, then return a network error. + if (request.redirectCount === 20) { + return Promise.resolve(makeNetworkError('redirect count exceeded')) + } + + // 8. Increase request’s redirect count by 1. + request.redirectCount += 1 + + // 9. If request’s mode is "cors", locationURL includes credentials, and + // request’s origin is not same origin with locationURL’s origin, then return + // a network error. + if ( + request.mode === 'cors' && + (locationURL.username || locationURL.password) && + !sameOrigin(request, locationURL) + ) { + return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')) + } + + // 10. If request’s response tainting is "cors" and locationURL includes + // credentials, then return a network error. + if ( + request.responseTainting === 'cors' && + (locationURL.username || locationURL.password) + ) { + return Promise.resolve(makeNetworkError( + 'URL cannot contain credentials for request mode "cors"' + )) + } + + // 11. If actualResponse’s status is not 303, request’s body is non-null, + // and request’s body’s source is null, then return a network error. + if ( + actualResponse.status !== 303 && + request.body != null && + request.body.source == null + ) { + return Promise.resolve(makeNetworkError()) + } + + // 12. If one of the following is true + // - actualResponse’s status is 301 or 302 and request’s method is `POST` + // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD` + if ( + ([301, 302].includes(actualResponse.status) && request.method === 'POST') || + (actualResponse.status === 303 && + !GET_OR_HEAD.includes(request.method)) + ) { + // then: + // 1. Set request’s method to `GET` and request’s body to null. + request.method = 'GET' + request.body = null + + // 2. For each headerName of request-body-header name, delete headerName from + // request’s header list. + for (const headerName of requestBodyHeader) { + request.headersList.delete(headerName) + } + } + + // 13. If request’s current URL’s origin is not same origin with locationURL’s + // origin, then for each headerName of CORS non-wildcard request-header name, + // delete headerName from request’s header list. + if (!sameOrigin(requestCurrentURL(request), locationURL)) { + // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name + request.headersList.delete('authorization') + + // https://fetch.spec.whatwg.org/#authentication-entries + request.headersList.delete('proxy-authorization', true) + + // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. + request.headersList.delete('cookie') + request.headersList.delete('host') + } + + // 14. If request’s body is non-null, then set request’s body to the first return + // value of safely extracting request’s body’s source. + if (request.body != null) { + assert(request.body.source != null) + request.body = safelyExtractBody(request.body.source)[0] + } + + // 15. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo + + // 16. Set timingInfo’s redirect end time and post-redirect start time to the + // coarsened shared current time given fetchParams’s cross-origin isolated + // capability. + timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = + coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability) + + // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s + // redirect start time to timingInfo’s start time. + if (timingInfo.redirectStartTime === 0) { + timingInfo.redirectStartTime = timingInfo.startTime + } + + // 18. Append locationURL to request’s URL list. + request.urlList.push(locationURL) + + // 19. Invoke set request’s referrer policy on redirect on request and + // actualResponse. + setRequestReferrerPolicyOnRedirect(request, actualResponse) + + // 20. Return the result of running main fetch given fetchParams and true. + return mainFetch(fetchParams, true) +} + +// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch +async function httpNetworkOrCacheFetch ( + fetchParams, + isAuthenticationFetch = false, + isNewConnectionFetch = false +) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let httpFetchParams be null. + let httpFetchParams = null + + // 3. Let httpRequest be null. + let httpRequest = null + + // 4. Let response be null. + let response = null + + // 5. Let storedResponse be null. + // TODO: cache + + // 6. Let httpCache be null. + const httpCache = null + + // 7. Let the revalidatingFlag be unset. + const revalidatingFlag = false + + // 8. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. If request’s window is "no-window" and request’s redirect mode is + // "error", then set httpFetchParams to fetchParams and httpRequest to + // request. + if (request.window === 'no-window' && request.redirect === 'error') { + httpFetchParams = fetchParams + httpRequest = request + } else { + // Otherwise: + + // 1. Set httpRequest to a clone of request. + httpRequest = makeRequest(request) + + // 2. Set httpFetchParams to a copy of fetchParams. + httpFetchParams = { ...fetchParams } + + // 3. Set httpFetchParams’s request to httpRequest. + httpFetchParams.request = httpRequest + } + + // 3. Let includeCredentials be true if one of + const includeCredentials = + request.credentials === 'include' || + (request.credentials === 'same-origin' && + request.responseTainting === 'basic') + + // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s + // body is non-null; otherwise null. + const contentLength = httpRequest.body ? httpRequest.body.length : null + + // 5. Let contentLengthHeaderValue be null. + let contentLengthHeaderValue = null + + // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or + // `PUT`, then set contentLengthHeaderValue to `0`. + if ( + httpRequest.body == null && + ['POST', 'PUT'].includes(httpRequest.method) + ) { + contentLengthHeaderValue = '0' + } + + // 7. If contentLength is non-null, then set contentLengthHeaderValue to + // contentLength, serialized and isomorphic encoded. + if (contentLength != null) { + contentLengthHeaderValue = isomorphicEncode(`${contentLength}`) + } + + // 8. If contentLengthHeaderValue is non-null, then append + // `Content-Length`/contentLengthHeaderValue to httpRequest’s header + // list. + if (contentLengthHeaderValue != null) { + httpRequest.headersList.append('content-length', contentLengthHeaderValue) + } + + // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`, + // contentLengthHeaderValue) to httpRequest’s header list. + + // 10. If contentLength is non-null and httpRequest’s keepalive is true, + // then: + if (contentLength != null && httpRequest.keepalive) { + // NOTE: keepalive is a noop outside of browser context. + } + + // 11. If httpRequest’s referrer is a URL, then append + // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded, + // to httpRequest’s header list. + if (httpRequest.referrer instanceof URL) { + httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href)) + } + + // 12. Append a request `Origin` header for httpRequest. + appendRequestOriginHeader(httpRequest) + + // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA] + appendFetchMetadata(httpRequest) + + // 14. If httpRequest’s header list does not contain `User-Agent`, then + // user agents should append `User-Agent`/default `User-Agent` value to + // httpRequest’s header list. + if (!httpRequest.headersList.contains('user-agent')) { + httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node') + } + + // 15. If httpRequest’s cache mode is "default" and httpRequest’s header + // list contains `If-Modified-Since`, `If-None-Match`, + // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set + // httpRequest’s cache mode to "no-store". + if ( + httpRequest.cache === 'default' && + (httpRequest.headersList.contains('if-modified-since') || + httpRequest.headersList.contains('if-none-match') || + httpRequest.headersList.contains('if-unmodified-since') || + httpRequest.headersList.contains('if-match') || + httpRequest.headersList.contains('if-range')) + ) { + httpRequest.cache = 'no-store' + } + + // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent + // no-cache cache-control header modification flag is unset, and + // httpRequest’s header list does not contain `Cache-Control`, then append + // `Cache-Control`/`max-age=0` to httpRequest’s header list. + if ( + httpRequest.cache === 'no-cache' && + !httpRequest.preventNoCacheCacheControlHeaderModification && + !httpRequest.headersList.contains('cache-control') + ) { + httpRequest.headersList.append('cache-control', 'max-age=0') + } + + // 17. If httpRequest’s cache mode is "no-store" or "reload", then: + if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') { + // 1. If httpRequest’s header list does not contain `Pragma`, then append + // `Pragma`/`no-cache` to httpRequest’s header list. + if (!httpRequest.headersList.contains('pragma')) { + httpRequest.headersList.append('pragma', 'no-cache') + } + + // 2. If httpRequest’s header list does not contain `Cache-Control`, + // then append `Cache-Control`/`no-cache` to httpRequest’s header list. + if (!httpRequest.headersList.contains('cache-control')) { + httpRequest.headersList.append('cache-control', 'no-cache') + } + } + + // 18. If httpRequest’s header list contains `Range`, then append + // `Accept-Encoding`/`identity` to httpRequest’s header list. + if (httpRequest.headersList.contains('range')) { + httpRequest.headersList.append('accept-encoding', 'identity') + } + + // 19. Modify httpRequest’s header list per HTTP. Do not append a given + // header if httpRequest’s header list contains that header’s name. + // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129 + if (!httpRequest.headersList.contains('accept-encoding')) { + if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { + httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate') + } else { + httpRequest.headersList.append('accept-encoding', 'gzip, deflate') + } + } + + httpRequest.headersList.delete('host') + + // 20. If includeCredentials is true, then: + if (includeCredentials) { + // 1. If the user agent is not configured to block cookies for httpRequest + // (see section 7 of [COOKIES]), then: + // TODO: credentials + // 2. If httpRequest’s header list does not contain `Authorization`, then: + // TODO: credentials + } + + // 21. If there’s a proxy-authentication entry, use it as appropriate. + // TODO: proxy-authentication + + // 22. Set httpCache to the result of determining the HTTP cache + // partition, given httpRequest. + // TODO: cache + + // 23. If httpCache is null, then set httpRequest’s cache mode to + // "no-store". + if (httpCache == null) { + httpRequest.cache = 'no-store' + } + + // 24. If httpRequest’s cache mode is neither "no-store" nor "reload", + // then: + if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') { + // TODO: cache + } + + // 9. If aborted, then return the appropriate network error for fetchParams. + // TODO + + // 10. If response is null, then: + if (response == null) { + // 1. If httpRequest’s cache mode is "only-if-cached", then return a + // network error. + if (httpRequest.mode === 'only-if-cached') { + return makeNetworkError('only if cached') + } + + // 2. Let forwardResponse be the result of running HTTP-network fetch + // given httpFetchParams, includeCredentials, and isNewConnectionFetch. + const forwardResponse = await httpNetworkFetch( + httpFetchParams, + includeCredentials, + isNewConnectionFetch + ) + + // 3. If httpRequest’s method is unsafe and forwardResponse’s status is + // in the range 200 to 399, inclusive, invalidate appropriate stored + // responses in httpCache, as per the "Invalidation" chapter of HTTP + // Caching, and set storedResponse to null. [HTTP-CACHING] + if ( + !safeMethodsSet.has(httpRequest.method) && + forwardResponse.status >= 200 && + forwardResponse.status <= 399 + ) { + // TODO: cache + } + + // 4. If the revalidatingFlag is set and forwardResponse’s status is 304, + // then: + if (revalidatingFlag && forwardResponse.status === 304) { + // TODO: cache + } + + // 5. If response is null, then: + if (response == null) { + // 1. Set response to forwardResponse. + response = forwardResponse + + // 2. Store httpRequest and forwardResponse in httpCache, as per the + // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING] + // TODO: cache + } + } + + // 11. Set response’s URL list to a clone of httpRequest’s URL list. + response.urlList = [...httpRequest.urlList] + + // 12. If httpRequest’s header list contains `Range`, then set response’s + // range-requested flag. + if (httpRequest.headersList.contains('range')) { + response.rangeRequested = true + } + + // 13. Set response’s request-includes-credentials to includeCredentials. + response.requestIncludesCredentials = includeCredentials + + // 14. If response’s status is 401, httpRequest’s response tainting is not + // "cors", includeCredentials is true, and request’s window is an environment + // settings object, then: + // TODO + + // 15. If response’s status is 407, then: + if (response.status === 407) { + // 1. If request’s window is "no-window", then return a network error. + if (request.window === 'no-window') { + return makeNetworkError() + } + + // 2. ??? + + // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams) + } + + // 4. Prompt the end user as appropriate in request’s window and store + // the result as a proxy-authentication entry. [HTTP-AUTH] + // TODO: Invoke some kind of callback? + + // 5. Set response to the result of running HTTP-network-or-cache fetch given + // fetchParams. + // TODO + return makeNetworkError('proxy authentication required') + } + + // 16. If all of the following are true + if ( + // response’s status is 421 + response.status === 421 && + // isNewConnectionFetch is false + !isNewConnectionFetch && + // request’s body is null, or request’s body is non-null and request’s body’s source is non-null + (request.body == null || request.body.source != null) + ) { + // then: + + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams) + } + + // 2. Set response to the result of running HTTP-network-or-cache + // fetch given fetchParams, isAuthenticationFetch, and true. + + // TODO (spec): The spec doesn't specify this but we need to cancel + // the active response before we can start a new one. + // https://github.com/whatwg/fetch/issues/1293 + fetchParams.controller.connection.destroy() + + response = await httpNetworkOrCacheFetch( + fetchParams, + isAuthenticationFetch, + true + ) + } + + // 17. If isAuthenticationFetch is true, then create an authentication entry + if (isAuthenticationFetch) { + // TODO + } + + // 18. Return response. + return response +} + +// https://fetch.spec.whatwg.org/#http-network-fetch +async function httpNetworkFetch ( + fetchParams, + includeCredentials = false, + forceNewConnection = false +) { + assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed) + + fetchParams.controller.connection = { + abort: null, + destroyed: false, + destroy (err) { + if (!this.destroyed) { + this.destroyed = true + this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError')) + } + } + } + + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let response be null. + let response = null + + // 3. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo + + // 4. Let httpCache be the result of determining the HTTP cache partition, + // given request. + // TODO: cache + const httpCache = null + + // 5. If httpCache is null, then set request’s cache mode to "no-store". + if (httpCache == null) { + request.cache = 'no-store' + } + + // 6. Let networkPartitionKey be the result of determining the network + // partition key given request. + // TODO + + // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise + // "no". + const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars + + // 8. Switch on request’s mode: + if (request.mode === 'websocket') { + // Let connection be the result of obtaining a WebSocket connection, + // given request’s current URL. + // TODO + } else { + // Let connection be the result of obtaining a connection, given + // networkPartitionKey, request’s current URL’s origin, + // includeCredentials, and forceNewConnection. + // TODO + } + + // 9. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. If connection is failure, then return a network error. + + // 2. Set timingInfo’s final connection timing info to the result of + // calling clamp and coarsen connection timing info with connection’s + // timing info, timingInfo’s post-redirect start time, and fetchParams’s + // cross-origin isolated capability. + + // 3. If connection is not an HTTP/2 connection, request’s body is non-null, + // and request’s body’s source is null, then append (`Transfer-Encoding`, + // `chunked`) to request’s header list. + + // 4. Set timingInfo’s final network-request start time to the coarsened + // shared current time given fetchParams’s cross-origin isolated + // capability. + + // 5. Set response to the result of making an HTTP request over connection + // using request with the following caveats: + + // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS] + // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH] + + // - If request’s body is non-null, and request’s body’s source is null, + // then the user agent may have a buffer of up to 64 kibibytes and store + // a part of request’s body in that buffer. If the user agent reads from + // request’s body beyond that buffer’s size and the user agent needs to + // resend request, then instead return a network error. + + // - Set timingInfo’s final network-response start time to the coarsened + // shared current time given fetchParams’s cross-origin isolated capability, + // immediately after the user agent’s HTTP parser receives the first byte + // of the response (e.g., frame header bytes for HTTP/2 or response status + // line for HTTP/1.x). + + // - Wait until all the headers are transmitted. + + // - Any responses whose status is in the range 100 to 199, inclusive, + // and is not 101, are to be ignored, except for the purposes of setting + // timingInfo’s final network-response start time above. + + // - If request’s header list contains `Transfer-Encoding`/`chunked` and + // response is transferred via HTTP/1.0 or older, then return a network + // error. + + // - If the HTTP request results in a TLS client certificate dialog, then: + + // 1. If request’s window is an environment settings object, make the + // dialog available in request’s window. + + // 2. Otherwise, return a network error. + + // To transmit request’s body body, run these steps: + let requestBody = null + // 1. If body is null and fetchParams’s process request end-of-body is + // non-null, then queue a fetch task given fetchParams’s process request + // end-of-body and fetchParams’s task destination. + if (request.body == null && fetchParams.processRequestEndOfBody) { + queueMicrotask(() => fetchParams.processRequestEndOfBody()) + } else if (request.body != null) { + // 2. Otherwise, if body is non-null: + + // 1. Let processBodyChunk given bytes be these steps: + const processBodyChunk = async function * (bytes) { + // 1. If the ongoing fetch is terminated, then abort these steps. + if (isCancelled(fetchParams)) { + return + } + + // 2. Run this step in parallel: transmit bytes. + yield bytes + + // 3. If fetchParams’s process request body is non-null, then run + // fetchParams’s process request body given bytes’s length. + fetchParams.processRequestBodyChunkLength?.(bytes.byteLength) + } + + // 2. Let processEndOfBody be these steps: + const processEndOfBody = () => { + // 1. If fetchParams is canceled, then abort these steps. + if (isCancelled(fetchParams)) { + return + } + + // 2. If fetchParams’s process request end-of-body is non-null, + // then run fetchParams’s process request end-of-body. + if (fetchParams.processRequestEndOfBody) { + fetchParams.processRequestEndOfBody() + } + } + + // 3. Let processBodyError given e be these steps: + const processBodyError = (e) => { + // 1. If fetchParams is canceled, then abort these steps. + if (isCancelled(fetchParams)) { + return + } + + // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller. + if (e.name === 'AbortError') { + fetchParams.controller.abort() + } else { + fetchParams.controller.terminate(e) + } + } + + // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody, + // processBodyError, and fetchParams’s task destination. + requestBody = (async function * () { + try { + for await (const bytes of request.body.stream) { + yield * processBodyChunk(bytes) + } + processEndOfBody() + } catch (err) { + processBodyError(err) + } + })() + } + + try { + // socket is only provided for websockets + const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }) + + if (socket) { + response = makeResponse({ status, statusText, headersList, socket }) + } else { + const iterator = body[Symbol.asyncIterator]() + fetchParams.controller.next = () => iterator.next() + + response = makeResponse({ status, statusText, headersList }) + } + } catch (err) { + // 10. If aborted, then: + if (err.name === 'AbortError') { + // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame. + fetchParams.controller.connection.destroy() + + // 2. Return the appropriate network error for fetchParams. + return makeAppropriateNetworkError(fetchParams, err) + } + + return makeNetworkError(err) + } + + // 11. Let pullAlgorithm be an action that resumes the ongoing fetch + // if it is suspended. + const pullAlgorithm = () => { + fetchParams.controller.resume() + } + + // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s + // controller with reason, given reason. + const cancelAlgorithm = (reason) => { + fetchParams.controller.abort(reason) + } + + // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by + // the user agent. + // TODO + + // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object + // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent. + // TODO + + // 15. Let stream be a new ReadableStream. + // 16. Set up stream with pullAlgorithm set to pullAlgorithm, + // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to + // highWaterMark, and sizeAlgorithm set to sizeAlgorithm. + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + const stream = new ReadableStream( + { + async start (controller) { + fetchParams.controller.controller = controller + }, + async pull (controller) { + await pullAlgorithm(controller) + }, + async cancel (reason) { + await cancelAlgorithm(reason) + } + }, + { + highWaterMark: 0, + size () { + return 1 + } + } + ) + + // 17. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. Set response’s body to a new body whose stream is stream. + response.body = { stream } + + // 2. If response is not a network error and request’s cache mode is + // not "no-store", then update response in httpCache for request. + // TODO + + // 3. If includeCredentials is true and the user agent is not configured + // to block cookies for request (see section 7 of [COOKIES]), then run the + // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on + // the value of each header whose name is a byte-case-insensitive match for + // `Set-Cookie` in response’s header list, if any, and request’s current URL. + // TODO + + // 18. If aborted, then: + // TODO + + // 19. Run these steps in parallel: + + // 1. Run these steps, but abort when fetchParams is canceled: + fetchParams.controller.on('terminated', onAborted) + fetchParams.controller.resume = async () => { + // 1. While true + while (true) { + // 1-3. See onData... + + // 4. Set bytes to the result of handling content codings given + // codings and bytes. + let bytes + let isFailure + try { + const { done, value } = await fetchParams.controller.next() + + if (isAborted(fetchParams)) { + break + } + + bytes = done ? undefined : value + } catch (err) { + if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { + // zlib doesn't like empty streams. + bytes = undefined + } else { + bytes = err + + // err may be propagated from the result of calling readablestream.cancel, + // which might not be an error. https://github.com/nodejs/undici/issues/2009 + isFailure = true + } + } + + if (bytes === undefined) { + // 2. Otherwise, if the bytes transmission for response’s message + // body is done normally and stream is readable, then close + // stream, finalize response for fetchParams and response, and + // abort these in-parallel steps. + readableStreamClose(fetchParams.controller.controller) + + finalizeResponse(fetchParams, response) + + return + } + + // 5. Increase timingInfo’s decoded body size by bytes’s length. + timingInfo.decodedBodySize += bytes?.byteLength ?? 0 + + // 6. If bytes is failure, then terminate fetchParams’s controller. + if (isFailure) { + fetchParams.controller.terminate(bytes) + return + } + + // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes + // into stream. + fetchParams.controller.controller.enqueue(new Uint8Array(bytes)) + + // 8. If stream is errored, then terminate the ongoing fetch. + if (isErrored(stream)) { + fetchParams.controller.terminate() + return + } + + // 9. If stream doesn’t need more data ask the user agent to suspend + // the ongoing fetch. + if (!fetchParams.controller.controller.desiredSize) { + return + } + } + } + + // 2. If aborted, then: + function onAborted (reason) { + // 2. If fetchParams is aborted, then: + if (isAborted(fetchParams)) { + // 1. Set response’s aborted flag. + response.aborted = true + + // 2. If stream is readable, then error stream with the result of + // deserialize a serialized abort reason given fetchParams’s + // controller’s serialized abort reason and an + // implementation-defined realm. + if (isReadable(stream)) { + fetchParams.controller.controller.error( + fetchParams.controller.serializedAbortReason + ) + } + } else { + // 3. Otherwise, if stream is readable, error stream with a TypeError. + if (isReadable(stream)) { + fetchParams.controller.controller.error(new TypeError('terminated', { + cause: isErrorLike(reason) ? reason : undefined + })) + } + } + + // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame. + // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so. + fetchParams.controller.connection.destroy() + } + + // 20. Return response. + return response + + async function dispatch ({ body }) { + const url = requestCurrentURL(request) + /** @type {import('../..').Agent} */ + const agent = fetchParams.controller.dispatcher + + return new Promise((resolve, reject) => agent.dispatch( + { + path: url.pathname + url.search, + origin: url.origin, + method: request.method, + body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body, + headers: request.headersList.entries, + maxRedirections: 0, + upgrade: request.mode === 'websocket' ? 'websocket' : undefined + }, + { + body: null, + abort: null, + + onConnect (abort) { + // TODO (fix): Do we need connection here? + const { connection } = fetchParams.controller + + if (connection.destroyed) { + abort(new DOMException('The operation was aborted.', 'AbortError')) + } else { + fetchParams.controller.on('terminated', abort) + this.abort = connection.abort = abort + } + }, + + onHeaders (status, headersList, resume, statusText) { + if (status < 200) { + return + } + + let codings = [] + let location = '' + + const headers = new Headers() + + // For H2, the headers are a plain JS object + // We distinguish between them and iterate accordingly + if (Array.isArray(headersList)) { + for (let n = 0; n < headersList.length; n += 2) { + const key = headersList[n + 0].toString('latin1') + const val = headersList[n + 1].toString('latin1') + if (key.toLowerCase() === 'content-encoding') { + // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 + // "All content-coding values are case-insensitive..." + codings = val.toLowerCase().split(',').map((x) => x.trim()) + } else if (key.toLowerCase() === 'location') { + location = val + } + + headers[kHeadersList].append(key, val) + } + } else { + const keys = Object.keys(headersList) + for (const key of keys) { + const val = headersList[key] + if (key.toLowerCase() === 'content-encoding') { + // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 + // "All content-coding values are case-insensitive..." + codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse() + } else if (key.toLowerCase() === 'location') { + location = val + } + + headers[kHeadersList].append(key, val) + } + } + + this.body = new Readable({ read: resume }) + + const decoders = [] + + const willFollow = request.redirect === 'follow' && + location && + redirectStatusSet.has(status) + + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding + if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) { + for (const coding of codings) { + // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2 + if (coding === 'x-gzip' || coding === 'gzip') { + decoders.push(zlib.createGunzip({ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH + })) + } else if (coding === 'deflate') { + decoders.push(zlib.createInflate()) + } else if (coding === 'br') { + decoders.push(zlib.createBrotliDecompress()) + } else { + decoders.length = 0 + break + } + } + } + + resolve({ + status, + statusText, + headersList: headers[kHeadersList], + body: decoders.length + ? pipeline(this.body, ...decoders, () => { }) + : this.body.on('error', () => {}) + }) + + return true + }, + + onData (chunk) { + if (fetchParams.controller.dump) { + return + } + + // 1. If one or more bytes have been transmitted from response’s + // message body, then: + + // 1. Let bytes be the transmitted bytes. + const bytes = chunk + + // 2. Let codings be the result of extracting header list values + // given `Content-Encoding` and response’s header list. + // See pullAlgorithm. + + // 3. Increase timingInfo’s encoded body size by bytes’s length. + timingInfo.encodedBodySize += bytes.byteLength + + // 4. See pullAlgorithm... + + return this.body.push(bytes) + }, + + onComplete () { + if (this.abort) { + fetchParams.controller.off('terminated', this.abort) + } + + fetchParams.controller.ended = true + + this.body.push(null) + }, + + onError (error) { + if (this.abort) { + fetchParams.controller.off('terminated', this.abort) + } + + this.body?.destroy(error) + + fetchParams.controller.terminate(error) + + reject(error) + }, + + onUpgrade (status, headersList, socket) { + if (status !== 101) { + return + } + + const headers = new Headers() + + for (let n = 0; n < headersList.length; n += 2) { + const key = headersList[n + 0].toString('latin1') + const val = headersList[n + 1].toString('latin1') + + headers[kHeadersList].append(key, val) + } + + resolve({ + status, + statusText: STATUS_CODES[status], + headersList: headers[kHeadersList], + socket + }) + + return true + } + } + )) + } +} + +module.exports = { + fetch, + Fetch, + fetching, + finalizeAndReportTiming +} + + +/***/ }), + +/***/ 48359: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/* globals AbortController */ + + + +const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(41472) +const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(10554) +const { FinalizationRegistry } = __nccwpck_require__(56436)() +const util = __nccwpck_require__(83983) +const { + isValidHTTPToken, + sameOrigin, + normalizeMethod, + makePolicyContainer, + normalizeMethodRecord +} = __nccwpck_require__(52538) +const { + forbiddenMethodsSet, + corsSafeListedMethodsSet, + referrerPolicy, + requestRedirect, + requestMode, + requestCredentials, + requestCache, + requestDuplex +} = __nccwpck_require__(41037) +const { kEnumerableProperty } = util +const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(15861) +const { webidl } = __nccwpck_require__(21744) +const { getGlobalOrigin } = __nccwpck_require__(71246) +const { URLSerializer } = __nccwpck_require__(685) +const { kHeadersList, kConstruct } = __nccwpck_require__(72785) +const assert = __nccwpck_require__(39491) +const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(82361) + +let TransformStream = globalThis.TransformStream + +const kAbortController = Symbol('abortController') + +const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { + signal.removeEventListener('abort', abort) +}) + +// https://fetch.spec.whatwg.org/#request-class +class Request { + // https://fetch.spec.whatwg.org/#dom-request + constructor (input, init = {}) { + if (input === kConstruct) { + return + } + + webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' }) + + input = webidl.converters.RequestInfo(input) + init = webidl.converters.RequestInit(init) + + // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object + this[kRealm] = { + settingsObject: { + baseUrl: getGlobalOrigin(), + get origin () { + return this.baseUrl?.origin + }, + policyContainer: makePolicyContainer() + } + } + + // 1. Let request be null. + let request = null + + // 2. Let fallbackMode be null. + let fallbackMode = null + + // 3. Let baseURL be this’s relevant settings object’s API base URL. + const baseUrl = this[kRealm].settingsObject.baseUrl + + // 4. Let signal be null. + let signal = null + + // 5. If input is a string, then: + if (typeof input === 'string') { + // 1. Let parsedURL be the result of parsing input with baseURL. + // 2. If parsedURL is failure, then throw a TypeError. + let parsedURL + try { + parsedURL = new URL(input, baseUrl) + } catch (err) { + throw new TypeError('Failed to parse URL from ' + input, { cause: err }) + } + + // 3. If parsedURL includes credentials, then throw a TypeError. + if (parsedURL.username || parsedURL.password) { + throw new TypeError( + 'Request cannot be constructed from a URL that includes credentials: ' + + input + ) + } + + // 4. Set request to a new request whose URL is parsedURL. + request = makeRequest({ urlList: [parsedURL] }) + + // 5. Set fallbackMode to "cors". + fallbackMode = 'cors' + } else { + // 6. Otherwise: + + // 7. Assert: input is a Request object. + assert(input instanceof Request) + + // 8. Set request to input’s request. + request = input[kState] + + // 9. Set signal to input’s signal. + signal = input[kSignal] + } + + // 7. Let origin be this’s relevant settings object’s origin. + const origin = this[kRealm].settingsObject.origin + + // 8. Let window be "client". + let window = 'client' + + // 9. If request’s window is an environment settings object and its origin + // is same origin with origin, then set window to request’s window. + if ( + request.window?.constructor?.name === 'EnvironmentSettingsObject' && + sameOrigin(request.window, origin) + ) { + window = request.window + } + + // 10. If init["window"] exists and is non-null, then throw a TypeError. + if (init.window != null) { + throw new TypeError(`'window' option '${window}' must be null`) + } + + // 11. If init["window"] exists, then set window to "no-window". + if ('window' in init) { + window = 'no-window' + } + + // 12. Set request to a new request with the following properties: + request = makeRequest({ + // URL request’s URL. + // undici implementation note: this is set as the first item in request's urlList in makeRequest + // method request’s method. + method: request.method, + // header list A copy of request’s header list. + // undici implementation note: headersList is cloned in makeRequest + headersList: request.headersList, + // unsafe-request flag Set. + unsafeRequest: request.unsafeRequest, + // client This’s relevant settings object. + client: this[kRealm].settingsObject, + // window window. + window, + // priority request’s priority. + priority: request.priority, + // origin request’s origin. The propagation of the origin is only significant for navigation requests + // being handled by a service worker. In this scenario a request can have an origin that is different + // from the current client. + origin: request.origin, + // referrer request’s referrer. + referrer: request.referrer, + // referrer policy request’s referrer policy. + referrerPolicy: request.referrerPolicy, + // mode request’s mode. + mode: request.mode, + // credentials mode request’s credentials mode. + credentials: request.credentials, + // cache mode request’s cache mode. + cache: request.cache, + // redirect mode request’s redirect mode. + redirect: request.redirect, + // integrity metadata request’s integrity metadata. + integrity: request.integrity, + // keepalive request’s keepalive. + keepalive: request.keepalive, + // reload-navigation flag request’s reload-navigation flag. + reloadNavigation: request.reloadNavigation, + // history-navigation flag request’s history-navigation flag. + historyNavigation: request.historyNavigation, + // URL list A clone of request’s URL list. + urlList: [...request.urlList] + }) + + const initHasKey = Object.keys(init).length !== 0 + + // 13. If init is not empty, then: + if (initHasKey) { + // 1. If request’s mode is "navigate", then set it to "same-origin". + if (request.mode === 'navigate') { + request.mode = 'same-origin' + } + + // 2. Unset request’s reload-navigation flag. + request.reloadNavigation = false + + // 3. Unset request’s history-navigation flag. + request.historyNavigation = false + + // 4. Set request’s origin to "client". + request.origin = 'client' + + // 5. Set request’s referrer to "client" + request.referrer = 'client' + + // 6. Set request’s referrer policy to the empty string. + request.referrerPolicy = '' + + // 7. Set request’s URL to request’s current URL. + request.url = request.urlList[request.urlList.length - 1] + + // 8. Set request’s URL list to « request’s URL ». + request.urlList = [request.url] + } + + // 14. If init["referrer"] exists, then: + if (init.referrer !== undefined) { + // 1. Let referrer be init["referrer"]. + const referrer = init.referrer + + // 2. If referrer is the empty string, then set request’s referrer to "no-referrer". + if (referrer === '') { + request.referrer = 'no-referrer' + } else { + // 1. Let parsedReferrer be the result of parsing referrer with + // baseURL. + // 2. If parsedReferrer is failure, then throw a TypeError. + let parsedReferrer + try { + parsedReferrer = new URL(referrer, baseUrl) + } catch (err) { + throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }) + } + + // 3. If one of the following is true + // - parsedReferrer’s scheme is "about" and path is the string "client" + // - parsedReferrer’s origin is not same origin with origin + // then set request’s referrer to "client". + if ( + (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') || + (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) + ) { + request.referrer = 'client' + } else { + // 4. Otherwise, set request’s referrer to parsedReferrer. + request.referrer = parsedReferrer + } + } + } + + // 15. If init["referrerPolicy"] exists, then set request’s referrer policy + // to it. + if (init.referrerPolicy !== undefined) { + request.referrerPolicy = init.referrerPolicy + } + + // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise. + let mode + if (init.mode !== undefined) { + mode = init.mode + } else { + mode = fallbackMode + } + + // 17. If mode is "navigate", then throw a TypeError. + if (mode === 'navigate') { + throw webidl.errors.exception({ + header: 'Request constructor', + message: 'invalid request mode navigate.' + }) + } + + // 18. If mode is non-null, set request’s mode to mode. + if (mode != null) { + request.mode = mode + } + + // 19. If init["credentials"] exists, then set request’s credentials mode + // to it. + if (init.credentials !== undefined) { + request.credentials = init.credentials + } + + // 18. If init["cache"] exists, then set request’s cache mode to it. + if (init.cache !== undefined) { + request.cache = init.cache + } + + // 21. If request’s cache mode is "only-if-cached" and request’s mode is + // not "same-origin", then throw a TypeError. + if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') { + throw new TypeError( + "'only-if-cached' can be set only with 'same-origin' mode" + ) + } + + // 22. If init["redirect"] exists, then set request’s redirect mode to it. + if (init.redirect !== undefined) { + request.redirect = init.redirect + } + + // 23. If init["integrity"] exists, then set request’s integrity metadata to it. + if (init.integrity != null) { + request.integrity = String(init.integrity) + } + + // 24. If init["keepalive"] exists, then set request’s keepalive to it. + if (init.keepalive !== undefined) { + request.keepalive = Boolean(init.keepalive) + } + + // 25. If init["method"] exists, then: + if (init.method !== undefined) { + // 1. Let method be init["method"]. + let method = init.method + + // 2. If method is not a method or method is a forbidden method, then + // throw a TypeError. + if (!isValidHTTPToken(method)) { + throw new TypeError(`'${method}' is not a valid HTTP method.`) + } + + if (forbiddenMethodsSet.has(method.toUpperCase())) { + throw new TypeError(`'${method}' HTTP method is unsupported.`) + } + + // 3. Normalize method. + method = normalizeMethodRecord[method] ?? normalizeMethod(method) + + // 4. Set request’s method to method. + request.method = method + } + + // 26. If init["signal"] exists, then set signal to it. + if (init.signal !== undefined) { + signal = init.signal + } + + // 27. Set this’s request to request. + this[kState] = request + + // 28. Set this’s signal to a new AbortSignal object with this’s relevant + // Realm. + // TODO: could this be simplified with AbortSignal.any + // (https://dom.spec.whatwg.org/#dom-abortsignal-any) + const ac = new AbortController() + this[kSignal] = ac.signal + this[kSignal][kRealm] = this[kRealm] + + // 29. If signal is not null, then make this’s signal follow signal. + if (signal != null) { + if ( + !signal || + typeof signal.aborted !== 'boolean' || + typeof signal.addEventListener !== 'function' + ) { + throw new TypeError( + "Failed to construct 'Request': member signal is not of type AbortSignal." + ) + } + + if (signal.aborted) { + ac.abort(signal.reason) + } else { + // Keep a strong ref to ac while request object + // is alive. This is needed to prevent AbortController + // from being prematurely garbage collected. + // See, https://github.com/nodejs/undici/issues/1926. + this[kAbortController] = ac + + const acRef = new WeakRef(ac) + const abort = function () { + const ac = acRef.deref() + if (ac !== undefined) { + ac.abort(this.reason) + } + } + + // Third-party AbortControllers may not work with these. + // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619. + try { + // If the max amount of listeners is equal to the default, increase it + // This is only available in node >= v19.9.0 + if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) { + setMaxListeners(100, signal) + } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) { + setMaxListeners(100, signal) + } + } catch {} + + util.addAbortListener(signal, abort) + requestFinalizer.register(ac, { signal, abort }) + } + } + + // 30. Set this’s headers to a new Headers object with this’s relevant + // Realm, whose header list is request’s header list and guard is + // "request". + this[kHeaders] = new Headers(kConstruct) + this[kHeaders][kHeadersList] = request.headersList + this[kHeaders][kGuard] = 'request' + this[kHeaders][kRealm] = this[kRealm] + + // 31. If this’s request’s mode is "no-cors", then: + if (mode === 'no-cors') { + // 1. If this’s request’s method is not a CORS-safelisted method, + // then throw a TypeError. + if (!corsSafeListedMethodsSet.has(request.method)) { + throw new TypeError( + `'${request.method} is unsupported in no-cors mode.` + ) + } + + // 2. Set this’s headers’s guard to "request-no-cors". + this[kHeaders][kGuard] = 'request-no-cors' + } + + // 32. If init is not empty, then: + if (initHasKey) { + /** @type {HeadersList} */ + const headersList = this[kHeaders][kHeadersList] + // 1. Let headers be a copy of this’s headers and its associated header + // list. + // 2. If init["headers"] exists, then set headers to init["headers"]. + const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList) + + // 3. Empty this’s headers’s header list. + headersList.clear() + + // 4. If headers is a Headers object, then for each header in its header + // list, append header’s name/header’s value to this’s headers. + if (headers instanceof HeadersList) { + for (const [key, val] of headers) { + headersList.append(key, val) + } + // Note: Copy the `set-cookie` meta-data. + headersList.cookies = headers.cookies + } else { + // 5. Otherwise, fill this’s headers with headers. + fillHeaders(this[kHeaders], headers) + } + } + + // 33. Let inputBody be input’s request’s body if input is a Request + // object; otherwise null. + const inputBody = input instanceof Request ? input[kState].body : null + + // 34. If either init["body"] exists and is non-null or inputBody is + // non-null, and request’s method is `GET` or `HEAD`, then throw a + // TypeError. + if ( + (init.body != null || inputBody != null) && + (request.method === 'GET' || request.method === 'HEAD') + ) { + throw new TypeError('Request with GET/HEAD method cannot have body.') + } + + // 35. Let initBody be null. + let initBody = null + + // 36. If init["body"] exists and is non-null, then: + if (init.body != null) { + // 1. Let Content-Type be null. + // 2. Set initBody and Content-Type to the result of extracting + // init["body"], with keepalive set to request’s keepalive. + const [extractedBody, contentType] = extractBody( + init.body, + request.keepalive + ) + initBody = extractedBody + + // 3, If Content-Type is non-null and this’s headers’s header list does + // not contain `Content-Type`, then append `Content-Type`/Content-Type to + // this’s headers. + if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) { + this[kHeaders].append('content-type', contentType) + } + } + + // 37. Let inputOrInitBody be initBody if it is non-null; otherwise + // inputBody. + const inputOrInitBody = initBody ?? inputBody + + // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is + // null, then: + if (inputOrInitBody != null && inputOrInitBody.source == null) { + // 1. If initBody is non-null and init["duplex"] does not exist, + // then throw a TypeError. + if (initBody != null && init.duplex == null) { + throw new TypeError('RequestInit: duplex option is required when sending a body.') + } + + // 2. If this’s request’s mode is neither "same-origin" nor "cors", + // then throw a TypeError. + if (request.mode !== 'same-origin' && request.mode !== 'cors') { + throw new TypeError( + 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' + ) + } + + // 3. Set this’s request’s use-CORS-preflight flag. + request.useCORSPreflightFlag = true + } + + // 39. Let finalBody be inputOrInitBody. + let finalBody = inputOrInitBody + + // 40. If initBody is null and inputBody is non-null, then: + if (initBody == null && inputBody != null) { + // 1. If input is unusable, then throw a TypeError. + if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) { + throw new TypeError( + 'Cannot construct a Request with a Request object that has already been used.' + ) + } + + // 2. Set finalBody to the result of creating a proxy for inputBody. + if (!TransformStream) { + TransformStream = (__nccwpck_require__(35356).TransformStream) + } + + // https://streams.spec.whatwg.org/#readablestream-create-a-proxy + const identityTransform = new TransformStream() + inputBody.stream.pipeThrough(identityTransform) + finalBody = { + source: inputBody.source, + length: inputBody.length, + stream: identityTransform.readable + } + } + + // 41. Set this’s request’s body to finalBody. + this[kState].body = finalBody + } + + // Returns request’s HTTP method, which is "GET" by default. + get method () { + webidl.brandCheck(this, Request) + + // The method getter steps are to return this’s request’s method. + return this[kState].method + } + + // Returns the URL of request as a string. + get url () { + webidl.brandCheck(this, Request) + + // The url getter steps are to return this’s request’s URL, serialized. + return URLSerializer(this[kState].url) + } + + // Returns a Headers object consisting of the headers associated with request. + // Note that headers added in the network layer by the user agent will not + // be accounted for in this object, e.g., the "Host" header. + get headers () { + webidl.brandCheck(this, Request) + + // The headers getter steps are to return this’s headers. + return this[kHeaders] + } + + // Returns the kind of resource requested by request, e.g., "document" + // or "script". + get destination () { + webidl.brandCheck(this, Request) + + // The destination getter are to return this’s request’s destination. + return this[kState].destination + } + + // Returns the referrer of request. Its value can be a same-origin URL if + // explicitly set in init, the empty string to indicate no referrer, and + // "about:client" when defaulting to the global’s default. This is used + // during fetching to determine the value of the `Referer` header of the + // request being made. + get referrer () { + webidl.brandCheck(this, Request) + + // 1. If this’s request’s referrer is "no-referrer", then return the + // empty string. + if (this[kState].referrer === 'no-referrer') { + return '' + } + + // 2. If this’s request’s referrer is "client", then return + // "about:client". + if (this[kState].referrer === 'client') { + return 'about:client' + } + + // Return this’s request’s referrer, serialized. + return this[kState].referrer.toString() + } + + // Returns the referrer policy associated with request. + // This is used during fetching to compute the value of the request’s + // referrer. + get referrerPolicy () { + webidl.brandCheck(this, Request) + + // The referrerPolicy getter steps are to return this’s request’s referrer policy. + return this[kState].referrerPolicy + } + + // Returns the mode associated with request, which is a string indicating + // whether the request will use CORS, or will be restricted to same-origin + // URLs. + get mode () { + webidl.brandCheck(this, Request) + + // The mode getter steps are to return this’s request’s mode. + return this[kState].mode + } + + // Returns the credentials mode associated with request, + // which is a string indicating whether credentials will be sent with the + // request always, never, or only when sent to a same-origin URL. + get credentials () { + // The credentials getter steps are to return this’s request’s credentials mode. + return this[kState].credentials + } + + // Returns the cache mode associated with request, + // which is a string indicating how the request will + // interact with the browser’s cache when fetching. + get cache () { + webidl.brandCheck(this, Request) + + // The cache getter steps are to return this’s request’s cache mode. + return this[kState].cache + } + + // Returns the redirect mode associated with request, + // which is a string indicating how redirects for the + // request will be handled during fetching. A request + // will follow redirects by default. + get redirect () { + webidl.brandCheck(this, Request) + + // The redirect getter steps are to return this’s request’s redirect mode. + return this[kState].redirect + } + + // Returns request’s subresource integrity metadata, which is a + // cryptographic hash of the resource being fetched. Its value + // consists of multiple hashes separated by whitespace. [SRI] + get integrity () { + webidl.brandCheck(this, Request) + + // The integrity getter steps are to return this’s request’s integrity + // metadata. + return this[kState].integrity + } + + // Returns a boolean indicating whether or not request can outlive the + // global in which it was created. + get keepalive () { + webidl.brandCheck(this, Request) + + // The keepalive getter steps are to return this’s request’s keepalive. + return this[kState].keepalive + } + + // Returns a boolean indicating whether or not request is for a reload + // navigation. + get isReloadNavigation () { + webidl.brandCheck(this, Request) + + // The isReloadNavigation getter steps are to return true if this’s + // request’s reload-navigation flag is set; otherwise false. + return this[kState].reloadNavigation + } + + // Returns a boolean indicating whether or not request is for a history + // navigation (a.k.a. back-foward navigation). + get isHistoryNavigation () { + webidl.brandCheck(this, Request) + + // The isHistoryNavigation getter steps are to return true if this’s request’s + // history-navigation flag is set; otherwise false. + return this[kState].historyNavigation + } + + // Returns the signal associated with request, which is an AbortSignal + // object indicating whether or not request has been aborted, and its + // abort event handler. + get signal () { + webidl.brandCheck(this, Request) + + // The signal getter steps are to return this’s signal. + return this[kSignal] + } + + get body () { + webidl.brandCheck(this, Request) + + return this[kState].body ? this[kState].body.stream : null + } + + get bodyUsed () { + webidl.brandCheck(this, Request) + + return !!this[kState].body && util.isDisturbed(this[kState].body.stream) + } + + get duplex () { + webidl.brandCheck(this, Request) + + return 'half' + } + + // Returns a clone of request. + clone () { + webidl.brandCheck(this, Request) + + // 1. If this is unusable, then throw a TypeError. + if (this.bodyUsed || this.body?.locked) { + throw new TypeError('unusable') + } + + // 2. Let clonedRequest be the result of cloning this’s request. + const clonedRequest = cloneRequest(this[kState]) + + // 3. Let clonedRequestObject be the result of creating a Request object, + // given clonedRequest, this’s headers’s guard, and this’s relevant Realm. + const clonedRequestObject = new Request(kConstruct) + clonedRequestObject[kState] = clonedRequest + clonedRequestObject[kRealm] = this[kRealm] + clonedRequestObject[kHeaders] = new Headers(kConstruct) + clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList + clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard] + clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm] + + // 4. Make clonedRequestObject’s signal follow this’s signal. + const ac = new AbortController() + if (this.signal.aborted) { + ac.abort(this.signal.reason) + } else { + util.addAbortListener( + this.signal, + () => { + ac.abort(this.signal.reason) + } + ) + } + clonedRequestObject[kSignal] = ac.signal + + // 4. Return clonedRequestObject. + return clonedRequestObject + } +} + +mixinBody(Request) + +function makeRequest (init) { + // https://fetch.spec.whatwg.org/#requests + const request = { + method: 'GET', + localURLsOnly: false, + unsafeRequest: false, + body: null, + client: null, + reservedClient: null, + replacesClientId: '', + window: 'client', + keepalive: false, + serviceWorkers: 'all', + initiator: '', + destination: '', + priority: null, + origin: 'client', + policyContainer: 'client', + referrer: 'client', + referrerPolicy: '', + mode: 'no-cors', + useCORSPreflightFlag: false, + credentials: 'same-origin', + useCredentials: false, + cache: 'default', + redirect: 'follow', + integrity: '', + cryptoGraphicsNonceMetadata: '', + parserMetadata: '', + reloadNavigation: false, + historyNavigation: false, + userActivation: false, + taintedOrigin: false, + redirectCount: 0, + responseTainting: 'basic', + preventNoCacheCacheControlHeaderModification: false, + done: false, + timingAllowFailed: false, + ...init, + headersList: init.headersList + ? new HeadersList(init.headersList) + : new HeadersList() + } + request.url = request.urlList[0] + return request +} + +// https://fetch.spec.whatwg.org/#concept-request-clone +function cloneRequest (request) { + // To clone a request request, run these steps: + + // 1. Let newRequest be a copy of request, except for its body. + const newRequest = makeRequest({ ...request, body: null }) + + // 2. If request’s body is non-null, set newRequest’s body to the + // result of cloning request’s body. + if (request.body != null) { + newRequest.body = cloneBody(request.body) + } + + // 3. Return newRequest. + return newRequest +} + +Object.defineProperties(Request.prototype, { + method: kEnumerableProperty, + url: kEnumerableProperty, + headers: kEnumerableProperty, + redirect: kEnumerableProperty, + clone: kEnumerableProperty, + signal: kEnumerableProperty, + duplex: kEnumerableProperty, + destination: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + isHistoryNavigation: kEnumerableProperty, + isReloadNavigation: kEnumerableProperty, + keepalive: kEnumerableProperty, + integrity: kEnumerableProperty, + cache: kEnumerableProperty, + credentials: kEnumerableProperty, + attribute: kEnumerableProperty, + referrerPolicy: kEnumerableProperty, + referrer: kEnumerableProperty, + mode: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'Request', + configurable: true + } +}) + +webidl.converters.Request = webidl.interfaceConverter( + Request +) + +// https://fetch.spec.whatwg.org/#requestinfo +webidl.converters.RequestInfo = function (V) { + if (typeof V === 'string') { + return webidl.converters.USVString(V) + } + + if (V instanceof Request) { + return webidl.converters.Request(V) + } + + return webidl.converters.USVString(V) +} + +webidl.converters.AbortSignal = webidl.interfaceConverter( + AbortSignal +) + +// https://fetch.spec.whatwg.org/#requestinit +webidl.converters.RequestInit = webidl.dictionaryConverter([ + { + key: 'method', + converter: webidl.converters.ByteString + }, + { + key: 'headers', + converter: webidl.converters.HeadersInit + }, + { + key: 'body', + converter: webidl.nullableConverter( + webidl.converters.BodyInit + ) + }, + { + key: 'referrer', + converter: webidl.converters.USVString + }, + { + key: 'referrerPolicy', + converter: webidl.converters.DOMString, + // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy + allowedValues: referrerPolicy + }, + { + key: 'mode', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#concept-request-mode + allowedValues: requestMode + }, + { + key: 'credentials', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcredentials + allowedValues: requestCredentials + }, + { + key: 'cache', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestcache + allowedValues: requestCache + }, + { + key: 'redirect', + converter: webidl.converters.DOMString, + // https://fetch.spec.whatwg.org/#requestredirect + allowedValues: requestRedirect + }, + { + key: 'integrity', + converter: webidl.converters.DOMString + }, + { + key: 'keepalive', + converter: webidl.converters.boolean + }, + { + key: 'signal', + converter: webidl.nullableConverter( + (signal) => webidl.converters.AbortSignal( + signal, + { strict: false } + ) + ) + }, + { + key: 'window', + converter: webidl.converters.any + }, + { + key: 'duplex', + converter: webidl.converters.DOMString, + allowedValues: requestDuplex + } +]) + +module.exports = { Request, makeRequest } + + +/***/ }), + +/***/ 27823: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { Headers, HeadersList, fill } = __nccwpck_require__(10554) +const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(41472) +const util = __nccwpck_require__(83983) +const { kEnumerableProperty } = util +const { + isValidReasonPhrase, + isCancelled, + isAborted, + isBlobLike, + serializeJavascriptValueToJSONString, + isErrorLike, + isomorphicEncode +} = __nccwpck_require__(52538) +const { + redirectStatusSet, + nullBodyStatus, + DOMException +} = __nccwpck_require__(41037) +const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(15861) +const { webidl } = __nccwpck_require__(21744) +const { FormData } = __nccwpck_require__(72015) +const { getGlobalOrigin } = __nccwpck_require__(71246) +const { URLSerializer } = __nccwpck_require__(685) +const { kHeadersList, kConstruct } = __nccwpck_require__(72785) +const assert = __nccwpck_require__(39491) +const { types } = __nccwpck_require__(73837) + +const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(35356).ReadableStream) +const textEncoder = new TextEncoder('utf-8') + +// https://fetch.spec.whatwg.org/#response-class +class Response { + // Creates network error Response. + static error () { + // TODO + const relevantRealm = { settingsObject: {} } + + // The static error() method steps are to return the result of creating a + // Response object, given a new network error, "immutable", and this’s + // relevant Realm. + const responseObject = new Response() + responseObject[kState] = makeNetworkError() + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList + responseObject[kHeaders][kGuard] = 'immutable' + responseObject[kHeaders][kRealm] = relevantRealm + return responseObject + } + + // https://fetch.spec.whatwg.org/#dom-response-json + static json (data, init = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' }) + + if (init !== null) { + init = webidl.converters.ResponseInit(init) + } + + // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data. + const bytes = textEncoder.encode( + serializeJavascriptValueToJSONString(data) + ) + + // 2. Let body be the result of extracting bytes. + const body = extractBody(bytes) + + // 3. Let responseObject be the result of creating a Response object, given a new response, + // "response", and this’s relevant Realm. + const relevantRealm = { settingsObject: {} } + const responseObject = new Response() + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kGuard] = 'response' + responseObject[kHeaders][kRealm] = relevantRealm + + // 4. Perform initialize a response given responseObject, init, and (body, "application/json"). + initializeResponse(responseObject, init, { body: body[0], type: 'application/json' }) + + // 5. Return responseObject. + return responseObject + } + + // Creates a redirect Response that redirects to url with status status. + static redirect (url, status = 302) { + const relevantRealm = { settingsObject: {} } + + webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' }) + + url = webidl.converters.USVString(url) + status = webidl.converters['unsigned short'](status) + + // 1. Let parsedURL be the result of parsing url with current settings + // object’s API base URL. + // 2. If parsedURL is failure, then throw a TypeError. + // TODO: base-URL? + let parsedURL + try { + parsedURL = new URL(url, getGlobalOrigin()) + } catch (err) { + throw Object.assign(new TypeError('Failed to parse URL from ' + url), { + cause: err + }) + } + + // 3. If status is not a redirect status, then throw a RangeError. + if (!redirectStatusSet.has(status)) { + throw new RangeError('Invalid status code ' + status) + } + + // 4. Let responseObject be the result of creating a Response object, + // given a new response, "immutable", and this’s relevant Realm. + const responseObject = new Response() + responseObject[kRealm] = relevantRealm + responseObject[kHeaders][kGuard] = 'immutable' + responseObject[kHeaders][kRealm] = relevantRealm + + // 5. Set responseObject’s response’s status to status. + responseObject[kState].status = status + + // 6. Let value be parsedURL, serialized and isomorphic encoded. + const value = isomorphicEncode(URLSerializer(parsedURL)) + + // 7. Append `Location`/value to responseObject’s response’s header list. + responseObject[kState].headersList.append('location', value) + + // 8. Return responseObject. + return responseObject + } + + // https://fetch.spec.whatwg.org/#dom-response + constructor (body = null, init = {}) { + if (body !== null) { + body = webidl.converters.BodyInit(body) + } + + init = webidl.converters.ResponseInit(init) + + // TODO + this[kRealm] = { settingsObject: {} } + + // 1. Set this’s response to a new response. + this[kState] = makeResponse({}) + + // 2. Set this’s headers to a new Headers object with this’s relevant + // Realm, whose header list is this’s response’s header list and guard + // is "response". + this[kHeaders] = new Headers(kConstruct) + this[kHeaders][kGuard] = 'response' + this[kHeaders][kHeadersList] = this[kState].headersList + this[kHeaders][kRealm] = this[kRealm] + + // 3. Let bodyWithType be null. + let bodyWithType = null + + // 4. If body is non-null, then set bodyWithType to the result of extracting body. + if (body != null) { + const [extractedBody, type] = extractBody(body) + bodyWithType = { body: extractedBody, type } + } + + // 5. Perform initialize a response given this, init, and bodyWithType. + initializeResponse(this, init, bodyWithType) + } + + // Returns response’s type, e.g., "cors". + get type () { + webidl.brandCheck(this, Response) + + // The type getter steps are to return this’s response’s type. + return this[kState].type + } + + // Returns response’s URL, if it has one; otherwise the empty string. + get url () { + webidl.brandCheck(this, Response) + + const urlList = this[kState].urlList + + // The url getter steps are to return the empty string if this’s + // response’s URL is null; otherwise this’s response’s URL, + // serialized with exclude fragment set to true. + const url = urlList[urlList.length - 1] ?? null + + if (url === null) { + return '' + } + + return URLSerializer(url, true) + } + + // Returns whether response was obtained through a redirect. + get redirected () { + webidl.brandCheck(this, Response) + + // The redirected getter steps are to return true if this’s response’s URL + // list has more than one item; otherwise false. + return this[kState].urlList.length > 1 + } + + // Returns response’s status. + get status () { + webidl.brandCheck(this, Response) + + // The status getter steps are to return this’s response’s status. + return this[kState].status + } + + // Returns whether response’s status is an ok status. + get ok () { + webidl.brandCheck(this, Response) + + // The ok getter steps are to return true if this’s response’s status is an + // ok status; otherwise false. + return this[kState].status >= 200 && this[kState].status <= 299 + } + + // Returns response’s status message. + get statusText () { + webidl.brandCheck(this, Response) + + // The statusText getter steps are to return this’s response’s status + // message. + return this[kState].statusText + } + + // Returns response’s headers as Headers. + get headers () { + webidl.brandCheck(this, Response) + + // The headers getter steps are to return this’s headers. + return this[kHeaders] + } + + get body () { + webidl.brandCheck(this, Response) + + return this[kState].body ? this[kState].body.stream : null + } + + get bodyUsed () { + webidl.brandCheck(this, Response) + + return !!this[kState].body && util.isDisturbed(this[kState].body.stream) + } + + // Returns a clone of response. + clone () { + webidl.brandCheck(this, Response) + + // 1. If this is unusable, then throw a TypeError. + if (this.bodyUsed || (this.body && this.body.locked)) { + throw webidl.errors.exception({ + header: 'Response.clone', + message: 'Body has already been consumed.' + }) + } + + // 2. Let clonedResponse be the result of cloning this’s response. + const clonedResponse = cloneResponse(this[kState]) + + // 3. Return the result of creating a Response object, given + // clonedResponse, this’s headers’s guard, and this’s relevant Realm. + const clonedResponseObject = new Response() + clonedResponseObject[kState] = clonedResponse + clonedResponseObject[kRealm] = this[kRealm] + clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList + clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard] + clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm] + + return clonedResponseObject + } +} + +mixinBody(Response) + +Object.defineProperties(Response.prototype, { + type: kEnumerableProperty, + url: kEnumerableProperty, + status: kEnumerableProperty, + ok: kEnumerableProperty, + redirected: kEnumerableProperty, + statusText: kEnumerableProperty, + headers: kEnumerableProperty, + clone: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'Response', + configurable: true + } +}) + +Object.defineProperties(Response, { + json: kEnumerableProperty, + redirect: kEnumerableProperty, + error: kEnumerableProperty +}) + +// https://fetch.spec.whatwg.org/#concept-response-clone +function cloneResponse (response) { + // To clone a response response, run these steps: + + // 1. If response is a filtered response, then return a new identical + // filtered response whose internal response is a clone of response’s + // internal response. + if (response.internalResponse) { + return filterResponse( + cloneResponse(response.internalResponse), + response.type + ) + } + + // 2. Let newResponse be a copy of response, except for its body. + const newResponse = makeResponse({ ...response, body: null }) + + // 3. If response’s body is non-null, then set newResponse’s body to the + // result of cloning response’s body. + if (response.body != null) { + newResponse.body = cloneBody(response.body) + } + + // 4. Return newResponse. + return newResponse +} + +function makeResponse (init) { + return { + aborted: false, + rangeRequested: false, + timingAllowPassed: false, + requestIncludesCredentials: false, + type: 'default', + status: 200, + timingInfo: null, + cacheState: '', + statusText: '', + ...init, + headersList: init.headersList + ? new HeadersList(init.headersList) + : new HeadersList(), + urlList: init.urlList ? [...init.urlList] : [] + } +} + +function makeNetworkError (reason) { + const isError = isErrorLike(reason) + return makeResponse({ + type: 'error', + status: 0, + error: isError + ? reason + : new Error(reason ? String(reason) : reason), + aborted: reason && reason.name === 'AbortError' + }) +} + +function makeFilteredResponse (response, state) { + state = { + internalResponse: response, + ...state + } + + return new Proxy(response, { + get (target, p) { + return p in state ? state[p] : target[p] + }, + set (target, p, value) { + assert(!(p in state)) + target[p] = value + return true + } + }) +} + +// https://fetch.spec.whatwg.org/#concept-filtered-response +function filterResponse (response, type) { + // Set response to the following filtered response with response as its + // internal response, depending on request’s response tainting: + if (type === 'basic') { + // A basic filtered response is a filtered response whose type is "basic" + // and header list excludes any headers in internal response’s header list + // whose name is a forbidden response-header name. + + // Note: undici does not implement forbidden response-header names + return makeFilteredResponse(response, { + type: 'basic', + headersList: response.headersList + }) + } else if (type === 'cors') { + // A CORS filtered response is a filtered response whose type is "cors" + // and header list excludes any headers in internal response’s header + // list whose name is not a CORS-safelisted response-header name, given + // internal response’s CORS-exposed header-name list. + + // Note: undici does not implement CORS-safelisted response-header names + return makeFilteredResponse(response, { + type: 'cors', + headersList: response.headersList + }) + } else if (type === 'opaque') { + // An opaque filtered response is a filtered response whose type is + // "opaque", URL list is the empty list, status is 0, status message + // is the empty byte sequence, header list is empty, and body is null. + + return makeFilteredResponse(response, { + type: 'opaque', + urlList: Object.freeze([]), + status: 0, + statusText: '', + body: null + }) + } else if (type === 'opaqueredirect') { + // An opaque-redirect filtered response is a filtered response whose type + // is "opaqueredirect", status is 0, status message is the empty byte + // sequence, header list is empty, and body is null. + + return makeFilteredResponse(response, { + type: 'opaqueredirect', + status: 0, + statusText: '', + headersList: [], + body: null + }) + } else { + assert(false) + } +} + +// https://fetch.spec.whatwg.org/#appropriate-network-error +function makeAppropriateNetworkError (fetchParams, err = null) { + // 1. Assert: fetchParams is canceled. + assert(isCancelled(fetchParams)) + + // 2. Return an aborted network error if fetchParams is aborted; + // otherwise return a network error. + return isAborted(fetchParams) + ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err })) + : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err })) +} + +// https://whatpr.org/fetch/1392.html#initialize-a-response +function initializeResponse (response, init, body) { + // 1. If init["status"] is not in the range 200 to 599, inclusive, then + // throw a RangeError. + if (init.status !== null && (init.status < 200 || init.status > 599)) { + throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.') + } + + // 2. If init["statusText"] does not match the reason-phrase token production, + // then throw a TypeError. + if ('statusText' in init && init.statusText != null) { + // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2: + // reason-phrase = *( HTAB / SP / VCHAR / obs-text ) + if (!isValidReasonPhrase(String(init.statusText))) { + throw new TypeError('Invalid statusText') + } + } + + // 3. Set response’s response’s status to init["status"]. + if ('status' in init && init.status != null) { + response[kState].status = init.status + } + + // 4. Set response’s response’s status message to init["statusText"]. + if ('statusText' in init && init.statusText != null) { + response[kState].statusText = init.statusText + } + + // 5. If init["headers"] exists, then fill response’s headers with init["headers"]. + if ('headers' in init && init.headers != null) { + fill(response[kHeaders], init.headers) + } + + // 6. If body was given, then: + if (body) { + // 1. If response's status is a null body status, then throw a TypeError. + if (nullBodyStatus.includes(response.status)) { + throw webidl.errors.exception({ + header: 'Response constructor', + message: 'Invalid response status code ' + response.status + }) + } + + // 2. Set response's body to body's body. + response[kState].body = body.body + + // 3. If body's type is non-null and response's header list does not contain + // `Content-Type`, then append (`Content-Type`, body's type) to response's header list. + if (body.type != null && !response[kState].headersList.contains('Content-Type')) { + response[kState].headersList.append('content-type', body.type) + } + } +} + +webidl.converters.ReadableStream = webidl.interfaceConverter( + ReadableStream +) + +webidl.converters.FormData = webidl.interfaceConverter( + FormData +) + +webidl.converters.URLSearchParams = webidl.interfaceConverter( + URLSearchParams +) + +// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit +webidl.converters.XMLHttpRequestBodyInit = function (V) { + if (typeof V === 'string') { + return webidl.converters.USVString(V) + } + + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }) + } + + if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { + return webidl.converters.BufferSource(V) + } + + if (util.isFormDataLike(V)) { + return webidl.converters.FormData(V, { strict: false }) + } + + if (V instanceof URLSearchParams) { + return webidl.converters.URLSearchParams(V) + } + + return webidl.converters.DOMString(V) +} + +// https://fetch.spec.whatwg.org/#bodyinit +webidl.converters.BodyInit = function (V) { + if (V instanceof ReadableStream) { + return webidl.converters.ReadableStream(V) + } + + // Note: the spec doesn't include async iterables, + // this is an undici extension. + if (V?.[Symbol.asyncIterator]) { + return V + } + + return webidl.converters.XMLHttpRequestBodyInit(V) +} + +webidl.converters.ResponseInit = webidl.dictionaryConverter([ + { + key: 'status', + converter: webidl.converters['unsigned short'], + defaultValue: 200 + }, + { + key: 'statusText', + converter: webidl.converters.ByteString, + defaultValue: '' + }, + { + key: 'headers', + converter: webidl.converters.HeadersInit + } +]) + +module.exports = { + makeNetworkError, + makeResponse, + makeAppropriateNetworkError, + filterResponse, + Response, + cloneResponse +} + + +/***/ }), + +/***/ 15861: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + kUrl: Symbol('url'), + kHeaders: Symbol('headers'), + kSignal: Symbol('signal'), + kState: Symbol('state'), + kGuard: Symbol('guard'), + kRealm: Symbol('realm') +} + + +/***/ }), + +/***/ 52538: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(41037) +const { getGlobalOrigin } = __nccwpck_require__(71246) +const { performance } = __nccwpck_require__(4074) +const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(83983) +const assert = __nccwpck_require__(39491) +const { isUint8Array } = __nccwpck_require__(29830) + +// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable +/** @type {import('crypto')|undefined} */ +let crypto + +try { + crypto = __nccwpck_require__(6113) +} catch { + +} + +function responseURL (response) { + // https://fetch.spec.whatwg.org/#responses + // A response has an associated URL. It is a pointer to the last URL + // in response’s URL list and null if response’s URL list is empty. + const urlList = response.urlList + const length = urlList.length + return length === 0 ? null : urlList[length - 1].toString() +} + +// https://fetch.spec.whatwg.org/#concept-response-location-url +function responseLocationURL (response, requestFragment) { + // 1. If response’s status is not a redirect status, then return null. + if (!redirectStatusSet.has(response.status)) { + return null + } + + // 2. Let location be the result of extracting header list values given + // `Location` and response’s header list. + let location = response.headersList.get('location') + + // 3. If location is a header value, then set location to the result of + // parsing location with response’s URL. + if (location !== null && isValidHeaderValue(location)) { + location = new URL(location, responseURL(response)) + } + + // 4. If location is a URL whose fragment is null, then set location’s + // fragment to requestFragment. + if (location && !location.hash) { + location.hash = requestFragment + } + + // 5. Return location. + return location +} + +/** @returns {URL} */ +function requestCurrentURL (request) { + return request.urlList[request.urlList.length - 1] +} + +function requestBadPort (request) { + // 1. Let url be request’s current URL. + const url = requestCurrentURL(request) + + // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port, + // then return blocked. + if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { + return 'blocked' + } + + // 3. Return allowed. + return 'allowed' +} + +function isErrorLike (object) { + return object instanceof Error || ( + object?.constructor?.name === 'Error' || + object?.constructor?.name === 'DOMException' + ) +} + +// Check whether |statusText| is a ByteString and +// matches the Reason-Phrase token production. +// RFC 2616: https://tools.ietf.org/html/rfc2616 +// RFC 7230: https://tools.ietf.org/html/rfc7230 +// "reason-phrase = *( HTAB / SP / VCHAR / obs-text )" +// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116 +function isValidReasonPhrase (statusText) { + for (let i = 0; i < statusText.length; ++i) { + const c = statusText.charCodeAt(i) + if ( + !( + ( + c === 0x09 || // HTAB + (c >= 0x20 && c <= 0x7e) || // SP / VCHAR + (c >= 0x80 && c <= 0xff) + ) // obs-text + ) + ) { + return false + } + } + return true +} + +/** + * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 + * @param {number} c + */ +function isTokenCharCode (c) { + switch (c) { + case 0x22: + case 0x28: + case 0x29: + case 0x2c: + case 0x2f: + case 0x3a: + case 0x3b: + case 0x3c: + case 0x3d: + case 0x3e: + case 0x3f: + case 0x40: + case 0x5b: + case 0x5c: + case 0x5d: + case 0x7b: + case 0x7d: + // DQUOTE and "(),/:;<=>?@[\]{}" + return false + default: + // VCHAR %x21-7E + return c >= 0x21 && c <= 0x7e + } +} + +/** + * @param {string} characters + */ +function isValidHTTPToken (characters) { + if (characters.length === 0) { + return false + } + for (let i = 0; i < characters.length; ++i) { + if (!isTokenCharCode(characters.charCodeAt(i))) { + return false + } + } + return true +} + +/** + * @see https://fetch.spec.whatwg.org/#header-name + * @param {string} potentialValue + */ +function isValidHeaderName (potentialValue) { + return isValidHTTPToken(potentialValue) +} + +/** + * @see https://fetch.spec.whatwg.org/#header-value + * @param {string} potentialValue + */ +function isValidHeaderValue (potentialValue) { + // - Has no leading or trailing HTTP tab or space bytes. + // - Contains no 0x00 (NUL) or HTTP newline bytes. + if ( + potentialValue.startsWith('\t') || + potentialValue.startsWith(' ') || + potentialValue.endsWith('\t') || + potentialValue.endsWith(' ') + ) { + return false + } + + if ( + potentialValue.includes('\0') || + potentialValue.includes('\r') || + potentialValue.includes('\n') + ) { + return false + } + + return true +} + +// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect +function setRequestReferrerPolicyOnRedirect (request, actualResponse) { + // Given a request request and a response actualResponse, this algorithm + // updates request’s referrer policy according to the Referrer-Policy + // header (if any) in actualResponse. + + // 1. Let policy be the result of executing § 8.1 Parse a referrer policy + // from a Referrer-Policy header on actualResponse. + + // 8.1 Parse a referrer policy from a Referrer-Policy header + // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list. + const { headersList } = actualResponse + // 2. Let policy be the empty string. + // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token. + // 4. Return policy. + const policyHeader = (headersList.get('referrer-policy') ?? '').split(',') + + // Note: As the referrer-policy can contain multiple policies + // separated by comma, we need to loop through all of them + // and pick the first valid one. + // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy + let policy = '' + if (policyHeader.length > 0) { + // The right-most policy takes precedence. + // The left-most policy is the fallback. + for (let i = policyHeader.length; i !== 0; i--) { + const token = policyHeader[i - 1].trim() + if (referrerPolicyTokens.has(token)) { + policy = token + break + } + } + } + + // 2. If policy is not the empty string, then set request’s referrer policy to policy. + if (policy !== '') { + request.referrerPolicy = policy + } +} + +// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check +function crossOriginResourcePolicyCheck () { + // TODO + return 'allowed' +} + +// https://fetch.spec.whatwg.org/#concept-cors-check +function corsCheck () { + // TODO + return 'success' +} + +// https://fetch.spec.whatwg.org/#concept-tao-check +function TAOCheck () { + // TODO + return 'success' +} + +function appendFetchMetadata (httpRequest) { + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header + // TODO + + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header + + // 1. Assert: r’s url is a potentially trustworthy URL. + // TODO + + // 2. Let header be a Structured Header whose value is a token. + let header = null + + // 3. Set header’s value to r’s mode. + header = httpRequest.mode + + // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list. + httpRequest.headersList.set('sec-fetch-mode', header) + + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header + // TODO + + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header + // TODO +} + +// https://fetch.spec.whatwg.org/#append-a-request-origin-header +function appendRequestOriginHeader (request) { + // 1. Let serializedOrigin be the result of byte-serializing a request origin with request. + let serializedOrigin = request.origin + + // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list. + if (request.responseTainting === 'cors' || request.mode === 'websocket') { + if (serializedOrigin) { + request.headersList.append('origin', serializedOrigin) + } + + // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then: + } else if (request.method !== 'GET' && request.method !== 'HEAD') { + // 1. Switch on request’s referrer policy: + switch (request.referrerPolicy) { + case 'no-referrer': + // Set serializedOrigin to `null`. + serializedOrigin = null + break + case 'no-referrer-when-downgrade': + case 'strict-origin': + case 'strict-origin-when-cross-origin': + // If request’s origin is a tuple origin, its scheme is "https", and request’s current URL’s scheme is not "https", then set serializedOrigin to `null`. + if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { + serializedOrigin = null + } + break + case 'same-origin': + // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`. + if (!sameOrigin(request, requestCurrentURL(request))) { + serializedOrigin = null + } + break + default: + // Do nothing. + } + + if (serializedOrigin) { + // 2. Append (`Origin`, serializedOrigin) to request’s header list. + request.headersList.append('origin', serializedOrigin) + } + } +} + +function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) { + // TODO + return performance.now() +} + +// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info +function createOpaqueTimingInfo (timingInfo) { + return { + startTime: timingInfo.startTime ?? 0, + redirectStartTime: 0, + redirectEndTime: 0, + postRedirectStartTime: timingInfo.startTime ?? 0, + finalServiceWorkerStartTime: 0, + finalNetworkResponseStartTime: 0, + finalNetworkRequestStartTime: 0, + endTime: 0, + encodedBodySize: 0, + decodedBodySize: 0, + finalConnectionTimingInfo: null + } +} + +// https://html.spec.whatwg.org/multipage/origin.html#policy-container +function makePolicyContainer () { + // Note: the fetch spec doesn't make use of embedder policy or CSP list + return { + referrerPolicy: 'strict-origin-when-cross-origin' + } +} + +// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container +function clonePolicyContainer (policyContainer) { + return { + referrerPolicy: policyContainer.referrerPolicy + } +} + +// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer +function determineRequestsReferrer (request) { + // 1. Let policy be request's referrer policy. + const policy = request.referrerPolicy + + // Note: policy cannot (shouldn't) be null or an empty string. + assert(policy) + + // 2. Let environment be request’s client. + + let referrerSource = null + + // 3. Switch on request’s referrer: + if (request.referrer === 'client') { + // Note: node isn't a browser and doesn't implement document/iframes, + // so we bypass this step and replace it with our own. + + const globalOrigin = getGlobalOrigin() + + if (!globalOrigin || globalOrigin.origin === 'null') { + return 'no-referrer' + } + + // note: we need to clone it as it's mutated + referrerSource = new URL(globalOrigin) + } else if (request.referrer instanceof URL) { + // Let referrerSource be request’s referrer. + referrerSource = request.referrer + } + + // 4. Let request’s referrerURL be the result of stripping referrerSource for + // use as a referrer. + let referrerURL = stripURLForReferrer(referrerSource) + + // 5. Let referrerOrigin be the result of stripping referrerSource for use as + // a referrer, with the origin-only flag set to true. + const referrerOrigin = stripURLForReferrer(referrerSource, true) + + // 6. If the result of serializing referrerURL is a string whose length is + // greater than 4096, set referrerURL to referrerOrigin. + if (referrerURL.toString().length > 4096) { + referrerURL = referrerOrigin + } + + const areSameOrigin = sameOrigin(request, referrerURL) + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && + !isURLPotentiallyTrustworthy(request.url) + + // 8. Execute the switch statements corresponding to the value of policy: + switch (policy) { + case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true) + case 'unsafe-url': return referrerURL + case 'same-origin': + return areSameOrigin ? referrerOrigin : 'no-referrer' + case 'origin-when-cross-origin': + return areSameOrigin ? referrerURL : referrerOrigin + case 'strict-origin-when-cross-origin': { + const currentURL = requestCurrentURL(request) + + // 1. If the origin of referrerURL and the origin of request’s current + // URL are the same, then return referrerURL. + if (sameOrigin(referrerURL, currentURL)) { + return referrerURL + } + + // 2. If referrerURL is a potentially trustworthy URL and request’s + // current URL is not a potentially trustworthy URL, then return no + // referrer. + if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { + return 'no-referrer' + } + + // 3. Return referrerOrigin. + return referrerOrigin + } + case 'strict-origin': // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + case 'no-referrer-when-downgrade': // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + + default: // eslint-disable-line + return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin + } +} + +/** + * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url + * @param {URL} url + * @param {boolean|undefined} originOnly + */ +function stripURLForReferrer (url, originOnly) { + // 1. Assert: url is a URL. + assert(url instanceof URL) + + // 2. If url’s scheme is a local scheme, then return no referrer. + if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') { + return 'no-referrer' + } + + // 3. Set url’s username to the empty string. + url.username = '' + + // 4. Set url’s password to the empty string. + url.password = '' + + // 5. Set url’s fragment to null. + url.hash = '' + + // 6. If the origin-only flag is true, then: + if (originOnly) { + // 1. Set url’s path to « the empty string ». + url.pathname = '' + + // 2. Set url’s query to null. + url.search = '' + } + + // 7. Return url. + return url +} + +function isURLPotentiallyTrustworthy (url) { + if (!(url instanceof URL)) { + return false + } + + // If child of about, return true + if (url.href === 'about:blank' || url.href === 'about:srcdoc') { + return true + } + + // If scheme is data, return true + if (url.protocol === 'data:') return true + + // If file, return true + if (url.protocol === 'file:') return true + + return isOriginPotentiallyTrustworthy(url.origin) + + function isOriginPotentiallyTrustworthy (origin) { + // If origin is explicitly null, return false + if (origin == null || origin === 'null') return false + + const originAsURL = new URL(origin) + + // If secure, return true + if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') { + return true + } + + // If localhost or variants, return true + if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || + (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) || + (originAsURL.hostname.endsWith('.localhost'))) { + return true + } + + // If any other, return false + return false + } +} + +/** + * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist + * @param {Uint8Array} bytes + * @param {string} metadataList + */ +function bytesMatch (bytes, metadataList) { + // If node is not built with OpenSSL support, we cannot check + // a request's integrity, so allow it by default (the spec will + // allow requests if an invalid hash is given, as precedence). + /* istanbul ignore if: only if node is built with --without-ssl */ + if (crypto === undefined) { + return true + } + + // 1. Let parsedMetadata be the result of parsing metadataList. + const parsedMetadata = parseMetadata(metadataList) + + // 2. If parsedMetadata is no metadata, return true. + if (parsedMetadata === 'no metadata') { + return true + } + + // 3. If parsedMetadata is the empty set, return true. + if (parsedMetadata.length === 0) { + return true + } + + // 4. Let metadata be the result of getting the strongest + // metadata from parsedMetadata. + const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo)) + // get the strongest algorithm + const strongest = list[0].algo + // get all entries that use the strongest algorithm; ignore weaker + const metadata = list.filter((item) => item.algo === strongest) + + // 5. For each item in metadata: + for (const item of metadata) { + // 1. Let algorithm be the alg component of item. + const algorithm = item.algo + + // 2. Let expectedValue be the val component of item. + let expectedValue = item.hash + + // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e + // "be liberal with padding". This is annoying, and it's not even in the spec. + + if (expectedValue.endsWith('==')) { + expectedValue = expectedValue.slice(0, -2) + } + + // 3. Let actualValue be the result of applying algorithm to bytes. + let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64') + + if (actualValue.endsWith('==')) { + actualValue = actualValue.slice(0, -2) + } + + // 4. If actualValue is a case-sensitive match for expectedValue, + // return true. + if (actualValue === expectedValue) { + return true + } + + let actualBase64URL = crypto.createHash(algorithm).update(bytes).digest('base64url') + + if (actualBase64URL.endsWith('==')) { + actualBase64URL = actualBase64URL.slice(0, -2) + } + + if (actualBase64URL === expectedValue) { + return true + } + } + + // 6. Return false. + return false +} + +// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options +// https://www.w3.org/TR/CSP2/#source-list-syntax +// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1 +const parseHashWithOptions = /((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i + +/** + * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + * @param {string} metadata + */ +function parseMetadata (metadata) { + // 1. Let result be the empty set. + /** @type {{ algo: string, hash: string }[]} */ + const result = [] + + // 2. Let empty be equal to true. + let empty = true + + const supportedHashes = crypto.getHashes() + + // 3. For each token returned by splitting metadata on spaces: + for (const token of metadata.split(' ')) { + // 1. Set empty to false. + empty = false + + // 2. Parse token as a hash-with-options. + const parsedToken = parseHashWithOptions.exec(token) + + // 3. If token does not parse, continue to the next token. + if (parsedToken === null || parsedToken.groups === undefined) { + // Note: Chromium blocks the request at this point, but Firefox + // gives a warning that an invalid integrity was given. The + // correct behavior is to ignore these, and subsequently not + // check the integrity of the resource. + continue + } + + // 4. Let algorithm be the hash-algo component of token. + const algorithm = parsedToken.groups.algo + + // 5. If algorithm is a hash function recognized by the user + // agent, add the parsed token to result. + if (supportedHashes.includes(algorithm.toLowerCase())) { + result.push(parsedToken.groups) + } + } + + // 4. Return no metadata if empty is true, otherwise return result. + if (empty === true) { + return 'no metadata' + } + + return result +} + +// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request +function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) { + // TODO +} + +/** + * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin} + * @param {URL} A + * @param {URL} B + */ +function sameOrigin (A, B) { + // 1. If A and B are the same opaque origin, then return true. + if (A.origin === B.origin && A.origin === 'null') { + return true + } + + // 2. If A and B are both tuple origins and their schemes, + // hosts, and port are identical, then return true. + if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { + return true + } + + // 3. Return false. + return false +} + +function createDeferredPromise () { + let res + let rej + const promise = new Promise((resolve, reject) => { + res = resolve + rej = reject + }) + + return { promise, resolve: res, reject: rej } +} + +function isAborted (fetchParams) { + return fetchParams.controller.state === 'aborted' +} + +function isCancelled (fetchParams) { + return fetchParams.controller.state === 'aborted' || + fetchParams.controller.state === 'terminated' +} + +const normalizeMethodRecord = { + delete: 'DELETE', + DELETE: 'DELETE', + get: 'GET', + GET: 'GET', + head: 'HEAD', + HEAD: 'HEAD', + options: 'OPTIONS', + OPTIONS: 'OPTIONS', + post: 'POST', + POST: 'POST', + put: 'PUT', + PUT: 'PUT' +} + +// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. +Object.setPrototypeOf(normalizeMethodRecord, null) + +/** + * @see https://fetch.spec.whatwg.org/#concept-method-normalize + * @param {string} method + */ +function normalizeMethod (method) { + return normalizeMethodRecord[method.toLowerCase()] ?? method +} + +// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string +function serializeJavascriptValueToJSONString (value) { + // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »). + const result = JSON.stringify(value) + + // 2. If result is undefined, then throw a TypeError. + if (result === undefined) { + throw new TypeError('Value is not JSON serializable') + } + + // 3. Assert: result is a string. + assert(typeof result === 'string') + + // 4. Return result. + return result +} + +// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object +const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())) + +/** + * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object + * @param {() => unknown[]} iterator + * @param {string} name name of the instance + * @param {'key'|'value'|'key+value'} kind + */ +function makeIterator (iterator, name, kind) { + const object = { + index: 0, + kind, + target: iterator + } + + const i = { + next () { + // 1. Let interface be the interface for which the iterator prototype object exists. + + // 2. Let thisValue be the this value. + + // 3. Let object be ? ToObject(thisValue). + + // 4. If object is a platform object, then perform a security + // check, passing: + + // 5. If object is not a default iterator object for interface, + // then throw a TypeError. + if (Object.getPrototypeOf(this) !== i) { + throw new TypeError( + `'next' called on an object that does not implement interface ${name} Iterator.` + ) + } + + // 6. Let index be object’s index. + // 7. Let kind be object’s kind. + // 8. Let values be object’s target's value pairs to iterate over. + const { index, kind, target } = object + const values = target() + + // 9. Let len be the length of values. + const len = values.length + + // 10. If index is greater than or equal to len, then return + // CreateIterResultObject(undefined, true). + if (index >= len) { + return { value: undefined, done: true } + } + + // 11. Let pair be the entry in values at index index. + const pair = values[index] + + // 12. Set object’s index to index + 1. + object.index = index + 1 + + // 13. Return the iterator result for pair and kind. + return iteratorResult(pair, kind) + }, + // The class string of an iterator prototype object for a given interface is the + // result of concatenating the identifier of the interface and the string " Iterator". + [Symbol.toStringTag]: `${name} Iterator` + } + + // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%. + Object.setPrototypeOf(i, esIteratorPrototype) + // esIteratorPrototype needs to be the prototype of i + // which is the prototype of an empty object. Yes, it's confusing. + return Object.setPrototypeOf({}, i) +} + +// https://webidl.spec.whatwg.org/#iterator-result +function iteratorResult (pair, kind) { + let result + + // 1. Let result be a value determined by the value of kind: + switch (kind) { + case 'key': { + // 1. Let idlKey be pair’s key. + // 2. Let key be the result of converting idlKey to an + // ECMAScript value. + // 3. result is key. + result = pair[0] + break + } + case 'value': { + // 1. Let idlValue be pair’s value. + // 2. Let value be the result of converting idlValue to + // an ECMAScript value. + // 3. result is value. + result = pair[1] + break + } + case 'key+value': { + // 1. Let idlKey be pair’s key. + // 2. Let idlValue be pair’s value. + // 3. Let key be the result of converting idlKey to an + // ECMAScript value. + // 4. Let value be the result of converting idlValue to + // an ECMAScript value. + // 5. Let array be ! ArrayCreate(2). + // 6. Call ! CreateDataProperty(array, "0", key). + // 7. Call ! CreateDataProperty(array, "1", value). + // 8. result is array. + result = pair + break + } + } + + // 2. Return CreateIterResultObject(result, false). + return { value: result, done: false } +} + +/** + * @see https://fetch.spec.whatwg.org/#body-fully-read + */ +async function fullyReadBody (body, processBody, processBodyError) { + // 1. If taskDestination is null, then set taskDestination to + // the result of starting a new parallel queue. + + // 2. Let successSteps given a byte sequence bytes be to queue a + // fetch task to run processBody given bytes, with taskDestination. + const successSteps = processBody + + // 3. Let errorSteps be to queue a fetch task to run processBodyError, + // with taskDestination. + const errorSteps = processBodyError + + // 4. Let reader be the result of getting a reader for body’s stream. + // If that threw an exception, then run errorSteps with that + // exception and return. + let reader + + try { + reader = body.stream.getReader() + } catch (e) { + errorSteps(e) + return + } + + // 5. Read all bytes from reader, given successSteps and errorSteps. + try { + const result = await readAllBytes(reader) + successSteps(result) + } catch (e) { + errorSteps(e) + } +} + +/** @type {ReadableStream} */ +let ReadableStream = globalThis.ReadableStream + +function isReadableStreamLike (stream) { + if (!ReadableStream) { + ReadableStream = (__nccwpck_require__(35356).ReadableStream) + } + + return stream instanceof ReadableStream || ( + stream[Symbol.toStringTag] === 'ReadableStream' && + typeof stream.tee === 'function' + ) +} + +const MAXIMUM_ARGUMENT_LENGTH = 65535 + +/** + * @see https://infra.spec.whatwg.org/#isomorphic-decode + * @param {number[]|Uint8Array} input + */ +function isomorphicDecode (input) { + // 1. To isomorphic decode a byte sequence input, return a string whose code point + // length is equal to input’s length and whose code points have the same values + // as the values of input’s bytes, in the same order. + + if (input.length < MAXIMUM_ARGUMENT_LENGTH) { + return String.fromCharCode(...input) + } + + return input.reduce((previous, current) => previous + String.fromCharCode(current), '') +} + +/** + * @param {ReadableStreamController} controller + */ +function readableStreamClose (controller) { + try { + controller.close() + } catch (err) { + // TODO: add comment explaining why this error occurs. + if (!err.message.includes('Controller is already closed')) { + throw err + } + } +} + +/** + * @see https://infra.spec.whatwg.org/#isomorphic-encode + * @param {string} input + */ +function isomorphicEncode (input) { + // 1. Assert: input contains no code points greater than U+00FF. + for (let i = 0; i < input.length; i++) { + assert(input.charCodeAt(i) <= 0xFF) + } + + // 2. Return a byte sequence whose length is equal to input’s code + // point length and whose bytes have the same values as the + // values of input’s code points, in the same order + return input +} + +/** + * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes + * @see https://streams.spec.whatwg.org/#read-loop + * @param {ReadableStreamDefaultReader} reader + */ +async function readAllBytes (reader) { + const bytes = [] + let byteLength = 0 + + while (true) { + const { done, value: chunk } = await reader.read() + + if (done) { + // 1. Call successSteps with bytes. + return Buffer.concat(bytes, byteLength) + } + + // 1. If chunk is not a Uint8Array object, call failureSteps + // with a TypeError and abort these steps. + if (!isUint8Array(chunk)) { + throw new TypeError('Received non-Uint8Array chunk') + } + + // 2. Append the bytes represented by chunk to bytes. + bytes.push(chunk) + byteLength += chunk.length + + // 3. Read-loop given reader, bytes, successSteps, and failureSteps. + } +} + +/** + * @see https://fetch.spec.whatwg.org/#is-local + * @param {URL} url + */ +function urlIsLocal (url) { + assert('protocol' in url) // ensure it's a url object + + const protocol = url.protocol + + return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:' +} + +/** + * @param {string|URL} url + */ +function urlHasHttpsScheme (url) { + if (typeof url === 'string') { + return url.startsWith('https:') + } + + return url.protocol === 'https:' +} + +/** + * @see https://fetch.spec.whatwg.org/#http-scheme + * @param {URL} url + */ +function urlIsHttpHttpsScheme (url) { + assert('protocol' in url) // ensure it's a url object + + const protocol = url.protocol + + return protocol === 'http:' || protocol === 'https:' +} + +/** + * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0. + */ +const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)) + +module.exports = { + isAborted, + isCancelled, + createDeferredPromise, + ReadableStreamFrom, + toUSVString, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + coarsenedSharedCurrentTime, + determineRequestsReferrer, + makePolicyContainer, + clonePolicyContainer, + appendFetchMetadata, + appendRequestOriginHeader, + TAOCheck, + corsCheck, + crossOriginResourcePolicyCheck, + createOpaqueTimingInfo, + setRequestReferrerPolicyOnRedirect, + isValidHTTPToken, + requestBadPort, + requestCurrentURL, + responseURL, + responseLocationURL, + isBlobLike, + isURLPotentiallyTrustworthy, + isValidReasonPhrase, + sameOrigin, + normalizeMethod, + serializeJavascriptValueToJSONString, + makeIterator, + isValidHeaderName, + isValidHeaderValue, + hasOwn, + isErrorLike, + fullyReadBody, + bytesMatch, + isReadableStreamLike, + readableStreamClose, + isomorphicEncode, + isomorphicDecode, + urlIsLocal, + urlHasHttpsScheme, + urlIsHttpHttpsScheme, + readAllBytes, + normalizeMethodRecord +} + + +/***/ }), + +/***/ 21744: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { types } = __nccwpck_require__(73837) +const { hasOwn, toUSVString } = __nccwpck_require__(52538) + +/** @type {import('../../types/webidl').Webidl} */ +const webidl = {} +webidl.converters = {} +webidl.util = {} +webidl.errors = {} + +webidl.errors.exception = function (message) { + return new TypeError(`${message.header}: ${message.message}`) +} + +webidl.errors.conversionFailed = function (context) { + const plural = context.types.length === 1 ? '' : ' one of' + const message = + `${context.argument} could not be converted to` + + `${plural}: ${context.types.join(', ')}.` + + return webidl.errors.exception({ + header: context.prefix, + message + }) +} + +webidl.errors.invalidArgument = function (context) { + return webidl.errors.exception({ + header: context.prefix, + message: `"${context.value}" is an invalid ${context.type}.` + }) +} + +// https://webidl.spec.whatwg.org/#implements +webidl.brandCheck = function (V, I, opts = undefined) { + if (opts?.strict !== false && !(V instanceof I)) { + throw new TypeError('Illegal invocation') + } else { + return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag] + } +} + +webidl.argumentLengthCheck = function ({ length }, min, ctx) { + if (length < min) { + throw webidl.errors.exception({ + message: `${min} argument${min !== 1 ? 's' : ''} required, ` + + `but${length ? ' only' : ''} ${length} found.`, + ...ctx + }) + } +} + +webidl.illegalConstructor = function () { + throw webidl.errors.exception({ + header: 'TypeError', + message: 'Illegal constructor' + }) +} + +// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values +webidl.util.Type = function (V) { + switch (typeof V) { + case 'undefined': return 'Undefined' + case 'boolean': return 'Boolean' + case 'string': return 'String' + case 'symbol': return 'Symbol' + case 'number': return 'Number' + case 'bigint': return 'BigInt' + case 'function': + case 'object': { + if (V === null) { + return 'Null' + } + + return 'Object' + } + } +} + +// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint +webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) { + let upperBound + let lowerBound + + // 1. If bitLength is 64, then: + if (bitLength === 64) { + // 1. Let upperBound be 2^53 − 1. + upperBound = Math.pow(2, 53) - 1 + + // 2. If signedness is "unsigned", then let lowerBound be 0. + if (signedness === 'unsigned') { + lowerBound = 0 + } else { + // 3. Otherwise let lowerBound be −2^53 + 1. + lowerBound = Math.pow(-2, 53) + 1 + } + } else if (signedness === 'unsigned') { + // 2. Otherwise, if signedness is "unsigned", then: + + // 1. Let lowerBound be 0. + lowerBound = 0 + + // 2. Let upperBound be 2^bitLength − 1. + upperBound = Math.pow(2, bitLength) - 1 + } else { + // 3. Otherwise: + + // 1. Let lowerBound be -2^bitLength − 1. + lowerBound = Math.pow(-2, bitLength) - 1 + + // 2. Let upperBound be 2^bitLength − 1 − 1. + upperBound = Math.pow(2, bitLength - 1) - 1 + } + + // 4. Let x be ? ToNumber(V). + let x = Number(V) + + // 5. If x is −0, then set x to +0. + if (x === 0) { + x = 0 + } + + // 6. If the conversion is to an IDL type associated + // with the [EnforceRange] extended attribute, then: + if (opts.enforceRange === true) { + // 1. If x is NaN, +∞, or −∞, then throw a TypeError. + if ( + Number.isNaN(x) || + x === Number.POSITIVE_INFINITY || + x === Number.NEGATIVE_INFINITY + ) { + throw webidl.errors.exception({ + header: 'Integer conversion', + message: `Could not convert ${V} to an integer.` + }) + } + + // 2. Set x to IntegerPart(x). + x = webidl.util.IntegerPart(x) + + // 3. If x < lowerBound or x > upperBound, then + // throw a TypeError. + if (x < lowerBound || x > upperBound) { + throw webidl.errors.exception({ + header: 'Integer conversion', + message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` + }) + } + + // 4. Return x. + return x + } + + // 7. If x is not NaN and the conversion is to an IDL + // type associated with the [Clamp] extended + // attribute, then: + if (!Number.isNaN(x) && opts.clamp === true) { + // 1. Set x to min(max(x, lowerBound), upperBound). + x = Math.min(Math.max(x, lowerBound), upperBound) + + // 2. Round x to the nearest integer, choosing the + // even integer if it lies halfway between two, + // and choosing +0 rather than −0. + if (Math.floor(x) % 2 === 0) { + x = Math.floor(x) + } else { + x = Math.ceil(x) + } + + // 3. Return x. + return x + } + + // 8. If x is NaN, +0, +∞, or −∞, then return +0. + if ( + Number.isNaN(x) || + (x === 0 && Object.is(0, x)) || + x === Number.POSITIVE_INFINITY || + x === Number.NEGATIVE_INFINITY + ) { + return 0 + } + + // 9. Set x to IntegerPart(x). + x = webidl.util.IntegerPart(x) + + // 10. Set x to x modulo 2^bitLength. + x = x % Math.pow(2, bitLength) + + // 11. If signedness is "signed" and x ≥ 2^bitLength − 1, + // then return x − 2^bitLength. + if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) { + return x - Math.pow(2, bitLength) + } + + // 12. Otherwise, return x. + return x +} + +// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart +webidl.util.IntegerPart = function (n) { + // 1. Let r be floor(abs(n)). + const r = Math.floor(Math.abs(n)) + + // 2. If n < 0, then return -1 × r. + if (n < 0) { + return -1 * r + } + + // 3. Otherwise, return r. + return r +} + +// https://webidl.spec.whatwg.org/#es-sequence +webidl.sequenceConverter = function (converter) { + return (V) => { + // 1. If Type(V) is not Object, throw a TypeError. + if (webidl.util.Type(V) !== 'Object') { + throw webidl.errors.exception({ + header: 'Sequence', + message: `Value of type ${webidl.util.Type(V)} is not an Object.` + }) + } + + // 2. Let method be ? GetMethod(V, @@iterator). + /** @type {Generator} */ + const method = V?.[Symbol.iterator]?.() + const seq = [] + + // 3. If method is undefined, throw a TypeError. + if ( + method === undefined || + typeof method.next !== 'function' + ) { + throw webidl.errors.exception({ + header: 'Sequence', + message: 'Object is not an iterator.' + }) + } + + // https://webidl.spec.whatwg.org/#create-sequence-from-iterable + while (true) { + const { done, value } = method.next() + + if (done) { + break + } + + seq.push(converter(value)) + } + + return seq + } +} + +// https://webidl.spec.whatwg.org/#es-to-record +webidl.recordConverter = function (keyConverter, valueConverter) { + return (O) => { + // 1. If Type(O) is not Object, throw a TypeError. + if (webidl.util.Type(O) !== 'Object') { + throw webidl.errors.exception({ + header: 'Record', + message: `Value of type ${webidl.util.Type(O)} is not an Object.` + }) + } + + // 2. Let result be a new empty instance of record. + const result = {} + + if (!types.isProxy(O)) { + // Object.keys only returns enumerable properties + const keys = Object.keys(O) + + for (const key of keys) { + // 1. Let typedKey be key converted to an IDL value of type K. + const typedKey = keyConverter(key) + + // 2. Let value be ? Get(O, key). + // 3. Let typedValue be value converted to an IDL value of type V. + const typedValue = valueConverter(O[key]) + + // 4. Set result[typedKey] to typedValue. + result[typedKey] = typedValue + } + + // 5. Return result. + return result + } + + // 3. Let keys be ? O.[[OwnPropertyKeys]](). + const keys = Reflect.ownKeys(O) + + // 4. For each key of keys. + for (const key of keys) { + // 1. Let desc be ? O.[[GetOwnProperty]](key). + const desc = Reflect.getOwnPropertyDescriptor(O, key) + + // 2. If desc is not undefined and desc.[[Enumerable]] is true: + if (desc?.enumerable) { + // 1. Let typedKey be key converted to an IDL value of type K. + const typedKey = keyConverter(key) + + // 2. Let value be ? Get(O, key). + // 3. Let typedValue be value converted to an IDL value of type V. + const typedValue = valueConverter(O[key]) + + // 4. Set result[typedKey] to typedValue. + result[typedKey] = typedValue + } + } + + // 5. Return result. + return result + } +} + +webidl.interfaceConverter = function (i) { + return (V, opts = {}) => { + if (opts.strict !== false && !(V instanceof i)) { + throw webidl.errors.exception({ + header: i.name, + message: `Expected ${V} to be an instance of ${i.name}.` + }) + } + + return V + } +} + +webidl.dictionaryConverter = function (converters) { + return (dictionary) => { + const type = webidl.util.Type(dictionary) + const dict = {} + + if (type === 'Null' || type === 'Undefined') { + return dict + } else if (type !== 'Object') { + throw webidl.errors.exception({ + header: 'Dictionary', + message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` + }) + } + + for (const options of converters) { + const { key, defaultValue, required, converter } = options + + if (required === true) { + if (!hasOwn(dictionary, key)) { + throw webidl.errors.exception({ + header: 'Dictionary', + message: `Missing required key "${key}".` + }) + } + } + + let value = dictionary[key] + const hasDefault = hasOwn(options, 'defaultValue') + + // Only use defaultValue if value is undefined and + // a defaultValue options was provided. + if (hasDefault && value !== null) { + value = value ?? defaultValue + } + + // A key can be optional and have no default value. + // When this happens, do not perform a conversion, + // and do not assign the key a value. + if (required || hasDefault || value !== undefined) { + value = converter(value) + + if ( + options.allowedValues && + !options.allowedValues.includes(value) + ) { + throw webidl.errors.exception({ + header: 'Dictionary', + message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.` + }) + } + + dict[key] = value + } + } + + return dict + } +} + +webidl.nullableConverter = function (converter) { + return (V) => { + if (V === null) { + return V + } + + return converter(V) + } +} + +// https://webidl.spec.whatwg.org/#es-DOMString +webidl.converters.DOMString = function (V, opts = {}) { + // 1. If V is null and the conversion is to an IDL type + // associated with the [LegacyNullToEmptyString] + // extended attribute, then return the DOMString value + // that represents the empty string. + if (V === null && opts.legacyNullToEmptyString) { + return '' + } + + // 2. Let x be ? ToString(V). + if (typeof V === 'symbol') { + throw new TypeError('Could not convert argument of type symbol to string.') + } + + // 3. Return the IDL DOMString value that represents the + // same sequence of code units as the one the + // ECMAScript String value x represents. + return String(V) +} + +// https://webidl.spec.whatwg.org/#es-ByteString +webidl.converters.ByteString = function (V) { + // 1. Let x be ? ToString(V). + // Note: DOMString converter perform ? ToString(V) + const x = webidl.converters.DOMString(V) + + // 2. If the value of any element of x is greater than + // 255, then throw a TypeError. + for (let index = 0; index < x.length; index++) { + if (x.charCodeAt(index) > 255) { + throw new TypeError( + 'Cannot convert argument to a ByteString because the character at ' + + `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` + ) + } + } + + // 3. Return an IDL ByteString value whose length is the + // length of x, and where the value of each element is + // the value of the corresponding element of x. + return x +} + +// https://webidl.spec.whatwg.org/#es-USVString +webidl.converters.USVString = toUSVString + +// https://webidl.spec.whatwg.org/#es-boolean +webidl.converters.boolean = function (V) { + // 1. Let x be the result of computing ToBoolean(V). + const x = Boolean(V) + + // 2. Return the IDL boolean value that is the one that represents + // the same truth value as the ECMAScript Boolean value x. + return x +} + +// https://webidl.spec.whatwg.org/#es-any +webidl.converters.any = function (V) { + return V +} + +// https://webidl.spec.whatwg.org/#es-long-long +webidl.converters['long long'] = function (V) { + // 1. Let x be ? ConvertToInt(V, 64, "signed"). + const x = webidl.util.ConvertToInt(V, 64, 'signed') + + // 2. Return the IDL long long value that represents + // the same numeric value as x. + return x +} + +// https://webidl.spec.whatwg.org/#es-unsigned-long-long +webidl.converters['unsigned long long'] = function (V) { + // 1. Let x be ? ConvertToInt(V, 64, "unsigned"). + const x = webidl.util.ConvertToInt(V, 64, 'unsigned') + + // 2. Return the IDL unsigned long long value that + // represents the same numeric value as x. + return x +} + +// https://webidl.spec.whatwg.org/#es-unsigned-long +webidl.converters['unsigned long'] = function (V) { + // 1. Let x be ? ConvertToInt(V, 32, "unsigned"). + const x = webidl.util.ConvertToInt(V, 32, 'unsigned') + + // 2. Return the IDL unsigned long value that + // represents the same numeric value as x. + return x +} + +// https://webidl.spec.whatwg.org/#es-unsigned-short +webidl.converters['unsigned short'] = function (V, opts) { + // 1. Let x be ? ConvertToInt(V, 16, "unsigned"). + const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts) + + // 2. Return the IDL unsigned short value that represents + // the same numeric value as x. + return x +} + +// https://webidl.spec.whatwg.org/#idl-ArrayBuffer +webidl.converters.ArrayBuffer = function (V, opts = {}) { + // 1. If Type(V) is not Object, or V does not have an + // [[ArrayBufferData]] internal slot, then throw a + // TypeError. + // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances + // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances + if ( + webidl.util.Type(V) !== 'Object' || + !types.isAnyArrayBuffer(V) + ) { + throw webidl.errors.conversionFailed({ + prefix: `${V}`, + argument: `${V}`, + types: ['ArrayBuffer'] + }) + } + + // 2. If the conversion is not to an IDL type associated + // with the [AllowShared] extended attribute, and + // IsSharedArrayBuffer(V) is true, then throw a + // TypeError. + if (opts.allowShared === false && types.isSharedArrayBuffer(V)) { + throw webidl.errors.exception({ + header: 'ArrayBuffer', + message: 'SharedArrayBuffer is not allowed.' + }) + } + + // 3. If the conversion is not to an IDL type associated + // with the [AllowResizable] extended attribute, and + // IsResizableArrayBuffer(V) is true, then throw a + // TypeError. + // Note: resizable ArrayBuffers are currently a proposal. + + // 4. Return the IDL ArrayBuffer value that is a + // reference to the same object as V. + return V +} + +webidl.converters.TypedArray = function (V, T, opts = {}) { + // 1. Let T be the IDL type V is being converted to. + + // 2. If Type(V) is not Object, or V does not have a + // [[TypedArrayName]] internal slot with a value + // equal to T’s name, then throw a TypeError. + if ( + webidl.util.Type(V) !== 'Object' || + !types.isTypedArray(V) || + V.constructor.name !== T.name + ) { + throw webidl.errors.conversionFailed({ + prefix: `${T.name}`, + argument: `${V}`, + types: [T.name] + }) + } + + // 3. If the conversion is not to an IDL type associated + // with the [AllowShared] extended attribute, and + // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is + // true, then throw a TypeError. + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: 'ArrayBuffer', + message: 'SharedArrayBuffer is not allowed.' + }) + } + + // 4. If the conversion is not to an IDL type associated + // with the [AllowResizable] extended attribute, and + // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is + // true, then throw a TypeError. + // Note: resizable array buffers are currently a proposal + + // 5. Return the IDL value of type T that is a reference + // to the same object as V. + return V +} + +webidl.converters.DataView = function (V, opts = {}) { + // 1. If Type(V) is not Object, or V does not have a + // [[DataView]] internal slot, then throw a TypeError. + if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) { + throw webidl.errors.exception({ + header: 'DataView', + message: 'Object is not a DataView.' + }) + } + + // 2. If the conversion is not to an IDL type associated + // with the [AllowShared] extended attribute, and + // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true, + // then throw a TypeError. + if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) { + throw webidl.errors.exception({ + header: 'ArrayBuffer', + message: 'SharedArrayBuffer is not allowed.' + }) + } + + // 3. If the conversion is not to an IDL type associated + // with the [AllowResizable] extended attribute, and + // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is + // true, then throw a TypeError. + // Note: resizable ArrayBuffers are currently a proposal + + // 4. Return the IDL DataView value that is a reference + // to the same object as V. + return V +} + +// https://webidl.spec.whatwg.org/#BufferSource +webidl.converters.BufferSource = function (V, opts = {}) { + if (types.isAnyArrayBuffer(V)) { + return webidl.converters.ArrayBuffer(V, opts) + } + + if (types.isTypedArray(V)) { + return webidl.converters.TypedArray(V, V.constructor) + } + + if (types.isDataView(V)) { + return webidl.converters.DataView(V, opts) + } + + throw new TypeError(`Could not convert ${V} to a BufferSource.`) +} + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.ByteString +) + +webidl.converters['sequence>'] = webidl.sequenceConverter( + webidl.converters['sequence'] +) + +webidl.converters['record'] = webidl.recordConverter( + webidl.converters.ByteString, + webidl.converters.ByteString +) + +module.exports = { + webidl +} + + +/***/ }), + +/***/ 84854: +/***/ ((module) => { + +"use strict"; + + +/** + * @see https://encoding.spec.whatwg.org/#concept-encoding-get + * @param {string|undefined} label + */ +function getEncoding (label) { + if (!label) { + return 'failure' + } + + // 1. Remove any leading and trailing ASCII whitespace from label. + // 2. If label is an ASCII case-insensitive match for any of the + // labels listed in the table below, then return the + // corresponding encoding; otherwise return failure. + switch (label.trim().toLowerCase()) { + case 'unicode-1-1-utf-8': + case 'unicode11utf8': + case 'unicode20utf8': + case 'utf-8': + case 'utf8': + case 'x-unicode20utf8': + return 'UTF-8' + case '866': + case 'cp866': + case 'csibm866': + case 'ibm866': + return 'IBM866' + case 'csisolatin2': + case 'iso-8859-2': + case 'iso-ir-101': + case 'iso8859-2': + case 'iso88592': + case 'iso_8859-2': + case 'iso_8859-2:1987': + case 'l2': + case 'latin2': + return 'ISO-8859-2' + case 'csisolatin3': + case 'iso-8859-3': + case 'iso-ir-109': + case 'iso8859-3': + case 'iso88593': + case 'iso_8859-3': + case 'iso_8859-3:1988': + case 'l3': + case 'latin3': + return 'ISO-8859-3' + case 'csisolatin4': + case 'iso-8859-4': + case 'iso-ir-110': + case 'iso8859-4': + case 'iso88594': + case 'iso_8859-4': + case 'iso_8859-4:1988': + case 'l4': + case 'latin4': + return 'ISO-8859-4' + case 'csisolatincyrillic': + case 'cyrillic': + case 'iso-8859-5': + case 'iso-ir-144': + case 'iso8859-5': + case 'iso88595': + case 'iso_8859-5': + case 'iso_8859-5:1988': + return 'ISO-8859-5' + case 'arabic': + case 'asmo-708': + case 'csiso88596e': + case 'csiso88596i': + case 'csisolatinarabic': + case 'ecma-114': + case 'iso-8859-6': + case 'iso-8859-6-e': + case 'iso-8859-6-i': + case 'iso-ir-127': + case 'iso8859-6': + case 'iso88596': + case 'iso_8859-6': + case 'iso_8859-6:1987': + return 'ISO-8859-6' + case 'csisolatingreek': + case 'ecma-118': + case 'elot_928': + case 'greek': + case 'greek8': + case 'iso-8859-7': + case 'iso-ir-126': + case 'iso8859-7': + case 'iso88597': + case 'iso_8859-7': + case 'iso_8859-7:1987': + case 'sun_eu_greek': + return 'ISO-8859-7' + case 'csiso88598e': + case 'csisolatinhebrew': + case 'hebrew': + case 'iso-8859-8': + case 'iso-8859-8-e': + case 'iso-ir-138': + case 'iso8859-8': + case 'iso88598': + case 'iso_8859-8': + case 'iso_8859-8:1988': + case 'visual': + return 'ISO-8859-8' + case 'csiso88598i': + case 'iso-8859-8-i': + case 'logical': + return 'ISO-8859-8-I' + case 'csisolatin6': + case 'iso-8859-10': + case 'iso-ir-157': + case 'iso8859-10': + case 'iso885910': + case 'l6': + case 'latin6': + return 'ISO-8859-10' + case 'iso-8859-13': + case 'iso8859-13': + case 'iso885913': + return 'ISO-8859-13' + case 'iso-8859-14': + case 'iso8859-14': + case 'iso885914': + return 'ISO-8859-14' + case 'csisolatin9': + case 'iso-8859-15': + case 'iso8859-15': + case 'iso885915': + case 'iso_8859-15': + case 'l9': + return 'ISO-8859-15' + case 'iso-8859-16': + return 'ISO-8859-16' + case 'cskoi8r': + case 'koi': + case 'koi8': + case 'koi8-r': + case 'koi8_r': + return 'KOI8-R' + case 'koi8-ru': + case 'koi8-u': + return 'KOI8-U' + case 'csmacintosh': + case 'mac': + case 'macintosh': + case 'x-mac-roman': + return 'macintosh' + case 'iso-8859-11': + case 'iso8859-11': + case 'iso885911': + case 'tis-620': + case 'windows-874': + return 'windows-874' + case 'cp1250': + case 'windows-1250': + case 'x-cp1250': + return 'windows-1250' + case 'cp1251': + case 'windows-1251': + case 'x-cp1251': + return 'windows-1251' + case 'ansi_x3.4-1968': + case 'ascii': + case 'cp1252': + case 'cp819': + case 'csisolatin1': + case 'ibm819': + case 'iso-8859-1': + case 'iso-ir-100': + case 'iso8859-1': + case 'iso88591': + case 'iso_8859-1': + case 'iso_8859-1:1987': + case 'l1': + case 'latin1': + case 'us-ascii': + case 'windows-1252': + case 'x-cp1252': + return 'windows-1252' + case 'cp1253': + case 'windows-1253': + case 'x-cp1253': + return 'windows-1253' + case 'cp1254': + case 'csisolatin5': + case 'iso-8859-9': + case 'iso-ir-148': + case 'iso8859-9': + case 'iso88599': + case 'iso_8859-9': + case 'iso_8859-9:1989': + case 'l5': + case 'latin5': + case 'windows-1254': + case 'x-cp1254': + return 'windows-1254' + case 'cp1255': + case 'windows-1255': + case 'x-cp1255': + return 'windows-1255' + case 'cp1256': + case 'windows-1256': + case 'x-cp1256': + return 'windows-1256' + case 'cp1257': + case 'windows-1257': + case 'x-cp1257': + return 'windows-1257' + case 'cp1258': + case 'windows-1258': + case 'x-cp1258': + return 'windows-1258' + case 'x-mac-cyrillic': + case 'x-mac-ukrainian': + return 'x-mac-cyrillic' + case 'chinese': + case 'csgb2312': + case 'csiso58gb231280': + case 'gb2312': + case 'gb_2312': + case 'gb_2312-80': + case 'gbk': + case 'iso-ir-58': + case 'x-gbk': + return 'GBK' + case 'gb18030': + return 'gb18030' + case 'big5': + case 'big5-hkscs': + case 'cn-big5': + case 'csbig5': + case 'x-x-big5': + return 'Big5' + case 'cseucpkdfmtjapanese': + case 'euc-jp': + case 'x-euc-jp': + return 'EUC-JP' + case 'csiso2022jp': + case 'iso-2022-jp': + return 'ISO-2022-JP' + case 'csshiftjis': + case 'ms932': + case 'ms_kanji': + case 'shift-jis': + case 'shift_jis': + case 'sjis': + case 'windows-31j': + case 'x-sjis': + return 'Shift_JIS' + case 'cseuckr': + case 'csksc56011987': + case 'euc-kr': + case 'iso-ir-149': + case 'korean': + case 'ks_c_5601-1987': + case 'ks_c_5601-1989': + case 'ksc5601': + case 'ksc_5601': + case 'windows-949': + return 'EUC-KR' + case 'csiso2022kr': + case 'hz-gb-2312': + case 'iso-2022-cn': + case 'iso-2022-cn-ext': + case 'iso-2022-kr': + case 'replacement': + return 'replacement' + case 'unicodefffe': + case 'utf-16be': + return 'UTF-16BE' + case 'csunicode': + case 'iso-10646-ucs-2': + case 'ucs-2': + case 'unicode': + case 'unicodefeff': + case 'utf-16': + case 'utf-16le': + return 'UTF-16LE' + case 'x-user-defined': + return 'x-user-defined' + default: return 'failure' + } +} + +module.exports = { + getEncoding +} + + +/***/ }), + +/***/ 1446: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent +} = __nccwpck_require__(87530) +const { + kState, + kError, + kResult, + kEvents, + kAborted +} = __nccwpck_require__(29054) +const { webidl } = __nccwpck_require__(21744) +const { kEnumerableProperty } = __nccwpck_require__(83983) + +class FileReader extends EventTarget { + constructor () { + super() + + this[kState] = 'empty' + this[kResult] = null + this[kError] = null + this[kEvents] = { + loadend: null, + error: null, + abort: null, + load: null, + progress: null, + loadstart: null + } + } + + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer + * @param {import('buffer').Blob} blob + */ + readAsArrayBuffer (blob) { + webidl.brandCheck(this, FileReader) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' }) + + blob = webidl.converters.Blob(blob, { strict: false }) + + // The readAsArrayBuffer(blob) method, when invoked, + // must initiate a read operation for blob with ArrayBuffer. + readOperation(this, blob, 'ArrayBuffer') + } + + /** + * @see https://w3c.github.io/FileAPI/#readAsBinaryString + * @param {import('buffer').Blob} blob + */ + readAsBinaryString (blob) { + webidl.brandCheck(this, FileReader) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' }) + + blob = webidl.converters.Blob(blob, { strict: false }) + + // The readAsBinaryString(blob) method, when invoked, + // must initiate a read operation for blob with BinaryString. + readOperation(this, blob, 'BinaryString') + } + + /** + * @see https://w3c.github.io/FileAPI/#readAsDataText + * @param {import('buffer').Blob} blob + * @param {string?} encoding + */ + readAsText (blob, encoding = undefined) { + webidl.brandCheck(this, FileReader) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' }) + + blob = webidl.converters.Blob(blob, { strict: false }) + + if (encoding !== undefined) { + encoding = webidl.converters.DOMString(encoding) + } + + // The readAsText(blob, encoding) method, when invoked, + // must initiate a read operation for blob with Text and encoding. + readOperation(this, blob, 'Text', encoding) + } + + /** + * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL + * @param {import('buffer').Blob} blob + */ + readAsDataURL (blob) { + webidl.brandCheck(this, FileReader) + + webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' }) + + blob = webidl.converters.Blob(blob, { strict: false }) + + // The readAsDataURL(blob) method, when invoked, must + // initiate a read operation for blob with DataURL. + readOperation(this, blob, 'DataURL') + } + + /** + * @see https://w3c.github.io/FileAPI/#dfn-abort + */ + abort () { + // 1. If this's state is "empty" or if this's state is + // "done" set this's result to null and terminate + // this algorithm. + if (this[kState] === 'empty' || this[kState] === 'done') { + this[kResult] = null + return + } + + // 2. If this's state is "loading" set this's state to + // "done" and set this's result to null. + if (this[kState] === 'loading') { + this[kState] = 'done' + this[kResult] = null + } + + // 3. If there are any tasks from this on the file reading + // task source in an affiliated task queue, then remove + // those tasks from that task queue. + this[kAborted] = true + + // 4. Terminate the algorithm for the read method being processed. + // TODO + + // 5. Fire a progress event called abort at this. + fireAProgressEvent('abort', this) + + // 6. If this's state is not "loading", fire a progress + // event called loadend at this. + if (this[kState] !== 'loading') { + fireAProgressEvent('loadend', this) + } + } + + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate + */ + get readyState () { + webidl.brandCheck(this, FileReader) + + switch (this[kState]) { + case 'empty': return this.EMPTY + case 'loading': return this.LOADING + case 'done': return this.DONE + } + } + + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-result + */ + get result () { + webidl.brandCheck(this, FileReader) + + // The result attribute’s getter, when invoked, must return + // this's result. + return this[kResult] + } + + /** + * @see https://w3c.github.io/FileAPI/#dom-filereader-error + */ + get error () { + webidl.brandCheck(this, FileReader) + + // The error attribute’s getter, when invoked, must return + // this's error. + return this[kError] + } + + get onloadend () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].loadend + } + + set onloadend (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].loadend) { + this.removeEventListener('loadend', this[kEvents].loadend) + } + + if (typeof fn === 'function') { + this[kEvents].loadend = fn + this.addEventListener('loadend', fn) + } else { + this[kEvents].loadend = null + } + } + + get onerror () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].error + } + + set onerror (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].error) { + this.removeEventListener('error', this[kEvents].error) + } + + if (typeof fn === 'function') { + this[kEvents].error = fn + this.addEventListener('error', fn) + } else { + this[kEvents].error = null + } + } + + get onloadstart () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].loadstart + } + + set onloadstart (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].loadstart) { + this.removeEventListener('loadstart', this[kEvents].loadstart) + } + + if (typeof fn === 'function') { + this[kEvents].loadstart = fn + this.addEventListener('loadstart', fn) + } else { + this[kEvents].loadstart = null + } + } + + get onprogress () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].progress + } + + set onprogress (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].progress) { + this.removeEventListener('progress', this[kEvents].progress) + } + + if (typeof fn === 'function') { + this[kEvents].progress = fn + this.addEventListener('progress', fn) + } else { + this[kEvents].progress = null + } + } + + get onload () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].load + } + + set onload (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].load) { + this.removeEventListener('load', this[kEvents].load) + } + + if (typeof fn === 'function') { + this[kEvents].load = fn + this.addEventListener('load', fn) + } else { + this[kEvents].load = null + } + } + + get onabort () { + webidl.brandCheck(this, FileReader) + + return this[kEvents].abort + } + + set onabort (fn) { + webidl.brandCheck(this, FileReader) + + if (this[kEvents].abort) { + this.removeEventListener('abort', this[kEvents].abort) + } + + if (typeof fn === 'function') { + this[kEvents].abort = fn + this.addEventListener('abort', fn) + } else { + this[kEvents].abort = null + } + } +} + +// https://w3c.github.io/FileAPI/#dom-filereader-empty +FileReader.EMPTY = FileReader.prototype.EMPTY = 0 +// https://w3c.github.io/FileAPI/#dom-filereader-loading +FileReader.LOADING = FileReader.prototype.LOADING = 1 +// https://w3c.github.io/FileAPI/#dom-filereader-done +FileReader.DONE = FileReader.prototype.DONE = 2 + +Object.defineProperties(FileReader.prototype, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors, + readAsArrayBuffer: kEnumerableProperty, + readAsBinaryString: kEnumerableProperty, + readAsText: kEnumerableProperty, + readAsDataURL: kEnumerableProperty, + abort: kEnumerableProperty, + readyState: kEnumerableProperty, + result: kEnumerableProperty, + error: kEnumerableProperty, + onloadstart: kEnumerableProperty, + onprogress: kEnumerableProperty, + onload: kEnumerableProperty, + onabort: kEnumerableProperty, + onerror: kEnumerableProperty, + onloadend: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'FileReader', + writable: false, + enumerable: false, + configurable: true + } +}) + +Object.defineProperties(FileReader, { + EMPTY: staticPropertyDescriptors, + LOADING: staticPropertyDescriptors, + DONE: staticPropertyDescriptors +}) + +module.exports = { + FileReader +} + + +/***/ }), + +/***/ 55504: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { webidl } = __nccwpck_require__(21744) + +const kState = Symbol('ProgressEvent state') + +/** + * @see https://xhr.spec.whatwg.org/#progressevent + */ +class ProgressEvent extends Event { + constructor (type, eventInitDict = {}) { + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}) + + super(type, eventInitDict) + + this[kState] = { + lengthComputable: eventInitDict.lengthComputable, + loaded: eventInitDict.loaded, + total: eventInitDict.total + } + } + + get lengthComputable () { + webidl.brandCheck(this, ProgressEvent) + + return this[kState].lengthComputable + } + + get loaded () { + webidl.brandCheck(this, ProgressEvent) + + return this[kState].loaded + } + + get total () { + webidl.brandCheck(this, ProgressEvent) + + return this[kState].total + } +} + +webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ + { + key: 'lengthComputable', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'loaded', + converter: webidl.converters['unsigned long long'], + defaultValue: 0 + }, + { + key: 'total', + converter: webidl.converters['unsigned long long'], + defaultValue: 0 + }, + { + key: 'bubbles', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'cancelable', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'composed', + converter: webidl.converters.boolean, + defaultValue: false + } +]) + +module.exports = { + ProgressEvent +} + + +/***/ }), + +/***/ 29054: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + kState: Symbol('FileReader state'), + kResult: Symbol('FileReader result'), + kError: Symbol('FileReader error'), + kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'), + kEvents: Symbol('FileReader events'), + kAborted: Symbol('FileReader aborted') +} + + +/***/ }), + +/***/ 87530: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + kState, + kError, + kResult, + kAborted, + kLastProgressEventFired +} = __nccwpck_require__(29054) +const { ProgressEvent } = __nccwpck_require__(55504) +const { getEncoding } = __nccwpck_require__(84854) +const { DOMException } = __nccwpck_require__(41037) +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685) +const { types } = __nccwpck_require__(73837) +const { StringDecoder } = __nccwpck_require__(71576) +const { btoa } = __nccwpck_require__(14300) + +/** @type {PropertyDescriptor} */ +const staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false +} + +/** + * @see https://w3c.github.io/FileAPI/#readOperation + * @param {import('./filereader').FileReader} fr + * @param {import('buffer').Blob} blob + * @param {string} type + * @param {string?} encodingName + */ +function readOperation (fr, blob, type, encodingName) { + // 1. If fr’s state is "loading", throw an InvalidStateError + // DOMException. + if (fr[kState] === 'loading') { + throw new DOMException('Invalid state', 'InvalidStateError') + } + + // 2. Set fr’s state to "loading". + fr[kState] = 'loading' + + // 3. Set fr’s result to null. + fr[kResult] = null + + // 4. Set fr’s error to null. + fr[kError] = null + + // 5. Let stream be the result of calling get stream on blob. + /** @type {import('stream/web').ReadableStream} */ + const stream = blob.stream() + + // 6. Let reader be the result of getting a reader from stream. + const reader = stream.getReader() + + // 7. Let bytes be an empty byte sequence. + /** @type {Uint8Array[]} */ + const bytes = [] + + // 8. Let chunkPromise be the result of reading a chunk from + // stream with reader. + let chunkPromise = reader.read() + + // 9. Let isFirstChunk be true. + let isFirstChunk = true + + // 10. In parallel, while true: + // Note: "In parallel" just means non-blocking + // Note 2: readOperation itself cannot be async as double + // reading the body would then reject the promise, instead + // of throwing an error. + ;(async () => { + while (!fr[kAborted]) { + // 1. Wait for chunkPromise to be fulfilled or rejected. + try { + const { done, value } = await chunkPromise + + // 2. If chunkPromise is fulfilled, and isFirstChunk is + // true, queue a task to fire a progress event called + // loadstart at fr. + if (isFirstChunk && !fr[kAborted]) { + queueMicrotask(() => { + fireAProgressEvent('loadstart', fr) + }) + } + + // 3. Set isFirstChunk to false. + isFirstChunk = false + + // 4. If chunkPromise is fulfilled with an object whose + // done property is false and whose value property is + // a Uint8Array object, run these steps: + if (!done && types.isUint8Array(value)) { + // 1. Let bs be the byte sequence represented by the + // Uint8Array object. + + // 2. Append bs to bytes. + bytes.push(value) + + // 3. If roughly 50ms have passed since these steps + // were last invoked, queue a task to fire a + // progress event called progress at fr. + if ( + ( + fr[kLastProgressEventFired] === undefined || + Date.now() - fr[kLastProgressEventFired] >= 50 + ) && + !fr[kAborted] + ) { + fr[kLastProgressEventFired] = Date.now() + queueMicrotask(() => { + fireAProgressEvent('progress', fr) + }) + } + + // 4. Set chunkPromise to the result of reading a + // chunk from stream with reader. + chunkPromise = reader.read() + } else if (done) { + // 5. Otherwise, if chunkPromise is fulfilled with an + // object whose done property is true, queue a task + // to run the following steps and abort this algorithm: + queueMicrotask(() => { + // 1. Set fr’s state to "done". + fr[kState] = 'done' + + // 2. Let result be the result of package data given + // bytes, type, blob’s type, and encodingName. + try { + const result = packageData(bytes, type, blob.type, encodingName) + + // 4. Else: + + if (fr[kAborted]) { + return + } + + // 1. Set fr’s result to result. + fr[kResult] = result + + // 2. Fire a progress event called load at the fr. + fireAProgressEvent('load', fr) + } catch (error) { + // 3. If package data threw an exception error: + + // 1. Set fr’s error to error. + fr[kError] = error + + // 2. Fire a progress event called error at fr. + fireAProgressEvent('error', fr) + } + + // 5. If fr’s state is not "loading", fire a progress + // event called loadend at the fr. + if (fr[kState] !== 'loading') { + fireAProgressEvent('loadend', fr) + } + }) + + break + } + } catch (error) { + if (fr[kAborted]) { + return + } + + // 6. Otherwise, if chunkPromise is rejected with an + // error error, queue a task to run the following + // steps and abort this algorithm: + queueMicrotask(() => { + // 1. Set fr’s state to "done". + fr[kState] = 'done' + + // 2. Set fr’s error to error. + fr[kError] = error + + // 3. Fire a progress event called error at fr. + fireAProgressEvent('error', fr) + + // 4. If fr’s state is not "loading", fire a progress + // event called loadend at fr. + if (fr[kState] !== 'loading') { + fireAProgressEvent('loadend', fr) + } + }) + + break + } + } + })() +} + +/** + * @see https://w3c.github.io/FileAPI/#fire-a-progress-event + * @see https://dom.spec.whatwg.org/#concept-event-fire + * @param {string} e The name of the event + * @param {import('./filereader').FileReader} reader + */ +function fireAProgressEvent (e, reader) { + // The progress event e does not bubble. e.bubbles must be false + // The progress event e is NOT cancelable. e.cancelable must be false + const event = new ProgressEvent(e, { + bubbles: false, + cancelable: false + }) + + reader.dispatchEvent(event) +} + +/** + * @see https://w3c.github.io/FileAPI/#blob-package-data + * @param {Uint8Array[]} bytes + * @param {string} type + * @param {string?} mimeType + * @param {string?} encodingName + */ +function packageData (bytes, type, mimeType, encodingName) { + // 1. A Blob has an associated package data algorithm, given + // bytes, a type, a optional mimeType, and a optional + // encodingName, which switches on type and runs the + // associated steps: + + switch (type) { + case 'DataURL': { + // 1. Return bytes as a DataURL [RFC2397] subject to + // the considerations below: + // * Use mimeType as part of the Data URL if it is + // available in keeping with the Data URL + // specification [RFC2397]. + // * If mimeType is not available return a Data URL + // without a media-type. [RFC2397]. + + // https://datatracker.ietf.org/doc/html/rfc2397#section-3 + // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data + // mediatype := [ type "/" subtype ] *( ";" parameter ) + // data := *urlchar + // parameter := attribute "=" value + let dataURL = 'data:' + + const parsed = parseMIMEType(mimeType || 'application/octet-stream') + + if (parsed !== 'failure') { + dataURL += serializeAMimeType(parsed) + } + + dataURL += ';base64,' + + const decoder = new StringDecoder('latin1') + + for (const chunk of bytes) { + dataURL += btoa(decoder.write(chunk)) + } + + dataURL += btoa(decoder.end()) + + return dataURL + } + case 'Text': { + // 1. Let encoding be failure + let encoding = 'failure' + + // 2. If the encodingName is present, set encoding to the + // result of getting an encoding from encodingName. + if (encodingName) { + encoding = getEncoding(encodingName) + } + + // 3. If encoding is failure, and mimeType is present: + if (encoding === 'failure' && mimeType) { + // 1. Let type be the result of parse a MIME type + // given mimeType. + const type = parseMIMEType(mimeType) + + // 2. If type is not failure, set encoding to the result + // of getting an encoding from type’s parameters["charset"]. + if (type !== 'failure') { + encoding = getEncoding(type.parameters.get('charset')) + } + } + + // 4. If encoding is failure, then set encoding to UTF-8. + if (encoding === 'failure') { + encoding = 'UTF-8' + } + + // 5. Decode bytes using fallback encoding encoding, and + // return the result. + return decode(bytes, encoding) + } + case 'ArrayBuffer': { + // Return a new ArrayBuffer whose contents are bytes. + const sequence = combineByteSequences(bytes) + + return sequence.buffer + } + case 'BinaryString': { + // Return bytes as a binary string, in which every byte + // is represented by a code unit of equal value [0..255]. + let binaryString = '' + + const decoder = new StringDecoder('latin1') + + for (const chunk of bytes) { + binaryString += decoder.write(chunk) + } + + binaryString += decoder.end() + + return binaryString + } + } +} + +/** + * @see https://encoding.spec.whatwg.org/#decode + * @param {Uint8Array[]} ioQueue + * @param {string} encoding + */ +function decode (ioQueue, encoding) { + const bytes = combineByteSequences(ioQueue) + + // 1. Let BOMEncoding be the result of BOM sniffing ioQueue. + const BOMEncoding = BOMSniffing(bytes) + + let slice = 0 + + // 2. If BOMEncoding is non-null: + if (BOMEncoding !== null) { + // 1. Set encoding to BOMEncoding. + encoding = BOMEncoding + + // 2. Read three bytes from ioQueue, if BOMEncoding is + // UTF-8; otherwise read two bytes. + // (Do nothing with those bytes.) + slice = BOMEncoding === 'UTF-8' ? 3 : 2 + } + + // 3. Process a queue with an instance of encoding’s + // decoder, ioQueue, output, and "replacement". + + // 4. Return output. + + const sliced = bytes.slice(slice) + return new TextDecoder(encoding).decode(sliced) +} + +/** + * @see https://encoding.spec.whatwg.org/#bom-sniff + * @param {Uint8Array} ioQueue + */ +function BOMSniffing (ioQueue) { + // 1. Let BOM be the result of peeking 3 bytes from ioQueue, + // converted to a byte sequence. + const [a, b, c] = ioQueue + + // 2. For each of the rows in the table below, starting with + // the first one and going down, if BOM starts with the + // bytes given in the first column, then return the + // encoding given in the cell in the second column of that + // row. Otherwise, return null. + if (a === 0xEF && b === 0xBB && c === 0xBF) { + return 'UTF-8' + } else if (a === 0xFE && b === 0xFF) { + return 'UTF-16BE' + } else if (a === 0xFF && b === 0xFE) { + return 'UTF-16LE' + } + + return null +} + +/** + * @param {Uint8Array[]} sequences + */ +function combineByteSequences (sequences) { + const size = sequences.reduce((a, b) => { + return a + b.byteLength + }, 0) + + let offset = 0 + + return sequences.reduce((a, b) => { + a.set(b, offset) + offset += b.byteLength + return a + }, new Uint8Array(size)) +} + +module.exports = { + staticPropertyDescriptors, + readOperation, + fireAProgressEvent +} + + +/***/ }), + +/***/ 21892: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +// We include a version number for the Dispatcher API. In case of breaking changes, +// this version number must be increased to avoid conflicts. +const globalDispatcher = Symbol.for('undici.globalDispatcher.1') +const { InvalidArgumentError } = __nccwpck_require__(48045) +const Agent = __nccwpck_require__(7890) + +if (getGlobalDispatcher() === undefined) { + setGlobalDispatcher(new Agent()) +} + +function setGlobalDispatcher (agent) { + if (!agent || typeof agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument agent must implement Agent') + } + Object.defineProperty(globalThis, globalDispatcher, { + value: agent, + writable: true, + enumerable: false, + configurable: false + }) +} + +function getGlobalDispatcher () { + return globalThis[globalDispatcher] +} + +module.exports = { + setGlobalDispatcher, + getGlobalDispatcher +} + + +/***/ }), + +/***/ 46930: +/***/ ((module) => { + +"use strict"; + + +module.exports = class DecoratorHandler { + constructor (handler) { + this.handler = handler + } + + onConnect (...args) { + return this.handler.onConnect(...args) + } + + onError (...args) { + return this.handler.onError(...args) + } + + onUpgrade (...args) { + return this.handler.onUpgrade(...args) + } + + onHeaders (...args) { + return this.handler.onHeaders(...args) + } + + onData (...args) { + return this.handler.onData(...args) + } + + onComplete (...args) { + return this.handler.onComplete(...args) + } + + onBodySent (...args) { + return this.handler.onBodySent(...args) + } +} + + +/***/ }), + +/***/ 72860: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const util = __nccwpck_require__(83983) +const { kBodyUsed } = __nccwpck_require__(72785) +const assert = __nccwpck_require__(39491) +const { InvalidArgumentError } = __nccwpck_require__(48045) +const EE = __nccwpck_require__(82361) + +const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] + +const kBody = Symbol('body') + +class BodyAsyncIterable { + constructor (body) { + this[kBody] = body + this[kBodyUsed] = false + } + + async * [Symbol.asyncIterator] () { + assert(!this[kBodyUsed], 'disturbed') + this[kBodyUsed] = true + yield * this[kBody] + } +} + +class RedirectHandler { + constructor (dispatch, maxRedirections, opts, handler) { + if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { + throw new InvalidArgumentError('maxRedirections must be a positive number') + } + + util.validateHandler(handler, opts.method, opts.upgrade) + + this.dispatch = dispatch + this.location = null + this.abort = null + this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy + this.maxRedirections = maxRedirections + this.handler = handler + this.history = [] + + if (util.isStream(this.opts.body)) { + // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp + // so that it can be dispatched again? + // TODO (fix): Do we need 100-expect support to provide a way to do this properly? + if (util.bodyLength(this.opts.body) === 0) { + this.opts.body + .on('data', function () { + assert(false) + }) + } + + if (typeof this.opts.body.readableDidRead !== 'boolean') { + this.opts.body[kBodyUsed] = false + EE.prototype.on.call(this.opts.body, 'data', function () { + this[kBodyUsed] = true + }) + } + } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') { + // TODO (fix): We can't access ReadableStream internal state + // to determine whether or not it has been disturbed. This is just + // a workaround. + this.opts.body = new BodyAsyncIterable(this.opts.body) + } else if ( + this.opts.body && + typeof this.opts.body !== 'string' && + !ArrayBuffer.isView(this.opts.body) && + util.isIterable(this.opts.body) + ) { + // TODO: Should we allow re-using iterable if !this.opts.idempotent + // or through some other flag? + this.opts.body = new BodyAsyncIterable(this.opts.body) + } + } + + onConnect (abort) { + this.abort = abort + this.handler.onConnect(abort, { history: this.history }) + } + + onUpgrade (statusCode, headers, socket) { + this.handler.onUpgrade(statusCode, headers, socket) + } + + onError (error) { + this.handler.onError(error) + } + + onHeaders (statusCode, headers, resume, statusText) { + this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) + ? null + : parseLocation(statusCode, headers) + + if (this.opts.origin) { + this.history.push(new URL(this.opts.path, this.opts.origin)) + } + + if (!this.location) { + return this.handler.onHeaders(statusCode, headers, resume, statusText) + } + + const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))) + const path = search ? `${pathname}${search}` : pathname + + // Remove headers referring to the original URL. + // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers. + // https://tools.ietf.org/html/rfc7231#section-6.4 + this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin) + this.opts.path = path + this.opts.origin = origin + this.opts.maxRedirections = 0 + this.opts.query = null + + // https://tools.ietf.org/html/rfc7231#section-6.4.4 + // In case of HTTP 303, always replace method to be either HEAD or GET + if (statusCode === 303 && this.opts.method !== 'HEAD') { + this.opts.method = 'GET' + this.opts.body = null + } + } + + onData (chunk) { + if (this.location) { + /* + https://tools.ietf.org/html/rfc7231#section-6.4 + + TLDR: undici always ignores 3xx response bodies. + + Redirection is used to serve the requested resource from another URL, so it is assumes that + no body is generated (and thus can be ignored). Even though generating a body is not prohibited. + + For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually + (which means it's optional and not mandated) contain just an hyperlink to the value of + the Location response header, so the body can be ignored safely. + + For status 300, which is "Multiple Choices", the spec mentions both generating a Location + response header AND a response body with the other possible location to follow. + Since the spec explicitily chooses not to specify a format for such body and leave it to + servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it. + */ + } else { + return this.handler.onData(chunk) + } + } + + onComplete (trailers) { + if (this.location) { + /* + https://tools.ietf.org/html/rfc7231#section-6.4 + + TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections + and neither are useful if present. + + See comment on onData method above for more detailed informations. + */ + + this.location = null + this.abort = null + + this.dispatch(this.opts, this) + } else { + this.handler.onComplete(trailers) + } + } + + onBodySent (chunk) { + if (this.handler.onBodySent) { + this.handler.onBodySent(chunk) + } + } +} + +function parseLocation (statusCode, headers) { + if (redirectableStatusCodes.indexOf(statusCode) === -1) { + return null + } + + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].toString().toLowerCase() === 'location') { + return headers[i + 1] + } + } +} + +// https://tools.ietf.org/html/rfc7231#section-6.4.4 +function shouldRemoveHeader (header, removeContent, unknownOrigin) { + return ( + (header.length === 4 && header.toString().toLowerCase() === 'host') || + (removeContent && header.toString().toLowerCase().indexOf('content-') === 0) || + (unknownOrigin && header.length === 13 && header.toString().toLowerCase() === 'authorization') || + (unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie') + ) +} + +// https://tools.ietf.org/html/rfc7231#section-6.4 +function cleanRequestHeaders (headers, removeContent, unknownOrigin) { + const ret = [] + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { + ret.push(headers[i], headers[i + 1]) + } + } + } else if (headers && typeof headers === 'object') { + for (const key of Object.keys(headers)) { + if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { + ret.push(key, headers[key]) + } + } + } else { + assert(headers == null, 'headers must be an object or an array') + } + return ret +} + +module.exports = RedirectHandler + + +/***/ }), + +/***/ 82286: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const assert = __nccwpck_require__(39491) + +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(72785) +const { RequestRetryError } = __nccwpck_require__(48045) +const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(83983) + +function calculateRetryAfterHeader (retryAfter) { + const current = Date.now() + const diff = new Date(retryAfter).getTime() - current + + return diff +} + +class RetryHandler { + constructor (opts, handlers) { + const { retryOptions, ...dispatchOpts } = opts + const { + // Retry scoped + retry: retryFn, + maxRetries, + maxTimeout, + minTimeout, + timeoutFactor, + // Response scoped + methods, + errorCodes, + retryAfter, + statusCodes + } = retryOptions ?? {} + + this.dispatch = handlers.dispatch + this.handler = handlers.handler + this.opts = dispatchOpts + this.abort = null + this.aborted = false + this.retryOpts = { + retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], + retryAfter: retryAfter ?? true, + maxTimeout: maxTimeout ?? 30 * 1000, // 30s, + timeout: minTimeout ?? 500, // .5s + timeoutFactor: timeoutFactor ?? 2, + maxRetries: maxRetries ?? 5, + // What errors we should retry + methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], + // Indicates which errors to retry + statusCodes: statusCodes ?? [500, 502, 503, 504, 429], + // List of errors to retry + errorCodes: errorCodes ?? [ + 'ECONNRESET', + 'ECONNREFUSED', + 'ENOTFOUND', + 'ENETDOWN', + 'ENETUNREACH', + 'EHOSTDOWN', + 'EHOSTUNREACH', + 'EPIPE' + ] + } + + this.retryCount = 0 + this.start = 0 + this.end = null + this.etag = null + this.resume = null + + // Handle possible onConnect duplication + this.handler.onConnect(reason => { + this.aborted = true + if (this.abort) { + this.abort(reason) + } else { + this.reason = reason + } + }) + } + + onRequestSent () { + if (this.handler.onRequestSent) { + this.handler.onRequestSent() + } + } + + onUpgrade (statusCode, headers, socket) { + if (this.handler.onUpgrade) { + this.handler.onUpgrade(statusCode, headers, socket) + } + } + + onConnect (abort) { + if (this.aborted) { + abort(this.reason) + } else { + this.abort = abort + } + } + + onBodySent (chunk) { + if (this.handler.onBodySent) return this.handler.onBodySent(chunk) + } + + static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { + const { statusCode, code, headers } = err + const { method, retryOptions } = opts + const { + maxRetries, + timeout, + maxTimeout, + timeoutFactor, + statusCodes, + errorCodes, + methods + } = retryOptions + let { counter, currentTimeout } = state + + currentTimeout = + currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout + + // Any code that is not a Undici's originated and allowed to retry + if ( + code && + code !== 'UND_ERR_REQ_RETRY' && + code !== 'UND_ERR_SOCKET' && + !errorCodes.includes(code) + ) { + cb(err) + return + } + + // If a set of method are provided and the current method is not in the list + if (Array.isArray(methods) && !methods.includes(method)) { + cb(err) + return + } + + // If a set of status code are provided and the current status code is not in the list + if ( + statusCode != null && + Array.isArray(statusCodes) && + !statusCodes.includes(statusCode) + ) { + cb(err) + return + } + + // If we reached the max number of retries + if (counter > maxRetries) { + cb(err) + return + } + + let retryAfterHeader = headers != null && headers['retry-after'] + if (retryAfterHeader) { + retryAfterHeader = Number(retryAfterHeader) + retryAfterHeader = isNaN(retryAfterHeader) + ? calculateRetryAfterHeader(retryAfterHeader) + : retryAfterHeader * 1e3 // Retry-After is in seconds + } + + const retryTimeout = + retryAfterHeader > 0 + ? Math.min(retryAfterHeader, maxTimeout) + : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout) + + state.currentTimeout = retryTimeout + + setTimeout(() => cb(null), retryTimeout) + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const headers = parseHeaders(rawHeaders) + + this.retryCount += 1 + + if (statusCode >= 300) { + this.abort( + new RequestRetryError('Request failed', statusCode, { + headers, + count: this.retryCount + }) + ) + return false + } + + // Checkpoint for resume from where we left it + if (this.resume != null) { + this.resume = null + + if (statusCode !== 206) { + return true + } + + const contentRange = parseRangeHeader(headers['content-range']) + // If no content range + if (!contentRange) { + this.abort( + new RequestRetryError('Content-Range mismatch', statusCode, { + headers, + count: this.retryCount + }) + ) + return false + } + + // Let's start with a weak etag check + if (this.etag != null && this.etag !== headers.etag) { + this.abort( + new RequestRetryError('ETag mismatch', statusCode, { + headers, + count: this.retryCount + }) + ) + return false + } + + const { start, size, end = size } = contentRange + + assert(this.start === start, 'content-range mismatch') + assert(this.end == null || this.end === end, 'content-range mismatch') + + this.resume = resume + return true + } + + if (this.end == null) { + if (statusCode === 206) { + // First time we receive 206 + const range = parseRangeHeader(headers['content-range']) + + if (range == null) { + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } + + const { start, size, end = size } = range + + assert( + start != null && Number.isFinite(start) && this.start !== start, + 'content-range mismatch' + ) + assert(Number.isFinite(start)) + assert( + end != null && Number.isFinite(end) && this.end !== end, + 'invalid content-length' + ) + + this.start = start + this.end = end + } + + // We make our best to checkpoint the body for further range headers + if (this.end == null) { + const contentLength = headers['content-length'] + this.end = contentLength != null ? Number(contentLength) : null + } + + assert(Number.isFinite(this.start)) + assert( + this.end == null || Number.isFinite(this.end), + 'invalid content-length' + ) + + this.resume = resume + this.etag = headers.etag != null ? headers.etag : null + + return this.handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } + + const err = new RequestRetryError('Request failed', statusCode, { + headers, + count: this.retryCount + }) + + this.abort(err) + + return false + } + + onData (chunk) { + this.start += chunk.length + + return this.handler.onData(chunk) + } + + onComplete (rawTrailers) { + this.retryCount = 0 + return this.handler.onComplete(rawTrailers) + } + + onError (err) { + if (this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err) + } + + this.retryOpts.retry( + err, + { + state: { counter: this.retryCount++, currentTimeout: this.retryAfter }, + opts: { retryOptions: this.retryOpts, ...this.opts } + }, + onRetry.bind(this) + ) + + function onRetry (err) { + if (err != null || this.aborted || isDisturbed(this.opts.body)) { + return this.handler.onError(err) + } + + if (this.start !== 0) { + this.opts = { + ...this.opts, + headers: { + ...this.opts.headers, + range: `bytes=${this.start}-${this.end ?? ''}` + } + } + } + + try { + this.dispatch(this.opts, this) + } catch (err) { + this.handler.onError(err) + } + } + } +} + +module.exports = RetryHandler + + +/***/ }), + +/***/ 38861: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const RedirectHandler = __nccwpck_require__(72860) + +function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { + return (dispatch) => { + return function Intercept (opts, handler) { + const { maxRedirections = defaultMaxRedirections } = opts + + if (!maxRedirections) { + return dispatch(opts, handler) + } + + const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler) + opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting. + return dispatch(opts, redirectHandler) + } + } +} + +module.exports = createRedirectInterceptor + + +/***/ }), + +/***/ 30953: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; +const utils_1 = __nccwpck_require__(41891); +// C headers +var ERROR; +(function (ERROR) { + ERROR[ERROR["OK"] = 0] = "OK"; + ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; + ERROR[ERROR["STRICT"] = 2] = "STRICT"; + ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; + ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR[ERROR["USER"] = 24] = "USER"; +})(ERROR = exports.ERROR || (exports.ERROR = {})); +var TYPE; +(function (TYPE) { + TYPE[TYPE["BOTH"] = 0] = "BOTH"; + TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; + TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; +})(TYPE = exports.TYPE || (exports.TYPE = {})); +var FLAGS; +(function (FLAGS) { + FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; + FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; + FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; + FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; + FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; + FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; + FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; + FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; + // 1 << 8 is unused + FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; +})(FLAGS = exports.FLAGS || (exports.FLAGS = {})); +var LENIENT_FLAGS; +(function (LENIENT_FLAGS) { + LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; + LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; + LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; +})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); +var METHODS; +(function (METHODS) { + METHODS[METHODS["DELETE"] = 0] = "DELETE"; + METHODS[METHODS["GET"] = 1] = "GET"; + METHODS[METHODS["HEAD"] = 2] = "HEAD"; + METHODS[METHODS["POST"] = 3] = "POST"; + METHODS[METHODS["PUT"] = 4] = "PUT"; + /* pathological */ + METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; + METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; + METHODS[METHODS["TRACE"] = 7] = "TRACE"; + /* WebDAV */ + METHODS[METHODS["COPY"] = 8] = "COPY"; + METHODS[METHODS["LOCK"] = 9] = "LOCK"; + METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; + METHODS[METHODS["MOVE"] = 11] = "MOVE"; + METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; + METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; + METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; + METHODS[METHODS["BIND"] = 16] = "BIND"; + METHODS[METHODS["REBIND"] = 17] = "REBIND"; + METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; + METHODS[METHODS["ACL"] = 19] = "ACL"; + /* subversion */ + METHODS[METHODS["REPORT"] = 20] = "REPORT"; + METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS[METHODS["MERGE"] = 23] = "MERGE"; + /* upnp */ + METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; + METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + /* RFC-5789 */ + METHODS[METHODS["PATCH"] = 28] = "PATCH"; + METHODS[METHODS["PURGE"] = 29] = "PURGE"; + /* CalDAV */ + METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; + /* RFC-2068, section 19.6.1.2 */ + METHODS[METHODS["LINK"] = 31] = "LINK"; + METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; + /* icecast */ + METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; + /* RFC-7540, section 11.6 */ + METHODS[METHODS["PRI"] = 34] = "PRI"; + /* RFC-2326 RTSP */ + METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS[METHODS["SETUP"] = 37] = "SETUP"; + METHODS[METHODS["PLAY"] = 38] = "PLAY"; + METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; + METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; + METHODS[METHODS["RECORD"] = 44] = "RECORD"; + /* RAOP */ + METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; +})(METHODS = exports.METHODS || (exports.METHODS = {})); +exports.METHODS_HTTP = [ + METHODS.DELETE, + METHODS.GET, + METHODS.HEAD, + METHODS.POST, + METHODS.PUT, + METHODS.CONNECT, + METHODS.OPTIONS, + METHODS.TRACE, + METHODS.COPY, + METHODS.LOCK, + METHODS.MKCOL, + METHODS.MOVE, + METHODS.PROPFIND, + METHODS.PROPPATCH, + METHODS.SEARCH, + METHODS.UNLOCK, + METHODS.BIND, + METHODS.REBIND, + METHODS.UNBIND, + METHODS.ACL, + METHODS.REPORT, + METHODS.MKACTIVITY, + METHODS.CHECKOUT, + METHODS.MERGE, + METHODS['M-SEARCH'], + METHODS.NOTIFY, + METHODS.SUBSCRIBE, + METHODS.UNSUBSCRIBE, + METHODS.PATCH, + METHODS.PURGE, + METHODS.MKCALENDAR, + METHODS.LINK, + METHODS.UNLINK, + METHODS.PRI, + // TODO(indutny): should we allow it with HTTP? + METHODS.SOURCE, +]; +exports.METHODS_ICE = [ + METHODS.SOURCE, +]; +exports.METHODS_RTSP = [ + METHODS.OPTIONS, + METHODS.DESCRIBE, + METHODS.ANNOUNCE, + METHODS.SETUP, + METHODS.PLAY, + METHODS.PAUSE, + METHODS.TEARDOWN, + METHODS.GET_PARAMETER, + METHODS.SET_PARAMETER, + METHODS.REDIRECT, + METHODS.RECORD, + METHODS.FLUSH, + // For AirPlay + METHODS.GET, + METHODS.POST, +]; +exports.METHOD_MAP = utils_1.enumToMap(METHODS); +exports.H_METHOD_MAP = {}; +Object.keys(exports.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) { + exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; + } +}); +var FINISH; +(function (FINISH) { + FINISH[FINISH["SAFE"] = 0] = "SAFE"; + FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; +})(FINISH = exports.FINISH || (exports.FINISH = {})); +exports.ALPHA = []; +for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) { + // Upper case + exports.ALPHA.push(String.fromCharCode(i)); + // Lower case + exports.ALPHA.push(String.fromCharCode(i + 0x20)); +} +exports.NUM_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, +}; +exports.HEX_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, + A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF, + a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf, +}; +exports.NUM = [ + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', +]; +exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); +exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')']; +exports.USERINFO_CHARS = exports.ALPHANUM + .concat(exports.MARK) + .concat(['%', ';', ':', '&', '=', '+', '$', ',']); +// TODO(indutny): use RFC +exports.STRICT_URL_CHAR = [ + '!', '"', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + ':', ';', '<', '=', '>', + '@', '[', '\\', ']', '^', '_', + '`', + '{', '|', '}', '~', +].concat(exports.ALPHANUM); +exports.URL_CHAR = exports.STRICT_URL_CHAR + .concat(['\t', '\f']); +// All characters with 0x80 bit set to 1 +for (let i = 0x80; i <= 0xff; i++) { + exports.URL_CHAR.push(i); +} +exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']); +/* Tokens as defined by rfc 2616. Also lowercases them. + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT + */ +exports.STRICT_TOKEN = [ + '!', '#', '$', '%', '&', '\'', + '*', '+', '-', '.', + '^', '_', '`', + '|', '~', +].concat(exports.ALPHANUM); +exports.TOKEN = exports.STRICT_TOKEN.concat([' ']); +/* + * Verify that a char is a valid visible (printable) US-ASCII + * character or %x80-FF + */ +exports.HEADER_CHARS = ['\t']; +for (let i = 32; i <= 255; i++) { + if (i !== 127) { + exports.HEADER_CHARS.push(i); + } +} +// ',' = \x44 +exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); +exports.MAJOR = exports.NUM_MAP; +exports.MINOR = exports.MAJOR; +var HEADER_STATE; +(function (HEADER_STATE) { + HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; +})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); +exports.SPECIAL_HEADERS = { + 'connection': HEADER_STATE.CONNECTION, + 'content-length': HEADER_STATE.CONTENT_LENGTH, + 'proxy-connection': HEADER_STATE.CONNECTION, + 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING, + 'upgrade': HEADER_STATE.UPGRADE, +}; +//# sourceMappingURL=constants.js.map + +/***/ }), + +/***/ 61145: +/***/ ((module) => { + +module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCsLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4ABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwHLAcoBuAHJAbkByAG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAQDcAQtBACEQDMYBC0EOIRAMxQELQQ0hEAzEAQtBDyEQDMMBC0EQIRAMwgELQRMhEAzBAQtBFCEQDMABC0EVIRAMvwELQRYhEAy+AQtBFyEQDL0BC0EYIRAMvAELQRkhEAy7AQtBGiEQDLoBC0EbIRAMuQELQRwhEAy4AQtBCCEQDLcBC0EdIRAMtgELQSAhEAy1AQtBHyEQDLQBC0EHIRAMswELQSEhEAyyAQtBIiEQDLEBC0EeIRAMsAELQSMhEAyvAQtBEiEQDK4BC0ERIRAMrQELQSQhEAysAQtBJSEQDKsBC0EmIRAMqgELQSchEAypAQtBwwEhEAyoAQtBKSEQDKcBC0ErIRAMpgELQSwhEAylAQtBLSEQDKQBC0EuIRAMowELQS8hEAyiAQtBxAEhEAyhAQtBMCEQDKABC0E0IRAMnwELQQwhEAyeAQtBMSEQDJ0BC0EyIRAMnAELQTMhEAybAQtBOSEQDJoBC0E1IRAMmQELQcUBIRAMmAELQQshEAyXAQtBOiEQDJYBC0E2IRAMlQELQQohEAyUAQtBNyEQDJMBC0E4IRAMkgELQTwhEAyRAQtBOyEQDJABC0E9IRAMjwELQQkhEAyOAQtBKCEQDI0BC0E+IRAMjAELQT8hEAyLAQtBwAAhEAyKAQtBwQAhEAyJAQtBwgAhEAyIAQtBwwAhEAyHAQtBxAAhEAyGAQtBxQAhEAyFAQtBxgAhEAyEAQtBKiEQDIMBC0HHACEQDIIBC0HIACEQDIEBC0HJACEQDIABC0HKACEQDH8LQcsAIRAMfgtBzQAhEAx9C0HMACEQDHwLQc4AIRAMewtBzwAhEAx6C0HQACEQDHkLQdEAIRAMeAtB0gAhEAx3C0HTACEQDHYLQdQAIRAMdQtB1gAhEAx0C0HVACEQDHMLQQYhEAxyC0HXACEQDHELQQUhEAxwC0HYACEQDG8LQQQhEAxuC0HZACEQDG0LQdoAIRAMbAtB2wAhEAxrC0HcACEQDGoLQQMhEAxpC0HdACEQDGgLQd4AIRAMZwtB3wAhEAxmC0HhACEQDGULQeAAIRAMZAtB4gAhEAxjC0HjACEQDGILQQIhEAxhC0HkACEQDGALQeUAIRAMXwtB5gAhEAxeC0HnACEQDF0LQegAIRAMXAtB6QAhEAxbC0HqACEQDFoLQesAIRAMWQtB7AAhEAxYC0HtACEQDFcLQe4AIRAMVgtB7wAhEAxVC0HwACEQDFQLQfEAIRAMUwtB8gAhEAxSC0HzACEQDFELQfQAIRAMUAtB9QAhEAxPC0H2ACEQDE4LQfcAIRAMTQtB+AAhEAxMC0H5ACEQDEsLQfoAIRAMSgtB+wAhEAxJC0H8ACEQDEgLQf0AIRAMRwtB/gAhEAxGC0H/ACEQDEULQYABIRAMRAtBgQEhEAxDC0GCASEQDEILQYMBIRAMQQtBhAEhEAxAC0GFASEQDD8LQYYBIRAMPgtBhwEhEAw9C0GIASEQDDwLQYkBIRAMOwtBigEhEAw6C0GLASEQDDkLQYwBIRAMOAtBjQEhEAw3C0GOASEQDDYLQY8BIRAMNQtBkAEhEAw0C0GRASEQDDMLQZIBIRAMMgtBkwEhEAwxC0GUASEQDDALQZUBIRAMLwtBlgEhEAwuC0GXASEQDC0LQZgBIRAMLAtBmQEhEAwrC0GaASEQDCoLQZsBIRAMKQtBnAEhEAwoC0GdASEQDCcLQZ4BIRAMJgtBnwEhEAwlC0GgASEQDCQLQaEBIRAMIwtBogEhEAwiC0GjASEQDCELQaQBIRAMIAtBpQEhEAwfC0GmASEQDB4LQacBIRAMHQtBqAEhEAwcC0GpASEQDBsLQaoBIRAMGgtBqwEhEAwZC0GsASEQDBgLQa0BIRAMFwtBrgEhEAwWC0EBIRAMFQtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAc8B0AHRAdIB0wHUAdUB1gHXAdgB2QHaAdsB3AHdAd4B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAZkCpAKwAv4C/gILIAEiBCACRw3zAUHdASEQDP8DCyABIhAgAkcN3QFBwwEhEAz+AwsgASIBIAJHDZABQfcAIRAM/QMLIAEiASACRw2GAUHvACEQDPwDCyABIgEgAkcNf0HqACEQDPsDCyABIgEgAkcNe0HoACEQDPoDCyABIgEgAkcNeEHmACEQDPkDCyABIgEgAkcNGkEYIRAM+AMLIAEiASACRw0UQRIhEAz3AwsgASIBIAJHDVlBxQAhEAz2AwsgASIBIAJHDUpBPyEQDPUDCyABIgEgAkcNSEE8IRAM9AMLIAEiASACRw1BQTEhEAzzAwsgAC0ALkEBRg3rAwyHAgsgACABIgEgAhDAgICAAEEBRw3mASAAQgA3AyAM5wELIAAgASIBIAIQtICAgAAiEA3nASABIQEM9QILAkAgASIBIAJHDQBBBiEQDPADCyAAIAFBAWoiASACELuAgIAAIhAN6AEgASEBDDELIABCADcDIEESIRAM1QMLIAEiECACRw0rQR0hEAztAwsCQCABIgEgAkYNACABQQFqIQFBECEQDNQDC0EHIRAM7AMLIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN5QFBCCEQDOsDCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEUIRAM0gMLQQkhEAzqAwsgASEBIAApAyBQDeQBIAEhAQzyAgsCQCABIgEgAkcNAEELIRAM6QMLIAAgAUEBaiIBIAIQtoCAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3mASABIQEMDQsgACABIgEgAhC6gICAACIQDecBIAEhAQzwAgsCQCABIgEgAkcNAEEPIRAM5QMLIAEtAAAiEEE7Rg0IIBBBDUcN6AEgAUEBaiEBDO8CCyAAIAEiASACELqAgIAAIhAN6AEgASEBDPICCwNAAkAgAS0AAEHwtYCAAGotAAAiEEEBRg0AIBBBAkcN6wEgACgCBCEQIABBADYCBCAAIBAgAUEBaiIBELmAgIAAIhAN6gEgASEBDPQCCyABQQFqIgEgAkcNAAtBEiEQDOIDCyAAIAEiASACELqAgIAAIhAN6QEgASEBDAoLIAEiASACRw0GQRshEAzgAwsCQCABIgEgAkcNAEEWIRAM4AMLIABBioCAgAA2AgggACABNgIEIAAgASACELiAgIAAIhAN6gEgASEBQSAhEAzGAwsCQCABIgEgAkYNAANAAkAgAS0AAEHwt4CAAGotAAAiEEECRg0AAkAgEEF/ag4E5QHsAQDrAewBCyABQQFqIQFBCCEQDMgDCyABQQFqIgEgAkcNAAtBFSEQDN8DC0EVIRAM3gMLA0ACQCABLQAAQfC5gIAAai0AACIQQQJGDQAgEEF/ag4E3gHsAeAB6wHsAQsgAUEBaiIBIAJHDQALQRghEAzdAwsCQCABIgEgAkYNACAAQYuAgIAANgIIIAAgATYCBCABIQFBByEQDMQDC0EZIRAM3AMLIAFBAWohAQwCCwJAIAEiFCACRw0AQRohEAzbAwsgFCEBAkAgFC0AAEFzag4U3QLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gIA7gILQQAhECAAQQA2AhwgAEGvi4CAADYCECAAQQI2AgwgACAUQQFqNgIUDNoDCwJAIAEtAAAiEEE7Rg0AIBBBDUcN6AEgAUEBaiEBDOUCCyABQQFqIQELQSIhEAy/AwsCQCABIhAgAkcNAEEcIRAM2AMLQgAhESAQIQEgEC0AAEFQag435wHmAQECAwQFBgcIAAAAAAAAAAkKCwwNDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWohAQwXC0EqIRAMtQMLAkAgASIQIAJHDQBBKyEQDLUDCwJAIBAtAAAiAUEJRg0AIAFBIEcN1QELIAAtACxBCEYN0wEgECEBDJEDCwJAIAEiASACRw0AQSwhEAy0AwsgAS0AAEEKRw3VASABQQFqIQEMyQILIAEiDiACRw3VAUEvIRAMsgMLA0ACQCABLQAAIhBBIEYNAAJAIBBBdmoOBADcAdwBANoBCyABIQEM4AELIAFBAWoiASACRw0AC0ExIRAMsQMLQTIhECABIhQgAkYNsAMgAiAUayAAKAIAIgFqIRUgFCABa0EDaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfC7gIAAai0AAEcNAQJAIAFBA0cNAEEGIQEMlgMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLEDCyAAQQA2AgAgFCEBDNkBC0EzIRAgASIUIAJGDa8DIAIgFGsgACgCACIBaiEVIBQgAWtBCGohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUH0u4CAAGotAABHDQECQCABQQhHDQBBBSEBDJUDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAywAwsgAEEANgIAIBQhAQzYAQtBNCEQIAEiFCACRg2uAyACIBRrIAAoAgAiAWohFSAUIAFrQQVqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw0BAkAgAUEFRw0AQQchAQyUAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMrwMLIABBADYCACAUIQEM1wELAkAgASIBIAJGDQADQAJAIAEtAABBgL6AgABqLQAAIhBBAUYNACAQQQJGDQogASEBDN0BCyABQQFqIgEgAkcNAAtBMCEQDK4DC0EwIRAMrQMLAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AIBBBdmoOBNkB2gHaAdkB2gELIAFBAWoiASACRw0AC0E4IRAMrQMLQTghEAysAwsDQAJAIAEtAAAiEEEgRg0AIBBBCUcNAwsgAUEBaiIBIAJHDQALQTwhEAyrAwsDQAJAIAEtAAAiEEEgRg0AAkACQCAQQXZqDgTaAQEB2gEACyAQQSxGDdsBCyABIQEMBAsgAUEBaiIBIAJHDQALQT8hEAyqAwsgASEBDNsBC0HAACEQIAEiFCACRg2oAyACIBRrIAAoAgAiAWohFiAUIAFrQQZqIRcCQANAIBQtAABBIHIgAUGAwICAAGotAABHDQEgAUEGRg2OAyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAypAwsgAEEANgIAIBQhAQtBNiEQDI4DCwJAIAEiDyACRw0AQcEAIRAMpwMLIABBjICAgAA2AgggACAPNgIEIA8hASAALQAsQX9qDgTNAdUB1wHZAYcDCyABQQFqIQEMzAELAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgciAQIBBBv39qQf8BcUEaSRtB/wFxIhBBCUYNACAQQSBGDQACQAJAAkACQCAQQZ1/ag4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIRAMkQMLIAFBAWohAUEyIRAMkAMLIAFBAWohAUEzIRAMjwMLIAEhAQzQAQsgAUEBaiIBIAJHDQALQTUhEAylAwtBNSEQDKQDCwJAIAEiASACRg0AA0ACQCABLQAAQYC8gIAAai0AAEEBRg0AIAEhAQzTAQsgAUEBaiIBIAJHDQALQT0hEAykAwtBPSEQDKMDCyAAIAEiASACELCAgIAAIhAN1gEgASEBDAELIBBBAWohAQtBPCEQDIcDCwJAIAEiASACRw0AQcIAIRAMoAMLAkADQAJAIAEtAABBd2oOGAAC/gL+AoQD/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4CAP4CCyABQQFqIgEgAkcNAAtBwgAhEAygAwsgAUEBaiEBIAAtAC1BAXFFDb0BIAEhAQtBLCEQDIUDCyABIgEgAkcN0wFBxAAhEAydAwsDQAJAIAEtAABBkMCAgABqLQAAQQFGDQAgASEBDLcCCyABQQFqIgEgAkcNAAtBxQAhEAycAwsgDS0AACIQQSBGDbMBIBBBOkcNgQMgACgCBCEBIABBADYCBCAAIAEgDRCvgICAACIBDdABIA1BAWohAQyzAgtBxwAhECABIg0gAkYNmgMgAiANayAAKAIAIgFqIRYgDSABa0EFaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGQwoCAAGotAABHDYADIAFBBUYN9AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmgMLQcgAIRAgASINIAJGDZkDIAIgDWsgACgCACIBaiEWIA0gAWtBCWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBlsKAgABqLQAARw3/AgJAIAFBCUcNAEECIQEM9QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJkDCwJAIAEiDSACRw0AQckAIRAMmQMLAkACQCANLQAAIgFBIHIgASABQb9/akH/AXFBGkkbQf8BcUGSf2oOBwCAA4ADgAOAA4ADAYADCyANQQFqIQFBPiEQDIADCyANQQFqIQFBPyEQDP8CC0HKACEQIAEiDSACRg2XAyACIA1rIAAoAgAiAWohFiANIAFrQQFqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaDCgIAAai0AAEcN/QIgAUEBRg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyXAwtBywAhECABIg0gAkYNlgMgAiANayAAKAIAIgFqIRYgDSABa0EOaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGiwoCAAGotAABHDfwCIAFBDkYN8AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlgMLQcwAIRAgASINIAJGDZUDIAIgDWsgACgCACIBaiEWIA0gAWtBD2ohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBwMKAgABqLQAARw37AgJAIAFBD0cNAEEDIQEM8QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJUDC0HNACEQIAEiDSACRg2UAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQdDCgIAAai0AAEcN+gICQCABQQVHDQBBBCEBDPACCyABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyUAwsCQCABIg0gAkcNAEHOACEQDJQDCwJAAkACQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZ1/ag4TAP0C/QL9Av0C/QL9Av0C/QL9Av0C/QL9AgH9Av0C/QICA/0CCyANQQFqIQFBwQAhEAz9AgsgDUEBaiEBQcIAIRAM/AILIA1BAWohAUHDACEQDPsCCyANQQFqIQFBxAAhEAz6AgsCQCABIgEgAkYNACAAQY2AgIAANgIIIAAgATYCBCABIQFBxQAhEAz6AgtBzwAhEAySAwsgECEBAkACQCAQLQAAQXZqDgQBqAKoAgCoAgsgEEEBaiEBC0EnIRAM+AILAkAgASIBIAJHDQBB0QAhEAyRAwsCQCABLQAAQSBGDQAgASEBDI0BCyABQQFqIQEgAC0ALUEBcUUNxwEgASEBDIwBCyABIhcgAkcNyAFB0gAhEAyPAwtB0wAhECABIhQgAkYNjgMgAiAUayAAKAIAIgFqIRYgFCABa0EBaiEXA0AgFC0AACABQdbCgIAAai0AAEcNzAEgAUEBRg3HASABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAyOAwsCQCABIgEgAkcNAEHVACEQDI4DCyABLQAAQQpHDcwBIAFBAWohAQzHAQsCQCABIgEgAkcNAEHWACEQDI0DCwJAAkAgAS0AAEF2ag4EAM0BzQEBzQELIAFBAWohAQzHAQsgAUEBaiEBQcoAIRAM8wILIAAgASIBIAIQroCAgAAiEA3LASABIQFBzQAhEAzyAgsgAC0AKUEiRg2FAwymAgsCQCABIgEgAkcNAEHbACEQDIoDC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgAS0AAEFQag4K1AHTAQABAgMEBQYI1QELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMzAELQQkhEEEBIRRBACEXQQAhFgzLAQsCQCABIgEgAkcNAEHdACEQDIkDCyABLQAAQS5HDcwBIAFBAWohAQymAgsgASIBIAJHDcwBQd8AIRAMhwMLAkAgASIBIAJGDQAgAEGOgICAADYCCCAAIAE2AgQgASEBQdAAIRAM7gILQeAAIRAMhgMLQeEAIRAgASIBIAJGDYUDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHiwoCAAGotAABHDc0BIBRBA0YNzAEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhQMLQeIAIRAgASIBIAJGDYQDIAIgAWsgACgCACIUaiEWIAEgFGtBAmohFwNAIAEtAAAgFEHmwoCAAGotAABHDcwBIBRBAkYNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhAMLQeMAIRAgASIBIAJGDYMDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHpwoCAAGotAABHDcsBIBRBA0YNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMgwMLAkAgASIBIAJHDQBB5QAhEAyDAwsgACABQQFqIgEgAhCogICAACIQDc0BIAEhAUHWACEQDOkCCwJAIAEiASACRg0AA0ACQCABLQAAIhBBIEYNAAJAAkACQCAQQbh/ag4LAAHPAc8BzwHPAc8BzwHPAc8BAs8BCyABQQFqIQFB0gAhEAztAgsgAUEBaiEBQdMAIRAM7AILIAFBAWohAUHUACEQDOsCCyABQQFqIgEgAkcNAAtB5AAhEAyCAwtB5AAhEAyBAwsDQAJAIAEtAABB8MKAgABqLQAAIhBBAUYNACAQQX5qDgPPAdAB0QHSAQsgAUEBaiIBIAJHDQALQeYAIRAMgAMLAkAgASIBIAJGDQAgAUEBaiEBDAMLQecAIRAM/wILA0ACQCABLQAAQfDEgIAAai0AACIQQQFGDQACQCAQQX5qDgTSAdMB1AEA1QELIAEhAUHXACEQDOcCCyABQQFqIgEgAkcNAAtB6AAhEAz+AgsCQCABIgEgAkcNAEHpACEQDP4CCwJAIAEtAAAiEEF2ag4augHVAdUBvAHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHKAdUB1QEA0wELIAFBAWohAQtBBiEQDOMCCwNAAkAgAS0AAEHwxoCAAGotAABBAUYNACABIQEMngILIAFBAWoiASACRw0AC0HqACEQDPsCCwJAIAEiASACRg0AIAFBAWohAQwDC0HrACEQDPoCCwJAIAEiASACRw0AQewAIRAM+gILIAFBAWohAQwBCwJAIAEiASACRw0AQe0AIRAM+QILIAFBAWohAQtBBCEQDN4CCwJAIAEiFCACRw0AQe4AIRAM9wILIBQhAQJAAkACQCAULQAAQfDIgIAAai0AAEF/ag4H1AHVAdYBAJwCAQLXAQsgFEEBaiEBDAoLIBRBAWohAQzNAQtBACEQIABBADYCHCAAQZuSgIAANgIQIABBBzYCDCAAIBRBAWo2AhQM9gILAkADQAJAIAEtAABB8MiAgABqLQAAIhBBBEYNAAJAAkAgEEF/ag4H0gHTAdQB2QEABAHZAQsgASEBQdoAIRAM4AILIAFBAWohAUHcACEQDN8CCyABQQFqIgEgAkcNAAtB7wAhEAz2AgsgAUEBaiEBDMsBCwJAIAEiFCACRw0AQfAAIRAM9QILIBQtAABBL0cN1AEgFEEBaiEBDAYLAkAgASIUIAJHDQBB8QAhEAz0AgsCQCAULQAAIgFBL0cNACAUQQFqIQFB3QAhEAzbAgsgAUF2aiIEQRZLDdMBQQEgBHRBiYCAAnFFDdMBDMoCCwJAIAEiASACRg0AIAFBAWohAUHeACEQDNoCC0HyACEQDPICCwJAIAEiFCACRw0AQfQAIRAM8gILIBQhAQJAIBQtAABB8MyAgABqLQAAQX9qDgPJApQCANQBC0HhACEQDNgCCwJAIAEiFCACRg0AA0ACQCAULQAAQfDKgIAAai0AACIBQQNGDQACQCABQX9qDgLLAgDVAQsgFCEBQd8AIRAM2gILIBRBAWoiFCACRw0AC0HzACEQDPECC0HzACEQDPACCwJAIAEiASACRg0AIABBj4CAgAA2AgggACABNgIEIAEhAUHgACEQDNcCC0H1ACEQDO8CCwJAIAEiASACRw0AQfYAIRAM7wILIABBj4CAgAA2AgggACABNgIEIAEhAQtBAyEQDNQCCwNAIAEtAABBIEcNwwIgAUEBaiIBIAJHDQALQfcAIRAM7AILAkAgASIBIAJHDQBB+AAhEAzsAgsgAS0AAEEgRw3OASABQQFqIQEM7wELIAAgASIBIAIQrICAgAAiEA3OASABIQEMjgILAkAgASIEIAJHDQBB+gAhEAzqAgsgBC0AAEHMAEcN0QEgBEEBaiEBQRMhEAzPAQsCQCABIgQgAkcNAEH7ACEQDOkCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRADQCAELQAAIAFB8M6AgABqLQAARw3QASABQQVGDc4BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQfsAIRAM6AILAkAgASIEIAJHDQBB/AAhEAzoAgsCQAJAIAQtAABBvX9qDgwA0QHRAdEB0QHRAdEB0QHRAdEB0QEB0QELIARBAWohAUHmACEQDM8CCyAEQQFqIQFB5wAhEAzOAgsCQCABIgQgAkcNAEH9ACEQDOcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDc8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH9ACEQDOcCCyAAQQA2AgAgEEEBaiEBQRAhEAzMAQsCQCABIgQgAkcNAEH+ACEQDOYCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUH2zoCAAGotAABHDc4BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH+ACEQDOYCCyAAQQA2AgAgEEEBaiEBQRYhEAzLAQsCQCABIgQgAkcNAEH/ACEQDOUCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUH8zoCAAGotAABHDc0BIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH/ACEQDOUCCyAAQQA2AgAgEEEBaiEBQQUhEAzKAQsCQCABIgQgAkcNAEGAASEQDOQCCyAELQAAQdkARw3LASAEQQFqIQFBCCEQDMkBCwJAIAEiBCACRw0AQYEBIRAM4wILAkACQCAELQAAQbJ/ag4DAMwBAcwBCyAEQQFqIQFB6wAhEAzKAgsgBEEBaiEBQewAIRAMyQILAkAgASIEIAJHDQBBggEhEAziAgsCQAJAIAQtAABBuH9qDggAywHLAcsBywHLAcsBAcsBCyAEQQFqIQFB6gAhEAzJAgsgBEEBaiEBQe0AIRAMyAILAkAgASIEIAJHDQBBgwEhEAzhAgsgAiAEayAAKAIAIgFqIRAgBCABa0ECaiEUAkADQCAELQAAIAFBgM+AgABqLQAARw3JASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBA2AgBBgwEhEAzhAgtBACEQIABBADYCACAUQQFqIQEMxgELAkAgASIEIAJHDQBBhAEhEAzgAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBg8+AgABqLQAARw3IASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhAEhEAzgAgsgAEEANgIAIBBBAWohAUEjIRAMxQELAkAgASIEIAJHDQBBhQEhEAzfAgsCQAJAIAQtAABBtH9qDggAyAHIAcgByAHIAcgBAcgBCyAEQQFqIQFB7wAhEAzGAgsgBEEBaiEBQfAAIRAMxQILAkAgASIEIAJHDQBBhgEhEAzeAgsgBC0AAEHFAEcNxQEgBEEBaiEBDIMCCwJAIAEiBCACRw0AQYcBIRAM3QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQYjPgIAAai0AAEcNxQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYcBIRAM3QILIABBADYCACAQQQFqIQFBLSEQDMIBCwJAIAEiBCACRw0AQYgBIRAM3AILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNxAEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYgBIRAM3AILIABBADYCACAQQQFqIQFBKSEQDMEBCwJAIAEiASACRw0AQYkBIRAM2wILQQEhECABLQAAQd8ARw3AASABQQFqIQEMgQILAkAgASIEIAJHDQBBigEhEAzaAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQA0AgBC0AACABQYzPgIAAai0AAEcNwQEgAUEBRg2vAiABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGKASEQDNkCCwJAIAEiBCACRw0AQYsBIRAM2QILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQY7PgIAAai0AAEcNwQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYsBIRAM2QILIABBADYCACAQQQFqIQFBAiEQDL4BCwJAIAEiBCACRw0AQYwBIRAM2AILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNwAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYwBIRAM2AILIABBADYCACAQQQFqIQFBHyEQDL0BCwJAIAEiBCACRw0AQY0BIRAM1wILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNvwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY0BIRAM1wILIABBADYCACAQQQFqIQFBCSEQDLwBCwJAIAEiBCACRw0AQY4BIRAM1gILAkACQCAELQAAQbd/ag4HAL8BvwG/Ab8BvwEBvwELIARBAWohAUH4ACEQDL0CCyAEQQFqIQFB+QAhEAy8AgsCQCABIgQgAkcNAEGPASEQDNUCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGRz4CAAGotAABHDb0BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGPASEQDNUCCyAAQQA2AgAgEEEBaiEBQRghEAy6AQsCQCABIgQgAkcNAEGQASEQDNQCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUGXz4CAAGotAABHDbwBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGQASEQDNQCCyAAQQA2AgAgEEEBaiEBQRchEAy5AQsCQCABIgQgAkcNAEGRASEQDNMCCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUGaz4CAAGotAABHDbsBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGRASEQDNMCCyAAQQA2AgAgEEEBaiEBQRUhEAy4AQsCQCABIgQgAkcNAEGSASEQDNICCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGhz4CAAGotAABHDboBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGSASEQDNICCyAAQQA2AgAgEEEBaiEBQR4hEAy3AQsCQCABIgQgAkcNAEGTASEQDNECCyAELQAAQcwARw24ASAEQQFqIQFBCiEQDLYBCwJAIAQgAkcNAEGUASEQDNACCwJAAkAgBC0AAEG/f2oODwC5AbkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AQG5AQsgBEEBaiEBQf4AIRAMtwILIARBAWohAUH/ACEQDLYCCwJAIAQgAkcNAEGVASEQDM8CCwJAAkAgBC0AAEG/f2oOAwC4AQG4AQsgBEEBaiEBQf0AIRAMtgILIARBAWohBEGAASEQDLUCCwJAIAQgAkcNAEGWASEQDM4CCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUGnz4CAAGotAABHDbYBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGWASEQDM4CCyAAQQA2AgAgEEEBaiEBQQshEAyzAQsCQCAEIAJHDQBBlwEhEAzNAgsCQAJAAkACQCAELQAAQVNqDiMAuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AQG4AbgBuAG4AbgBArgBuAG4AQO4AQsgBEEBaiEBQfsAIRAMtgILIARBAWohAUH8ACEQDLUCCyAEQQFqIQRBgQEhEAy0AgsgBEEBaiEEQYIBIRAMswILAkAgBCACRw0AQZgBIRAMzAILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQanPgIAAai0AAEcNtAEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZgBIRAMzAILIABBADYCACAQQQFqIQFBGSEQDLEBCwJAIAQgAkcNAEGZASEQDMsCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGuz4CAAGotAABHDbMBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGZASEQDMsCCyAAQQA2AgAgEEEBaiEBQQYhEAywAQsCQCAEIAJHDQBBmgEhEAzKAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBtM+AgABqLQAARw2yASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmgEhEAzKAgsgAEEANgIAIBBBAWohAUEcIRAMrwELAkAgBCACRw0AQZsBIRAMyQILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbbPgIAAai0AAEcNsQEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZsBIRAMyQILIABBADYCACAQQQFqIQFBJyEQDK4BCwJAIAQgAkcNAEGcASEQDMgCCwJAAkAgBC0AAEGsf2oOAgABsQELIARBAWohBEGGASEQDK8CCyAEQQFqIQRBhwEhEAyuAgsCQCAEIAJHDQBBnQEhEAzHAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBuM+AgABqLQAARw2vASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBnQEhEAzHAgsgAEEANgIAIBBBAWohAUEmIRAMrAELAkAgBCACRw0AQZ4BIRAMxgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbrPgIAAai0AAEcNrgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ4BIRAMxgILIABBADYCACAQQQFqIQFBAyEQDKsBCwJAIAQgAkcNAEGfASEQDMUCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDa0BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGfASEQDMUCCyAAQQA2AgAgEEEBaiEBQQwhEAyqAQsCQCAEIAJHDQBBoAEhEAzEAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBvM+AgABqLQAARw2sASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBoAEhEAzEAgsgAEEANgIAIBBBAWohAUENIRAMqQELAkAgBCACRw0AQaEBIRAMwwILAkACQCAELQAAQbp/ag4LAKwBrAGsAawBrAGsAawBrAGsAQGsAQsgBEEBaiEEQYsBIRAMqgILIARBAWohBEGMASEQDKkCCwJAIAQgAkcNAEGiASEQDMICCyAELQAAQdAARw2pASAEQQFqIQQM6QELAkAgBCACRw0AQaMBIRAMwQILAkACQCAELQAAQbd/ag4HAaoBqgGqAaoBqgEAqgELIARBAWohBEGOASEQDKgCCyAEQQFqIQFBIiEQDKYBCwJAIAQgAkcNAEGkASEQDMACCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHAz4CAAGotAABHDagBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGkASEQDMACCyAAQQA2AgAgEEEBaiEBQR0hEAylAQsCQCAEIAJHDQBBpQEhEAy/AgsCQAJAIAQtAABBrn9qDgMAqAEBqAELIARBAWohBEGQASEQDKYCCyAEQQFqIQFBBCEQDKQBCwJAIAQgAkcNAEGmASEQDL4CCwJAAkACQAJAAkAgBC0AAEG/f2oOFQCqAaoBqgGqAaoBqgGqAaoBqgGqAQGqAaoBAqoBqgEDqgGqAQSqAQsgBEEBaiEEQYgBIRAMqAILIARBAWohBEGJASEQDKcCCyAEQQFqIQRBigEhEAymAgsgBEEBaiEEQY8BIRAMpQILIARBAWohBEGRASEQDKQCCwJAIAQgAkcNAEGnASEQDL0CCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDaUBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGnASEQDL0CCyAAQQA2AgAgEEEBaiEBQREhEAyiAQsCQCAEIAJHDQBBqAEhEAy8AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBws+AgABqLQAARw2kASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqAEhEAy8AgsgAEEANgIAIBBBAWohAUEsIRAMoQELAkAgBCACRw0AQakBIRAMuwILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQcXPgIAAai0AAEcNowEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQakBIRAMuwILIABBADYCACAQQQFqIQFBKyEQDKABCwJAIAQgAkcNAEGqASEQDLoCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHKz4CAAGotAABHDaIBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGqASEQDLoCCyAAQQA2AgAgEEEBaiEBQRQhEAyfAQsCQCAEIAJHDQBBqwEhEAy5AgsCQAJAAkACQCAELQAAQb5/ag4PAAECpAGkAaQBpAGkAaQBpAGkAaQBpAGkAQOkAQsgBEEBaiEEQZMBIRAMogILIARBAWohBEGUASEQDKECCyAEQQFqIQRBlQEhEAygAgsgBEEBaiEEQZYBIRAMnwILAkAgBCACRw0AQawBIRAMuAILIAQtAABBxQBHDZ8BIARBAWohBAzgAQsCQCAEIAJHDQBBrQEhEAy3AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBzc+AgABqLQAARw2fASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrQEhEAy3AgsgAEEANgIAIBBBAWohAUEOIRAMnAELAkAgBCACRw0AQa4BIRAMtgILIAQtAABB0ABHDZ0BIARBAWohAUElIRAMmwELAkAgBCACRw0AQa8BIRAMtQILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNnQEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQa8BIRAMtQILIABBADYCACAQQQFqIQFBKiEQDJoBCwJAIAQgAkcNAEGwASEQDLQCCwJAAkAgBC0AAEGrf2oOCwCdAZ0BnQGdAZ0BnQGdAZ0BnQEBnQELIARBAWohBEGaASEQDJsCCyAEQQFqIQRBmwEhEAyaAgsCQCAEIAJHDQBBsQEhEAyzAgsCQAJAIAQtAABBv39qDhQAnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBAZwBCyAEQQFqIQRBmQEhEAyaAgsgBEEBaiEEQZwBIRAMmQILAkAgBCACRw0AQbIBIRAMsgILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQdnPgIAAai0AAEcNmgEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbIBIRAMsgILIABBADYCACAQQQFqIQFBISEQDJcBCwJAIAQgAkcNAEGzASEQDLECCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUHdz4CAAGotAABHDZkBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGzASEQDLECCyAAQQA2AgAgEEEBaiEBQRohEAyWAQsCQCAEIAJHDQBBtAEhEAywAgsCQAJAAkAgBC0AAEG7f2oOEQCaAZoBmgGaAZoBmgGaAZoBmgEBmgGaAZoBmgGaAQKaAQsgBEEBaiEEQZ0BIRAMmAILIARBAWohBEGeASEQDJcCCyAEQQFqIQRBnwEhEAyWAgsCQCAEIAJHDQBBtQEhEAyvAgsgAiAEayAAKAIAIgFqIRQgBCABa0EFaiEQAkADQCAELQAAIAFB5M+AgABqLQAARw2XASABQQVGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtQEhEAyvAgsgAEEANgIAIBBBAWohAUEoIRAMlAELAkAgBCACRw0AQbYBIRAMrgILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQerPgIAAai0AAEcNlgEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbYBIRAMrgILIABBADYCACAQQQFqIQFBByEQDJMBCwJAIAQgAkcNAEG3ASEQDK0CCwJAAkAgBC0AAEG7f2oODgCWAZYBlgGWAZYBlgGWAZYBlgGWAZYBlgEBlgELIARBAWohBEGhASEQDJQCCyAEQQFqIQRBogEhEAyTAgsCQCAEIAJHDQBBuAEhEAysAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB7c+AgABqLQAARw2UASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuAEhEAysAgsgAEEANgIAIBBBAWohAUESIRAMkQELAkAgBCACRw0AQbkBIRAMqwILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNkwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbkBIRAMqwILIABBADYCACAQQQFqIQFBICEQDJABCwJAIAQgAkcNAEG6ASEQDKoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHyz4CAAGotAABHDZIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG6ASEQDKoCCyAAQQA2AgAgEEEBaiEBQQ8hEAyPAQsCQCAEIAJHDQBBuwEhEAypAgsCQAJAIAQtAABBt39qDgcAkgGSAZIBkgGSAQGSAQsgBEEBaiEEQaUBIRAMkAILIARBAWohBEGmASEQDI8CCwJAIAQgAkcNAEG8ASEQDKgCCyACIARrIAAoAgAiAWohFCAEIAFrQQdqIRACQANAIAQtAAAgAUH0z4CAAGotAABHDZABIAFBB0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG8ASEQDKgCCyAAQQA2AgAgEEEBaiEBQRshEAyNAQsCQCAEIAJHDQBBvQEhEAynAgsCQAJAAkAgBC0AAEG+f2oOEgCRAZEBkQGRAZEBkQGRAZEBkQEBkQGRAZEBkQGRAZEBApEBCyAEQQFqIQRBpAEhEAyPAgsgBEEBaiEEQacBIRAMjgILIARBAWohBEGoASEQDI0CCwJAIAQgAkcNAEG+ASEQDKYCCyAELQAAQc4ARw2NASAEQQFqIQQMzwELAkAgBCACRw0AQb8BIRAMpQILAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgBC0AAEG/f2oOFQABAgOcAQQFBpwBnAGcAQcICQoLnAEMDQ4PnAELIARBAWohAUHoACEQDJoCCyAEQQFqIQFB6QAhEAyZAgsgBEEBaiEBQe4AIRAMmAILIARBAWohAUHyACEQDJcCCyAEQQFqIQFB8wAhEAyWAgsgBEEBaiEBQfYAIRAMlQILIARBAWohAUH3ACEQDJQCCyAEQQFqIQFB+gAhEAyTAgsgBEEBaiEEQYMBIRAMkgILIARBAWohBEGEASEQDJECCyAEQQFqIQRBhQEhEAyQAgsgBEEBaiEEQZIBIRAMjwILIARBAWohBEGYASEQDI4CCyAEQQFqIQRBoAEhEAyNAgsgBEEBaiEEQaMBIRAMjAILIARBAWohBEGqASEQDIsCCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEGrASEQDIsCC0HAASEQDKMCCyAAIAUgAhCqgICAACIBDYsBIAUhAQxcCwJAIAYgAkYNACAGQQFqIQUMjQELQcIBIRAMoQILA0ACQCAQLQAAQXZqDgSMAQAAjwEACyAQQQFqIhAgAkcNAAtBwwEhEAygAgsCQCAHIAJGDQAgAEGRgICAADYCCCAAIAc2AgQgByEBQQEhEAyHAgtBxAEhEAyfAgsCQCAHIAJHDQBBxQEhEAyfAgsCQAJAIActAABBdmoOBAHOAc4BAM4BCyAHQQFqIQYMjQELIAdBAWohBQyJAQsCQCAHIAJHDQBBxgEhEAyeAgsCQAJAIActAABBdmoOFwGPAY8BAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAQCPAQsgB0EBaiEHC0GwASEQDIQCCwJAIAggAkcNAEHIASEQDJ0CCyAILQAAQSBHDY0BIABBADsBMiAIQQFqIQFBswEhEAyDAgsgASEXAkADQCAXIgcgAkYNASAHLQAAQVBqQf8BcSIQQQpPDcwBAkAgAC8BMiIUQZkzSw0AIAAgFEEKbCIUOwEyIBBB//8DcyAUQf7/A3FJDQAgB0EBaiEXIAAgFCAQaiIQOwEyIBBB//8DcUHoB0kNAQsLQQAhECAAQQA2AhwgAEHBiYCAADYCECAAQQ02AgwgACAHQQFqNgIUDJwCC0HHASEQDJsCCyAAIAggAhCugICAACIQRQ3KASAQQRVHDYwBIABByAE2AhwgACAINgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAyaAgsCQCAJIAJHDQBBzAEhEAyaAgtBACEUQQEhF0EBIRZBACEQAkACQAJAAkACQAJAAkACQAJAIAktAABBUGoOCpYBlQEAAQIDBAUGCJcBC0ECIRAMBgtBAyEQDAULQQQhEAwEC0EFIRAMAwtBBiEQDAILQQchEAwBC0EIIRALQQAhF0EAIRZBACEUDI4BC0EJIRBBASEUQQAhF0EAIRYMjQELAkAgCiACRw0AQc4BIRAMmQILIAotAABBLkcNjgEgCkEBaiEJDMoBCyALIAJHDY4BQdABIRAMlwILAkAgCyACRg0AIABBjoCAgAA2AgggACALNgIEQbcBIRAM/gELQdEBIRAMlgILAkAgBCACRw0AQdIBIRAMlgILIAIgBGsgACgCACIQaiEUIAQgEGtBBGohCwNAIAQtAAAgEEH8z4CAAGotAABHDY4BIBBBBEYN6QEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB0gEhEAyVAgsgACAMIAIQrICAgAAiAQ2NASAMIQEMuAELAkAgBCACRw0AQdQBIRAMlAILIAIgBGsgACgCACIQaiEUIAQgEGtBAWohDANAIAQtAAAgEEGB0ICAAGotAABHDY8BIBBBAUYNjgEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB1AEhEAyTAgsCQCAEIAJHDQBB1gEhEAyTAgsgAiAEayAAKAIAIhBqIRQgBCAQa0ECaiELA0AgBC0AACAQQYPQgIAAai0AAEcNjgEgEEECRg2QASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHWASEQDJICCwJAIAQgAkcNAEHXASEQDJICCwJAAkAgBC0AAEG7f2oOEACPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAY8BCyAEQQFqIQRBuwEhEAz5AQsgBEEBaiEEQbwBIRAM+AELAkAgBCACRw0AQdgBIRAMkQILIAQtAABByABHDYwBIARBAWohBAzEAQsCQCAEIAJGDQAgAEGQgICAADYCCCAAIAQ2AgRBvgEhEAz3AQtB2QEhEAyPAgsCQCAEIAJHDQBB2gEhEAyPAgsgBC0AAEHIAEYNwwEgAEEBOgAoDLkBCyAAQQI6AC8gACAEIAIQpoCAgAAiEA2NAUHCASEQDPQBCyAALQAoQX9qDgK3AbkBuAELA0ACQCAELQAAQXZqDgQAjgGOAQCOAQsgBEEBaiIEIAJHDQALQd0BIRAMiwILIABBADoALyAALQAtQQRxRQ2EAgsgAEEAOgAvIABBAToANCABIQEMjAELIBBBFUYN2gEgAEEANgIcIAAgATYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMiAILAkAgACAQIAIQtICAgAAiBA0AIBAhAQyBAgsCQCAEQRVHDQAgAEEDNgIcIAAgEDYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMiAILIABBADYCHCAAIBA2AhQgAEGnjoCAADYCECAAQRI2AgxBACEQDIcCCyAQQRVGDdYBIABBADYCHCAAIAE2AhQgAEHajYCAADYCECAAQRQ2AgxBACEQDIYCCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNjQEgAEEHNgIcIAAgEDYCFCAAIBQ2AgxBACEQDIUCCyAAIAAvATBBgAFyOwEwIAEhAQtBKiEQDOoBCyAQQRVGDdEBIABBADYCHCAAIAE2AhQgAEGDjICAADYCECAAQRM2AgxBACEQDIICCyAQQRVGDc8BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDIECCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyNAQsgAEEMNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDIACCyAQQRVGDcwBIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDP8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyMAQsgAEENNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDP4BCyAQQRVGDckBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDP0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyLAQsgAEEONgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPwBCyAAQQA2AhwgACABNgIUIABBwJWAgAA2AhAgAEECNgIMQQAhEAz7AQsgEEEVRg3FASAAQQA2AhwgACABNgIUIABBxoyAgAA2AhAgAEEjNgIMQQAhEAz6AQsgAEEQNgIcIAAgATYCFCAAIBA2AgxBACEQDPkBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQzxAQsgAEERNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPgBCyAQQRVGDcEBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPcBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyIAQsgAEETNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPYBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQztAQsgAEEUNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPUBCyAQQRVGDb0BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDPQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyGAQsgAEEWNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPMBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQt4CAgAAiBA0AIAFBAWohAQzpAQsgAEEXNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPIBCyAAQQA2AhwgACABNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzxAQtCASERCyAQQQFqIQECQCAAKQMgIhJC//////////8PVg0AIAAgEkIEhiARhDcDICABIQEMhAELIABBADYCHCAAIAE2AhQgAEGtiYCAADYCECAAQQw2AgxBACEQDO8BCyAAQQA2AhwgACAQNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzuAQsgACgCBCEXIABBADYCBCAQIBGnaiIWIQEgACAXIBAgFiAUGyIQELWAgIAAIhRFDXMgAEEFNgIcIAAgEDYCFCAAIBQ2AgxBACEQDO0BCyAAQQA2AhwgACAQNgIUIABBqpyAgAA2AhAgAEEPNgIMQQAhEAzsAQsgACAQIAIQtICAgAAiAQ0BIBAhAQtBDiEQDNEBCwJAIAFBFUcNACAAQQI2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAzqAQsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAM6QELIAFBAWohEAJAIAAvATAiAUGAAXFFDQACQCAAIBAgAhC7gICAACIBDQAgECEBDHALIAFBFUcNugEgAEEFNgIcIAAgEDYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAM6QELAkAgAUGgBHFBoARHDQAgAC0ALUECcQ0AIABBADYCHCAAIBA2AhQgAEGWk4CAADYCECAAQQQ2AgxBACEQDOkBCyAAIBAgAhC9gICAABogECEBAkACQAJAAkACQCAAIBAgAhCzgICAAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIABBAToALgsgACAALwEwQcAAcjsBMCAQIQELQSYhEAzRAQsgAEEjNgIcIAAgEDYCFCAAQaWWgIAANgIQIABBFTYCDEEAIRAM6QELIABBADYCHCAAIBA2AhQgAEHVi4CAADYCECAAQRE2AgxBACEQDOgBCyAALQAtQQFxRQ0BQcMBIRAMzgELAkAgDSACRg0AA0ACQCANLQAAQSBGDQAgDSEBDMQBCyANQQFqIg0gAkcNAAtBJSEQDOcBC0ElIRAM5gELIAAoAgQhBCAAQQA2AgQgACAEIA0Qr4CAgAAiBEUNrQEgAEEmNgIcIAAgBDYCDCAAIA1BAWo2AhRBACEQDOUBCyAQQRVGDasBIABBADYCHCAAIAE2AhQgAEH9jYCAADYCECAAQR02AgxBACEQDOQBCyAAQSc2AhwgACABNgIUIAAgEDYCDEEAIRAM4wELIBAhAUEBIRQCQAJAAkACQAJAAkACQCAALQAsQX5qDgcGBQUDAQIABQsgACAALwEwQQhyOwEwDAMLQQIhFAwBC0EEIRQLIABBAToALCAAIAAvATAgFHI7ATALIBAhAQtBKyEQDMoBCyAAQQA2AhwgACAQNgIUIABBq5KAgAA2AhAgAEELNgIMQQAhEAziAQsgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDEEAIRAM4QELIABBADoALCAQIQEMvQELIBAhAUEBIRQCQAJAAkACQAJAIAAtACxBe2oOBAMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0EpIRAMxQELIABBADYCHCAAIAE2AhQgAEHwlICAADYCECAAQQM2AgxBACEQDN0BCwJAIA4tAABBDUcNACAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA5BAWohAQx1CyAAQSw2AhwgACABNgIMIAAgDkEBajYCFEEAIRAM3QELIAAtAC1BAXFFDQFBxAEhEAzDAQsCQCAOIAJHDQBBLSEQDNwBCwJAAkADQAJAIA4tAABBdmoOBAIAAAMACyAOQQFqIg4gAkcNAAtBLSEQDN0BCyAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA4hAQx0CyAAQSw2AhwgACAONgIUIAAgATYCDEEAIRAM3AELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHMLIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzbAQsgACgCBCEEIABBADYCBCAAIAQgDhCxgICAACIEDaABIA4hAQzOAQsgEEEsRw0BIAFBAWohEEEBIQECQAJAAkACQAJAIAAtACxBe2oOBAMBAgQACyAQIQEMBAtBAiEBDAELQQQhAQsgAEEBOgAsIAAgAC8BMCABcjsBMCAQIQEMAQsgACAALwEwQQhyOwEwIBAhAQtBOSEQDL8BCyAAQQA6ACwgASEBC0E0IRAMvQELIAAgAC8BMEEgcjsBMCABIQEMAgsgACgCBCEEIABBADYCBAJAIAAgBCABELGAgIAAIgQNACABIQEMxwELIABBNzYCHCAAIAE2AhQgACAENgIMQQAhEAzUAQsgAEEIOgAsIAEhAQtBMCEQDLkBCwJAIAAtAChBAUYNACABIQEMBAsgAC0ALUEIcUUNkwEgASEBDAMLIAAtADBBIHENlAFBxQEhEAy3AQsCQCAPIAJGDQACQANAAkAgDy0AAEFQaiIBQf8BcUEKSQ0AIA8hAUE1IRAMugELIAApAyAiEUKZs+bMmbPmzBlWDQEgACARQgp+IhE3AyAgESABrUL/AYMiEkJ/hVYNASAAIBEgEnw3AyAgD0EBaiIPIAJHDQALQTkhEAzRAQsgACgCBCECIABBADYCBCAAIAIgD0EBaiIEELGAgIAAIgINlQEgBCEBDMMBC0E5IRAMzwELAkAgAC8BMCIBQQhxRQ0AIAAtAChBAUcNACAALQAtQQhxRQ2QAQsgACABQff7A3FBgARyOwEwIA8hAQtBNyEQDLQBCyAAIAAvATBBEHI7ATAMqwELIBBBFUYNiwEgAEEANgIcIAAgATYCFCAAQfCOgIAANgIQIABBHDYCDEEAIRAMywELIABBwwA2AhwgACABNgIMIAAgDUEBajYCFEEAIRAMygELAkAgAS0AAEE6Rw0AIAAoAgQhECAAQQA2AgQCQCAAIBAgARCvgICAACIQDQAgAUEBaiEBDGMLIABBwwA2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMygELIABBADYCHCAAIAE2AhQgAEGxkYCAADYCECAAQQo2AgxBACEQDMkBCyAAQQA2AhwgACABNgIUIABBoJmAgAA2AhAgAEEeNgIMQQAhEAzIAQsgAEEANgIACyAAQYASOwEqIAAgF0EBaiIBIAIQqICAgAAiEA0BIAEhAQtBxwAhEAysAQsgEEEVRw2DASAAQdEANgIcIAAgATYCFCAAQeOXgIAANgIQIABBFTYCDEEAIRAMxAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDF4LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMwwELIABBADYCHCAAIBQ2AhQgAEHBqICAADYCECAAQQc2AgwgAEEANgIAQQAhEAzCAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAzBAQtBACEQIABBADYCHCAAIAE2AhQgAEGAkYCAADYCECAAQQk2AgwMwAELIBBBFUYNfSAAQQA2AhwgACABNgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAy/AQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgAUEBaiEBAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBAJAIAAgECABEK2AgIAAIhANACABIQEMXAsgAEHYADYCHCAAIAE2AhQgACAQNgIMQQAhEAy+AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMrQELIABB2QA2AhwgACABNgIUIAAgBDYCDEEAIRAMvQELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKsBCyAAQdoANgIcIAAgATYCFCAAIAQ2AgxBACEQDLwBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQypAQsgAEHcADYCHCAAIAE2AhQgACAENgIMQQAhEAy7AQsCQCABLQAAQVBqIhBB/wFxQQpPDQAgACAQOgAqIAFBAWohAUHPACEQDKIBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQynAQsgAEHeADYCHCAAIAE2AhQgACAENgIMQQAhEAy6AQsgAEEANgIAIBdBAWohAQJAIAAtAClBI08NACABIQEMWQsgAEEANgIcIAAgATYCFCAAQdOJgIAANgIQIABBCDYCDEEAIRAMuQELIABBADYCAAtBACEQIABBADYCHCAAIAE2AhQgAEGQs4CAADYCECAAQQg2AgwMtwELIABBADYCACAXQQFqIQECQCAALQApQSFHDQAgASEBDFYLIABBADYCHCAAIAE2AhQgAEGbioCAADYCECAAQQg2AgxBACEQDLYBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKSIQQV1qQQtPDQAgASEBDFULAkAgEEEGSw0AQQEgEHRBygBxRQ0AIAEhAQxVC0EAIRAgAEEANgIcIAAgATYCFCAAQfeJgIAANgIQIABBCDYCDAy1AQsgEEEVRg1xIABBADYCHCAAIAE2AhQgAEG5jYCAADYCECAAQRo2AgxBACEQDLQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxUCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIRAgAEEANgIEIAAgECABEKuAgIAAIhANVCABIQEMPgsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQfGbgIAANgIQIABBBjYCDAyXAQsgAUEVRg1QIABBADYCHCAAIAU2AhQgAEHwjICAADYCECAAQRs2AgxBACEQDJYBCyAAKAIEIQUgAEEANgIEIAAgBSAQEKmAgIAAIgUNASAQQQFqIQULQa0BIRAMewsgAEHBATYCHCAAIAU2AgwgACAQQQFqNgIUQQAhEAyTAQsgACgCBCEGIABBADYCBCAAIAYgEBCpgICAACIGDQEgEEEBaiEGC0GuASEQDHgLIABBwgE2AhwgACAGNgIMIAAgEEEBajYCFEEAIRAMkAELIABBADYCHCAAIAc2AhQgAEGXi4CAADYCECAAQQ02AgxBACEQDI8BCyAAQQA2AhwgACAINgIUIABB45CAgAA2AhAgAEEJNgIMQQAhEAyOAQsgAEEANgIcIAAgCDYCFCAAQZSNgIAANgIQIABBITYCDEEAIRAMjQELQQEhFkEAIRdBACEUQQEhEAsgACAQOgArIAlBAWohCAJAAkAgAC0ALUEQcQ0AAkACQAJAIAAtACoOAwEAAgQLIBZFDQMMAgsgFA0BDAILIBdFDQELIAAoAgQhECAAQQA2AgQgACAQIAgQrYCAgAAiEEUNPSAAQckBNgIcIAAgCDYCFCAAIBA2AgxBACEQDIwBCyAAKAIEIQQgAEEANgIEIAAgBCAIEK2AgIAAIgRFDXYgAEHKATYCHCAAIAg2AhQgACAENgIMQQAhEAyLAQsgACgCBCEEIABBADYCBCAAIAQgCRCtgICAACIERQ10IABBywE2AhwgACAJNgIUIAAgBDYCDEEAIRAMigELIAAoAgQhBCAAQQA2AgQgACAEIAoQrYCAgAAiBEUNciAAQc0BNgIcIAAgCjYCFCAAIAQ2AgxBACEQDIkBCwJAIAstAABBUGoiEEH/AXFBCk8NACAAIBA6ACogC0EBaiEKQbYBIRAMcAsgACgCBCEEIABBADYCBCAAIAQgCxCtgICAACIERQ1wIABBzwE2AhwgACALNgIUIAAgBDYCDEEAIRAMiAELIABBADYCHCAAIAQ2AhQgAEGQs4CAADYCECAAQQg2AgwgAEEANgIAQQAhEAyHAQsgAUEVRg0/IABBADYCHCAAIAw2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDIYBCyAAQYEEOwEoIAAoAgQhECAAQgA3AwAgACAQIAxBAWoiDBCrgICAACIQRQ04IABB0wE2AhwgACAMNgIUIAAgEDYCDEEAIRAMhQELIABBADYCAAtBACEQIABBADYCHCAAIAQ2AhQgAEHYm4CAADYCECAAQQg2AgwMgwELIAAoAgQhECAAQgA3AwAgACAQIAtBAWoiCxCrgICAACIQDQFBxgEhEAxpCyAAQQI6ACgMVQsgAEHVATYCHCAAIAs2AhQgACAQNgIMQQAhEAyAAQsgEEEVRg03IABBADYCHCAAIAQ2AhQgAEGkjICAADYCECAAQRA2AgxBACEQDH8LIAAtADRBAUcNNCAAIAQgAhC8gICAACIQRQ00IBBBFUcNNSAAQdwBNgIcIAAgBDYCFCAAQdWWgIAANgIQIABBFTYCDEEAIRAMfgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQMfQtBACEQDGMLQQIhEAxiC0ENIRAMYQtBDyEQDGALQSUhEAxfC0ETIRAMXgtBFSEQDF0LQRYhEAxcC0EXIRAMWwtBGCEQDFoLQRkhEAxZC0EaIRAMWAtBGyEQDFcLQRwhEAxWC0EdIRAMVQtBHyEQDFQLQSEhEAxTC0EjIRAMUgtBxgAhEAxRC0EuIRAMUAtBLyEQDE8LQTshEAxOC0E9IRAMTQtByAAhEAxMC0HJACEQDEsLQcsAIRAMSgtBzAAhEAxJC0HOACEQDEgLQdEAIRAMRwtB1QAhEAxGC0HYACEQDEULQdkAIRAMRAtB2wAhEAxDC0HkACEQDEILQeUAIRAMQQtB8QAhEAxAC0H0ACEQDD8LQY0BIRAMPgtBlwEhEAw9C0GpASEQDDwLQawBIRAMOwtBwAEhEAw6C0G5ASEQDDkLQa8BIRAMOAtBsQEhEAw3C0GyASEQDDYLQbQBIRAMNQtBtQEhEAw0C0G6ASEQDDMLQb0BIRAMMgtBvwEhEAwxC0HBASEQDDALIABBADYCHCAAIAQ2AhQgAEHpi4CAADYCECAAQR82AgxBACEQDEgLIABB2wE2AhwgACAENgIUIABB+paAgAA2AhAgAEEVNgIMQQAhEAxHCyAAQfgANgIcIAAgDDYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMRgsgAEHRADYCHCAAIAU2AhQgAEGwl4CAADYCECAAQRU2AgxBACEQDEULIABB+QA2AhwgACABNgIUIAAgEDYCDEEAIRAMRAsgAEH4ADYCHCAAIAE2AhQgAEHKmICAADYCECAAQRU2AgxBACEQDEMLIABB5AA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAxCCyAAQdcANgIcIAAgATYCFCAAQcmXgIAANgIQIABBFTYCDEEAIRAMQQsgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMQAsgAEHCADYCHCAAIAE2AhQgAEHjmICAADYCECAAQRU2AgxBACEQDD8LIABBADYCBCAAIA8gDxCxgICAACIERQ0BIABBOjYCHCAAIAQ2AgwgACAPQQFqNgIUQQAhEAw+CyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBEUNACAAQTs2AhwgACAENgIMIAAgAUEBajYCFEEAIRAMPgsgAUEBaiEBDC0LIA9BAWohAQwtCyAAQQA2AhwgACAPNgIUIABB5JKAgAA2AhAgAEEENgIMQQAhEAw7CyAAQTY2AhwgACAENgIUIAAgAjYCDEEAIRAMOgsgAEEuNgIcIAAgDjYCFCAAIAQ2AgxBACEQDDkLIABB0AA2AhwgACABNgIUIABBkZiAgAA2AhAgAEEVNgIMQQAhEAw4CyANQQFqIQEMLAsgAEEVNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMNgsgAEEbNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNQsgAEEPNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNAsgAEELNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMMwsgAEEaNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMgsgAEELNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMQsgAEEKNgIcIAAgATYCFCAAQeSWgIAANgIQIABBFTYCDEEAIRAMMAsgAEEeNgIcIAAgATYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAMLwsgAEEANgIcIAAgEDYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMLgsgAEEENgIcIAAgATYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMLQsgAEEANgIAIAtBAWohCwtBuAEhEAwSCyAAQQA2AgAgEEEBaiEBQfUAIRAMEQsgASEBAkAgAC0AKUEFRw0AQeMAIRAMEQtB4gAhEAwQC0EAIRAgAEEANgIcIABB5JGAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAwoCyAAQQA2AgAgF0EBaiEBQcAAIRAMDgtBASEBCyAAIAE6ACwgAEEANgIAIBdBAWohAQtBKCEQDAsLIAEhAQtBOCEQDAkLAkAgASIPIAJGDQADQAJAIA8tAABBgL6AgABqLQAAIgFBAUYNACABQQJHDQMgD0EBaiEBDAQLIA9BAWoiDyACRw0AC0E+IRAMIgtBPiEQDCELIABBADoALCAPIQEMAQtBCyEQDAYLQTohEAwFCyABQQFqIQFBLSEQDAQLIAAgAToALCAAQQA2AgAgFkEBaiEBQQwhEAwDCyAAQQA2AgAgF0EBaiEBQQohEAwCCyAAQQA2AgALIABBADoALCANIQFBCSEQDAALC0EAIRAgAEEANgIcIAAgCzYCFCAAQc2QgIAANgIQIABBCTYCDAwXC0EAIRAgAEEANgIcIAAgCjYCFCAAQemKgIAANgIQIABBCTYCDAwWC0EAIRAgAEEANgIcIAAgCTYCFCAAQbeQgIAANgIQIABBCTYCDAwVC0EAIRAgAEEANgIcIAAgCDYCFCAAQZyRgIAANgIQIABBCTYCDAwUC0EAIRAgAEEANgIcIAAgATYCFCAAQc2QgIAANgIQIABBCTYCDAwTC0EAIRAgAEEANgIcIAAgATYCFCAAQemKgIAANgIQIABBCTYCDAwSC0EAIRAgAEEANgIcIAAgATYCFCAAQbeQgIAANgIQIABBCTYCDAwRC0EAIRAgAEEANgIcIAAgATYCFCAAQZyRgIAANgIQIABBCTYCDAwQC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwPC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwOC0EAIRAgAEEANgIcIAAgATYCFCAAQcCSgIAANgIQIABBCzYCDAwNC0EAIRAgAEEANgIcIAAgATYCFCAAQZWJgIAANgIQIABBCzYCDAwMC0EAIRAgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDAwLC0EAIRAgAEEANgIcIAAgATYCFCAAQfuPgIAANgIQIABBCjYCDAwKC0EAIRAgAEEANgIcIAAgATYCFCAAQfGZgIAANgIQIABBAjYCDAwJC0EAIRAgAEEANgIcIAAgATYCFCAAQcSUgIAANgIQIABBAjYCDAwIC0EAIRAgAEEANgIcIAAgATYCFCAAQfKVgIAANgIQIABBAjYCDAwHCyAAQQI2AhwgACABNgIUIABBnJqAgAA2AhAgAEEWNgIMQQAhEAwGC0EBIRAMBQtB1AAhECABIgQgAkYNBCADQQhqIAAgBCACQdjCgIAAQQoQxYCAgAAgAygCDCEEIAMoAggOAwEEAgALEMqAgIAAAAsgAEEANgIcIABBtZqAgAA2AhAgAEEXNgIMIAAgBEEBajYCFEEAIRAMAgsgAEEANgIcIAAgBDYCFCAAQcqagIAANgIQIABBCTYCDEEAIRAMAQsCQCABIgQgAkcNAEEiIRAMAQsgAEGJgICAADYCCCAAIAQ2AgRBISEQCyADQRBqJICAgIAAIBALrwEBAn8gASgCACEGAkACQCACIANGDQAgBCAGaiEEIAYgA2ogAmshByACIAZBf3MgBWoiBmohBQNAAkAgAi0AACAELQAARg0AQQIhBAwDCwJAIAYNAEEAIQQgBSECDAMLIAZBf2ohBiAEQQFqIQQgAkEBaiICIANHDQALIAchBiADIQILIABBATYCACABIAY2AgAgACACNgIEDwsgAUEANgIAIAAgBDYCACAAIAI2AgQLCgAgABDHgICAAAvyNgELfyOAgICAAEEQayIBJICAgIAAAkBBACgCoNCAgAANAEEAEMuAgIAAQYDUhIAAayICQdkASQ0AQQAhAwJAQQAoAuDTgIAAIgQNAEEAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEIakFwcUHYqtWqBXMiBDYC4NOAgABBAEEANgL004CAAEEAQQA2AsTTgIAAC0EAIAI2AszTgIAAQQBBgNSEgAA2AsjTgIAAQQBBgNSEgAA2ApjQgIAAQQAgBDYCrNCAgABBAEF/NgKo0ICAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALQYDUhIAAQXhBgNSEgABrQQ9xQQBBgNSEgABBCGpBD3EbIgNqIgRBBGogAkFIaiIFIANrIgNBAXI2AgBBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAQYDUhIAAIAVqQTg2AgQLAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFLDQACQEEAKAKI0ICAACIGQRAgAEETakFwcSAAQQtJGyICQQN2IgR2IgNBA3FFDQACQAJAIANBAXEgBHJBAXMiBUEDdCIEQbDQgIAAaiIDIARBuNCAgABqKAIAIgQoAggiAkcNAEEAIAZBfiAFd3E2AojQgIAADAELIAMgAjYCCCACIAM2AgwLIARBCGohAyAEIAVBA3QiBUEDcjYCBCAEIAVqIgQgBCgCBEEBcjYCBAwMCyACQQAoApDQgIAAIgdNDQECQCADRQ0AAkACQCADIAR0QQIgBHQiA0EAIANrcnEiA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqIgRBA3QiA0Gw0ICAAGoiBSADQbjQgIAAaigCACIDKAIIIgBHDQBBACAGQX4gBHdxIgY2AojQgIAADAELIAUgADYCCCAAIAU2AgwLIAMgAkEDcjYCBCADIARBA3QiBGogBCACayIFNgIAIAMgAmoiACAFQQFyNgIEAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQQCQAJAIAZBASAHQQN2dCIIcQ0AQQAgBiAIcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCAENgIMIAIgBDYCCCAEIAI2AgwgBCAINgIICyADQQhqIQNBACAANgKc0ICAAEEAIAU2ApDQgIAADAwLQQAoAozQgIAAIglFDQEgCUEAIAlrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqQQJ0QbjSgIAAaigCACIAKAIEQXhxIAJrIQQgACEFAkADQAJAIAUoAhAiAw0AIAVBFGooAgAiA0UNAgsgAygCBEF4cSACayIFIAQgBSAESSIFGyEEIAMgACAFGyEAIAMhBQwACwsgACgCGCEKAkAgACgCDCIIIABGDQAgACgCCCIDQQAoApjQgIAASRogCCADNgIIIAMgCDYCDAwLCwJAIABBFGoiBSgCACIDDQAgACgCECIDRQ0DIABBEGohBQsDQCAFIQsgAyIIQRRqIgUoAgAiAw0AIAhBEGohBSAIKAIQIgMNAAsgC0EANgIADAoLQX8hAiAAQb9/Sw0AIABBE2oiA0FwcSECQQAoAozQgIAAIgdFDQBBACELAkAgAkGAAkkNAEEfIQsgAkH///8HSw0AIANBCHYiAyADQYD+P2pBEHZBCHEiA3QiBCAEQYDgH2pBEHZBBHEiBHQiBSAFQYCAD2pBEHZBAnEiBXRBD3YgAyAEciAFcmsiA0EBdCACIANBFWp2QQFxckEcaiELC0EAIAJrIQQCQAJAAkACQCALQQJ0QbjSgIAAaigCACIFDQBBACEDQQAhCAwBC0EAIQMgAkEAQRkgC0EBdmsgC0EfRht0IQBBACEIA0ACQCAFKAIEQXhxIAJrIgYgBE8NACAGIQQgBSEIIAYNAEEAIQQgBSEIIAUhAwwDCyADIAVBFGooAgAiBiAGIAUgAEEddkEEcWpBEGooAgAiBUYbIAMgBhshAyAAQQF0IQAgBQ0ACwsCQCADIAhyDQBBACEIQQIgC3QiA0EAIANrciAHcSIDRQ0DIANBACADa3FBf2oiAyADQQx2QRBxIgN2IgVBBXZBCHEiACADciAFIAB2IgNBAnZBBHEiBXIgAyAFdiIDQQF2QQJxIgVyIAMgBXYiA0EBdkEBcSIFciADIAV2akECdEG40oCAAGooAgAhAwsgA0UNAQsDQCADKAIEQXhxIAJrIgYgBEkhAAJAIAMoAhAiBQ0AIANBFGooAgAhBQsgBiAEIAAbIQQgAyAIIAAbIQggBSEDIAUNAAsLIAhFDQAgBEEAKAKQ0ICAACACa08NACAIKAIYIQsCQCAIKAIMIgAgCEYNACAIKAIIIgNBACgCmNCAgABJGiAAIAM2AgggAyAANgIMDAkLAkAgCEEUaiIFKAIAIgMNACAIKAIQIgNFDQMgCEEQaiEFCwNAIAUhBiADIgBBFGoiBSgCACIDDQAgAEEQaiEFIAAoAhAiAw0ACyAGQQA2AgAMCAsCQEEAKAKQ0ICAACIDIAJJDQBBACgCnNCAgAAhBAJAAkAgAyACayIFQRBJDQAgBCACaiIAIAVBAXI2AgRBACAFNgKQ0ICAAEEAIAA2ApzQgIAAIAQgA2ogBTYCACAEIAJBA3I2AgQMAQsgBCADQQNyNgIEIAQgA2oiAyADKAIEQQFyNgIEQQBBADYCnNCAgABBAEEANgKQ0ICAAAsgBEEIaiEDDAoLAkBBACgClNCAgAAiACACTQ0AQQAoAqDQgIAAIgMgAmoiBCAAIAJrIgVBAXI2AgRBACAFNgKU0ICAAEEAIAQ2AqDQgIAAIAMgAkEDcjYCBCADQQhqIQMMCgsCQAJAQQAoAuDTgIAARQ0AQQAoAujTgIAAIQQMAQtBAEJ/NwLs04CAAEEAQoCAhICAgMAANwLk04CAAEEAIAFBDGpBcHFB2KrVqgVzNgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgABBgIAEIQQLQQAhAwJAIAQgAkHHAGoiB2oiBkEAIARrIgtxIgggAksNAEEAQTA2AvjTgIAADAoLAkBBACgCwNOAgAAiA0UNAAJAQQAoArjTgIAAIgQgCGoiBSAETQ0AIAUgA00NAQtBACEDQQBBMDYC+NOAgAAMCgtBAC0AxNOAgABBBHENBAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQAJAIAMoAgAiBSAESw0AIAUgAygCBGogBEsNAwsgAygCCCIDDQALC0EAEMuAgIAAIgBBf0YNBSAIIQYCQEEAKALk04CAACIDQX9qIgQgAHFFDQAgCCAAayAEIABqQQAgA2txaiEGCyAGIAJNDQUgBkH+////B0sNBQJAQQAoAsDTgIAAIgNFDQBBACgCuNOAgAAiBCAGaiIFIARNDQYgBSADSw0GCyAGEMuAgIAAIgMgAEcNAQwHCyAGIABrIAtxIgZB/v///wdLDQQgBhDLgICAACIAIAMoAgAgAygCBGpGDQMgACEDCwJAIANBf0YNACACQcgAaiAGTQ0AAkAgByAGa0EAKALo04CAACIEakEAIARrcSIEQf7///8HTQ0AIAMhAAwHCwJAIAQQy4CAgABBf0YNACAEIAZqIQYgAyEADAcLQQAgBmsQy4CAgAAaDAQLIAMhACADQX9HDQUMAwtBACEIDAcLQQAhAAwFCyAAQX9HDQILQQBBACgCxNOAgABBBHI2AsTTgIAACyAIQf7///8HSw0BIAgQy4CAgAAhAEEAEMuAgIAAIQMgAEF/Rg0BIANBf0YNASAAIANPDQEgAyAAayIGIAJBOGpNDQELQQBBACgCuNOAgAAgBmoiAzYCuNOAgAACQCADQQAoArzTgIAATQ0AQQAgAzYCvNOAgAALAkACQAJAAkBBACgCoNCAgAAiBEUNAEHI04CAACEDA0AgACADKAIAIgUgAygCBCIIakYNAiADKAIIIgMNAAwDCwsCQAJAQQAoApjQgIAAIgNFDQAgACADTw0BC0EAIAA2ApjQgIAAC0EAIQNBACAGNgLM04CAAEEAIAA2AsjTgIAAQQBBfzYCqNCAgABBAEEAKALg04CAADYCrNCAgABBAEEANgLU04CAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgQgBkFIaiIFIANrIgNBAXI2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAIAAgBWpBODYCBAwCCyADLQAMQQhxDQAgBCAFSQ0AIAQgAE8NACAEQXggBGtBD3FBACAEQQhqQQ9xGyIFaiIAQQAoApTQgIAAIAZqIgsgBWsiBUEBcjYCBCADIAggBmo2AgRBAEEAKALw04CAADYCpNCAgABBACAFNgKU0ICAAEEAIAA2AqDQgIAAIAQgC2pBODYCBAwBCwJAIABBACgCmNCAgAAiCE8NAEEAIAA2ApjQgIAAIAAhCAsgACAGaiEFQcjTgIAAIQMCQAJAAkACQAJAAkACQANAIAMoAgAgBUYNASADKAIIIgMNAAwCCwsgAy0ADEEIcUUNAQtByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiIFIARLDQMLIAMoAgghAwwACwsgAyAANgIAIAMgAygCBCAGajYCBCAAQXggAGtBD3FBACAAQQhqQQ9xG2oiCyACQQNyNgIEIAVBeCAFa0EPcUEAIAVBCGpBD3EbaiIGIAsgAmoiAmshAwJAIAYgBEcNAEEAIAI2AqDQgIAAQQBBACgClNCAgAAgA2oiAzYClNCAgAAgAiADQQFyNgIEDAMLAkAgBkEAKAKc0ICAAEcNAEEAIAI2ApzQgIAAQQBBACgCkNCAgAAgA2oiAzYCkNCAgAAgAiADQQFyNgIEIAIgA2ogAzYCAAwDCwJAIAYoAgQiBEEDcUEBRw0AIARBeHEhBwJAAkAgBEH/AUsNACAGKAIIIgUgBEEDdiIIQQN0QbDQgIAAaiIARhoCQCAGKAIMIgQgBUcNAEEAQQAoAojQgIAAQX4gCHdxNgKI0ICAAAwCCyAEIABGGiAEIAU2AgggBSAENgIMDAELIAYoAhghCQJAAkAgBigCDCIAIAZGDQAgBigCCCIEIAhJGiAAIAQ2AgggBCAANgIMDAELAkAgBkEUaiIEKAIAIgUNACAGQRBqIgQoAgAiBQ0AQQAhAAwBCwNAIAQhCCAFIgBBFGoiBCgCACIFDQAgAEEQaiEEIAAoAhAiBQ0ACyAIQQA2AgALIAlFDQACQAJAIAYgBigCHCIFQQJ0QbjSgIAAaiIEKAIARw0AIAQgADYCACAADQFBAEEAKAKM0ICAAEF+IAV3cTYCjNCAgAAMAgsgCUEQQRQgCSgCECAGRhtqIAA2AgAgAEUNAQsgACAJNgIYAkAgBigCECIERQ0AIAAgBDYCECAEIAA2AhgLIAYoAhQiBEUNACAAQRRqIAQ2AgAgBCAANgIYCyAHIANqIQMgBiAHaiIGKAIEIQQLIAYgBEF+cTYCBCACIANqIAM2AgAgAiADQQFyNgIEAkAgA0H/AUsNACADQXhxQbDQgIAAaiEEAkACQEEAKAKI0ICAACIFQQEgA0EDdnQiA3ENAEEAIAUgA3I2AojQgIAAIAQhAwwBCyAEKAIIIQMLIAMgAjYCDCAEIAI2AgggAiAENgIMIAIgAzYCCAwDC0EfIQQCQCADQf///wdLDQAgA0EIdiIEIARBgP4/akEQdkEIcSIEdCIFIAVBgOAfakEQdkEEcSIFdCIAIABBgIAPakEQdkECcSIAdEEPdiAEIAVyIAByayIEQQF0IAMgBEEVanZBAXFyQRxqIQQLIAIgBDYCHCACQgA3AhAgBEECdEG40oCAAGohBQJAQQAoAozQgIAAIgBBASAEdCIIcQ0AIAUgAjYCAEEAIAAgCHI2AozQgIAAIAIgBTYCGCACIAI2AgggAiACNgIMDAMLIANBAEEZIARBAXZrIARBH0YbdCEEIAUoAgAhAANAIAAiBSgCBEF4cSADRg0CIARBHXYhACAEQQF0IQQgBSAAQQRxakEQaiIIKAIAIgANAAsgCCACNgIAIAIgBTYCGCACIAI2AgwgAiACNgIIDAILIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgsgBkFIaiIIIANrIgNBAXI2AgQgACAIakE4NgIEIAQgBUE3IAVrQQ9xQQAgBUFJakEPcRtqQUFqIgggCCAEQRBqSRsiCEEjNgIEQQBBACgC8NOAgAA2AqTQgIAAQQAgAzYClNCAgABBACALNgKg0ICAACAIQRBqQQApAtDTgIAANwIAIAhBACkCyNOAgAA3AghBACAIQQhqNgLQ04CAAEEAIAY2AszTgIAAQQAgADYCyNOAgABBAEEANgLU04CAACAIQSRqIQMDQCADQQc2AgAgA0EEaiIDIAVJDQALIAggBEYNAyAIIAgoAgRBfnE2AgQgCCAIIARrIgA2AgAgBCAAQQFyNgIEAkAgAEH/AUsNACAAQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgAEEDdnQiAHENAEEAIAUgAHI2AojQgIAAIAMhBQwBCyADKAIIIQULIAUgBDYCDCADIAQ2AgggBCADNgIMIAQgBTYCCAwEC0EfIQMCQCAAQf///wdLDQAgAEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCIIIAhBgIAPakEQdkECcSIIdEEPdiADIAVyIAhyayIDQQF0IAAgA0EVanZBAXFyQRxqIQMLIAQgAzYCHCAEQgA3AhAgA0ECdEG40oCAAGohBQJAQQAoAozQgIAAIghBASADdCIGcQ0AIAUgBDYCAEEAIAggBnI2AozQgIAAIAQgBTYCGCAEIAQ2AgggBCAENgIMDAQLIABBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhCANAIAgiBSgCBEF4cSAARg0DIANBHXYhCCADQQF0IQMgBSAIQQRxakEQaiIGKAIAIggNAAsgBiAENgIAIAQgBTYCGCAEIAQ2AgwgBCAENgIIDAMLIAUoAggiAyACNgIMIAUgAjYCCCACQQA2AhggAiAFNgIMIAIgAzYCCAsgC0EIaiEDDAULIAUoAggiAyAENgIMIAUgBDYCCCAEQQA2AhggBCAFNgIMIAQgAzYCCAtBACgClNCAgAAiAyACTQ0AQQAoAqDQgIAAIgQgAmoiBSADIAJrIgNBAXI2AgRBACADNgKU0ICAAEEAIAU2AqDQgIAAIAQgAkEDcjYCBCAEQQhqIQMMAwtBACEDQQBBMDYC+NOAgAAMAgsCQCALRQ0AAkACQCAIIAgoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAA2AgAgAA0BQQAgB0F+IAV3cSIHNgKM0ICAAAwCCyALQRBBFCALKAIQIAhGG2ogADYCACAARQ0BCyAAIAs2AhgCQCAIKAIQIgNFDQAgACADNgIQIAMgADYCGAsgCEEUaigCACIDRQ0AIABBFGogAzYCACADIAA2AhgLAkACQCAEQQ9LDQAgCCAEIAJqIgNBA3I2AgQgCCADaiIDIAMoAgRBAXI2AgQMAQsgCCACaiIAIARBAXI2AgQgCCACQQNyNgIEIAAgBGogBDYCAAJAIARB/wFLDQAgBEF4cUGw0ICAAGohAwJAAkBBACgCiNCAgAAiBUEBIARBA3Z0IgRxDQBBACAFIARyNgKI0ICAACADIQQMAQsgAygCCCEECyAEIAA2AgwgAyAANgIIIAAgAzYCDCAAIAQ2AggMAQtBHyEDAkAgBEH///8HSw0AIARBCHYiAyADQYD+P2pBEHZBCHEiA3QiBSAFQYDgH2pBEHZBBHEiBXQiAiACQYCAD2pBEHZBAnEiAnRBD3YgAyAFciACcmsiA0EBdCAEIANBFWp2QQFxckEcaiEDCyAAIAM2AhwgAEIANwIQIANBAnRBuNKAgABqIQUCQCAHQQEgA3QiAnENACAFIAA2AgBBACAHIAJyNgKM0ICAACAAIAU2AhggACAANgIIIAAgADYCDAwBCyAEQQBBGSADQQF2ayADQR9GG3QhAyAFKAIAIQICQANAIAIiBSgCBEF4cSAERg0BIANBHXYhAiADQQF0IQMgBSACQQRxakEQaiIGKAIAIgINAAsgBiAANgIAIAAgBTYCGCAAIAA2AgwgACAANgIIDAELIAUoAggiAyAANgIMIAUgADYCCCAAQQA2AhggACAFNgIMIAAgAzYCCAsgCEEIaiEDDAELAkAgCkUNAAJAAkAgACAAKAIcIgVBAnRBuNKAgABqIgMoAgBHDQAgAyAINgIAIAgNAUEAIAlBfiAFd3E2AozQgIAADAILIApBEEEUIAooAhAgAEYbaiAINgIAIAhFDQELIAggCjYCGAJAIAAoAhAiA0UNACAIIAM2AhAgAyAINgIYCyAAQRRqKAIAIgNFDQAgCEEUaiADNgIAIAMgCDYCGAsCQAJAIARBD0sNACAAIAQgAmoiA0EDcjYCBCAAIANqIgMgAygCBEEBcjYCBAwBCyAAIAJqIgUgBEEBcjYCBCAAIAJBA3I2AgQgBSAEaiAENgIAAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQMCQAJAQQEgB0EDdnQiCCAGcQ0AQQAgCCAGcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCADNgIMIAIgAzYCCCADIAI2AgwgAyAINgIIC0EAIAU2ApzQgIAAQQAgBDYCkNCAgAALIABBCGohAwsgAUEQaiSAgICAACADCwoAIAAQyYCAgAAL4g0BB38CQCAARQ0AIABBeGoiASAAQXxqKAIAIgJBeHEiAGohAwJAIAJBAXENACACQQNxRQ0BIAEgASgCACICayIBQQAoApjQgIAAIgRJDQEgAiAAaiEAAkAgAUEAKAKc0ICAAEYNAAJAIAJB/wFLDQAgASgCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgASgCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAwsgAiAGRhogAiAENgIIIAQgAjYCDAwCCyABKAIYIQcCQAJAIAEoAgwiBiABRg0AIAEoAggiAiAESRogBiACNgIIIAIgBjYCDAwBCwJAIAFBFGoiAigCACIEDQAgAUEQaiICKAIAIgQNAEEAIQYMAQsDQCACIQUgBCIGQRRqIgIoAgAiBA0AIAZBEGohAiAGKAIQIgQNAAsgBUEANgIACyAHRQ0BAkACQCABIAEoAhwiBEECdEG40oCAAGoiAigCAEcNACACIAY2AgAgBg0BQQBBACgCjNCAgABBfiAEd3E2AozQgIAADAMLIAdBEEEUIAcoAhAgAUYbaiAGNgIAIAZFDQILIAYgBzYCGAJAIAEoAhAiAkUNACAGIAI2AhAgAiAGNgIYCyABKAIUIgJFDQEgBkEUaiACNgIAIAIgBjYCGAwBCyADKAIEIgJBA3FBA0cNACADIAJBfnE2AgRBACAANgKQ0ICAACABIABqIAA2AgAgASAAQQFyNgIEDwsgASADTw0AIAMoAgQiAkEBcUUNAAJAAkAgAkECcQ0AAkAgA0EAKAKg0ICAAEcNAEEAIAE2AqDQgIAAQQBBACgClNCAgAAgAGoiADYClNCAgAAgASAAQQFyNgIEIAFBACgCnNCAgABHDQNBAEEANgKQ0ICAAEEAQQA2ApzQgIAADwsCQCADQQAoApzQgIAARw0AQQAgATYCnNCAgABBAEEAKAKQ0ICAACAAaiIANgKQ0ICAACABIABBAXI2AgQgASAAaiAANgIADwsgAkF4cSAAaiEAAkACQCACQf8BSw0AIAMoAggiBCACQQN2IgVBA3RBsNCAgABqIgZGGgJAIAMoAgwiAiAERw0AQQBBACgCiNCAgABBfiAFd3E2AojQgIAADAILIAIgBkYaIAIgBDYCCCAEIAI2AgwMAQsgAygCGCEHAkACQCADKAIMIgYgA0YNACADKAIIIgJBACgCmNCAgABJGiAGIAI2AgggAiAGNgIMDAELAkAgA0EUaiICKAIAIgQNACADQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQACQAJAIAMgAygCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAgsgB0EQQRQgBygCECADRhtqIAY2AgAgBkUNAQsgBiAHNgIYAkAgAygCECICRQ0AIAYgAjYCECACIAY2AhgLIAMoAhQiAkUNACAGQRRqIAI2AgAgAiAGNgIYCyABIABqIAA2AgAgASAAQQFyNgIEIAFBACgCnNCAgABHDQFBACAANgKQ0ICAAA8LIAMgAkF+cTYCBCABIABqIAA2AgAgASAAQQFyNgIECwJAIABB/wFLDQAgAEF4cUGw0ICAAGohAgJAAkBBACgCiNCAgAAiBEEBIABBA3Z0IgBxDQBBACAEIAByNgKI0ICAACACIQAMAQsgAigCCCEACyAAIAE2AgwgAiABNgIIIAEgAjYCDCABIAA2AggPC0EfIQICQCAAQf///wdLDQAgAEEIdiICIAJBgP4/akEQdkEIcSICdCIEIARBgOAfakEQdkEEcSIEdCIGIAZBgIAPakEQdkECcSIGdEEPdiACIARyIAZyayICQQF0IAAgAkEVanZBAXFyQRxqIQILIAEgAjYCHCABQgA3AhAgAkECdEG40oCAAGohBAJAAkBBACgCjNCAgAAiBkEBIAJ0IgNxDQAgBCABNgIAQQAgBiADcjYCjNCAgAAgASAENgIYIAEgATYCCCABIAE2AgwMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgBCgCACEGAkADQCAGIgQoAgRBeHEgAEYNASACQR12IQYgAkEBdCECIAQgBkEEcWpBEGoiAygCACIGDQALIAMgATYCACABIAQ2AhggASABNgIMIAEgATYCCAwBCyAEKAIIIgAgATYCDCAEIAE2AgggAUEANgIYIAEgBDYCDCABIAA2AggLQQBBACgCqNCAgABBf2oiAUF/IAEbNgKo0ICAAAsLBAAAAAtOAAJAIAANAD8AQRB0DwsCQCAAQf//A3ENACAAQX9MDQACQCAAQRB2QAAiAEF/Rw0AQQBBMDYC+NOAgABBfw8LIABBEHQPCxDKgICAAAAL8gICA38BfgJAIAJFDQAgACABOgAAIAIgAGoiA0F/aiABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBfWogAToAACADQX5qIAE6AAAgAkEHSQ0AIAAgAToAAyADQXxqIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIFayICQSBJDQAgAa1CgYCAgBB+IQYgAyAFaiEBA0AgASAGNwMYIAEgBjcDECABIAY3AwggASAGNwMAIAFBIGohASACQWBqIgJBH0sNAAsLIAALC45IAQBBgAgLhkgBAAAAAgAAAAMAAAAAAAAAAAAAAAQAAAAFAAAAAAAAAAAAAAAGAAAABwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEludmFsaWQgY2hhciBpbiB1cmwgcXVlcnkAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9ib2R5AENvbnRlbnQtTGVuZ3RoIG92ZXJmbG93AENodW5rIHNpemUgb3ZlcmZsb3cAUmVzcG9uc2Ugb3ZlcmZsb3cASW52YWxpZCBtZXRob2QgZm9yIEhUVFAveC54IHJlcXVlc3QASW52YWxpZCBtZXRob2QgZm9yIFJUU1AveC54IHJlcXVlc3QARXhwZWN0ZWQgU09VUkNFIG1ldGhvZCBmb3IgSUNFL3gueCByZXF1ZXN0AEludmFsaWQgY2hhciBpbiB1cmwgZnJhZ21lbnQgc3RhcnQARXhwZWN0ZWQgZG90AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fc3RhdHVzAEludmFsaWQgcmVzcG9uc2Ugc3RhdHVzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21ldGhvZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lYCBjYWxsYmFjayBlcnJvcgBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNlcnZlcgBJbnZhbGlkIGhlYWRlciB2YWx1ZSBjaGFyAEludmFsaWQgaGVhZGVyIGZpZWxkIGNoYXIAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl92ZXJzaW9uAEludmFsaWQgbWlub3IgdmVyc2lvbgBJbnZhbGlkIG1ham9yIHZlcnNpb24ARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgdmVyc2lvbgBFeHBlY3RlZCBDUkxGIGFmdGVyIHZlcnNpb24ASW52YWxpZCBIVFRQIHZlcnNpb24ASW52YWxpZCBoZWFkZXIgdG9rZW4AU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl91cmwASW52YWxpZCBjaGFyYWN0ZXJzIGluIHVybABVbmV4cGVjdGVkIHN0YXJ0IGNoYXIgaW4gdXJsAERvdWJsZSBAIGluIHVybABFbXB0eSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXJhY3RlciBpbiBDb250ZW50LUxlbmd0aABEdXBsaWNhdGUgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyIGluIHVybCBwYXRoAENvbnRlbnQtTGVuZ3RoIGNhbid0IGJlIHByZXNlbnQgd2l0aCBUcmFuc2Zlci1FbmNvZGluZwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBzaXplAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX3ZhbHVlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgdmFsdWUATWlzc2luZyBleHBlY3RlZCBMRiBhZnRlciBoZWFkZXIgdmFsdWUASW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fbmFtZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIG5hbWUAUGF1c2Ugb24gQ09OTkVDVC9VcGdyYWRlAFBhdXNlIG9uIFBSSS9VcGdyYWRlAEV4cGVjdGVkIEhUVFAvMiBDb25uZWN0aW9uIFByZWZhY2UAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9tZXRob2QARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgbWV0aG9kAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX2ZpZWxkAFBhdXNlZABJbnZhbGlkIHdvcmQgZW5jb3VudGVyZWQASW52YWxpZCBtZXRob2QgZW5jb3VudGVyZWQAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzY2hlbWEAUmVxdWVzdCBoYXMgaW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX0NIVU5LX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX05BTUVfQ09NUExFVEUASFBFX0NCX01FU1NBR0VfQ09NUExFVEUASFBFX0NCX01FVEhPRF9DT01QTEVURQBIUEVfQ0JfSEVBREVSX0ZJRUxEX0NPTVBMRVRFAERFTEVURQBIUEVfSU5WQUxJRF9FT0ZfU1RBVEUASU5WQUxJRF9TU0xfQ0VSVElGSUNBVEUAUEFVU0UATk9fUkVTUE9OU0UAVU5TVVBQT1JURURfTUVESUFfVFlQRQBHT05FAE5PVF9BQ0NFUFRBQkxFAFNFUlZJQ0VfVU5BVkFJTEFCTEUAUkFOR0VfTk9UX1NBVElTRklBQkxFAE9SSUdJTl9JU19VTlJFQUNIQUJMRQBSRVNQT05TRV9JU19TVEFMRQBQVVJHRQBNRVJHRQBSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFAFJFUVVFU1RfSEVBREVSX1RPT19MQVJHRQBQQVlMT0FEX1RPT19MQVJHRQBJTlNVRkZJQ0lFTlRfU1RPUkFHRQBIUEVfUEFVU0VEX1VQR1JBREUASFBFX1BBVVNFRF9IMl9VUEdSQURFAFNPVVJDRQBBTk5PVU5DRQBUUkFDRQBIUEVfVU5FWFBFQ1RFRF9TUEFDRQBERVNDUklCRQBVTlNVQlNDUklCRQBSRUNPUkQASFBFX0lOVkFMSURfTUVUSE9EAE5PVF9GT1VORABQUk9QRklORABVTkJJTkQAUkVCSU5EAFVOQVVUSE9SSVpFRABNRVRIT0RfTk9UX0FMTE9XRUQASFRUUF9WRVJTSU9OX05PVF9TVVBQT1JURUQAQUxSRUFEWV9SRVBPUlRFRABBQ0NFUFRFRABOT1RfSU1QTEVNRU5URUQATE9PUF9ERVRFQ1RFRABIUEVfQ1JfRVhQRUNURUQASFBFX0xGX0VYUEVDVEVEAENSRUFURUQASU1fVVNFRABIUEVfUEFVU0VEAFRJTUVPVVRfT0NDVVJFRABQQVlNRU5UX1JFUVVJUkVEAFBSRUNPTkRJVElPTl9SRVFVSVJFRABQUk9YWV9BVVRIRU5USUNBVElPTl9SRVFVSVJFRABORVRXT1JLX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAExFTkdUSF9SRVFVSVJFRABTU0xfQ0VSVElGSUNBVEVfUkVRVUlSRUQAVVBHUkFERV9SRVFVSVJFRABQQUdFX0VYUElSRUQAUFJFQ09ORElUSU9OX0ZBSUxFRABFWFBFQ1RBVElPTl9GQUlMRUQAUkVWQUxJREFUSU9OX0ZBSUxFRABTU0xfSEFORFNIQUtFX0ZBSUxFRABMT0NLRUQAVFJBTlNGT1JNQVRJT05fQVBQTElFRABOT1RfTU9ESUZJRUQATk9UX0VYVEVOREVEAEJBTkRXSURUSF9MSU1JVF9FWENFRURFRABTSVRFX0lTX09WRVJMT0FERUQASEVBRABFeHBlY3RlZCBIVFRQLwAAXhMAACYTAAAwEAAA8BcAAJ0TAAAVEgAAORcAAPASAAAKEAAAdRIAAK0SAACCEwAATxQAAH8QAACgFQAAIxQAAIkSAACLFAAATRUAANQRAADPFAAAEBgAAMkWAADcFgAAwREAAOAXAAC7FAAAdBQAAHwVAADlFAAACBcAAB8QAABlFQAAoxQAACgVAAACFQAAmRUAACwQAACLGQAATw8AANQOAABqEAAAzhAAAAIXAACJDgAAbhMAABwTAABmFAAAVhcAAMETAADNEwAAbBMAAGgXAABmFwAAXxcAACITAADODwAAaQ4AANgOAABjFgAAyxMAAKoOAAAoFwAAJhcAAMUTAABdFgAA6BEAAGcTAABlEwAA8hYAAHMTAAAdFwAA+RYAAPMRAADPDgAAzhUAAAwSAACzEQAApREAAGEQAAAyFwAAuxMAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIDAgICAgIAAAICAAICAAICAgICAgICAgIABAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbG9zZWVlcC1hbGl2ZQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEAAAEBAAEBAAEBAQEBAQEBAQEAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AAAAAAAAAAAAAAAAAAAByYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AAAAAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQIAAQMAAAAAAAAAAAAAAAAAAAAAAAAEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAQAAAgAAAAAAAAAAAAAAAAAAAAAAAAMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAIAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8=' + + +/***/ }), + +/***/ 95627: +/***/ ((module) => { + +module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCrLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AcsBygG4AckBuQHIAboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBANwBC0EAIRAMxgELQQ4hEAzFAQtBDSEQDMQBC0EPIRAMwwELQRAhEAzCAQtBEyEQDMEBC0EUIRAMwAELQRUhEAy/AQtBFiEQDL4BC0EXIRAMvQELQRghEAy8AQtBGSEQDLsBC0EaIRAMugELQRshEAy5AQtBHCEQDLgBC0EIIRAMtwELQR0hEAy2AQtBICEQDLUBC0EfIRAMtAELQQchEAyzAQtBISEQDLIBC0EiIRAMsQELQR4hEAywAQtBIyEQDK8BC0ESIRAMrgELQREhEAytAQtBJCEQDKwBC0ElIRAMqwELQSYhEAyqAQtBJyEQDKkBC0HDASEQDKgBC0EpIRAMpwELQSshEAymAQtBLCEQDKUBC0EtIRAMpAELQS4hEAyjAQtBLyEQDKIBC0HEASEQDKEBC0EwIRAMoAELQTQhEAyfAQtBDCEQDJ4BC0ExIRAMnQELQTIhEAycAQtBMyEQDJsBC0E5IRAMmgELQTUhEAyZAQtBxQEhEAyYAQtBCyEQDJcBC0E6IRAMlgELQTYhEAyVAQtBCiEQDJQBC0E3IRAMkwELQTghEAySAQtBPCEQDJEBC0E7IRAMkAELQT0hEAyPAQtBCSEQDI4BC0EoIRAMjQELQT4hEAyMAQtBPyEQDIsBC0HAACEQDIoBC0HBACEQDIkBC0HCACEQDIgBC0HDACEQDIcBC0HEACEQDIYBC0HFACEQDIUBC0HGACEQDIQBC0EqIRAMgwELQccAIRAMggELQcgAIRAMgQELQckAIRAMgAELQcoAIRAMfwtBywAhEAx+C0HNACEQDH0LQcwAIRAMfAtBzgAhEAx7C0HPACEQDHoLQdAAIRAMeQtB0QAhEAx4C0HSACEQDHcLQdMAIRAMdgtB1AAhEAx1C0HWACEQDHQLQdUAIRAMcwtBBiEQDHILQdcAIRAMcQtBBSEQDHALQdgAIRAMbwtBBCEQDG4LQdkAIRAMbQtB2gAhEAxsC0HbACEQDGsLQdwAIRAMagtBAyEQDGkLQd0AIRAMaAtB3gAhEAxnC0HfACEQDGYLQeEAIRAMZQtB4AAhEAxkC0HiACEQDGMLQeMAIRAMYgtBAiEQDGELQeQAIRAMYAtB5QAhEAxfC0HmACEQDF4LQecAIRAMXQtB6AAhEAxcC0HpACEQDFsLQeoAIRAMWgtB6wAhEAxZC0HsACEQDFgLQe0AIRAMVwtB7gAhEAxWC0HvACEQDFULQfAAIRAMVAtB8QAhEAxTC0HyACEQDFILQfMAIRAMUQtB9AAhEAxQC0H1ACEQDE8LQfYAIRAMTgtB9wAhEAxNC0H4ACEQDEwLQfkAIRAMSwtB+gAhEAxKC0H7ACEQDEkLQfwAIRAMSAtB/QAhEAxHC0H+ACEQDEYLQf8AIRAMRQtBgAEhEAxEC0GBASEQDEMLQYIBIRAMQgtBgwEhEAxBC0GEASEQDEALQYUBIRAMPwtBhgEhEAw+C0GHASEQDD0LQYgBIRAMPAtBiQEhEAw7C0GKASEQDDoLQYsBIRAMOQtBjAEhEAw4C0GNASEQDDcLQY4BIRAMNgtBjwEhEAw1C0GQASEQDDQLQZEBIRAMMwtBkgEhEAwyC0GTASEQDDELQZQBIRAMMAtBlQEhEAwvC0GWASEQDC4LQZcBIRAMLQtBmAEhEAwsC0GZASEQDCsLQZoBIRAMKgtBmwEhEAwpC0GcASEQDCgLQZ0BIRAMJwtBngEhEAwmC0GfASEQDCULQaABIRAMJAtBoQEhEAwjC0GiASEQDCILQaMBIRAMIQtBpAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHgAeEB4gHjAeQB5QHmAecB6AHpAeoB6wHsAe0B7gHvAfAB8QHyAfMBmQKkArAC/gL+AgsgASIEIAJHDfMBQd0BIRAM/wMLIAEiECACRw3dAUHDASEQDP4DCyABIgEgAkcNkAFB9wAhEAz9AwsgASIBIAJHDYYBQe8AIRAM/AMLIAEiASACRw1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQRkhEAzcAwsgAUEBaiEBDAILAkAgASIUIAJHDQBBGiEQDNsDCyAUIQECQCAULQAAQXNqDhTdAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAgDuAgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQM2gMLAkAgAS0AACIQQTtGDQAgEEENRw3oASABQQFqIQEM5QILIAFBAWohAQtBIiEQDL8DCwJAIAEiECACRw0AQRwhEAzYAwtCACERIBAhASAQLQAAQVBqDjfnAeYBAQIDBAUGBwgAAAAAAAAACQoLDA0OAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPEBESExQAC0EeIRAMvQMLQgIhEQzlAQtCAyERDOQBC0IEIREM4wELQgUhEQziAQtCBiERDOEBC0IHIREM4AELQgghEQzfAQtCCSERDN4BC0IKIREM3QELQgshEQzcAQtCDCERDNsBC0INIREM2gELQg4hEQzZAQtCDyERDNgBC0IKIREM1wELQgshEQzWAQtCDCERDNUBC0INIREM1AELQg4hEQzTAQtCDyERDNIBC0IAIRECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAtAABBUGoON+UB5AEAAQIDBAUGB+YB5gHmAeYB5gHmAeYBCAkKCwwN5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAQ4PEBESE+YBC0ICIREM5AELQgMhEQzjAQtCBCERDOIBC0IFIREM4QELQgYhEQzgAQtCByERDN8BC0IIIREM3gELQgkhEQzdAQtCCiERDNwBC0ILIREM2wELQgwhEQzaAQtCDSERDNkBC0IOIREM2AELQg8hEQzXAQtCCiERDNYBC0ILIREM1QELQgwhEQzUAQtCDSERDNMBC0IOIREM0gELQg8hEQzRAQsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3SAUEfIRAMwAMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQSQhEAynAwtBICEQDL8DCyAAIAEiECACEL6AgIAAQX9qDgW2AQDFAgHRAdIBC0ERIRAMpAMLIABBAToALyAQIQEMuwMLIAEiASACRw3SAUEkIRAMuwMLIAEiDSACRw0eQcYAIRAMugMLIAAgASIBIAIQsoCAgAAiEA3UASABIQEMtQELIAEiECACRw0mQdAAIRAMuAMLAkAgASIBIAJHDQBBKCEQDLgDCyAAQQA2AgQgAEGMgICAADYCCCAAIAEgARCxgICAACIQDdMBIAEhAQzYAQsCQCABIhAgAkcNAEEpIRAMtwMLIBAtAAAiAUEgRg0UIAFBCUcN0wEgEEEBaiEBDBULAkAgASIBIAJGDQAgAUEBaiEBDBcLQSohEAy1AwsCQCABIhAgAkcNAEErIRAMtQMLAkAgEC0AACIBQQlGDQAgAUEgRw3VAQsgAC0ALEEIRg3TASAQIQEMkQMLAkAgASIBIAJHDQBBLCEQDLQDCyABLQAAQQpHDdUBIAFBAWohAQzJAgsgASIOIAJHDdUBQS8hEAyyAwsDQAJAIAEtAAAiEEEgRg0AAkAgEEF2ag4EANwB3AEA2gELIAEhAQzgAQsgAUEBaiIBIAJHDQALQTEhEAyxAwtBMiEQIAEiFCACRg2wAyACIBRrIAAoAgAiAWohFSAUIAFrQQNqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB8LuAgABqLQAARw0BAkAgAUEDRw0AQQYhAQyWAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMsQMLIABBADYCACAUIQEM2QELQTMhECABIhQgAkYNrwMgAiAUayAAKAIAIgFqIRUgFCABa0EIaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfS7gIAAai0AAEcNAQJAIAFBCEcNAEEFIQEMlQMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLADCyAAQQA2AgAgFCEBDNgBC0E0IRAgASIUIAJGDa4DIAIgFGsgACgCACIBaiEVIBQgAWtBBWohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUHQwoCAAGotAABHDQECQCABQQVHDQBBByEBDJQDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAyvAwsgAEEANgIAIBQhAQzXAQsCQCABIgEgAkYNAANAAkAgAS0AAEGAvoCAAGotAAAiEEEBRg0AIBBBAkYNCiABIQEM3QELIAFBAWoiASACRw0AC0EwIRAMrgMLQTAhEAytAwsCQCABIgEgAkYNAANAAkAgAS0AACIQQSBGDQAgEEF2ag4E2QHaAdoB2QHaAQsgAUEBaiIBIAJHDQALQTghEAytAwtBOCEQDKwDCwNAAkAgAS0AACIQQSBGDQAgEEEJRw0DCyABQQFqIgEgAkcNAAtBPCEQDKsDCwNAAkAgAS0AACIQQSBGDQACQAJAIBBBdmoOBNoBAQHaAQALIBBBLEYN2wELIAEhAQwECyABQQFqIgEgAkcNAAtBPyEQDKoDCyABIQEM2wELQcAAIRAgASIUIAJGDagDIAIgFGsgACgCACIBaiEWIBQgAWtBBmohFwJAA0AgFC0AAEEgciABQYDAgIAAai0AAEcNASABQQZGDY4DIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADKkDCyAAQQA2AgAgFCEBC0E2IRAMjgMLAkAgASIPIAJHDQBBwQAhEAynAwsgAEGMgICAADYCCCAAIA82AgQgDyEBIAAtACxBf2oOBM0B1QHXAdkBhwMLIAFBAWohAQzMAQsCQCABIgEgAkYNAANAAkAgAS0AACIQQSByIBAgEEG/f2pB/wFxQRpJG0H/AXEiEEEJRg0AIBBBIEYNAAJAAkACQAJAIBBBnX9qDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTEhEAyRAwsgAUEBaiEBQTIhEAyQAwsgAUEBaiEBQTMhEAyPAwsgASEBDNABCyABQQFqIgEgAkcNAAtBNSEQDKUDC0E1IRAMpAMLAkAgASIBIAJGDQADQAJAIAEtAABBgLyAgABqLQAAQQFGDQAgASEBDNMBCyABQQFqIgEgAkcNAAtBPSEQDKQDC0E9IRAMowMLIAAgASIBIAIQsICAgAAiEA3WASABIQEMAQsgEEEBaiEBC0E8IRAMhwMLAkAgASIBIAJHDQBBwgAhEAygAwsCQANAAkAgAS0AAEF3ag4YAAL+Av4ChAP+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gIA/gILIAFBAWoiASACRw0AC0HCACEQDKADCyABQQFqIQEgAC0ALUEBcUUNvQEgASEBC0EsIRAMhQMLIAEiASACRw3TAUHEACEQDJ0DCwNAAkAgAS0AAEGQwICAAGotAABBAUYNACABIQEMtwILIAFBAWoiASACRw0AC0HFACEQDJwDCyANLQAAIhBBIEYNswEgEEE6Rw2BAyAAKAIEIQEgAEEANgIEIAAgASANEK+AgIAAIgEN0AEgDUEBaiEBDLMCC0HHACEQIAEiDSACRg2aAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQZDCgIAAai0AAEcNgAMgAUEFRg30AiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyaAwtByAAhECABIg0gAkYNmQMgAiANayAAKAIAIgFqIRYgDSABa0EJaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGWwoCAAGotAABHDf8CAkAgAUEJRw0AQQIhAQz1AgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmQMLAkAgASINIAJHDQBByQAhEAyZAwsCQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZJ/ag4HAIADgAOAA4ADgAMBgAMLIA1BAWohAUE+IRAMgAMLIA1BAWohAUE/IRAM/wILQcoAIRAgASINIAJGDZcDIAIgDWsgACgCACIBaiEWIA0gAWtBAWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBoMKAgABqLQAARw39AiABQQFGDfACIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJcDC0HLACEQIAEiDSACRg2WAyACIA1rIAAoAgAiAWohFiANIAFrQQ5qIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaLCgIAAai0AAEcN/AIgAUEORg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyWAwtBzAAhECABIg0gAkYNlQMgAiANayAAKAIAIgFqIRYgDSABa0EPaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUHAwoCAAGotAABHDfsCAkAgAUEPRw0AQQMhAQzxAgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlQMLQc0AIRAgASINIAJGDZQDIAIgDWsgACgCACIBaiEWIA0gAWtBBWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw36AgJAIAFBBUcNAEEEIQEM8AILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJQDCwJAIAEiDSACRw0AQc4AIRAMlAMLAkACQAJAAkAgDS0AACIBQSByIAEgAUG/f2pB/wFxQRpJG0H/AXFBnX9qDhMA/QL9Av0C/QL9Av0C/QL9Av0C/QL9Av0CAf0C/QL9AgID/QILIA1BAWohAUHBACEQDP0CCyANQQFqIQFBwgAhEAz8AgsgDUEBaiEBQcMAIRAM+wILIA1BAWohAUHEACEQDPoCCwJAIAEiASACRg0AIABBjYCAgAA2AgggACABNgIEIAEhAUHFACEQDPoCC0HPACEQDJIDCyAQIQECQAJAIBAtAABBdmoOBAGoAqgCAKgCCyAQQQFqIQELQSchEAz4AgsCQCABIgEgAkcNAEHRACEQDJEDCwJAIAEtAABBIEYNACABIQEMjQELIAFBAWohASAALQAtQQFxRQ3HASABIQEMjAELIAEiFyACRw3IAUHSACEQDI8DC0HTACEQIAEiFCACRg2OAyACIBRrIAAoAgAiAWohFiAUIAFrQQFqIRcDQCAULQAAIAFB1sKAgABqLQAARw3MASABQQFGDccBIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADI4DCwJAIAEiASACRw0AQdUAIRAMjgMLIAEtAABBCkcNzAEgAUEBaiEBDMcBCwJAIAEiASACRw0AQdYAIRAMjQMLAkACQCABLQAAQXZqDgQAzQHNAQHNAQsgAUEBaiEBDMcBCyABQQFqIQFBygAhEAzzAgsgACABIgEgAhCugICAACIQDcsBIAEhAUHNACEQDPICCyAALQApQSJGDYUDDKYCCwJAIAEiASACRw0AQdsAIRAMigMLQQAhFEEBIRdBASEWQQAhEAJAAkACQAJAAkACQAJAAkACQCABLQAAQVBqDgrUAdMBAAECAwQFBgjVAQtBAiEQDAYLQQMhEAwFC0EEIRAMBAtBBSEQDAMLQQYhEAwCC0EHIRAMAQtBCCEQC0EAIRdBACEWQQAhFAzMAQtBCSEQQQEhFEEAIRdBACEWDMsBCwJAIAEiASACRw0AQd0AIRAMiQMLIAEtAABBLkcNzAEgAUEBaiEBDKYCCyABIgEgAkcNzAFB3wAhEAyHAwsCQCABIgEgAkYNACAAQY6AgIAANgIIIAAgATYCBCABIQFB0AAhEAzuAgtB4AAhEAyGAwtB4QAhECABIgEgAkYNhQMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQeLCgIAAai0AAEcNzQEgFEEDRg3MASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyFAwtB4gAhECABIgEgAkYNhAMgAiABayAAKAIAIhRqIRYgASAUa0ECaiEXA0AgAS0AACAUQebCgIAAai0AAEcNzAEgFEECRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyEAwtB4wAhECABIgEgAkYNgwMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQenCgIAAai0AAEcNywEgFEEDRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyDAwsCQCABIgEgAkcNAEHlACEQDIMDCyAAIAFBAWoiASACEKiAgIAAIhANzQEgASEBQdYAIRAM6QILAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AAkACQAJAIBBBuH9qDgsAAc8BzwHPAc8BzwHPAc8BzwECzwELIAFBAWohAUHSACEQDO0CCyABQQFqIQFB0wAhEAzsAgsgAUEBaiEBQdQAIRAM6wILIAFBAWoiASACRw0AC0HkACEQDIIDC0HkACEQDIEDCwNAAkAgAS0AAEHwwoCAAGotAAAiEEEBRg0AIBBBfmoOA88B0AHRAdIBCyABQQFqIgEgAkcNAAtB5gAhEAyAAwsCQCABIgEgAkYNACABQQFqIQEMAwtB5wAhEAz/AgsDQAJAIAEtAABB8MSAgABqLQAAIhBBAUYNAAJAIBBBfmoOBNIB0wHUAQDVAQsgASEBQdcAIRAM5wILIAFBAWoiASACRw0AC0HoACEQDP4CCwJAIAEiASACRw0AQekAIRAM/gILAkAgAS0AACIQQXZqDhq6AdUB1QG8AdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAcoB1QHVAQDTAQsgAUEBaiEBC0EGIRAM4wILA0ACQCABLQAAQfDGgIAAai0AAEEBRg0AIAEhAQyeAgsgAUEBaiIBIAJHDQALQeoAIRAM+wILAkAgASIBIAJGDQAgAUEBaiEBDAMLQesAIRAM+gILAkAgASIBIAJHDQBB7AAhEAz6AgsgAUEBaiEBDAELAkAgASIBIAJHDQBB7QAhEAz5AgsgAUEBaiEBC0EEIRAM3gILAkAgASIUIAJHDQBB7gAhEAz3AgsgFCEBAkACQAJAIBQtAABB8MiAgABqLQAAQX9qDgfUAdUB1gEAnAIBAtcBCyAUQQFqIQEMCgsgFEEBaiEBDM0BC0EAIRAgAEEANgIcIABBm5KAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAz2AgsCQANAAkAgAS0AAEHwyICAAGotAAAiEEEERg0AAkACQCAQQX9qDgfSAdMB1AHZAQAEAdkBCyABIQFB2gAhEAzgAgsgAUEBaiEBQdwAIRAM3wILIAFBAWoiASACRw0AC0HvACEQDPYCCyABQQFqIQEMywELAkAgASIUIAJHDQBB8AAhEAz1AgsgFC0AAEEvRw3UASAUQQFqIQEMBgsCQCABIhQgAkcNAEHxACEQDPQCCwJAIBQtAAAiAUEvRw0AIBRBAWohAUHdACEQDNsCCyABQXZqIgRBFksN0wFBASAEdEGJgIACcUUN0wEMygILAkAgASIBIAJGDQAgAUEBaiEBQd4AIRAM2gILQfIAIRAM8gILAkAgASIUIAJHDQBB9AAhEAzyAgsgFCEBAkAgFC0AAEHwzICAAGotAABBf2oOA8kClAIA1AELQeEAIRAM2AILAkAgASIUIAJGDQADQAJAIBQtAABB8MqAgABqLQAAIgFBA0YNAAJAIAFBf2oOAssCANUBCyAUIQFB3wAhEAzaAgsgFEEBaiIUIAJHDQALQfMAIRAM8QILQfMAIRAM8AILAkAgASIBIAJGDQAgAEGPgICAADYCCCAAIAE2AgQgASEBQeAAIRAM1wILQfUAIRAM7wILAkAgASIBIAJHDQBB9gAhEAzvAgsgAEGPgICAADYCCCAAIAE2AgQgASEBC0EDIRAM1AILA0AgAS0AAEEgRw3DAiABQQFqIgEgAkcNAAtB9wAhEAzsAgsCQCABIgEgAkcNAEH4ACEQDOwCCyABLQAAQSBHDc4BIAFBAWohAQzvAQsgACABIgEgAhCsgICAACIQDc4BIAEhAQyOAgsCQCABIgQgAkcNAEH6ACEQDOoCCyAELQAAQcwARw3RASAEQQFqIQFBEyEQDM8BCwJAIAEiBCACRw0AQfsAIRAM6QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEANAIAQtAAAgAUHwzoCAAGotAABHDdABIAFBBUYNzgEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBB+wAhEAzoAgsCQCABIgQgAkcNAEH8ACEQDOgCCwJAAkAgBC0AAEG9f2oODADRAdEB0QHRAdEB0QHRAdEB0QHRAQHRAQsgBEEBaiEBQeYAIRAMzwILIARBAWohAUHnACEQDM4CCwJAIAEiBCACRw0AQf0AIRAM5wILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNzwEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf0AIRAM5wILIABBADYCACAQQQFqIQFBECEQDMwBCwJAIAEiBCACRw0AQf4AIRAM5gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQfbOgIAAai0AAEcNzgEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf4AIRAM5gILIABBADYCACAQQQFqIQFBFiEQDMsBCwJAIAEiBCACRw0AQf8AIRAM5QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQfzOgIAAai0AAEcNzQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf8AIRAM5QILIABBADYCACAQQQFqIQFBBSEQDMoBCwJAIAEiBCACRw0AQYABIRAM5AILIAQtAABB2QBHDcsBIARBAWohAUEIIRAMyQELAkAgASIEIAJHDQBBgQEhEAzjAgsCQAJAIAQtAABBsn9qDgMAzAEBzAELIARBAWohAUHrACEQDMoCCyAEQQFqIQFB7AAhEAzJAgsCQCABIgQgAkcNAEGCASEQDOICCwJAAkAgBC0AAEG4f2oOCADLAcsBywHLAcsBywEBywELIARBAWohAUHqACEQDMkCCyAEQQFqIQFB7QAhEAzIAgsCQCABIgQgAkcNAEGDASEQDOECCyACIARrIAAoAgAiAWohECAEIAFrQQJqIRQCQANAIAQtAAAgAUGAz4CAAGotAABHDckBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgEDYCAEGDASEQDOECC0EAIRAgAEEANgIAIBRBAWohAQzGAQsCQCABIgQgAkcNAEGEASEQDOACCyACIARrIAAoAgAiAWohFCAEIAFrQQRqIRACQANAIAQtAAAgAUGDz4CAAGotAABHDcgBIAFBBEYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGEASEQDOACCyAAQQA2AgAgEEEBaiEBQSMhEAzFAQsCQCABIgQgAkcNAEGFASEQDN8CCwJAAkAgBC0AAEG0f2oOCADIAcgByAHIAcgByAEByAELIARBAWohAUHvACEQDMYCCyAEQQFqIQFB8AAhEAzFAgsCQCABIgQgAkcNAEGGASEQDN4CCyAELQAAQcUARw3FASAEQQFqIQEMgwILAkAgASIEIAJHDQBBhwEhEAzdAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBiM+AgABqLQAARw3FASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhwEhEAzdAgsgAEEANgIAIBBBAWohAUEtIRAMwgELAkAgASIEIAJHDQBBiAEhEAzcAgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw3EASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiAEhEAzcAgsgAEEANgIAIBBBAWohAUEpIRAMwQELAkAgASIBIAJHDQBBiQEhEAzbAgtBASEQIAEtAABB3wBHDcABIAFBAWohAQyBAgsCQCABIgQgAkcNAEGKASEQDNoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRADQCAELQAAIAFBjM+AgABqLQAARw3BASABQQFGDa8CIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYoBIRAM2QILAkAgASIEIAJHDQBBiwEhEAzZAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBjs+AgABqLQAARw3BASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiwEhEAzZAgsgAEEANgIAIBBBAWohAUECIRAMvgELAkAgASIEIAJHDQBBjAEhEAzYAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw3AASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjAEhEAzYAgsgAEEANgIAIBBBAWohAUEfIRAMvQELAkAgASIEIAJHDQBBjQEhEAzXAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8s+AgABqLQAARw2/ASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjQEhEAzXAgsgAEEANgIAIBBBAWohAUEJIRAMvAELAkAgASIEIAJHDQBBjgEhEAzWAgsCQAJAIAQtAABBt39qDgcAvwG/Ab8BvwG/AQG/AQsgBEEBaiEBQfgAIRAMvQILIARBAWohAUH5ACEQDLwCCwJAIAEiBCACRw0AQY8BIRAM1QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQZHPgIAAai0AAEcNvQEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY8BIRAM1QILIABBADYCACAQQQFqIQFBGCEQDLoBCwJAIAEiBCACRw0AQZABIRAM1AILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQZfPgIAAai0AAEcNvAEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZABIRAM1AILIABBADYCACAQQQFqIQFBFyEQDLkBCwJAIAEiBCACRw0AQZEBIRAM0wILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQZrPgIAAai0AAEcNuwEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZEBIRAM0wILIABBADYCACAQQQFqIQFBFSEQDLgBCwJAIAEiBCACRw0AQZIBIRAM0gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQaHPgIAAai0AAEcNugEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZIBIRAM0gILIABBADYCACAQQQFqIQFBHiEQDLcBCwJAIAEiBCACRw0AQZMBIRAM0QILIAQtAABBzABHDbgBIARBAWohAUEKIRAMtgELAkAgBCACRw0AQZQBIRAM0AILAkACQCAELQAAQb9/ag4PALkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AbkBAbkBCyAEQQFqIQFB/gAhEAy3AgsgBEEBaiEBQf8AIRAMtgILAkAgBCACRw0AQZUBIRAMzwILAkACQCAELQAAQb9/ag4DALgBAbgBCyAEQQFqIQFB/QAhEAy2AgsgBEEBaiEEQYABIRAMtQILAkAgBCACRw0AQZYBIRAMzgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQafPgIAAai0AAEcNtgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZYBIRAMzgILIABBADYCACAQQQFqIQFBCyEQDLMBCwJAIAQgAkcNAEGXASEQDM0CCwJAAkACQAJAIAQtAABBU2oOIwC4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBAbgBuAG4AbgBuAECuAG4AbgBA7gBCyAEQQFqIQFB+wAhEAy2AgsgBEEBaiEBQfwAIRAMtQILIARBAWohBEGBASEQDLQCCyAEQQFqIQRBggEhEAyzAgsCQCAEIAJHDQBBmAEhEAzMAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBqc+AgABqLQAARw20ASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmAEhEAzMAgsgAEEANgIAIBBBAWohAUEZIRAMsQELAkAgBCACRw0AQZkBIRAMywILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQa7PgIAAai0AAEcNswEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZkBIRAMywILIABBADYCACAQQQFqIQFBBiEQDLABCwJAIAQgAkcNAEGaASEQDMoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG0z4CAAGotAABHDbIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGaASEQDMoCCyAAQQA2AgAgEEEBaiEBQRwhEAyvAQsCQCAEIAJHDQBBmwEhEAzJAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBts+AgABqLQAARw2xASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmwEhEAzJAgsgAEEANgIAIBBBAWohAUEnIRAMrgELAkAgBCACRw0AQZwBIRAMyAILAkACQCAELQAAQax/ag4CAAGxAQsgBEEBaiEEQYYBIRAMrwILIARBAWohBEGHASEQDK4CCwJAIAQgAkcNAEGdASEQDMcCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG4z4CAAGotAABHDa8BIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGdASEQDMcCCyAAQQA2AgAgEEEBaiEBQSYhEAysAQsCQCAEIAJHDQBBngEhEAzGAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBus+AgABqLQAARw2uASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBngEhEAzGAgsgAEEANgIAIBBBAWohAUEDIRAMqwELAkAgBCACRw0AQZ8BIRAMxQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNrQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ8BIRAMxQILIABBADYCACAQQQFqIQFBDCEQDKoBCwJAIAQgAkcNAEGgASEQDMQCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUG8z4CAAGotAABHDawBIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGgASEQDMQCCyAAQQA2AgAgEEEBaiEBQQ0hEAypAQsCQCAEIAJHDQBBoQEhEAzDAgsCQAJAIAQtAABBun9qDgsArAGsAawBrAGsAawBrAGsAawBAawBCyAEQQFqIQRBiwEhEAyqAgsgBEEBaiEEQYwBIRAMqQILAkAgBCACRw0AQaIBIRAMwgILIAQtAABB0ABHDakBIARBAWohBAzpAQsCQCAEIAJHDQBBowEhEAzBAgsCQAJAIAQtAABBt39qDgcBqgGqAaoBqgGqAQCqAQsgBEEBaiEEQY4BIRAMqAILIARBAWohAUEiIRAMpgELAkAgBCACRw0AQaQBIRAMwAILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQcDPgIAAai0AAEcNqAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaQBIRAMwAILIABBADYCACAQQQFqIQFBHSEQDKUBCwJAIAQgAkcNAEGlASEQDL8CCwJAAkAgBC0AAEGuf2oOAwCoAQGoAQsgBEEBaiEEQZABIRAMpgILIARBAWohAUEEIRAMpAELAkAgBCACRw0AQaYBIRAMvgILAkACQAJAAkACQCAELQAAQb9/ag4VAKoBqgGqAaoBqgGqAaoBqgGqAaoBAaoBqgECqgGqAQOqAaoBBKoBCyAEQQFqIQRBiAEhEAyoAgsgBEEBaiEEQYkBIRAMpwILIARBAWohBEGKASEQDKYCCyAEQQFqIQRBjwEhEAylAgsgBEEBaiEEQZEBIRAMpAILAkAgBCACRw0AQacBIRAMvQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNpQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQacBIRAMvQILIABBADYCACAQQQFqIQFBESEQDKIBCwJAIAQgAkcNAEGoASEQDLwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHCz4CAAGotAABHDaQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGoASEQDLwCCyAAQQA2AgAgEEEBaiEBQSwhEAyhAQsCQCAEIAJHDQBBqQEhEAy7AgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBxc+AgABqLQAARw2jASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqQEhEAy7AgsgAEEANgIAIBBBAWohAUErIRAMoAELAkAgBCACRw0AQaoBIRAMugILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQcrPgIAAai0AAEcNogEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaoBIRAMugILIABBADYCACAQQQFqIQFBFCEQDJ8BCwJAIAQgAkcNAEGrASEQDLkCCwJAAkACQAJAIAQtAABBvn9qDg8AAQKkAaQBpAGkAaQBpAGkAaQBpAGkAaQBA6QBCyAEQQFqIQRBkwEhEAyiAgsgBEEBaiEEQZQBIRAMoQILIARBAWohBEGVASEQDKACCyAEQQFqIQRBlgEhEAyfAgsCQCAEIAJHDQBBrAEhEAy4AgsgBC0AAEHFAEcNnwEgBEEBaiEEDOABCwJAIAQgAkcNAEGtASEQDLcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHNz4CAAGotAABHDZ8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGtASEQDLcCCyAAQQA2AgAgEEEBaiEBQQ4hEAycAQsCQCAEIAJHDQBBrgEhEAy2AgsgBC0AAEHQAEcNnQEgBEEBaiEBQSUhEAybAQsCQCAEIAJHDQBBrwEhEAy1AgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw2dASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrwEhEAy1AgsgAEEANgIAIBBBAWohAUEqIRAMmgELAkAgBCACRw0AQbABIRAMtAILAkACQCAELQAAQat/ag4LAJ0BnQGdAZ0BnQGdAZ0BnQGdAQGdAQsgBEEBaiEEQZoBIRAMmwILIARBAWohBEGbASEQDJoCCwJAIAQgAkcNAEGxASEQDLMCCwJAAkAgBC0AAEG/f2oOFACcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAEBnAELIARBAWohBEGZASEQDJoCCyAEQQFqIQRBnAEhEAyZAgsCQCAEIAJHDQBBsgEhEAyyAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFB2c+AgABqLQAARw2aASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBsgEhEAyyAgsgAEEANgIAIBBBAWohAUEhIRAMlwELAkAgBCACRw0AQbMBIRAMsQILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQd3PgIAAai0AAEcNmQEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbMBIRAMsQILIABBADYCACAQQQFqIQFBGiEQDJYBCwJAIAQgAkcNAEG0ASEQDLACCwJAAkACQCAELQAAQbt/ag4RAJoBmgGaAZoBmgGaAZoBmgGaAQGaAZoBmgGaAZoBApoBCyAEQQFqIQRBnQEhEAyYAgsgBEEBaiEEQZ4BIRAMlwILIARBAWohBEGfASEQDJYCCwJAIAQgAkcNAEG1ASEQDK8CCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUHkz4CAAGotAABHDZcBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG1ASEQDK8CCyAAQQA2AgAgEEEBaiEBQSghEAyUAQsCQCAEIAJHDQBBtgEhEAyuAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB6s+AgABqLQAARw2WASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtgEhEAyuAgsgAEEANgIAIBBBAWohAUEHIRAMkwELAkAgBCACRw0AQbcBIRAMrQILAkACQCAELQAAQbt/ag4OAJYBlgGWAZYBlgGWAZYBlgGWAZYBlgGWAQGWAQsgBEEBaiEEQaEBIRAMlAILIARBAWohBEGiASEQDJMCCwJAIAQgAkcNAEG4ASEQDKwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDZQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG4ASEQDKwCCyAAQQA2AgAgEEEBaiEBQRIhEAyRAQsCQCAEIAJHDQBBuQEhEAyrAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw2TASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuQEhEAyrAgsgAEEANgIAIBBBAWohAUEgIRAMkAELAkAgBCACRw0AQboBIRAMqgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNkgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQboBIRAMqgILIABBADYCACAQQQFqIQFBDyEQDI8BCwJAIAQgAkcNAEG7ASEQDKkCCwJAAkAgBC0AAEG3f2oOBwCSAZIBkgGSAZIBAZIBCyAEQQFqIQRBpQEhEAyQAgsgBEEBaiEEQaYBIRAMjwILAkAgBCACRw0AQbwBIRAMqAILIAIgBGsgACgCACIBaiEUIAQgAWtBB2ohEAJAA0AgBC0AACABQfTPgIAAai0AAEcNkAEgAUEHRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbwBIRAMqAILIABBADYCACAQQQFqIQFBGyEQDI0BCwJAIAQgAkcNAEG9ASEQDKcCCwJAAkACQCAELQAAQb5/ag4SAJEBkQGRAZEBkQGRAZEBkQGRAQGRAZEBkQGRAZEBkQECkQELIARBAWohBEGkASEQDI8CCyAEQQFqIQRBpwEhEAyOAgsgBEEBaiEEQagBIRAMjQILAkAgBCACRw0AQb4BIRAMpgILIAQtAABBzgBHDY0BIARBAWohBAzPAQsCQCAEIAJHDQBBvwEhEAylAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAELQAAQb9/ag4VAAECA5wBBAUGnAGcAZwBBwgJCgucAQwNDg+cAQsgBEEBaiEBQegAIRAMmgILIARBAWohAUHpACEQDJkCCyAEQQFqIQFB7gAhEAyYAgsgBEEBaiEBQfIAIRAMlwILIARBAWohAUHzACEQDJYCCyAEQQFqIQFB9gAhEAyVAgsgBEEBaiEBQfcAIRAMlAILIARBAWohAUH6ACEQDJMCCyAEQQFqIQRBgwEhEAySAgsgBEEBaiEEQYQBIRAMkQILIARBAWohBEGFASEQDJACCyAEQQFqIQRBkgEhEAyPAgsgBEEBaiEEQZgBIRAMjgILIARBAWohBEGgASEQDI0CCyAEQQFqIQRBowEhEAyMAgsgBEEBaiEEQaoBIRAMiwILAkAgBCACRg0AIABBkICAgAA2AgggACAENgIEQasBIRAMiwILQcABIRAMowILIAAgBSACEKqAgIAAIgENiwEgBSEBDFwLAkAgBiACRg0AIAZBAWohBQyNAQtBwgEhEAyhAgsDQAJAIBAtAABBdmoOBIwBAACPAQALIBBBAWoiECACRw0AC0HDASEQDKACCwJAIAcgAkYNACAAQZGAgIAANgIIIAAgBzYCBCAHIQFBASEQDIcCC0HEASEQDJ8CCwJAIAcgAkcNAEHFASEQDJ8CCwJAAkAgBy0AAEF2ag4EAc4BzgEAzgELIAdBAWohBgyNAQsgB0EBaiEFDIkBCwJAIAcgAkcNAEHGASEQDJ4CCwJAAkAgBy0AAEF2ag4XAY8BjwEBjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAI8BCyAHQQFqIQcLQbABIRAMhAILAkAgCCACRw0AQcgBIRAMnQILIAgtAABBIEcNjQEgAEEAOwEyIAhBAWohAUGzASEQDIMCCyABIRcCQANAIBciByACRg0BIActAABBUGpB/wFxIhBBCk8NzAECQCAALwEyIhRBmTNLDQAgACAUQQpsIhQ7ATIgEEH//wNzIBRB/v8DcUkNACAHQQFqIRcgACAUIBBqIhA7ATIgEEH//wNxQegHSQ0BCwtBACEQIABBADYCHCAAQcGJgIAANgIQIABBDTYCDCAAIAdBAWo2AhQMnAILQccBIRAMmwILIAAgCCACEK6AgIAAIhBFDcoBIBBBFUcNjAEgAEHIATYCHCAAIAg2AhQgAEHJl4CAADYCECAAQRU2AgxBACEQDJoCCwJAIAkgAkcNAEHMASEQDJoCC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgCS0AAEFQag4KlgGVAQABAgMEBQYIlwELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMjgELQQkhEEEBIRRBACEXQQAhFgyNAQsCQCAKIAJHDQBBzgEhEAyZAgsgCi0AAEEuRw2OASAKQQFqIQkMygELIAsgAkcNjgFB0AEhEAyXAgsCQCALIAJGDQAgAEGOgICAADYCCCAAIAs2AgRBtwEhEAz+AQtB0QEhEAyWAgsCQCAEIAJHDQBB0gEhEAyWAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EEaiELA0AgBC0AACAQQfzPgIAAai0AAEcNjgEgEEEERg3pASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHSASEQDJUCCyAAIAwgAhCsgICAACIBDY0BIAwhAQy4AQsCQCAEIAJHDQBB1AEhEAyUAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EBaiEMA0AgBC0AACAQQYHQgIAAai0AAEcNjwEgEEEBRg2OASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHUASEQDJMCCwJAIAQgAkcNAEHWASEQDJMCCyACIARrIAAoAgAiEGohFCAEIBBrQQJqIQsDQCAELQAAIBBBg9CAgABqLQAARw2OASAQQQJGDZABIBBBAWohECAEQQFqIgQgAkcNAAsgACAUNgIAQdYBIRAMkgILAkAgBCACRw0AQdcBIRAMkgILAkACQCAELQAAQbt/ag4QAI8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwEBjwELIARBAWohBEG7ASEQDPkBCyAEQQFqIQRBvAEhEAz4AQsCQCAEIAJHDQBB2AEhEAyRAgsgBC0AAEHIAEcNjAEgBEEBaiEEDMQBCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEG+ASEQDPcBC0HZASEQDI8CCwJAIAQgAkcNAEHaASEQDI8CCyAELQAAQcgARg3DASAAQQE6ACgMuQELIABBAjoALyAAIAQgAhCmgICAACIQDY0BQcIBIRAM9AELIAAtAChBf2oOArcBuQG4AQsDQAJAIAQtAABBdmoOBACOAY4BAI4BCyAEQQFqIgQgAkcNAAtB3QEhEAyLAgsgAEEAOgAvIAAtAC1BBHFFDYQCCyAAQQA6AC8gAEEBOgA0IAEhAQyMAQsgEEEVRg3aASAAQQA2AhwgACABNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAyIAgsCQCAAIBAgAhC0gICAACIEDQAgECEBDIECCwJAIARBFUcNACAAQQM2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAyIAgsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMhwILIBBBFUYN1gEgAEEANgIcIAAgATYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMhgILIAAoAgQhFyAAQQA2AgQgECARp2oiFiEBIAAgFyAQIBYgFBsiEBC1gICAACIURQ2NASAAQQc2AhwgACAQNgIUIAAgFDYCDEEAIRAMhQILIAAgAC8BMEGAAXI7ATAgASEBC0EqIRAM6gELIBBBFUYN0QEgAEEANgIcIAAgATYCFCAAQYOMgIAANgIQIABBEzYCDEEAIRAMggILIBBBFUYNzwEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAMgQILIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDI0BCyAAQQw2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMgAILIBBBFUYNzAEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM/wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIwBCyAAQQ02AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/gELIBBBFUYNyQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM/QELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIsBCyAAQQ42AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/AELIABBADYCHCAAIAE2AhQgAEHAlYCAADYCECAAQQI2AgxBACEQDPsBCyAQQRVGDcUBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPoBCyAAQRA2AhwgACABNgIUIAAgEDYCDEEAIRAM+QELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDPEBCyAAQRE2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM+AELIBBBFUYNwQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM9wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIgBCyAAQRM2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM9gELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDO0BCyAAQRQ2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM9QELIBBBFUYNvQEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM9AELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIYBCyAAQRY2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM8wELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC3gICAACIEDQAgAUEBaiEBDOkBCyAAQRc2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM8gELIABBADYCHCAAIAE2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDPEBC0IBIRELIBBBAWohAQJAIAApAyAiEkL//////////w9WDQAgACASQgSGIBGENwMgIAEhAQyEAQsgAEEANgIcIAAgATYCFCAAQa2JgIAANgIQIABBDDYCDEEAIRAM7wELIABBADYCHCAAIBA2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDO4BCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNcyAAQQU2AhwgACAQNgIUIAAgFDYCDEEAIRAM7QELIABBADYCHCAAIBA2AhQgAEGqnICAADYCECAAQQ82AgxBACEQDOwBCyAAIBAgAhC0gICAACIBDQEgECEBC0EOIRAM0QELAkAgAUEVRw0AIABBAjYCHCAAIBA2AhQgAEGwmICAADYCECAAQRU2AgxBACEQDOoBCyAAQQA2AhwgACAQNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAzpAQsgAUEBaiEQAkAgAC8BMCIBQYABcUUNAAJAIAAgECACELuAgIAAIgENACAQIQEMcAsgAUEVRw26ASAAQQU2AhwgACAQNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAzpAQsCQCABQaAEcUGgBEcNACAALQAtQQJxDQAgAEEANgIcIAAgEDYCFCAAQZaTgIAANgIQIABBBDYCDEEAIRAM6QELIAAgECACEL2AgIAAGiAQIQECQAJAAkACQAJAIAAgECACELOAgIAADhYCAQAEBAQEBAQEBAQEBAQEBAQEBAQDBAsgAEEBOgAuCyAAIAAvATBBwAByOwEwIBAhAQtBJiEQDNEBCyAAQSM2AhwgACAQNgIUIABBpZaAgAA2AhAgAEEVNgIMQQAhEAzpAQsgAEEANgIcIAAgEDYCFCAAQdWLgIAANgIQIABBETYCDEEAIRAM6AELIAAtAC1BAXFFDQFBwwEhEAzOAQsCQCANIAJGDQADQAJAIA0tAABBIEYNACANIQEMxAELIA1BAWoiDSACRw0AC0ElIRAM5wELQSUhEAzmAQsgACgCBCEEIABBADYCBCAAIAQgDRCvgICAACIERQ2tASAAQSY2AhwgACAENgIMIAAgDUEBajYCFEEAIRAM5QELIBBBFUYNqwEgAEEANgIcIAAgATYCFCAAQf2NgIAANgIQIABBHTYCDEEAIRAM5AELIABBJzYCHCAAIAE2AhQgACAQNgIMQQAhEAzjAQsgECEBQQEhFAJAAkACQAJAAkACQAJAIAAtACxBfmoOBwYFBQMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0ErIRAMygELIABBADYCHCAAIBA2AhQgAEGrkoCAADYCECAAQQs2AgxBACEQDOIBCyAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMQQAhEAzhAQsgAEEAOgAsIBAhAQy9AQsgECEBQQEhFAJAAkACQAJAAkAgAC0ALEF7ag4EAwECAAULIAAgAC8BMEEIcjsBMAwDC0ECIRQMAQtBBCEUCyAAQQE6ACwgACAALwEwIBRyOwEwCyAQIQELQSkhEAzFAQsgAEEANgIcIAAgATYCFCAAQfCUgIAANgIQIABBAzYCDEEAIRAM3QELAkAgDi0AAEENRw0AIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHULIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzdAQsgAC0ALUEBcUUNAUHEASEQDMMBCwJAIA4gAkcNAEEtIRAM3AELAkACQANAAkAgDi0AAEF2ag4EAgAAAwALIA5BAWoiDiACRw0AC0EtIRAM3QELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDiEBDHQLIABBLDYCHCAAIA42AhQgACABNgIMQQAhEAzcAQsgACgCBCEBIABBADYCBAJAIAAgASAOELGAgIAAIgENACAOQQFqIQEMcwsgAEEsNgIcIAAgATYCDCAAIA5BAWo2AhRBACEQDNsBCyAAKAIEIQQgAEEANgIEIAAgBCAOELGAgIAAIgQNoAEgDiEBDM4BCyAQQSxHDQEgAUEBaiEQQQEhAQJAAkACQAJAAkAgAC0ALEF7ag4EAwECBAALIBAhAQwEC0ECIQEMAQtBBCEBCyAAQQE6ACwgACAALwEwIAFyOwEwIBAhAQwBCyAAIAAvATBBCHI7ATAgECEBC0E5IRAMvwELIABBADoALCABIQELQTQhEAy9AQsgACAALwEwQSByOwEwIAEhAQwCCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBA0AIAEhAQzHAQsgAEE3NgIcIAAgATYCFCAAIAQ2AgxBACEQDNQBCyAAQQg6ACwgASEBC0EwIRAMuQELAkAgAC0AKEEBRg0AIAEhAQwECyAALQAtQQhxRQ2TASABIQEMAwsgAC0AMEEgcQ2UAUHFASEQDLcBCwJAIA8gAkYNAAJAA0ACQCAPLQAAQVBqIgFB/wFxQQpJDQAgDyEBQTUhEAy6AQsgACkDICIRQpmz5syZs+bMGVYNASAAIBFCCn4iETcDICARIAGtQv8BgyISQn+FVg0BIAAgESASfDcDICAPQQFqIg8gAkcNAAtBOSEQDNEBCyAAKAIEIQIgAEEANgIEIAAgAiAPQQFqIgQQsYCAgAAiAg2VASAEIQEMwwELQTkhEAzPAQsCQCAALwEwIgFBCHFFDQAgAC0AKEEBRw0AIAAtAC1BCHFFDZABCyAAIAFB9/sDcUGABHI7ATAgDyEBC0E3IRAMtAELIAAgAC8BMEEQcjsBMAyrAQsgEEEVRg2LASAAQQA2AhwgACABNgIUIABB8I6AgAA2AhAgAEEcNgIMQQAhEAzLAQsgAEHDADYCHCAAIAE2AgwgACANQQFqNgIUQQAhEAzKAQsCQCABLQAAQTpHDQAgACgCBCEQIABBADYCBAJAIAAgECABEK+AgIAAIhANACABQQFqIQEMYwsgAEHDADYCHCAAIBA2AgwgACABQQFqNgIUQQAhEAzKAQsgAEEANgIcIAAgATYCFCAAQbGRgIAANgIQIABBCjYCDEEAIRAMyQELIABBADYCHCAAIAE2AhQgAEGgmYCAADYCECAAQR42AgxBACEQDMgBCyAAQQA2AgALIABBgBI7ASogACAXQQFqIgEgAhCogICAACIQDQEgASEBC0HHACEQDKwBCyAQQRVHDYMBIABB0QA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAzEAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAzDAQsgAEEANgIcIAAgFDYCFCAAQcGogIAANgIQIABBBzYCDCAAQQA2AgBBACEQDMIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxdCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDMEBC0EAIRAgAEEANgIcIAAgATYCFCAAQYCRgIAANgIQIABBCTYCDAzAAQsgEEEVRg19IABBADYCHCAAIAE2AhQgAEGUjYCAADYCECAAQSE2AgxBACEQDL8BC0EBIRZBACEXQQAhFEEBIRALIAAgEDoAKyABQQFqIQECQAJAIAAtAC1BEHENAAJAAkACQCAALQAqDgMBAAIECyAWRQ0DDAILIBQNAQwCCyAXRQ0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQrYCAgAAiEA0AIAEhAQxcCyAAQdgANgIcIAAgATYCFCAAIBA2AgxBACEQDL4BCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQytAQsgAEHZADYCHCAAIAE2AhQgACAENgIMQQAhEAy9AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMqwELIABB2gA2AhwgACABNgIUIAAgBDYCDEEAIRAMvAELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKkBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMRgsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAylAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHSADYCHCAAIBQ2AhQgACABNgIMQQAhEAykAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHTADYCHCAAIBQ2AhQgACABNgIMQQAhEAyjAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMQwsgAEHlADYCHCAAIBQ2AhQgACABNgIMQQAhEAyiAQsgAEEANgIcIAAgFDYCFCAAQcOPgIAANgIQIABBBzYCDEEAIRAMoQELIABBADYCHCAAIAE2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKABC0EAIRAgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDAyfAQsgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDEEAIRAMngELIABBADYCHCAAIBQ2AhQgAEH+kYCAADYCECAAQQc2AgxBACEQDJ0BCyAAQQA2AhwgACABNgIUIABBjpuAgAA2AhAgAEEGNgIMQQAhEAycAQsgEEEVRg1XIABBADYCHCAAIAE2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDJsBCyAAQQA2AgAgEEEBaiEBQSQhEAsgACAQOgApIAAoAgQhECAAQQA2AgQgACAQIAEQq4CAgAAiEA1UIAEhAQw+CyAAQQA2AgALQQAhECAAQQA2AhwgACAENgIUIABB8ZuAgAA2AhAgAEEGNgIMDJcBCyABQRVGDVAgAEEANgIcIAAgBTYCFCAAQfCMgIAANgIQIABBGzYCDEEAIRAMlgELIAAoAgQhBSAAQQA2AgQgACAFIBAQqYCAgAAiBQ0BIBBBAWohBQtBrQEhEAx7CyAAQcEBNgIcIAAgBTYCDCAAIBBBAWo2AhRBACEQDJMBCyAAKAIEIQYgAEEANgIEIAAgBiAQEKmAgIAAIgYNASAQQQFqIQYLQa4BIRAMeAsgAEHCATYCHCAAIAY2AgwgACAQQQFqNgIUQQAhEAyQAQsgAEEANgIcIAAgBzYCFCAAQZeLgIAANgIQIABBDTYCDEEAIRAMjwELIABBADYCHCAAIAg2AhQgAEHjkICAADYCECAAQQk2AgxBACEQDI4BCyAAQQA2AhwgACAINgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAyNAQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgCUEBaiEIAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBCAAIBAgCBCtgICAACIQRQ09IABByQE2AhwgACAINgIUIAAgEDYCDEEAIRAMjAELIAAoAgQhBCAAQQA2AgQgACAEIAgQrYCAgAAiBEUNdiAAQcoBNgIcIAAgCDYCFCAAIAQ2AgxBACEQDIsBCyAAKAIEIQQgAEEANgIEIAAgBCAJEK2AgIAAIgRFDXQgAEHLATYCHCAAIAk2AhQgACAENgIMQQAhEAyKAQsgACgCBCEEIABBADYCBCAAIAQgChCtgICAACIERQ1yIABBzQE2AhwgACAKNgIUIAAgBDYCDEEAIRAMiQELAkAgCy0AAEFQaiIQQf8BcUEKTw0AIAAgEDoAKiALQQFqIQpBtgEhEAxwCyAAKAIEIQQgAEEANgIEIAAgBCALEK2AgIAAIgRFDXAgAEHPATYCHCAAIAs2AhQgACAENgIMQQAhEAyIAQsgAEEANgIcIAAgBDYCFCAAQZCzgIAANgIQIABBCDYCDCAAQQA2AgBBACEQDIcBCyABQRVGDT8gAEEANgIcIAAgDDYCFCAAQcyOgIAANgIQIABBIDYCDEEAIRAMhgELIABBgQQ7ASggACgCBCEQIABCADcDACAAIBAgDEEBaiIMEKuAgIAAIhBFDTggAEHTATYCHCAAIAw2AhQgACAQNgIMQQAhEAyFAQsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQdibgIAANgIQIABBCDYCDAyDAQsgACgCBCEQIABCADcDACAAIBAgC0EBaiILEKuAgIAAIhANAUHGASEQDGkLIABBAjoAKAxVCyAAQdUBNgIcIAAgCzYCFCAAIBA2AgxBACEQDIABCyAQQRVGDTcgAEEANgIcIAAgBDYCFCAAQaSMgIAANgIQIABBEDYCDEEAIRAMfwsgAC0ANEEBRw00IAAgBCACELyAgIAAIhBFDTQgEEEVRw01IABB3AE2AhwgACAENgIUIABB1ZaAgAA2AhAgAEEVNgIMQQAhEAx+C0EAIRAgAEEANgIcIABBr4uAgAA2AhAgAEECNgIMIAAgFEEBajYCFAx9C0EAIRAMYwtBAiEQDGILQQ0hEAxhC0EPIRAMYAtBJSEQDF8LQRMhEAxeC0EVIRAMXQtBFiEQDFwLQRchEAxbC0EYIRAMWgtBGSEQDFkLQRohEAxYC0EbIRAMVwtBHCEQDFYLQR0hEAxVC0EfIRAMVAtBISEQDFMLQSMhEAxSC0HGACEQDFELQS4hEAxQC0EvIRAMTwtBOyEQDE4LQT0hEAxNC0HIACEQDEwLQckAIRAMSwtBywAhEAxKC0HMACEQDEkLQc4AIRAMSAtB0QAhEAxHC0HVACEQDEYLQdgAIRAMRQtB2QAhEAxEC0HbACEQDEMLQeQAIRAMQgtB5QAhEAxBC0HxACEQDEALQfQAIRAMPwtBjQEhEAw+C0GXASEQDD0LQakBIRAMPAtBrAEhEAw7C0HAASEQDDoLQbkBIRAMOQtBrwEhEAw4C0GxASEQDDcLQbIBIRAMNgtBtAEhEAw1C0G1ASEQDDQLQboBIRAMMwtBvQEhEAwyC0G/ASEQDDELQcEBIRAMMAsgAEEANgIcIAAgBDYCFCAAQemLgIAANgIQIABBHzYCDEEAIRAMSAsgAEHbATYCHCAAIAQ2AhQgAEH6loCAADYCECAAQRU2AgxBACEQDEcLIABB+AA2AhwgACAMNgIUIABBypiAgAA2AhAgAEEVNgIMQQAhEAxGCyAAQdEANgIcIAAgBTYCFCAAQbCXgIAANgIQIABBFTYCDEEAIRAMRQsgAEH5ADYCHCAAIAE2AhQgACAQNgIMQQAhEAxECyAAQfgANgIcIAAgATYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMQwsgAEHkADYCHCAAIAE2AhQgAEHjl4CAADYCECAAQRU2AgxBACEQDEILIABB1wA2AhwgACABNgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAxBCyAAQQA2AhwgACABNgIUIABBuY2AgAA2AhAgAEEaNgIMQQAhEAxACyAAQcIANgIcIAAgATYCFCAAQeOYgIAANgIQIABBFTYCDEEAIRAMPwsgAEEANgIEIAAgDyAPELGAgIAAIgRFDQEgAEE6NgIcIAAgBDYCDCAAIA9BAWo2AhRBACEQDD4LIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCxgICAACIERQ0AIABBOzYCHCAAIAQ2AgwgACABQQFqNgIUQQAhEAw+CyABQQFqIQEMLQsgD0EBaiEBDC0LIABBADYCHCAAIA82AhQgAEHkkoCAADYCECAAQQQ2AgxBACEQDDsLIABBNjYCHCAAIAQ2AhQgACACNgIMQQAhEAw6CyAAQS42AhwgACAONgIUIAAgBDYCDEEAIRAMOQsgAEHQADYCHCAAIAE2AhQgAEGRmICAADYCECAAQRU2AgxBACEQDDgLIA1BAWohAQwsCyAAQRU2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAw2CyAAQRs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw1CyAAQQ82AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw0CyAAQQs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAwzCyAAQRo2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwyCyAAQQs2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwxCyAAQQo2AhwgACABNgIUIABB5JaAgAA2AhAgAEEVNgIMQQAhEAwwCyAAQR42AhwgACABNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAwvCyAAQQA2AhwgACAQNgIUIABB2o2AgAA2AhAgAEEUNgIMQQAhEAwuCyAAQQQ2AhwgACABNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAwtCyAAQQA2AgAgC0EBaiELC0G4ASEQDBILIABBADYCACAQQQFqIQFB9QAhEAwRCyABIQECQCAALQApQQVHDQBB4wAhEAwRC0HiACEQDBALQQAhECAAQQA2AhwgAEHkkYCAADYCECAAQQc2AgwgACAUQQFqNgIUDCgLIABBADYCACAXQQFqIQFBwAAhEAwOC0EBIQELIAAgAToALCAAQQA2AgAgF0EBaiEBC0EoIRAMCwsgASEBC0E4IRAMCQsCQCABIg8gAkYNAANAAkAgDy0AAEGAvoCAAGotAAAiAUEBRg0AIAFBAkcNAyAPQQFqIQEMBAsgD0EBaiIPIAJHDQALQT4hEAwiC0E+IRAMIQsgAEEAOgAsIA8hAQwBC0ELIRAMBgtBOiEQDAULIAFBAWohAUEtIRAMBAsgACABOgAsIABBADYCACAWQQFqIQFBDCEQDAMLIABBADYCACAXQQFqIQFBCiEQDAILIABBADYCAAsgAEEAOgAsIA0hAUEJIRAMAAsLQQAhECAAQQA2AhwgACALNgIUIABBzZCAgAA2AhAgAEEJNgIMDBcLQQAhECAAQQA2AhwgACAKNgIUIABB6YqAgAA2AhAgAEEJNgIMDBYLQQAhECAAQQA2AhwgACAJNgIUIABBt5CAgAA2AhAgAEEJNgIMDBULQQAhECAAQQA2AhwgACAINgIUIABBnJGAgAA2AhAgAEEJNgIMDBQLQQAhECAAQQA2AhwgACABNgIUIABBzZCAgAA2AhAgAEEJNgIMDBMLQQAhECAAQQA2AhwgACABNgIUIABB6YqAgAA2AhAgAEEJNgIMDBILQQAhECAAQQA2AhwgACABNgIUIABBt5CAgAA2AhAgAEEJNgIMDBELQQAhECAAQQA2AhwgACABNgIUIABBnJGAgAA2AhAgAEEJNgIMDBALQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA8LQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA4LQQAhECAAQQA2AhwgACABNgIUIABBwJKAgAA2AhAgAEELNgIMDA0LQQAhECAAQQA2AhwgACABNgIUIABBlYmAgAA2AhAgAEELNgIMDAwLQQAhECAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMDAsLQQAhECAAQQA2AhwgACABNgIUIABB+4+AgAA2AhAgAEEKNgIMDAoLQQAhECAAQQA2AhwgACABNgIUIABB8ZmAgAA2AhAgAEECNgIMDAkLQQAhECAAQQA2AhwgACABNgIUIABBxJSAgAA2AhAgAEECNgIMDAgLQQAhECAAQQA2AhwgACABNgIUIABB8pWAgAA2AhAgAEECNgIMDAcLIABBAjYCHCAAIAE2AhQgAEGcmoCAADYCECAAQRY2AgxBACEQDAYLQQEhEAwFC0HUACEQIAEiBCACRg0EIANBCGogACAEIAJB2MKAgABBChDFgICAACADKAIMIQQgAygCCA4DAQQCAAsQyoCAgAAACyAAQQA2AhwgAEG1moCAADYCECAAQRc2AgwgACAEQQFqNgIUQQAhEAwCCyAAQQA2AhwgACAENgIUIABBypqAgAA2AhAgAEEJNgIMQQAhEAwBCwJAIAEiBCACRw0AQSIhEAwBCyAAQYmAgIAANgIIIAAgBDYCBEEhIRALIANBEGokgICAgAAgEAuvAQECfyABKAIAIQYCQAJAIAIgA0YNACAEIAZqIQQgBiADaiACayEHIAIgBkF/cyAFaiIGaiEFA0ACQCACLQAAIAQtAABGDQBBAiEEDAMLAkAgBg0AQQAhBCAFIQIMAwsgBkF/aiEGIARBAWohBCACQQFqIgIgA0cNAAsgByEGIAMhAgsgAEEBNgIAIAEgBjYCACAAIAI2AgQPCyABQQA2AgAgACAENgIAIAAgAjYCBAsKACAAEMeAgIAAC/I2AQt/I4CAgIAAQRBrIgEkgICAgAACQEEAKAKg0ICAAA0AQQAQy4CAgABBgNSEgABrIgJB2QBJDQBBACEDAkBBACgC4NOAgAAiBA0AQQBCfzcC7NOAgABBAEKAgISAgIDAADcC5NOAgABBACABQQhqQXBxQdiq1aoFcyIENgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgAALQQAgAjYCzNOAgABBAEGA1ISAADYCyNOAgABBAEGA1ISAADYCmNCAgABBACAENgKs0ICAAEEAQX82AqjQgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAtBgNSEgABBeEGA1ISAAGtBD3FBAEGA1ISAAEEIakEPcRsiA2oiBEEEaiACQUhqIgUgA2siA0EBcjYCAEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgABBgNSEgAAgBWpBODYCBAsCQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAUsNAAJAQQAoAojQgIAAIgZBECAAQRNqQXBxIABBC0kbIgJBA3YiBHYiA0EDcUUNAAJAAkAgA0EBcSAEckEBcyIFQQN0IgRBsNCAgABqIgMgBEG40ICAAGooAgAiBCgCCCICRw0AQQAgBkF+IAV3cTYCiNCAgAAMAQsgAyACNgIIIAIgAzYCDAsgBEEIaiEDIAQgBUEDdCIFQQNyNgIEIAQgBWoiBCAEKAIEQQFyNgIEDAwLIAJBACgCkNCAgAAiB00NAQJAIANFDQACQAJAIAMgBHRBAiAEdCIDQQAgA2tycSIDQQAgA2txQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmoiBEEDdCIDQbDQgIAAaiIFIANBuNCAgABqKAIAIgMoAggiAEcNAEEAIAZBfiAEd3EiBjYCiNCAgAAMAQsgBSAANgIIIAAgBTYCDAsgAyACQQNyNgIEIAMgBEEDdCIEaiAEIAJrIgU2AgAgAyACaiIAIAVBAXI2AgQCQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhBAJAAkAgBkEBIAdBA3Z0IghxDQBBACAGIAhyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAQ2AgwgAiAENgIIIAQgAjYCDCAEIAg2AggLIANBCGohA0EAIAA2ApzQgIAAQQAgBTYCkNCAgAAMDAtBACgCjNCAgAAiCUUNASAJQQAgCWtxQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmpBAnRBuNKAgABqKAIAIgAoAgRBeHEgAmshBCAAIQUCQANAAkAgBSgCECIDDQAgBUEUaigCACIDRQ0CCyADKAIEQXhxIAJrIgUgBCAFIARJIgUbIQQgAyAAIAUbIQAgAyEFDAALCyAAKAIYIQoCQCAAKAIMIgggAEYNACAAKAIIIgNBACgCmNCAgABJGiAIIAM2AgggAyAINgIMDAsLAkAgAEEUaiIFKAIAIgMNACAAKAIQIgNFDQMgAEEQaiEFCwNAIAUhCyADIghBFGoiBSgCACIDDQAgCEEQaiEFIAgoAhAiAw0ACyALQQA2AgAMCgtBfyECIABBv39LDQAgAEETaiIDQXBxIQJBACgCjNCAgAAiB0UNAEEAIQsCQCACQYACSQ0AQR8hCyACQf///wdLDQAgA0EIdiIDIANBgP4/akEQdkEIcSIDdCIEIARBgOAfakEQdkEEcSIEdCIFIAVBgIAPakEQdkECcSIFdEEPdiADIARyIAVyayIDQQF0IAIgA0EVanZBAXFyQRxqIQsLQQAgAmshBAJAAkACQAJAIAtBAnRBuNKAgABqKAIAIgUNAEEAIQNBACEIDAELQQAhAyACQQBBGSALQQF2ayALQR9GG3QhAEEAIQgDQAJAIAUoAgRBeHEgAmsiBiAETw0AIAYhBCAFIQggBg0AQQAhBCAFIQggBSEDDAMLIAMgBUEUaigCACIGIAYgBSAAQR12QQRxakEQaigCACIFRhsgAyAGGyEDIABBAXQhACAFDQALCwJAIAMgCHINAEEAIQhBAiALdCIDQQAgA2tyIAdxIgNFDQMgA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBUEFdkEIcSIAIANyIAUgAHYiA0ECdkEEcSIFciADIAV2IgNBAXZBAnEiBXIgAyAFdiIDQQF2QQFxIgVyIAMgBXZqQQJ0QbjSgIAAaigCACEDCyADRQ0BCwNAIAMoAgRBeHEgAmsiBiAESSEAAkAgAygCECIFDQAgA0EUaigCACEFCyAGIAQgABshBCADIAggABshCCAFIQMgBQ0ACwsgCEUNACAEQQAoApDQgIAAIAJrTw0AIAgoAhghCwJAIAgoAgwiACAIRg0AIAgoAggiA0EAKAKY0ICAAEkaIAAgAzYCCCADIAA2AgwMCQsCQCAIQRRqIgUoAgAiAw0AIAgoAhAiA0UNAyAIQRBqIQULA0AgBSEGIAMiAEEUaiIFKAIAIgMNACAAQRBqIQUgACgCECIDDQALIAZBADYCAAwICwJAQQAoApDQgIAAIgMgAkkNAEEAKAKc0ICAACEEAkACQCADIAJrIgVBEEkNACAEIAJqIgAgBUEBcjYCBEEAIAU2ApDQgIAAQQAgADYCnNCAgAAgBCADaiAFNgIAIAQgAkEDcjYCBAwBCyAEIANBA3I2AgQgBCADaiIDIAMoAgRBAXI2AgRBAEEANgKc0ICAAEEAQQA2ApDQgIAACyAEQQhqIQMMCgsCQEEAKAKU0ICAACIAIAJNDQBBACgCoNCAgAAiAyACaiIEIAAgAmsiBUEBcjYCBEEAIAU2ApTQgIAAQQAgBDYCoNCAgAAgAyACQQNyNgIEIANBCGohAwwKCwJAAkBBACgC4NOAgABFDQBBACgC6NOAgAAhBAwBC0EAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEMakFwcUHYqtWqBXM2AuDTgIAAQQBBADYC9NOAgABBAEEANgLE04CAAEGAgAQhBAtBACEDAkAgBCACQccAaiIHaiIGQQAgBGsiC3EiCCACSw0AQQBBMDYC+NOAgAAMCgsCQEEAKALA04CAACIDRQ0AAkBBACgCuNOAgAAiBCAIaiIFIARNDQAgBSADTQ0BC0EAIQNBAEEwNgL404CAAAwKC0EALQDE04CAAEEEcQ0EAkACQAJAQQAoAqDQgIAAIgRFDQBByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiAESw0DCyADKAIIIgMNAAsLQQAQy4CAgAAiAEF/Rg0FIAghBgJAQQAoAuTTgIAAIgNBf2oiBCAAcUUNACAIIABrIAQgAGpBACADa3FqIQYLIAYgAk0NBSAGQf7///8HSw0FAkBBACgCwNOAgAAiA0UNAEEAKAK404CAACIEIAZqIgUgBE0NBiAFIANLDQYLIAYQy4CAgAAiAyAARw0BDAcLIAYgAGsgC3EiBkH+////B0sNBCAGEMuAgIAAIgAgAygCACADKAIEakYNAyAAIQMLAkAgA0F/Rg0AIAJByABqIAZNDQACQCAHIAZrQQAoAujTgIAAIgRqQQAgBGtxIgRB/v///wdNDQAgAyEADAcLAkAgBBDLgICAAEF/Rg0AIAQgBmohBiADIQAMBwtBACAGaxDLgICAABoMBAsgAyEAIANBf0cNBQwDC0EAIQgMBwtBACEADAULIABBf0cNAgtBAEEAKALE04CAAEEEcjYCxNOAgAALIAhB/v///wdLDQEgCBDLgICAACEAQQAQy4CAgAAhAyAAQX9GDQEgA0F/Rg0BIAAgA08NASADIABrIgYgAkE4ak0NAQtBAEEAKAK404CAACAGaiIDNgK404CAAAJAIANBACgCvNOAgABNDQBBACADNgK804CAAAsCQAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQCAAIAMoAgAiBSADKAIEIghqRg0CIAMoAggiAw0ADAMLCwJAAkBBACgCmNCAgAAiA0UNACAAIANPDQELQQAgADYCmNCAgAALQQAhA0EAIAY2AszTgIAAQQAgADYCyNOAgABBAEF/NgKo0ICAAEEAQQAoAuDTgIAANgKs0ICAAEEAQQA2AtTTgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiBCAGQUhqIgUgA2siA0EBcjYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgAAgACAFakE4NgIEDAILIAMtAAxBCHENACAEIAVJDQAgBCAATw0AIARBeCAEa0EPcUEAIARBCGpBD3EbIgVqIgBBACgClNCAgAAgBmoiCyAFayIFQQFyNgIEIAMgCCAGajYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAU2ApTQgIAAQQAgADYCoNCAgAAgBCALakE4NgIEDAELAkAgAEEAKAKY0ICAACIITw0AQQAgADYCmNCAgAAgACEICyAAIAZqIQVByNOAgAAhAwJAAkACQAJAAkACQAJAA0AgAygCACAFRg0BIAMoAggiAw0ADAILCyADLQAMQQhxRQ0BC0HI04CAACEDA0ACQCADKAIAIgUgBEsNACAFIAMoAgRqIgUgBEsNAwsgAygCCCEDDAALCyADIAA2AgAgAyADKAIEIAZqNgIEIABBeCAAa0EPcUEAIABBCGpBD3EbaiILIAJBA3I2AgQgBUF4IAVrQQ9xQQAgBUEIakEPcRtqIgYgCyACaiICayEDAkAgBiAERw0AQQAgAjYCoNCAgABBAEEAKAKU0ICAACADaiIDNgKU0ICAACACIANBAXI2AgQMAwsCQCAGQQAoApzQgIAARw0AQQAgAjYCnNCAgABBAEEAKAKQ0ICAACADaiIDNgKQ0ICAACACIANBAXI2AgQgAiADaiADNgIADAMLAkAgBigCBCIEQQNxQQFHDQAgBEF4cSEHAkACQCAEQf8BSw0AIAYoAggiBSAEQQN2IghBA3RBsNCAgABqIgBGGgJAIAYoAgwiBCAFRw0AQQBBACgCiNCAgABBfiAId3E2AojQgIAADAILIAQgAEYaIAQgBTYCCCAFIAQ2AgwMAQsgBigCGCEJAkACQCAGKAIMIgAgBkYNACAGKAIIIgQgCEkaIAAgBDYCCCAEIAA2AgwMAQsCQCAGQRRqIgQoAgAiBQ0AIAZBEGoiBCgCACIFDQBBACEADAELA0AgBCEIIAUiAEEUaiIEKAIAIgUNACAAQRBqIQQgACgCECIFDQALIAhBADYCAAsgCUUNAAJAAkAgBiAGKAIcIgVBAnRBuNKAgABqIgQoAgBHDQAgBCAANgIAIAANAUEAQQAoAozQgIAAQX4gBXdxNgKM0ICAAAwCCyAJQRBBFCAJKAIQIAZGG2ogADYCACAARQ0BCyAAIAk2AhgCQCAGKAIQIgRFDQAgACAENgIQIAQgADYCGAsgBigCFCIERQ0AIABBFGogBDYCACAEIAA2AhgLIAcgA2ohAyAGIAdqIgYoAgQhBAsgBiAEQX5xNgIEIAIgA2ogAzYCACACIANBAXI2AgQCQCADQf8BSw0AIANBeHFBsNCAgABqIQQCQAJAQQAoAojQgIAAIgVBASADQQN2dCIDcQ0AQQAgBSADcjYCiNCAgAAgBCEDDAELIAQoAgghAwsgAyACNgIMIAQgAjYCCCACIAQ2AgwgAiADNgIIDAMLQR8hBAJAIANB////B0sNACADQQh2IgQgBEGA/j9qQRB2QQhxIgR0IgUgBUGA4B9qQRB2QQRxIgV0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAQgBXIgAHJrIgRBAXQgAyAEQRVqdkEBcXJBHGohBAsgAiAENgIcIAJCADcCECAEQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiAEEBIAR0IghxDQAgBSACNgIAQQAgACAIcjYCjNCAgAAgAiAFNgIYIAIgAjYCCCACIAI2AgwMAwsgA0EAQRkgBEEBdmsgBEEfRht0IQQgBSgCACEAA0AgACIFKAIEQXhxIANGDQIgBEEddiEAIARBAXQhBCAFIABBBHFqQRBqIggoAgAiAA0ACyAIIAI2AgAgAiAFNgIYIAIgAjYCDCACIAI2AggMAgsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiCyAGQUhqIgggA2siA0EBcjYCBCAAIAhqQTg2AgQgBCAFQTcgBWtBD3FBACAFQUlqQQ9xG2pBQWoiCCAIIARBEGpJGyIIQSM2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAs2AqDQgIAAIAhBEGpBACkC0NOAgAA3AgAgCEEAKQLI04CAADcCCEEAIAhBCGo2AtDTgIAAQQAgBjYCzNOAgABBACAANgLI04CAAEEAQQA2AtTTgIAAIAhBJGohAwNAIANBBzYCACADQQRqIgMgBUkNAAsgCCAERg0DIAggCCgCBEF+cTYCBCAIIAggBGsiADYCACAEIABBAXI2AgQCQCAAQf8BSw0AIABBeHFBsNCAgABqIQMCQAJAQQAoAojQgIAAIgVBASAAQQN2dCIAcQ0AQQAgBSAAcjYCiNCAgAAgAyEFDAELIAMoAgghBQsgBSAENgIMIAMgBDYCCCAEIAM2AgwgBCAFNgIIDAQLQR8hAwJAIABB////B0sNACAAQQh2IgMgA0GA/j9qQRB2QQhxIgN0IgUgBUGA4B9qQRB2QQRxIgV0IgggCEGAgA9qQRB2QQJxIgh0QQ92IAMgBXIgCHJrIgNBAXQgACADQRVqdkEBcXJBHGohAwsgBCADNgIcIARCADcCECADQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiCEEBIAN0IgZxDQAgBSAENgIAQQAgCCAGcjYCjNCAgAAgBCAFNgIYIAQgBDYCCCAEIAQ2AgwMBAsgAEEAQRkgA0EBdmsgA0EfRht0IQMgBSgCACEIA0AgCCIFKAIEQXhxIABGDQMgA0EddiEIIANBAXQhAyAFIAhBBHFqQRBqIgYoAgAiCA0ACyAGIAQ2AgAgBCAFNgIYIAQgBDYCDCAEIAQ2AggMAwsgBSgCCCIDIAI2AgwgBSACNgIIIAJBADYCGCACIAU2AgwgAiADNgIICyALQQhqIQMMBQsgBSgCCCIDIAQ2AgwgBSAENgIIIARBADYCGCAEIAU2AgwgBCADNgIIC0EAKAKU0ICAACIDIAJNDQBBACgCoNCAgAAiBCACaiIFIAMgAmsiA0EBcjYCBEEAIAM2ApTQgIAAQQAgBTYCoNCAgAAgBCACQQNyNgIEIARBCGohAwwDC0EAIQNBAEEwNgL404CAAAwCCwJAIAtFDQACQAJAIAggCCgCHCIFQQJ0QbjSgIAAaiIDKAIARw0AIAMgADYCACAADQFBACAHQX4gBXdxIgc2AozQgIAADAILIAtBEEEUIAsoAhAgCEYbaiAANgIAIABFDQELIAAgCzYCGAJAIAgoAhAiA0UNACAAIAM2AhAgAyAANgIYCyAIQRRqKAIAIgNFDQAgAEEUaiADNgIAIAMgADYCGAsCQAJAIARBD0sNACAIIAQgAmoiA0EDcjYCBCAIIANqIgMgAygCBEEBcjYCBAwBCyAIIAJqIgAgBEEBcjYCBCAIIAJBA3I2AgQgACAEaiAENgIAAkAgBEH/AUsNACAEQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgBEEDdnQiBHENAEEAIAUgBHI2AojQgIAAIAMhBAwBCyADKAIIIQQLIAQgADYCDCADIAA2AgggACADNgIMIAAgBDYCCAwBC0EfIQMCQCAEQf///wdLDQAgBEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCICIAJBgIAPakEQdkECcSICdEEPdiADIAVyIAJyayIDQQF0IAQgA0EVanZBAXFyQRxqIQMLIAAgAzYCHCAAQgA3AhAgA0ECdEG40oCAAGohBQJAIAdBASADdCICcQ0AIAUgADYCAEEAIAcgAnI2AozQgIAAIAAgBTYCGCAAIAA2AgggACAANgIMDAELIARBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhAgJAA0AgAiIFKAIEQXhxIARGDQEgA0EddiECIANBAXQhAyAFIAJBBHFqQRBqIgYoAgAiAg0ACyAGIAA2AgAgACAFNgIYIAAgADYCDCAAIAA2AggMAQsgBSgCCCIDIAA2AgwgBSAANgIIIABBADYCGCAAIAU2AgwgACADNgIICyAIQQhqIQMMAQsCQCAKRQ0AAkACQCAAIAAoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAg2AgAgCA0BQQAgCUF+IAV3cTYCjNCAgAAMAgsgCkEQQRQgCigCECAARhtqIAg2AgAgCEUNAQsgCCAKNgIYAkAgACgCECIDRQ0AIAggAzYCECADIAg2AhgLIABBFGooAgAiA0UNACAIQRRqIAM2AgAgAyAINgIYCwJAAkAgBEEPSw0AIAAgBCACaiIDQQNyNgIEIAAgA2oiAyADKAIEQQFyNgIEDAELIAAgAmoiBSAEQQFyNgIEIAAgAkEDcjYCBCAFIARqIAQ2AgACQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhAwJAAkBBASAHQQN2dCIIIAZxDQBBACAIIAZyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAM2AgwgAiADNgIIIAMgAjYCDCADIAg2AggLQQAgBTYCnNCAgABBACAENgKQ0ICAAAsgAEEIaiEDCyABQRBqJICAgIAAIAMLCgAgABDJgICAAAviDQEHfwJAIABFDQAgAEF4aiIBIABBfGooAgAiAkF4cSIAaiEDAkAgAkEBcQ0AIAJBA3FFDQEgASABKAIAIgJrIgFBACgCmNCAgAAiBEkNASACIABqIQACQCABQQAoApzQgIAARg0AAkAgAkH/AUsNACABKAIIIgQgAkEDdiIFQQN0QbDQgIAAaiIGRhoCQCABKAIMIgIgBEcNAEEAQQAoAojQgIAAQX4gBXdxNgKI0ICAAAwDCyACIAZGGiACIAQ2AgggBCACNgIMDAILIAEoAhghBwJAAkAgASgCDCIGIAFGDQAgASgCCCICIARJGiAGIAI2AgggAiAGNgIMDAELAkAgAUEUaiICKAIAIgQNACABQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQECQAJAIAEgASgCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAwsgB0EQQRQgBygCECABRhtqIAY2AgAgBkUNAgsgBiAHNgIYAkAgASgCECICRQ0AIAYgAjYCECACIAY2AhgLIAEoAhQiAkUNASAGQRRqIAI2AgAgAiAGNgIYDAELIAMoAgQiAkEDcUEDRw0AIAMgAkF+cTYCBEEAIAA2ApDQgIAAIAEgAGogADYCACABIABBAXI2AgQPCyABIANPDQAgAygCBCICQQFxRQ0AAkACQCACQQJxDQACQCADQQAoAqDQgIAARw0AQQAgATYCoNCAgABBAEEAKAKU0ICAACAAaiIANgKU0ICAACABIABBAXI2AgQgAUEAKAKc0ICAAEcNA0EAQQA2ApDQgIAAQQBBADYCnNCAgAAPCwJAIANBACgCnNCAgABHDQBBACABNgKc0ICAAEEAQQAoApDQgIAAIABqIgA2ApDQgIAAIAEgAEEBcjYCBCABIABqIAA2AgAPCyACQXhxIABqIQACQAJAIAJB/wFLDQAgAygCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgAygCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAgsgAiAGRhogAiAENgIIIAQgAjYCDAwBCyADKAIYIQcCQAJAIAMoAgwiBiADRg0AIAMoAggiAkEAKAKY0ICAAEkaIAYgAjYCCCACIAY2AgwMAQsCQCADQRRqIgIoAgAiBA0AIANBEGoiAigCACIEDQBBACEGDAELA0AgAiEFIAQiBkEUaiICKAIAIgQNACAGQRBqIQIgBigCECIEDQALIAVBADYCAAsgB0UNAAJAAkAgAyADKAIcIgRBAnRBuNKAgABqIgIoAgBHDQAgAiAGNgIAIAYNAUEAQQAoAozQgIAAQX4gBHdxNgKM0ICAAAwCCyAHQRBBFCAHKAIQIANGG2ogBjYCACAGRQ0BCyAGIAc2AhgCQCADKAIQIgJFDQAgBiACNgIQIAIgBjYCGAsgAygCFCICRQ0AIAZBFGogAjYCACACIAY2AhgLIAEgAGogADYCACABIABBAXI2AgQgAUEAKAKc0ICAAEcNAUEAIAA2ApDQgIAADwsgAyACQX5xNgIEIAEgAGogADYCACABIABBAXI2AgQLAkAgAEH/AUsNACAAQXhxQbDQgIAAaiECAkACQEEAKAKI0ICAACIEQQEgAEEDdnQiAHENAEEAIAQgAHI2AojQgIAAIAIhAAwBCyACKAIIIQALIAAgATYCDCACIAE2AgggASACNgIMIAEgADYCCA8LQR8hAgJAIABB////B0sNACAAQQh2IgIgAkGA/j9qQRB2QQhxIgJ0IgQgBEGA4B9qQRB2QQRxIgR0IgYgBkGAgA9qQRB2QQJxIgZ0QQ92IAIgBHIgBnJrIgJBAXQgACACQRVqdkEBcXJBHGohAgsgASACNgIcIAFCADcCECACQQJ0QbjSgIAAaiEEAkACQEEAKAKM0ICAACIGQQEgAnQiA3ENACAEIAE2AgBBACAGIANyNgKM0ICAACABIAQ2AhggASABNgIIIAEgATYCDAwBCyAAQQBBGSACQQF2ayACQR9GG3QhAiAEKAIAIQYCQANAIAYiBCgCBEF4cSAARg0BIAJBHXYhBiACQQF0IQIgBCAGQQRxakEQaiIDKAIAIgYNAAsgAyABNgIAIAEgBDYCGCABIAE2AgwgASABNgIIDAELIAQoAggiACABNgIMIAQgATYCCCABQQA2AhggASAENgIMIAEgADYCCAtBAEEAKAKo0ICAAEF/aiIBQX8gARs2AqjQgIAACwsEAAAAC04AAkAgAA0APwBBEHQPCwJAIABB//8DcQ0AIABBf0wNAAJAIABBEHZAACIAQX9HDQBBAEEwNgL404CAAEF/DwsgAEEQdA8LEMqAgIAAAAvyAgIDfwF+AkAgAkUNACAAIAE6AAAgAiAAaiIDQX9qIAE6AAAgAkEDSQ0AIAAgAToAAiAAIAE6AAEgA0F9aiABOgAAIANBfmogAToAACACQQdJDQAgACABOgADIANBfGogAToAACACQQlJDQAgAEEAIABrQQNxIgRqIgMgAUH/AXFBgYKECGwiATYCACADIAIgBGtBfHEiBGoiAkF8aiABNgIAIARBCUkNACADIAE2AgggAyABNgIEIAJBeGogATYCACACQXRqIAE2AgAgBEEZSQ0AIAMgATYCGCADIAE2AhQgAyABNgIQIAMgATYCDCACQXBqIAE2AgAgAkFsaiABNgIAIAJBaGogATYCACACQWRqIAE2AgAgBCADQQRxQRhyIgVrIgJBIEkNACABrUKBgICAEH4hBiADIAVqIQEDQCABIAY3AxggASAGNwMQIAEgBjcDCCABIAY3AwAgAUEgaiEBIAJBYGoiAkEfSw0ACwsgAAsLjkgBAEGACAuGSAEAAAACAAAAAwAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAYAAAAHAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsb3NlZWVwLWFsaXZlAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgAAAAAAAAAAAAAAAAAAAHJhbnNmZXItZW5jb2RpbmdwZ3JhZGUNCg0KDQpTTQ0KDQpUVFAvQ0UvVFNQLwAAAAAAAAAAAAAAAAECAAEDAAAAAAAAAAAAAAAAAAAAAAAABAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAABAAACAAAAAAAAAAAAAAAAAAAAAAAAAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==' + + +/***/ }), + +/***/ 41891: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.enumToMap = void 0; +function enumToMap(obj) { + const res = {}; + Object.keys(obj).forEach((key) => { + const value = obj[key]; + if (typeof value === 'number') { + res[key] = value; + } + }); + return res; +} +exports.enumToMap = enumToMap; +//# sourceMappingURL=utils.js.map + +/***/ }), + +/***/ 66771: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kClients } = __nccwpck_require__(72785) +const Agent = __nccwpck_require__(7890) +const { + kAgent, + kMockAgentSet, + kMockAgentGet, + kDispatches, + kIsMockActive, + kNetConnect, + kGetNetConnect, + kOptions, + kFactory +} = __nccwpck_require__(24347) +const MockClient = __nccwpck_require__(58687) +const MockPool = __nccwpck_require__(26193) +const { matchValue, buildMockOptions } = __nccwpck_require__(79323) +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(48045) +const Dispatcher = __nccwpck_require__(60412) +const Pluralizer = __nccwpck_require__(78891) +const PendingInterceptorsFormatter = __nccwpck_require__(86823) + +class FakeWeakRef { + constructor (value) { + this.value = value + } + + deref () { + return this.value + } +} + +class MockAgent extends Dispatcher { + constructor (opts) { + super(opts) + + this[kNetConnect] = true + this[kIsMockActive] = true + + // Instantiate Agent and encapsulate + if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + const agent = opts && opts.agent ? opts.agent : new Agent(opts) + this[kAgent] = agent + + this[kClients] = agent[kClients] + this[kOptions] = buildMockOptions(opts) + } + + get (origin) { + let dispatcher = this[kMockAgentGet](origin) + + if (!dispatcher) { + dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + } + return dispatcher + } + + dispatch (opts, handler) { + // Call MockAgent.get to perform additional setup before dispatching as normal + this.get(opts.origin) + return this[kAgent].dispatch(opts, handler) + } + + async close () { + await this[kAgent].close() + this[kClients].clear() + } + + deactivate () { + this[kIsMockActive] = false + } + + activate () { + this[kIsMockActive] = true + } + + enableNetConnect (matcher) { + if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) { + if (Array.isArray(this[kNetConnect])) { + this[kNetConnect].push(matcher) + } else { + this[kNetConnect] = [matcher] + } + } else if (typeof matcher === 'undefined') { + this[kNetConnect] = true + } else { + throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.') + } + } + + disableNetConnect () { + this[kNetConnect] = false + } + + // This is required to bypass issues caused by using global symbols - see: + // https://github.com/nodejs/undici/issues/1447 + get isMockActive () { + return this[kIsMockActive] + } + + [kMockAgentSet] (origin, dispatcher) { + this[kClients].set(origin, new FakeWeakRef(dispatcher)) + } + + [kFactory] (origin) { + const mockOptions = Object.assign({ agent: this }, this[kOptions]) + return this[kOptions] && this[kOptions].connections === 1 + ? new MockClient(origin, mockOptions) + : new MockPool(origin, mockOptions) + } + + [kMockAgentGet] (origin) { + // First check if we can immediately find it + const ref = this[kClients].get(origin) + if (ref) { + return ref.deref() + } + + // If the origin is not a string create a dummy parent pool and return to user + if (typeof origin !== 'string') { + const dispatcher = this[kFactory]('http://localhost:9999') + this[kMockAgentSet](origin, dispatcher) + return dispatcher + } + + // If we match, create a pool and assign the same dispatches + for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { + const nonExplicitDispatcher = nonExplicitRef.deref() + if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) { + const dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches] + return dispatcher + } + } + } + + [kGetNetConnect] () { + return this[kNetConnect] + } + + pendingInterceptors () { + const mockAgentClients = this[kClients] + + return Array.from(mockAgentClients.entries()) + .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin }))) + .filter(({ pending }) => pending) + } + + assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { + const pending = this.pendingInterceptors() + + if (pending.length === 0) { + return + } + + const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length) + + throw new UndiciError(` +${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: + +${pendingInterceptorsFormatter.format(pending)} +`.trim()) + } +} + +module.exports = MockAgent + + +/***/ }), + +/***/ 58687: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { promisify } = __nccwpck_require__(73837) +const Client = __nccwpck_require__(33598) +const { buildMockDispatch } = __nccwpck_require__(79323) +const { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected +} = __nccwpck_require__(24347) +const { MockInterceptor } = __nccwpck_require__(90410) +const Symbols = __nccwpck_require__(72785) +const { InvalidArgumentError } = __nccwpck_require__(48045) + +/** + * MockClient provides an API that extends the Client to influence the mockDispatches. + */ +class MockClient extends Client { + constructor (origin, opts) { + super(origin, opts) + + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + + this[kMockAgent] = opts.agent + this[kOrigin] = origin + this[kDispatches] = [] + this[kConnected] = 1 + this[kOriginalDispatch] = this.dispatch + this[kOriginalClose] = this.close.bind(this) + + this.dispatch = buildMockDispatch.call(this) + this.close = this[kClose] + } + + get [Symbols.kConnected] () { + return this[kConnected] + } + + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept (opts) { + return new MockInterceptor(opts, this[kDispatches]) + } + + async [kClose] () { + await promisify(this[kOriginalClose])() + this[kConnected] = 0 + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) + } +} + +module.exports = MockClient + + +/***/ }), + +/***/ 50888: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { UndiciError } = __nccwpck_require__(48045) + +class MockNotMatchedError extends UndiciError { + constructor (message) { + super(message) + Error.captureStackTrace(this, MockNotMatchedError) + this.name = 'MockNotMatchedError' + this.message = message || 'The request does not match any registered mock dispatches' + this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' + } +} + +module.exports = { + MockNotMatchedError +} + + +/***/ }), + +/***/ 90410: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(79323) +const { + kDispatches, + kDispatchKey, + kDefaultHeaders, + kDefaultTrailers, + kContentLength, + kMockDispatch +} = __nccwpck_require__(24347) +const { InvalidArgumentError } = __nccwpck_require__(48045) +const { buildURL } = __nccwpck_require__(83983) + +/** + * Defines the scope API for an interceptor reply + */ +class MockScope { + constructor (mockDispatch) { + this[kMockDispatch] = mockDispatch + } + + /** + * Delay a reply by a set amount in ms. + */ + delay (waitInMs) { + if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) { + throw new InvalidArgumentError('waitInMs must be a valid integer > 0') + } + + this[kMockDispatch].delay = waitInMs + return this + } + + /** + * For a defined reply, never mark as consumed. + */ + persist () { + this[kMockDispatch].persist = true + return this + } + + /** + * Allow one to define a reply for a set amount of matching requests. + */ + times (repeatTimes) { + if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { + throw new InvalidArgumentError('repeatTimes must be a valid integer > 0') + } + + this[kMockDispatch].times = repeatTimes + return this + } +} + +/** + * Defines an interceptor for a Mock + */ +class MockInterceptor { + constructor (opts, mockDispatches) { + if (typeof opts !== 'object') { + throw new InvalidArgumentError('opts must be an object') + } + if (typeof opts.path === 'undefined') { + throw new InvalidArgumentError('opts.path must be defined') + } + if (typeof opts.method === 'undefined') { + opts.method = 'GET' + } + // See https://github.com/nodejs/undici/issues/1245 + // As per RFC 3986, clients are not supposed to send URI + // fragments to servers when they retrieve a document, + if (typeof opts.path === 'string') { + if (opts.query) { + opts.path = buildURL(opts.path, opts.query) + } else { + // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811 + const parsedURL = new URL(opts.path, 'data://') + opts.path = parsedURL.pathname + parsedURL.search + } + } + if (typeof opts.method === 'string') { + opts.method = opts.method.toUpperCase() + } + + this[kDispatchKey] = buildKey(opts) + this[kDispatches] = mockDispatches + this[kDefaultHeaders] = {} + this[kDefaultTrailers] = {} + this[kContentLength] = false + } + + createMockScopeDispatchData (statusCode, data, responseOptions = {}) { + const responseData = getResponseData(data) + const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {} + const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers } + const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers } + + return { statusCode, data, headers, trailers } + } + + validateReplyParameters (statusCode, data, responseOptions) { + if (typeof statusCode === 'undefined') { + throw new InvalidArgumentError('statusCode must be defined') + } + if (typeof data === 'undefined') { + throw new InvalidArgumentError('data must be defined') + } + if (typeof responseOptions !== 'object') { + throw new InvalidArgumentError('responseOptions must be an object') + } + } + + /** + * Mock an undici request with a defined reply. + */ + reply (replyData) { + // Values of reply aren't available right now as they + // can only be available when the reply callback is invoked. + if (typeof replyData === 'function') { + // We'll first wrap the provided callback in another function, + // this function will properly resolve the data from the callback + // when invoked. + const wrappedDefaultsCallback = (opts) => { + // Our reply options callback contains the parameter for statusCode, data and options. + const resolvedData = replyData(opts) + + // Check if it is in the right format + if (typeof resolvedData !== 'object') { + throw new InvalidArgumentError('reply options callback must return an object') + } + + const { statusCode, data = '', responseOptions = {} } = resolvedData + this.validateReplyParameters(statusCode, data, responseOptions) + // Since the values can be obtained immediately we return them + // from this higher order function that will be resolved later. + return { + ...this.createMockScopeDispatchData(statusCode, data, responseOptions) + } + } + + // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data. + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback) + return new MockScope(newMockDispatch) + } + + // We can have either one or three parameters, if we get here, + // we should have 1-3 parameters. So we spread the arguments of + // this function to obtain the parameters, since replyData will always + // just be the statusCode. + const [statusCode, data = '', responseOptions = {}] = [...arguments] + this.validateReplyParameters(statusCode, data, responseOptions) + + // Send in-already provided data like usual + const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions) + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData) + return new MockScope(newMockDispatch) + } + + /** + * Mock an undici request with a defined error. + */ + replyWithError (error) { + if (typeof error === 'undefined') { + throw new InvalidArgumentError('error must be defined') + } + + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }) + return new MockScope(newMockDispatch) + } + + /** + * Set default reply headers on the interceptor for subsequent replies + */ + defaultReplyHeaders (headers) { + if (typeof headers === 'undefined') { + throw new InvalidArgumentError('headers must be defined') + } + + this[kDefaultHeaders] = headers + return this + } + + /** + * Set default reply trailers on the interceptor for subsequent replies + */ + defaultReplyTrailers (trailers) { + if (typeof trailers === 'undefined') { + throw new InvalidArgumentError('trailers must be defined') + } + + this[kDefaultTrailers] = trailers + return this + } + + /** + * Set reply content length header for replies on the interceptor + */ + replyContentLength () { + this[kContentLength] = true + return this + } +} + +module.exports.MockInterceptor = MockInterceptor +module.exports.MockScope = MockScope + + +/***/ }), + +/***/ 26193: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { promisify } = __nccwpck_require__(73837) +const Pool = __nccwpck_require__(4634) +const { buildMockDispatch } = __nccwpck_require__(79323) +const { + kDispatches, + kMockAgent, + kClose, + kOriginalClose, + kOrigin, + kOriginalDispatch, + kConnected +} = __nccwpck_require__(24347) +const { MockInterceptor } = __nccwpck_require__(90410) +const Symbols = __nccwpck_require__(72785) +const { InvalidArgumentError } = __nccwpck_require__(48045) + +/** + * MockPool provides an API that extends the Pool to influence the mockDispatches. + */ +class MockPool extends Pool { + constructor (origin, opts) { + super(origin, opts) + + if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + + this[kMockAgent] = opts.agent + this[kOrigin] = origin + this[kDispatches] = [] + this[kConnected] = 1 + this[kOriginalDispatch] = this.dispatch + this[kOriginalClose] = this.close.bind(this) + + this.dispatch = buildMockDispatch.call(this) + this.close = this[kClose] + } + + get [Symbols.kConnected] () { + return this[kConnected] + } + + /** + * Sets up the base interceptor for mocking replies from undici. + */ + intercept (opts) { + return new MockInterceptor(opts, this[kDispatches]) + } + + async [kClose] () { + await promisify(this[kOriginalClose])() + this[kConnected] = 0 + this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) + } +} + +module.exports = MockPool + + +/***/ }), + +/***/ 24347: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + kAgent: Symbol('agent'), + kOptions: Symbol('options'), + kFactory: Symbol('factory'), + kDispatches: Symbol('dispatches'), + kDispatchKey: Symbol('dispatch key'), + kDefaultHeaders: Symbol('default headers'), + kDefaultTrailers: Symbol('default trailers'), + kContentLength: Symbol('content length'), + kMockAgent: Symbol('mock agent'), + kMockAgentSet: Symbol('mock agent set'), + kMockAgentGet: Symbol('mock agent get'), + kMockDispatch: Symbol('mock dispatch'), + kClose: Symbol('close'), + kOriginalClose: Symbol('original agent close'), + kOrigin: Symbol('origin'), + kIsMockActive: Symbol('is mock active'), + kNetConnect: Symbol('net connect'), + kGetNetConnect: Symbol('get net connect'), + kConnected: Symbol('connected') +} + + +/***/ }), + +/***/ 79323: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { MockNotMatchedError } = __nccwpck_require__(50888) +const { + kDispatches, + kMockAgent, + kOriginalDispatch, + kOrigin, + kGetNetConnect +} = __nccwpck_require__(24347) +const { buildURL, nop } = __nccwpck_require__(83983) +const { STATUS_CODES } = __nccwpck_require__(13685) +const { + types: { + isPromise + } +} = __nccwpck_require__(73837) + +function matchValue (match, value) { + if (typeof match === 'string') { + return match === value + } + if (match instanceof RegExp) { + return match.test(value) + } + if (typeof match === 'function') { + return match(value) === true + } + return false +} + +function lowerCaseEntries (headers) { + return Object.fromEntries( + Object.entries(headers).map(([headerName, headerValue]) => { + return [headerName.toLocaleLowerCase(), headerValue] + }) + ) +} + +/** + * @param {import('../../index').Headers|string[]|Record} headers + * @param {string} key + */ +function getHeaderByName (headers, key) { + if (Array.isArray(headers)) { + for (let i = 0; i < headers.length; i += 2) { + if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { + return headers[i + 1] + } + } + + return undefined + } else if (typeof headers.get === 'function') { + return headers.get(key) + } else { + return lowerCaseEntries(headers)[key.toLocaleLowerCase()] + } +} + +/** @param {string[]} headers */ +function buildHeadersFromArray (headers) { // fetch HeadersList + const clone = headers.slice() + const entries = [] + for (let index = 0; index < clone.length; index += 2) { + entries.push([clone[index], clone[index + 1]]) + } + return Object.fromEntries(entries) +} + +function matchHeaders (mockDispatch, headers) { + if (typeof mockDispatch.headers === 'function') { + if (Array.isArray(headers)) { // fetch HeadersList + headers = buildHeadersFromArray(headers) + } + return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {}) + } + if (typeof mockDispatch.headers === 'undefined') { + return true + } + if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') { + return false + } + + for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) { + const headerValue = getHeaderByName(headers, matchHeaderName) + + if (!matchValue(matchHeaderValue, headerValue)) { + return false + } + } + return true +} + +function safeUrl (path) { + if (typeof path !== 'string') { + return path + } + + const pathSegments = path.split('?') + + if (pathSegments.length !== 2) { + return path + } + + const qp = new URLSearchParams(pathSegments.pop()) + qp.sort() + return [...pathSegments, qp.toString()].join('?') +} + +function matchKey (mockDispatch, { path, method, body, headers }) { + const pathMatch = matchValue(mockDispatch.path, path) + const methodMatch = matchValue(mockDispatch.method, method) + const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true + const headersMatch = matchHeaders(mockDispatch, headers) + return pathMatch && methodMatch && bodyMatch && headersMatch +} + +function getResponseData (data) { + if (Buffer.isBuffer(data)) { + return data + } else if (typeof data === 'object') { + return JSON.stringify(data) + } else { + return data.toString() + } +} + +function getMockDispatch (mockDispatches, key) { + const basePath = key.query ? buildURL(key.path, key.query) : key.path + const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath + + // Match path + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`) + } + + // Match method + matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`) + } + + // Match body + matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`) + } + + // Match headers + matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers)) + if (matchedMockDispatches.length === 0) { + throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`) + } + + return matchedMockDispatches[0] +} + +function addMockDispatch (mockDispatches, key, data) { + const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false } + const replyData = typeof data === 'function' ? { callback: data } : { ...data } + const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } } + mockDispatches.push(newMockDispatch) + return newMockDispatch +} + +function deleteMockDispatch (mockDispatches, key) { + const index = mockDispatches.findIndex(dispatch => { + if (!dispatch.consumed) { + return false + } + return matchKey(dispatch, key) + }) + if (index !== -1) { + mockDispatches.splice(index, 1) + } +} + +function buildKey (opts) { + const { path, method, body, headers, query } = opts + return { + path, + method, + body, + headers, + query + } +} + +function generateKeyValues (data) { + return Object.entries(data).reduce((keyValuePairs, [key, value]) => [ + ...keyValuePairs, + Buffer.from(`${key}`), + Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`) + ], []) +} + +/** + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status + * @param {number} statusCode + */ +function getStatusText (statusCode) { + return STATUS_CODES[statusCode] || 'unknown' +} + +async function getResponse (body) { + const buffers = [] + for await (const data of body) { + buffers.push(data) + } + return Buffer.concat(buffers).toString('utf8') +} + +/** + * Mock dispatch function used to simulate undici dispatches + */ +function mockDispatch (opts, handler) { + // Get mock dispatch from built key + const key = buildKey(opts) + const mockDispatch = getMockDispatch(this[kDispatches], key) + + mockDispatch.timesInvoked++ + + // Here's where we resolve a callback if a callback is present for the dispatch data. + if (mockDispatch.data.callback) { + mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) } + } + + // Parse mockDispatch data + const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch + const { timesInvoked, times } = mockDispatch + + // If it's used up and not persistent, mark as consumed + mockDispatch.consumed = !persist && timesInvoked >= times + mockDispatch.pending = timesInvoked < times + + // If specified, trigger dispatch error + if (error !== null) { + deleteMockDispatch(this[kDispatches], key) + handler.onError(error) + return true + } + + // Handle the request with a delay if necessary + if (typeof delay === 'number' && delay > 0) { + setTimeout(() => { + handleReply(this[kDispatches]) + }, delay) + } else { + handleReply(this[kDispatches]) + } + + function handleReply (mockDispatches, _data = data) { + // fetch's HeadersList is a 1D string array + const optsHeaders = Array.isArray(opts.headers) + ? buildHeadersFromArray(opts.headers) + : opts.headers + const body = typeof _data === 'function' + ? _data({ ...opts, headers: optsHeaders }) + : _data + + // util.types.isPromise is likely needed for jest. + if (isPromise(body)) { + // If handleReply is asynchronous, throwing an error + // in the callback will reject the promise, rather than + // synchronously throw the error, which breaks some tests. + // Rather, we wait for the callback to resolve if it is a + // promise, and then re-run handleReply with the new body. + body.then((newData) => handleReply(mockDispatches, newData)) + return + } + + const responseData = getResponseData(body) + const responseHeaders = generateKeyValues(headers) + const responseTrailers = generateKeyValues(trailers) + + handler.abort = nop + handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode)) + handler.onData(Buffer.from(responseData)) + handler.onComplete(responseTrailers) + deleteMockDispatch(mockDispatches, key) + } + + function resume () {} + + return true +} + +function buildMockDispatch () { + const agent = this[kMockAgent] + const origin = this[kOrigin] + const originalDispatch = this[kOriginalDispatch] + + return function dispatch (opts, handler) { + if (agent.isMockActive) { + try { + mockDispatch.call(this, opts, handler) + } catch (error) { + if (error instanceof MockNotMatchedError) { + const netConnect = agent[kGetNetConnect]() + if (netConnect === false) { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`) + } + if (checkNetConnect(netConnect, origin)) { + originalDispatch.call(this, opts, handler) + } else { + throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`) + } + } else { + throw error + } + } + } else { + originalDispatch.call(this, opts, handler) + } + } +} + +function checkNetConnect (netConnect, origin) { + const url = new URL(origin) + if (netConnect === true) { + return true + } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { + return true + } + return false +} + +function buildMockOptions (opts) { + if (opts) { + const { agent, ...mockOptions } = opts + return mockOptions + } +} + +module.exports = { + getResponseData, + getMockDispatch, + addMockDispatch, + deleteMockDispatch, + buildKey, + generateKeyValues, + matchValue, + getResponse, + getStatusText, + mockDispatch, + buildMockDispatch, + checkNetConnect, + buildMockOptions, + getHeaderByName +} + + +/***/ }), + +/***/ 86823: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { Transform } = __nccwpck_require__(12781) +const { Console } = __nccwpck_require__(96206) + +/** + * Gets the output of `console.table(…)` as a string. + */ +module.exports = class PendingInterceptorsFormatter { + constructor ({ disableColors } = {}) { + this.transform = new Transform({ + transform (chunk, _enc, cb) { + cb(null, chunk) + } + }) + + this.logger = new Console({ + stdout: this.transform, + inspectOptions: { + colors: !disableColors && !process.env.CI + } + }) + } + + format (pendingInterceptors) { + const withPrettyHeaders = pendingInterceptors.map( + ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + Method: method, + Origin: origin, + Path: path, + 'Status code': statusCode, + Persistent: persist ? '✅' : '❌', + Invocations: timesInvoked, + Remaining: persist ? Infinity : times - timesInvoked + })) + + this.logger.table(withPrettyHeaders) + return this.transform.read().toString() + } +} + + +/***/ }), + +/***/ 78891: +/***/ ((module) => { + +"use strict"; + + +const singulars = { + pronoun: 'it', + is: 'is', + was: 'was', + this: 'this' +} + +const plurals = { + pronoun: 'they', + is: 'are', + was: 'were', + this: 'these' +} + +module.exports = class Pluralizer { + constructor (singular, plural) { + this.singular = singular + this.plural = plural + } + + pluralize (count) { + const one = count === 1 + const keys = one ? singulars : plurals + const noun = one ? this.singular : this.plural + return { ...keys, count, noun } + } +} + + +/***/ }), + +/***/ 68266: +/***/ ((module) => { + +"use strict"; +/* eslint-disable */ + + + +// Extracted from node/lib/internal/fixed_queue.js + +// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two. +const kSize = 2048; +const kMask = kSize - 1; + +// The FixedQueue is implemented as a singly-linked list of fixed-size +// circular buffers. It looks something like this: +// +// head tail +// | | +// v v +// +-----------+ <-----\ +-----------+ <------\ +-----------+ +// | [null] | \----- | next | \------- | next | +// +-----------+ +-----------+ +-----------+ +// | item | <-- bottom | item | <-- bottom | [empty] | +// | item | | item | | [empty] | +// | item | | item | | [empty] | +// | item | | item | | [empty] | +// | item | | item | bottom --> | item | +// | item | | item | | item | +// | ... | | ... | | ... | +// | item | | item | | item | +// | item | | item | | item | +// | [empty] | <-- top | item | | item | +// | [empty] | | item | | item | +// | [empty] | | [empty] | <-- top top --> | [empty] | +// +-----------+ +-----------+ +-----------+ +// +// Or, if there is only one circular buffer, it looks something +// like either of these: +// +// head tail head tail +// | | | | +// v v v v +// +-----------+ +-----------+ +// | [null] | | [null] | +// +-----------+ +-----------+ +// | [empty] | | item | +// | [empty] | | item | +// | item | <-- bottom top --> | [empty] | +// | item | | [empty] | +// | [empty] | <-- top bottom --> | item | +// | [empty] | | item | +// +-----------+ +-----------+ +// +// Adding a value means moving `top` forward by one, removing means +// moving `bottom` forward by one. After reaching the end, the queue +// wraps around. +// +// When `top === bottom` the current queue is empty and when +// `top + 1 === bottom` it's full. This wastes a single space of storage +// but allows much quicker checks. + +class FixedCircularBuffer { + constructor() { + this.bottom = 0; + this.top = 0; + this.list = new Array(kSize); + this.next = null; + } + + isEmpty() { + return this.top === this.bottom; + } + + isFull() { + return ((this.top + 1) & kMask) === this.bottom; + } + + push(data) { + this.list[this.top] = data; + this.top = (this.top + 1) & kMask; + } + + shift() { + const nextItem = this.list[this.bottom]; + if (nextItem === undefined) + return null; + this.list[this.bottom] = undefined; + this.bottom = (this.bottom + 1) & kMask; + return nextItem; + } +} + +module.exports = class FixedQueue { + constructor() { + this.head = this.tail = new FixedCircularBuffer(); + } + + isEmpty() { + return this.head.isEmpty(); + } + + push(data) { + if (this.head.isFull()) { + // Head is full: Creates a new queue, sets the old queue's `.next` to it, + // and sets it as the new main queue. + this.head = this.head.next = new FixedCircularBuffer(); } - }); + this.head.push(data); + } - // src/typescript/typescript.ts - var require_typescript = __commonJS({ - "src/typescript/typescript.ts"(exports, module2) { - init_ts6(); - init_ts6(); - if (typeof console !== "undefined") { - Debug.loggingHost = { - log(level, s) { - switch (level) { - case 1 /* Error */: - return console.error(s); - case 2 /* Warning */: - return console.warn(s); - case 3 /* Info */: - return console.log(s); - case 4 /* Verbose */: - return console.log(s); + shift() { + const tail = this.tail; + const next = tail.shift(); + if (tail.isEmpty() && tail.next !== null) { + // If there is another queue, it forms the new tail. + this.tail = tail.next; + } + return next; + } +}; + + +/***/ }), + +/***/ 73198: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const DispatcherBase = __nccwpck_require__(74839) +const FixedQueue = __nccwpck_require__(68266) +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(72785) +const PoolStats = __nccwpck_require__(39689) + +const kClients = Symbol('clients') +const kNeedDrain = Symbol('needDrain') +const kQueue = Symbol('queue') +const kClosedResolve = Symbol('closed resolve') +const kOnDrain = Symbol('onDrain') +const kOnConnect = Symbol('onConnect') +const kOnDisconnect = Symbol('onDisconnect') +const kOnConnectionError = Symbol('onConnectionError') +const kGetDispatcher = Symbol('get dispatcher') +const kAddClient = Symbol('add client') +const kRemoveClient = Symbol('remove client') +const kStats = Symbol('stats') + +class PoolBase extends DispatcherBase { + constructor () { + super() + + this[kQueue] = new FixedQueue() + this[kClients] = [] + this[kQueued] = 0 + + const pool = this + + this[kOnDrain] = function onDrain (origin, targets) { + const queue = pool[kQueue] + + let needDrain = false + + while (!needDrain) { + const item = queue.shift() + if (!item) { + break + } + pool[kQueued]-- + needDrain = !this.dispatch(item.opts, item.handler) + } + + this[kNeedDrain] = needDrain + + if (!this[kNeedDrain] && pool[kNeedDrain]) { + pool[kNeedDrain] = false + pool.emit('drain', origin, [pool, ...targets]) + } + + if (pool[kClosedResolve] && queue.isEmpty()) { + Promise + .all(pool[kClients].map(c => c.close())) + .then(pool[kClosedResolve]) + } + } + + this[kOnConnect] = (origin, targets) => { + pool.emit('connect', origin, [pool, ...targets]) + } + + this[kOnDisconnect] = (origin, targets, err) => { + pool.emit('disconnect', origin, [pool, ...targets], err) + } + + this[kOnConnectionError] = (origin, targets, err) => { + pool.emit('connectionError', origin, [pool, ...targets], err) + } + + this[kStats] = new PoolStats(this) + } + + get [kBusy] () { + return this[kNeedDrain] + } + + get [kConnected] () { + return this[kClients].filter(client => client[kConnected]).length + } + + get [kFree] () { + return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length + } + + get [kPending] () { + let ret = this[kQueued] + for (const { [kPending]: pending } of this[kClients]) { + ret += pending + } + return ret + } + + get [kRunning] () { + let ret = 0 + for (const { [kRunning]: running } of this[kClients]) { + ret += running + } + return ret + } + + get [kSize] () { + let ret = this[kQueued] + for (const { [kSize]: size } of this[kClients]) { + ret += size + } + return ret + } + + get stats () { + return this[kStats] + } + + async [kClose] () { + if (this[kQueue].isEmpty()) { + return Promise.all(this[kClients].map(c => c.close())) + } else { + return new Promise((resolve) => { + this[kClosedResolve] = resolve + }) + } + } + + async [kDestroy] (err) { + while (true) { + const item = this[kQueue].shift() + if (!item) { + break + } + item.handler.onError(err) + } + + return Promise.all(this[kClients].map(c => c.destroy(err))) + } + + [kDispatch] (opts, handler) { + const dispatcher = this[kGetDispatcher]() + + if (!dispatcher) { + this[kNeedDrain] = true + this[kQueue].push({ opts, handler }) + this[kQueued]++ + } else if (!dispatcher.dispatch(opts, handler)) { + dispatcher[kNeedDrain] = true + this[kNeedDrain] = !this[kGetDispatcher]() + } + + return !this[kNeedDrain] + } + + [kAddClient] (client) { + client + .on('drain', this[kOnDrain]) + .on('connect', this[kOnConnect]) + .on('disconnect', this[kOnDisconnect]) + .on('connectionError', this[kOnConnectionError]) + + this[kClients].push(client) + + if (this[kNeedDrain]) { + process.nextTick(() => { + if (this[kNeedDrain]) { + this[kOnDrain](client[kUrl], [this, client]) + } + }) + } + + return this + } + + [kRemoveClient] (client) { + client.close(() => { + const idx = this[kClients].indexOf(client) + if (idx !== -1) { + this[kClients].splice(idx, 1) + } + }) + + this[kNeedDrain] = this[kClients].some(dispatcher => ( + !dispatcher[kNeedDrain] && + dispatcher.closed !== true && + dispatcher.destroyed !== true + )) + } +} + +module.exports = { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kRemoveClient, + kGetDispatcher +} + + +/***/ }), + +/***/ 39689: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(72785) +const kPool = Symbol('pool') + +class PoolStats { + constructor (pool) { + this[kPool] = pool + } + + get connected () { + return this[kPool][kConnected] + } + + get free () { + return this[kPool][kFree] + } + + get pending () { + return this[kPool][kPending] + } + + get queued () { + return this[kPool][kQueued] + } + + get running () { + return this[kPool][kRunning] + } + + get size () { + return this[kPool][kSize] + } +} + +module.exports = PoolStats + + +/***/ }), + +/***/ 4634: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kGetDispatcher +} = __nccwpck_require__(73198) +const Client = __nccwpck_require__(33598) +const { + InvalidArgumentError +} = __nccwpck_require__(48045) +const util = __nccwpck_require__(83983) +const { kUrl, kInterceptors } = __nccwpck_require__(72785) +const buildConnector = __nccwpck_require__(82067) + +const kOptions = Symbol('options') +const kConnections = Symbol('connections') +const kFactory = Symbol('factory') + +function defaultFactory (origin, opts) { + return new Client(origin, opts) +} + +class Pool extends PoolBase { + constructor (origin, { + connections, + factory = defaultFactory, + connect, + connectTimeout, + tls, + maxCachedSessions, + socketPath, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + allowH2, + ...options + } = {}) { + super() + + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { + throw new InvalidArgumentError('invalid connections') + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (typeof connect !== 'function') { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), + ...connect + }) + } + + this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) + ? options.interceptors.Pool + : [] + this[kConnections] = connections || null + this[kUrl] = util.parseOrigin(origin) + this[kOptions] = { ...util.deepClone(options), connect, allowH2 } + this[kOptions].interceptors = options.interceptors + ? { ...options.interceptors } + : undefined + this[kFactory] = factory + } + + [kGetDispatcher] () { + let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain]) + + if (dispatcher) { + return dispatcher + } + + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + dispatcher = this[kFactory](this[kUrl], this[kOptions]) + this[kAddClient](dispatcher) + } + + return dispatcher + } +} + +module.exports = Pool + + +/***/ }), + +/***/ 97858: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(72785) +const { URL } = __nccwpck_require__(57310) +const Agent = __nccwpck_require__(7890) +const Pool = __nccwpck_require__(4634) +const DispatcherBase = __nccwpck_require__(74839) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(48045) +const buildConnector = __nccwpck_require__(82067) + +const kAgent = Symbol('proxy agent') +const kClient = Symbol('proxy client') +const kProxyHeaders = Symbol('proxy headers') +const kRequestTls = Symbol('request tls settings') +const kProxyTls = Symbol('proxy tls settings') +const kConnectEndpoint = Symbol('connect endpoint function') + +function defaultProtocolPort (protocol) { + return protocol === 'https:' ? 443 : 80 +} + +function buildProxyOptions (opts) { + if (typeof opts === 'string') { + opts = { uri: opts } + } + + if (!opts || !opts.uri) { + throw new InvalidArgumentError('Proxy opts.uri is mandatory') + } + + return { + uri: opts.uri, + protocol: opts.protocol || 'https' + } +} + +function defaultFactory (origin, opts) { + return new Pool(origin, opts) +} + +class ProxyAgent extends DispatcherBase { + constructor (opts) { + super(opts) + this[kProxy] = buildProxyOptions(opts) + this[kAgent] = new Agent(opts) + this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) + ? opts.interceptors.ProxyAgent + : [] + + if (typeof opts === 'string') { + opts = { uri: opts } + } + + if (!opts || !opts.uri) { + throw new InvalidArgumentError('Proxy opts.uri is mandatory') + } + + const { clientFactory = defaultFactory } = opts + + if (typeof clientFactory !== 'function') { + throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.') + } + + this[kRequestTls] = opts.requestTls + this[kProxyTls] = opts.proxyTls + this[kProxyHeaders] = opts.headers || {} + + const resolvedUrl = new URL(opts.uri) + const { origin, port, host, username, password } = resolvedUrl + + if (opts.auth && opts.token) { + throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') + } else if (opts.auth) { + /* @deprecated in favour of opts.token */ + this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` + } else if (opts.token) { + this[kProxyHeaders]['proxy-authorization'] = opts.token + } else if (username && password) { + this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}` + } + + const connect = buildConnector({ ...opts.proxyTls }) + this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) + this[kClient] = clientFactory(resolvedUrl, { connect }) + this[kAgent] = new Agent({ + ...opts, + connect: async (opts, callback) => { + let requestedHost = opts.host + if (!opts.port) { + requestedHost += `:${defaultProtocolPort(opts.protocol)}` + } + try { + const { socket, statusCode } = await this[kClient].connect({ + origin, + port, + path: requestedHost, + signal: opts.signal, + headers: { + ...this[kProxyHeaders], + host } + }) + if (statusCode !== 200) { + socket.on('error', () => {}).destroy() + callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)) } - }; + if (opts.protocol !== 'https:') { + callback(null, socket) + return + } + let servername + if (this[kRequestTls]) { + servername = this[kRequestTls].servername + } else { + servername = opts.servername + } + this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback) + } catch (err) { + callback(err) + } } - module2.exports = ts_exports2; + }) + } + + dispatch (opts, handler) { + const { host } = new URL(opts.origin) + const headers = buildHeaders(opts.headers) + throwIfProxyAuthIsSent(headers) + return this[kAgent].dispatch( + { + ...opts, + headers: { + ...headers, + host + } + }, + handler + ) + } + + async [kClose] () { + await this[kAgent].close() + await this[kClient].close() + } + + async [kDestroy] () { + await this[kAgent].destroy() + await this[kClient].destroy() + } +} + +/** + * @param {string[] | Record} headers + * @returns {Record} + */ +function buildHeaders (headers) { + // When using undici.fetch, the headers list is stored + // as an array. + if (Array.isArray(headers)) { + /** @type {Record} */ + const headersPair = {} + + for (let i = 0; i < headers.length; i += 2) { + headersPair[headers[i]] = headers[i + 1] } - }); - return require_typescript(); -})(); -if ( true && module.exports) { module.exports = ts; } -//# sourceMappingURL=typescript.js.map + return headersPair + } + + return headers +} + +/** + * @param {Record} headers + * + * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers + * Nevertheless, it was changed and to avoid a security vulnerability by end users + * this check was created. + * It should be removed in the next major version for performance reasons + */ +function throwIfProxyAuthIsSent (headers) { + const existProxyAuth = headers && Object.keys(headers) + .find((key) => key.toLowerCase() === 'proxy-authorization') + if (existProxyAuth) { + throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') + } +} + +module.exports = ProxyAgent + + +/***/ }), + +/***/ 29459: +/***/ ((module) => { + +"use strict"; + + +let fastNow = Date.now() +let fastNowTimeout + +const fastTimers = [] + +function onTimeout () { + fastNow = Date.now() + + let len = fastTimers.length + let idx = 0 + while (idx < len) { + const timer = fastTimers[idx] + + if (timer.state === 0) { + timer.state = fastNow + timer.delay + } else if (timer.state > 0 && fastNow >= timer.state) { + timer.state = -1 + timer.callback(timer.opaque) + } + + if (timer.state === -1) { + timer.state = -2 + if (idx !== len - 1) { + fastTimers[idx] = fastTimers.pop() + } else { + fastTimers.pop() + } + len -= 1 + } else { + idx += 1 + } + } + + if (fastTimers.length > 0) { + refreshTimeout() + } +} + +function refreshTimeout () { + if (fastNowTimeout && fastNowTimeout.refresh) { + fastNowTimeout.refresh() + } else { + clearTimeout(fastNowTimeout) + fastNowTimeout = setTimeout(onTimeout, 1e3) + if (fastNowTimeout.unref) { + fastNowTimeout.unref() + } + } +} + +class Timeout { + constructor (callback, delay, opaque) { + this.callback = callback + this.delay = delay + this.opaque = opaque + + // -2 not in timer list + // -1 in timer list but inactive + // 0 in timer list waiting for time + // > 0 in timer list waiting for time to expire + this.state = -2 + + this.refresh() + } + + refresh () { + if (this.state === -2) { + fastTimers.push(this) + if (!fastNowTimeout || fastTimers.length === 1) { + refreshTimeout() + } + } + + this.state = 0 + } + + clear () { + this.state = -1 + } +} + +module.exports = { + setTimeout (callback, delay, opaque) { + return delay < 1e3 + ? setTimeout(callback, delay, opaque) + : new Timeout(callback, delay, opaque) + }, + clearTimeout (timeout) { + if (timeout instanceof Timeout) { + timeout.clear() + } else { + clearTimeout(timeout) + } + } +} + + +/***/ }), + +/***/ 35354: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const diagnosticsChannel = __nccwpck_require__(67643) +const { uid, states } = __nccwpck_require__(19188) +const { + kReadyState, + kSentClose, + kByteParser, + kReceivedClose +} = __nccwpck_require__(37578) +const { fireEvent, failWebsocketConnection } = __nccwpck_require__(25515) +const { CloseEvent } = __nccwpck_require__(52611) +const { makeRequest } = __nccwpck_require__(48359) +const { fetching } = __nccwpck_require__(74881) +const { Headers } = __nccwpck_require__(10554) +const { getGlobalDispatcher } = __nccwpck_require__(21892) +const { kHeadersList } = __nccwpck_require__(72785) + +const channels = {} +channels.open = diagnosticsChannel.channel('undici:websocket:open') +channels.close = diagnosticsChannel.channel('undici:websocket:close') +channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error') + +/** @type {import('crypto')} */ +let crypto +try { + crypto = __nccwpck_require__(6113) +} catch { + +} + +/** + * @see https://websockets.spec.whatwg.org/#concept-websocket-establish + * @param {URL} url + * @param {string|string[]} protocols + * @param {import('./websocket').WebSocket} ws + * @param {(response: any) => void} onEstablish + * @param {Partial} options + */ +function establishWebSocketConnection (url, protocols, ws, onEstablish, options) { + // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s + // scheme is "ws", and to "https" otherwise. + const requestURL = url + + requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:' + + // 2. Let request be a new request, whose URL is requestURL, client is client, + // service-workers mode is "none", referrer is "no-referrer", mode is + // "websocket", credentials mode is "include", cache mode is "no-store" , + // and redirect mode is "error". + const request = makeRequest({ + urlList: [requestURL], + serviceWorkers: 'none', + referrer: 'no-referrer', + mode: 'websocket', + credentials: 'include', + cache: 'no-store', + redirect: 'error' + }) + + // Note: undici extension, allow setting custom headers. + if (options.headers) { + const headersList = new Headers(options.headers)[kHeadersList] + + request.headersList = headersList + } + + // 3. Append (`Upgrade`, `websocket`) to request’s header list. + // 4. Append (`Connection`, `Upgrade`) to request’s header list. + // Note: both of these are handled by undici currently. + // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397 + + // 5. Let keyValue be a nonce consisting of a randomly selected + // 16-byte value that has been forgiving-base64-encoded and + // isomorphic encoded. + const keyValue = crypto.randomBytes(16).toString('base64') + + // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s + // header list. + request.headersList.append('sec-websocket-key', keyValue) + + // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s + // header list. + request.headersList.append('sec-websocket-version', '13') + + // 8. For each protocol in protocols, combine + // (`Sec-WebSocket-Protocol`, protocol) in request’s header + // list. + for (const protocol of protocols) { + request.headersList.append('sec-websocket-protocol', protocol) + } + + // 9. Let permessageDeflate be a user-agent defined + // "permessage-deflate" extension header value. + // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673 + // TODO: enable once permessage-deflate is supported + const permessageDeflate = '' // 'permessage-deflate; 15' + + // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to + // request’s header list. + // request.headersList.append('sec-websocket-extensions', permessageDeflate) + + // 11. Fetch request with useParallelQueue set to true, and + // processResponse given response being these steps: + const controller = fetching({ + request, + useParallelQueue: true, + dispatcher: options.dispatcher ?? getGlobalDispatcher(), + processResponse (response) { + // 1. If response is a network error or its status is not 101, + // fail the WebSocket connection. + if (response.type === 'error' || response.status !== 101) { + failWebsocketConnection(ws, 'Received network error or non-101 status code.') + return + } + + // 2. If protocols is not the empty list and extracting header + // list values given `Sec-WebSocket-Protocol` and response’s + // header list results in null, failure, or the empty byte + // sequence, then fail the WebSocket connection. + if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) { + failWebsocketConnection(ws, 'Server did not respond with sent protocols.') + return + } + + // 3. Follow the requirements stated step 2 to step 6, inclusive, + // of the last set of steps in section 4.1 of The WebSocket + // Protocol to validate response. This either results in fail + // the WebSocket connection or the WebSocket connection is + // established. + + // 2. If the response lacks an |Upgrade| header field or the |Upgrade| + // header field contains a value that is not an ASCII case- + // insensitive match for the value "websocket", the client MUST + // _Fail the WebSocket Connection_. + if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') { + failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".') + return + } + + // 3. If the response lacks a |Connection| header field or the + // |Connection| header field doesn't contain a token that is an + // ASCII case-insensitive match for the value "Upgrade", the client + // MUST _Fail the WebSocket Connection_. + if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') { + failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".') + return + } + + // 4. If the response lacks a |Sec-WebSocket-Accept| header field or + // the |Sec-WebSocket-Accept| contains a value other than the + // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket- + // Key| (as a string, not base64-decoded) with the string "258EAFA5- + // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and + // trailing whitespace, the client MUST _Fail the WebSocket + // Connection_. + const secWSAccept = response.headersList.get('Sec-WebSocket-Accept') + const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64') + if (secWSAccept !== digest) { + failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.') + return + } + + // 5. If the response includes a |Sec-WebSocket-Extensions| header + // field and this header field indicates the use of an extension + // that was not present in the client's handshake (the server has + // indicated an extension not requested by the client), the client + // MUST _Fail the WebSocket Connection_. (The parsing of this + // header field to determine which extensions are requested is + // discussed in Section 9.1.) + const secExtension = response.headersList.get('Sec-WebSocket-Extensions') + + if (secExtension !== null && secExtension !== permessageDeflate) { + failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.') + return + } + + // 6. If the response includes a |Sec-WebSocket-Protocol| header field + // and this header field indicates the use of a subprotocol that was + // not present in the client's handshake (the server has indicated a + // subprotocol not requested by the client), the client MUST _Fail + // the WebSocket Connection_. + const secProtocol = response.headersList.get('Sec-WebSocket-Protocol') + + if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) { + failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.') + return + } + + response.socket.on('data', onSocketData) + response.socket.on('close', onSocketClose) + response.socket.on('error', onSocketError) + + if (channels.open.hasSubscribers) { + channels.open.publish({ + address: response.socket.address(), + protocol: secProtocol, + extensions: secExtension + }) + } + + onEstablish(response) + } + }) + + return controller +} + +/** + * @param {Buffer} chunk + */ +function onSocketData (chunk) { + if (!this.ws[kByteParser].write(chunk)) { + this.pause() + } +} + +/** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4 + */ +function onSocketClose () { + const { ws } = this + + // If the TCP connection was closed after the + // WebSocket closing handshake was completed, the WebSocket connection + // is said to have been closed _cleanly_. + const wasClean = ws[kSentClose] && ws[kReceivedClose] + + let code = 1005 + let reason = '' + + const result = ws[kByteParser].closingInfo + + if (result) { + code = result.code ?? 1005 + reason = result.reason + } else if (!ws[kSentClose]) { + // If _The WebSocket + // Connection is Closed_ and no Close control frame was received by the + // endpoint (such as could occur if the underlying transport connection + // is lost), _The WebSocket Connection Close Code_ is considered to be + // 1006. + code = 1006 + } + + // 1. Change the ready state to CLOSED (3). + ws[kReadyState] = states.CLOSED + + // 2. If the user agent was required to fail the WebSocket + // connection, or if the WebSocket connection was closed + // after being flagged as full, fire an event named error + // at the WebSocket object. + // TODO + + // 3. Fire an event named close at the WebSocket object, + // using CloseEvent, with the wasClean attribute + // initialized to true if the connection closed cleanly + // and false otherwise, the code attribute initialized to + // the WebSocket connection close code, and the reason + // attribute initialized to the result of applying UTF-8 + // decode without BOM to the WebSocket connection close + // reason. + fireEvent('close', ws, CloseEvent, { + wasClean, code, reason + }) + + if (channels.close.hasSubscribers) { + channels.close.publish({ + websocket: ws, + code, + reason + }) + } +} + +function onSocketError (error) { + const { ws } = this + + ws[kReadyState] = states.CLOSING + + if (channels.socketError.hasSubscribers) { + channels.socketError.publish(error) + } + + this.destroy() +} + +module.exports = { + establishWebSocketConnection +} + + +/***/ }), + +/***/ 19188: +/***/ ((module) => { + +"use strict"; + + +// This is a Globally Unique Identifier unique used +// to validate that the endpoint accepts websocket +// connections. +// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3 +const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' + +/** @type {PropertyDescriptor} */ +const staticPropertyDescriptors = { + enumerable: true, + writable: false, + configurable: false +} + +const states = { + CONNECTING: 0, + OPEN: 1, + CLOSING: 2, + CLOSED: 3 +} + +const opcodes = { + CONTINUATION: 0x0, + TEXT: 0x1, + BINARY: 0x2, + CLOSE: 0x8, + PING: 0x9, + PONG: 0xA +} + +const maxUnsigned16Bit = 2 ** 16 - 1 // 65535 + +const parserStates = { + INFO: 0, + PAYLOADLENGTH_16: 2, + PAYLOADLENGTH_64: 3, + READ_DATA: 4 +} + +const emptyBuffer = Buffer.allocUnsafe(0) + +module.exports = { + uid, + staticPropertyDescriptors, + states, + opcodes, + maxUnsigned16Bit, + parserStates, + emptyBuffer +} + + +/***/ }), + +/***/ 52611: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { webidl } = __nccwpck_require__(21744) +const { kEnumerableProperty } = __nccwpck_require__(83983) +const { MessagePort } = __nccwpck_require__(71267) + +/** + * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent + */ +class MessageEvent extends Event { + #eventInit + + constructor (type, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' }) + + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.MessageEventInit(eventInitDict) + + super(type, eventInitDict) + + this.#eventInit = eventInitDict + } + + get data () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.data + } + + get origin () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.origin + } + + get lastEventId () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.lastEventId + } + + get source () { + webidl.brandCheck(this, MessageEvent) + + return this.#eventInit.source + } + + get ports () { + webidl.brandCheck(this, MessageEvent) + + if (!Object.isFrozen(this.#eventInit.ports)) { + Object.freeze(this.#eventInit.ports) + } + + return this.#eventInit.ports + } + + initMessageEvent ( + type, + bubbles = false, + cancelable = false, + data = null, + origin = '', + lastEventId = '', + source = null, + ports = [] + ) { + webidl.brandCheck(this, MessageEvent) + + webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' }) + + return new MessageEvent(type, { + bubbles, cancelable, data, origin, lastEventId, source, ports + }) + } +} + +/** + * @see https://websockets.spec.whatwg.org/#the-closeevent-interface + */ +class CloseEvent extends Event { + #eventInit + + constructor (type, eventInitDict = {}) { + webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' }) + + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.CloseEventInit(eventInitDict) + + super(type, eventInitDict) + + this.#eventInit = eventInitDict + } + + get wasClean () { + webidl.brandCheck(this, CloseEvent) + + return this.#eventInit.wasClean + } + + get code () { + webidl.brandCheck(this, CloseEvent) + + return this.#eventInit.code + } + + get reason () { + webidl.brandCheck(this, CloseEvent) + + return this.#eventInit.reason + } +} + +// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface +class ErrorEvent extends Event { + #eventInit + + constructor (type, eventInitDict) { + webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' }) + + super(type, eventInitDict) + + type = webidl.converters.DOMString(type) + eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}) + + this.#eventInit = eventInitDict + } + + get message () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.message + } + + get filename () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.filename + } + + get lineno () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.lineno + } + + get colno () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.colno + } + + get error () { + webidl.brandCheck(this, ErrorEvent) + + return this.#eventInit.error + } +} + +Object.defineProperties(MessageEvent.prototype, { + [Symbol.toStringTag]: { + value: 'MessageEvent', + configurable: true + }, + data: kEnumerableProperty, + origin: kEnumerableProperty, + lastEventId: kEnumerableProperty, + source: kEnumerableProperty, + ports: kEnumerableProperty, + initMessageEvent: kEnumerableProperty +}) + +Object.defineProperties(CloseEvent.prototype, { + [Symbol.toStringTag]: { + value: 'CloseEvent', + configurable: true + }, + reason: kEnumerableProperty, + code: kEnumerableProperty, + wasClean: kEnumerableProperty +}) + +Object.defineProperties(ErrorEvent.prototype, { + [Symbol.toStringTag]: { + value: 'ErrorEvent', + configurable: true + }, + message: kEnumerableProperty, + filename: kEnumerableProperty, + lineno: kEnumerableProperty, + colno: kEnumerableProperty, + error: kEnumerableProperty +}) + +webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort) + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.MessagePort +) + +const eventInit = [ + { + key: 'bubbles', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'cancelable', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'composed', + converter: webidl.converters.boolean, + defaultValue: false + } +] + +webidl.converters.MessageEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: 'data', + converter: webidl.converters.any, + defaultValue: null + }, + { + key: 'origin', + converter: webidl.converters.USVString, + defaultValue: '' + }, + { + key: 'lastEventId', + converter: webidl.converters.DOMString, + defaultValue: '' + }, + { + key: 'source', + // Node doesn't implement WindowProxy or ServiceWorker, so the only + // valid value for source is a MessagePort. + converter: webidl.nullableConverter(webidl.converters.MessagePort), + defaultValue: null + }, + { + key: 'ports', + converter: webidl.converters['sequence'], + get defaultValue () { + return [] + } + } +]) + +webidl.converters.CloseEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: 'wasClean', + converter: webidl.converters.boolean, + defaultValue: false + }, + { + key: 'code', + converter: webidl.converters['unsigned short'], + defaultValue: 0 + }, + { + key: 'reason', + converter: webidl.converters.USVString, + defaultValue: '' + } +]) + +webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ + ...eventInit, + { + key: 'message', + converter: webidl.converters.DOMString, + defaultValue: '' + }, + { + key: 'filename', + converter: webidl.converters.USVString, + defaultValue: '' + }, + { + key: 'lineno', + converter: webidl.converters['unsigned long'], + defaultValue: 0 + }, + { + key: 'colno', + converter: webidl.converters['unsigned long'], + defaultValue: 0 + }, + { + key: 'error', + converter: webidl.converters.any + } +]) + +module.exports = { + MessageEvent, + CloseEvent, + ErrorEvent +} + + +/***/ }), + +/***/ 25444: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { maxUnsigned16Bit } = __nccwpck_require__(19188) + +/** @type {import('crypto')} */ +let crypto +try { + crypto = __nccwpck_require__(6113) +} catch { + +} + +class WebsocketFrameSend { + /** + * @param {Buffer|undefined} data + */ + constructor (data) { + this.frameData = data + this.maskKey = crypto.randomBytes(4) + } + + createFrame (opcode) { + const bodyLength = this.frameData?.byteLength ?? 0 + + /** @type {number} */ + let payloadLength = bodyLength // 0-125 + let offset = 6 + + if (bodyLength > maxUnsigned16Bit) { + offset += 8 // payload length is next 8 bytes + payloadLength = 127 + } else if (bodyLength > 125) { + offset += 2 // payload length is next 2 bytes + payloadLength = 126 + } + + const buffer = Buffer.allocUnsafe(bodyLength + offset) + + // Clear first 2 bytes, everything else is overwritten + buffer[0] = buffer[1] = 0 + buffer[0] |= 0x80 // FIN + buffer[0] = (buffer[0] & 0xF0) + opcode // opcode + + /*! ws. MIT License. Einar Otto Stangvik */ + buffer[offset - 4] = this.maskKey[0] + buffer[offset - 3] = this.maskKey[1] + buffer[offset - 2] = this.maskKey[2] + buffer[offset - 1] = this.maskKey[3] + + buffer[1] = payloadLength + + if (payloadLength === 126) { + buffer.writeUInt16BE(bodyLength, 2) + } else if (payloadLength === 127) { + // Clear extended payload length + buffer[2] = buffer[3] = 0 + buffer.writeUIntBE(bodyLength, 4, 6) + } + + buffer[1] |= 0x80 // MASK + + // mask body + for (let i = 0; i < bodyLength; i++) { + buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4] + } + + return buffer + } +} + +module.exports = { + WebsocketFrameSend +} + + +/***/ }), + +/***/ 11688: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { Writable } = __nccwpck_require__(12781) +const diagnosticsChannel = __nccwpck_require__(67643) +const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(19188) +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(37578) +const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(25515) +const { WebsocketFrameSend } = __nccwpck_require__(25444) + +// This code was influenced by ws released under the MIT license. +// Copyright (c) 2011 Einar Otto Stangvik +// Copyright (c) 2013 Arnout Kazemier and contributors +// Copyright (c) 2016 Luigi Pinca and contributors + +const channels = {} +channels.ping = diagnosticsChannel.channel('undici:websocket:ping') +channels.pong = diagnosticsChannel.channel('undici:websocket:pong') + +class ByteParser extends Writable { + #buffers = [] + #byteOffset = 0 + + #state = parserStates.INFO + + #info = {} + #fragments = [] + + constructor (ws) { + super() + + this.ws = ws + } + + /** + * @param {Buffer} chunk + * @param {() => void} callback + */ + _write (chunk, _, callback) { + this.#buffers.push(chunk) + this.#byteOffset += chunk.length + + this.run(callback) + } + + /** + * Runs whenever a new chunk is received. + * Callback is called whenever there are no more chunks buffering, + * or not enough bytes are buffered to parse. + */ + run (callback) { + while (true) { + if (this.#state === parserStates.INFO) { + // If there aren't enough bytes to parse the payload length, etc. + if (this.#byteOffset < 2) { + return callback() + } + + const buffer = this.consume(2) + + this.#info.fin = (buffer[0] & 0x80) !== 0 + this.#info.opcode = buffer[0] & 0x0F + + // If we receive a fragmented message, we use the type of the first + // frame to parse the full message as binary/text, when it's terminated + this.#info.originalOpcode ??= this.#info.opcode + + this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION + + if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) { + // Only text and binary frames can be fragmented + failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.') + return + } + + const payloadLength = buffer[1] & 0x7F + + if (payloadLength <= 125) { + this.#info.payloadLength = payloadLength + this.#state = parserStates.READ_DATA + } else if (payloadLength === 126) { + this.#state = parserStates.PAYLOADLENGTH_16 + } else if (payloadLength === 127) { + this.#state = parserStates.PAYLOADLENGTH_64 + } + + if (this.#info.fragmented && payloadLength > 125) { + // A fragmented frame can't be fragmented itself + failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.') + return + } else if ( + (this.#info.opcode === opcodes.PING || + this.#info.opcode === opcodes.PONG || + this.#info.opcode === opcodes.CLOSE) && + payloadLength > 125 + ) { + // Control frames can have a payload length of 125 bytes MAX + failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.') + return + } else if (this.#info.opcode === opcodes.CLOSE) { + if (payloadLength === 1) { + failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.') + return + } + + const body = this.consume(payloadLength) + + this.#info.closeInfo = this.parseCloseBody(false, body) + + if (!this.ws[kSentClose]) { + // If an endpoint receives a Close frame and did not previously send a + // Close frame, the endpoint MUST send a Close frame in response. (When + // sending a Close frame in response, the endpoint typically echos the + // status code it received.) + const body = Buffer.allocUnsafe(2) + body.writeUInt16BE(this.#info.closeInfo.code, 0) + const closeFrame = new WebsocketFrameSend(body) + + this.ws[kResponse].socket.write( + closeFrame.createFrame(opcodes.CLOSE), + (err) => { + if (!err) { + this.ws[kSentClose] = true + } + } + ) + } + + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + this.ws[kReadyState] = states.CLOSING + this.ws[kReceivedClose] = true + + this.end() + + return + } else if (this.#info.opcode === opcodes.PING) { + // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in + // response, unless it already received a Close frame. + // A Pong frame sent in response to a Ping frame must have identical + // "Application data" + + const body = this.consume(payloadLength) + + if (!this.ws[kReceivedClose]) { + const frame = new WebsocketFrameSend(body) + + this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)) + + if (channels.ping.hasSubscribers) { + channels.ping.publish({ + payload: body + }) + } + } + + this.#state = parserStates.INFO + + if (this.#byteOffset > 0) { + continue + } else { + callback() + return + } + } else if (this.#info.opcode === opcodes.PONG) { + // A Pong frame MAY be sent unsolicited. This serves as a + // unidirectional heartbeat. A response to an unsolicited Pong frame is + // not expected. + + const body = this.consume(payloadLength) + + if (channels.pong.hasSubscribers) { + channels.pong.publish({ + payload: body + }) + } + + if (this.#byteOffset > 0) { + continue + } else { + callback() + return + } + } + } else if (this.#state === parserStates.PAYLOADLENGTH_16) { + if (this.#byteOffset < 2) { + return callback() + } + + const buffer = this.consume(2) + + this.#info.payloadLength = buffer.readUInt16BE(0) + this.#state = parserStates.READ_DATA + } else if (this.#state === parserStates.PAYLOADLENGTH_64) { + if (this.#byteOffset < 8) { + return callback() + } + + const buffer = this.consume(8) + const upper = buffer.readUInt32BE(0) + + // 2^31 is the maxinimum bytes an arraybuffer can contain + // on 32-bit systems. Although, on 64-bit systems, this is + // 2^53-1 bytes. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length + // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275 + // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e + if (upper > 2 ** 31 - 1) { + failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.') + return + } + + const lower = buffer.readUInt32BE(4) + + this.#info.payloadLength = (upper << 8) + lower + this.#state = parserStates.READ_DATA + } else if (this.#state === parserStates.READ_DATA) { + if (this.#byteOffset < this.#info.payloadLength) { + // If there is still more data in this chunk that needs to be read + return callback() + } else if (this.#byteOffset >= this.#info.payloadLength) { + // If the server sent multiple frames in a single chunk + + const body = this.consume(this.#info.payloadLength) + + this.#fragments.push(body) + + // If the frame is unfragmented, or a fragmented frame was terminated, + // a message was received + if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) { + const fullMessage = Buffer.concat(this.#fragments) + + websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage) + + this.#info = {} + this.#fragments.length = 0 + } + + this.#state = parserStates.INFO + } + } + + if (this.#byteOffset > 0) { + continue + } else { + callback() + break + } + } + } + + /** + * Take n bytes from the buffered Buffers + * @param {number} n + * @returns {Buffer|null} + */ + consume (n) { + if (n > this.#byteOffset) { + return null + } else if (n === 0) { + return emptyBuffer + } + + if (this.#buffers[0].length === n) { + this.#byteOffset -= this.#buffers[0].length + return this.#buffers.shift() + } + + const buffer = Buffer.allocUnsafe(n) + let offset = 0 + + while (offset !== n) { + const next = this.#buffers[0] + const { length } = next + + if (length + offset === n) { + buffer.set(this.#buffers.shift(), offset) + break + } else if (length + offset > n) { + buffer.set(next.subarray(0, n - offset), offset) + this.#buffers[0] = next.subarray(n - offset) + break + } else { + buffer.set(this.#buffers.shift(), offset) + offset += next.length + } + } + + this.#byteOffset -= n + + return buffer + } + + parseCloseBody (onlyCode, data) { + // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5 + /** @type {number|undefined} */ + let code + + if (data.length >= 2) { + // _The WebSocket Connection Close Code_ is + // defined as the status code (Section 7.4) contained in the first Close + // control frame received by the application + code = data.readUInt16BE(0) + } + + if (onlyCode) { + if (!isValidStatusCode(code)) { + return null + } + + return { code } + } + + // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6 + /** @type {Buffer} */ + let reason = data.subarray(2) + + // Remove BOM + if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) { + reason = reason.subarray(3) + } + + if (code !== undefined && !isValidStatusCode(code)) { + return null + } + + try { + // TODO: optimize this + reason = new TextDecoder('utf-8', { fatal: true }).decode(reason) + } catch { + return null + } + + return { code, reason } + } + + get closingInfo () { + return this.#info.closeInfo + } +} + +module.exports = { + ByteParser +} + + +/***/ }), + +/***/ 37578: +/***/ ((module) => { + +"use strict"; + + +module.exports = { + kWebSocketURL: Symbol('url'), + kReadyState: Symbol('ready state'), + kController: Symbol('controller'), + kResponse: Symbol('response'), + kBinaryType: Symbol('binary type'), + kSentClose: Symbol('sent close'), + kReceivedClose: Symbol('received close'), + kByteParser: Symbol('byte parser') +} + + +/***/ }), + +/***/ 25515: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(37578) +const { states, opcodes } = __nccwpck_require__(19188) +const { MessageEvent, ErrorEvent } = __nccwpck_require__(52611) + +/* globals Blob */ + +/** + * @param {import('./websocket').WebSocket} ws + */ +function isEstablished (ws) { + // If the server's response is validated as provided for above, it is + // said that _The WebSocket Connection is Established_ and that the + // WebSocket Connection is in the OPEN state. + return ws[kReadyState] === states.OPEN +} + +/** + * @param {import('./websocket').WebSocket} ws + */ +function isClosing (ws) { + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + return ws[kReadyState] === states.CLOSING +} + +/** + * @param {import('./websocket').WebSocket} ws + */ +function isClosed (ws) { + return ws[kReadyState] === states.CLOSED +} + +/** + * @see https://dom.spec.whatwg.org/#concept-event-fire + * @param {string} e + * @param {EventTarget} target + * @param {EventInit | undefined} eventInitDict + */ +function fireEvent (e, target, eventConstructor = Event, eventInitDict) { + // 1. If eventConstructor is not given, then let eventConstructor be Event. + + // 2. Let event be the result of creating an event given eventConstructor, + // in the relevant realm of target. + // 3. Initialize event’s type attribute to e. + const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap + + // 4. Initialize any other IDL attributes of event as described in the + // invocation of this algorithm. + + // 5. Return the result of dispatching event at target, with legacy target + // override flag set if set. + target.dispatchEvent(event) +} + +/** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + * @param {import('./websocket').WebSocket} ws + * @param {number} type Opcode + * @param {Buffer} data application data + */ +function websocketMessageReceived (ws, type, data) { + // 1. If ready state is not OPEN (1), then return. + if (ws[kReadyState] !== states.OPEN) { + return + } + + // 2. Let dataForEvent be determined by switching on type and binary type: + let dataForEvent + + if (type === opcodes.TEXT) { + // -> type indicates that the data is Text + // a new DOMString containing data + try { + dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data) + } catch { + failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.') + return + } + } else if (type === opcodes.BINARY) { + if (ws[kBinaryType] === 'blob') { + // -> type indicates that the data is Binary and binary type is "blob" + // a new Blob object, created in the relevant Realm of the WebSocket + // object, that represents data as its raw data + dataForEvent = new Blob([data]) + } else { + // -> type indicates that the data is Binary and binary type is "arraybuffer" + // a new ArrayBuffer object, created in the relevant Realm of the + // WebSocket object, whose contents are data + dataForEvent = new Uint8Array(data).buffer + } + } + + // 3. Fire an event named message at the WebSocket object, using MessageEvent, + // with the origin attribute initialized to the serialization of the WebSocket + // object’s url's origin, and the data attribute initialized to dataForEvent. + fireEvent('message', ws, MessageEvent, { + origin: ws[kWebSocketURL].origin, + data: dataForEvent + }) +} + +/** + * @see https://datatracker.ietf.org/doc/html/rfc6455 + * @see https://datatracker.ietf.org/doc/html/rfc2616 + * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407 + * @param {string} protocol + */ +function isValidSubprotocol (protocol) { + // If present, this value indicates one + // or more comma-separated subprotocol the client wishes to speak, + // ordered by preference. The elements that comprise this value + // MUST be non-empty strings with characters in the range U+0021 to + // U+007E not including separator characters as defined in + // [RFC2616] and MUST all be unique strings. + if (protocol.length === 0) { + return false + } + + for (const char of protocol) { + const code = char.charCodeAt(0) + + if ( + code < 0x21 || + code > 0x7E || + char === '(' || + char === ')' || + char === '<' || + char === '>' || + char === '@' || + char === ',' || + char === ';' || + char === ':' || + char === '\\' || + char === '"' || + char === '/' || + char === '[' || + char === ']' || + char === '?' || + char === '=' || + char === '{' || + char === '}' || + code === 32 || // SP + code === 9 // HT + ) { + return false + } + } + + return true +} + +/** + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4 + * @param {number} code + */ +function isValidStatusCode (code) { + if (code >= 1000 && code < 1015) { + return ( + code !== 1004 && // reserved + code !== 1005 && // "MUST NOT be set as a status code" + code !== 1006 // "MUST NOT be set as a status code" + ) + } + + return code >= 3000 && code <= 4999 +} + +/** + * @param {import('./websocket').WebSocket} ws + * @param {string|undefined} reason + */ +function failWebsocketConnection (ws, reason) { + const { [kController]: controller, [kResponse]: response } = ws + + controller.abort() + + if (response?.socket && !response.socket.destroyed) { + response.socket.destroy() + } + + if (reason) { + fireEvent('error', ws, ErrorEvent, { + error: new Error(reason) + }) + } +} + +module.exports = { + isEstablished, + isClosing, + isClosed, + fireEvent, + isValidSubprotocol, + isValidStatusCode, + failWebsocketConnection, + websocketMessageReceived +} + + +/***/ }), + +/***/ 54284: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const { webidl } = __nccwpck_require__(21744) +const { DOMException } = __nccwpck_require__(41037) +const { URLSerializer } = __nccwpck_require__(685) +const { getGlobalOrigin } = __nccwpck_require__(71246) +const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(19188) +const { + kWebSocketURL, + kReadyState, + kController, + kBinaryType, + kResponse, + kSentClose, + kByteParser +} = __nccwpck_require__(37578) +const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(25515) +const { establishWebSocketConnection } = __nccwpck_require__(35354) +const { WebsocketFrameSend } = __nccwpck_require__(25444) +const { ByteParser } = __nccwpck_require__(11688) +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(83983) +const { getGlobalDispatcher } = __nccwpck_require__(21892) +const { types } = __nccwpck_require__(73837) + +let experimentalWarned = false + +// https://websockets.spec.whatwg.org/#interface-definition +class WebSocket extends EventTarget { + #events = { + open: null, + error: null, + close: null, + message: null + } + + #bufferedAmount = 0 + #protocol = '' + #extensions = '' + + /** + * @param {string} url + * @param {string|string[]} protocols + */ + constructor (url, protocols = []) { + super() + + webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' }) + + if (!experimentalWarned) { + experimentalWarned = true + process.emitWarning('WebSockets are experimental, expect them to change at any time.', { + code: 'UNDICI-WS' + }) + } + + const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols) + + url = webidl.converters.USVString(url) + protocols = options.protocols + + // 1. Let baseURL be this's relevant settings object's API base URL. + const baseURL = getGlobalOrigin() + + // 1. Let urlRecord be the result of applying the URL parser to url with baseURL. + let urlRecord + + try { + urlRecord = new URL(url, baseURL) + } catch (e) { + // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException. + throw new DOMException(e, 'SyntaxError') + } + + // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws". + if (urlRecord.protocol === 'http:') { + urlRecord.protocol = 'ws:' + } else if (urlRecord.protocol === 'https:') { + // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss". + urlRecord.protocol = 'wss:' + } + + // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException. + if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') { + throw new DOMException( + `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, + 'SyntaxError' + ) + } + + // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError" + // DOMException. + if (urlRecord.hash || urlRecord.href.endsWith('#')) { + throw new DOMException('Got fragment', 'SyntaxError') + } + + // 8. If protocols is a string, set protocols to a sequence consisting + // of just that string. + if (typeof protocols === 'string') { + protocols = [protocols] + } + + // 9. If any of the values in protocols occur more than once or otherwise + // fail to match the requirements for elements that comprise the value + // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket + // protocol, then throw a "SyntaxError" DOMException. + if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) { + throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') + } + + if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) { + throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError') + } + + // 10. Set this's url to urlRecord. + this[kWebSocketURL] = new URL(urlRecord.href) + + // 11. Let client be this's relevant settings object. + + // 12. Run this step in parallel: + + // 1. Establish a WebSocket connection given urlRecord, protocols, + // and client. + this[kController] = establishWebSocketConnection( + urlRecord, + protocols, + this, + (response) => this.#onConnectionEstablished(response), + options + ) + + // Each WebSocket object has an associated ready state, which is a + // number representing the state of the connection. Initially it must + // be CONNECTING (0). + this[kReadyState] = WebSocket.CONNECTING + + // The extensions attribute must initially return the empty string. + + // The protocol attribute must initially return the empty string. + + // Each WebSocket object has an associated binary type, which is a + // BinaryType. Initially it must be "blob". + this[kBinaryType] = 'blob' + } + + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-close + * @param {number|undefined} code + * @param {string|undefined} reason + */ + close (code = undefined, reason = undefined) { + webidl.brandCheck(this, WebSocket) + + if (code !== undefined) { + code = webidl.converters['unsigned short'](code, { clamp: true }) + } + + if (reason !== undefined) { + reason = webidl.converters.USVString(reason) + } + + // 1. If code is present, but is neither an integer equal to 1000 nor an + // integer in the range 3000 to 4999, inclusive, throw an + // "InvalidAccessError" DOMException. + if (code !== undefined) { + if (code !== 1000 && (code < 3000 || code > 4999)) { + throw new DOMException('invalid code', 'InvalidAccessError') + } + } + + let reasonByteLength = 0 + + // 2. If reason is present, then run these substeps: + if (reason !== undefined) { + // 1. Let reasonBytes be the result of encoding reason. + // 2. If reasonBytes is longer than 123 bytes, then throw a + // "SyntaxError" DOMException. + reasonByteLength = Buffer.byteLength(reason) + + if (reasonByteLength > 123) { + throw new DOMException( + `Reason must be less than 123 bytes; received ${reasonByteLength}`, + 'SyntaxError' + ) + } + } + + // 3. Run the first matching steps from the following list: + if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) { + // If this's ready state is CLOSING (2) or CLOSED (3) + // Do nothing. + } else if (!isEstablished(this)) { + // If the WebSocket connection is not yet established + // Fail the WebSocket connection and set this's ready state + // to CLOSING (2). + failWebsocketConnection(this, 'Connection was closed before it was established.') + this[kReadyState] = WebSocket.CLOSING + } else if (!isClosing(this)) { + // If the WebSocket closing handshake has not yet been started + // Start the WebSocket closing handshake and set this's ready + // state to CLOSING (2). + // - If neither code nor reason is present, the WebSocket Close + // message must not have a body. + // - If code is present, then the status code to use in the + // WebSocket Close message must be the integer given by code. + // - If reason is also present, then reasonBytes must be + // provided in the Close message after the status code. + + const frame = new WebsocketFrameSend() + + // If neither code nor reason is present, the WebSocket Close + // message must not have a body. + + // If code is present, then the status code to use in the + // WebSocket Close message must be the integer given by code. + if (code !== undefined && reason === undefined) { + frame.frameData = Buffer.allocUnsafe(2) + frame.frameData.writeUInt16BE(code, 0) + } else if (code !== undefined && reason !== undefined) { + // If reason is also present, then reasonBytes must be + // provided in the Close message after the status code. + frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength) + frame.frameData.writeUInt16BE(code, 0) + // the body MAY contain UTF-8-encoded data with value /reason/ + frame.frameData.write(reason, 2, 'utf-8') + } else { + frame.frameData = emptyBuffer + } + + /** @type {import('stream').Duplex} */ + const socket = this[kResponse].socket + + socket.write(frame.createFrame(opcodes.CLOSE), (err) => { + if (!err) { + this[kSentClose] = true + } + }) + + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + this[kReadyState] = states.CLOSING + } else { + // Otherwise + // Set this's ready state to CLOSING (2). + this[kReadyState] = WebSocket.CLOSING + } + } + + /** + * @see https://websockets.spec.whatwg.org/#dom-websocket-send + * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data + */ + send (data) { + webidl.brandCheck(this, WebSocket) + + webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' }) + + data = webidl.converters.WebSocketSendData(data) + + // 1. If this's ready state is CONNECTING, then throw an + // "InvalidStateError" DOMException. + if (this[kReadyState] === WebSocket.CONNECTING) { + throw new DOMException('Sent before connected.', 'InvalidStateError') + } + + // 2. Run the appropriate set of steps from the following list: + // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1 + // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2 + + if (!isEstablished(this) || isClosing(this)) { + return + } + + /** @type {import('stream').Duplex} */ + const socket = this[kResponse].socket + + // If data is a string + if (typeof data === 'string') { + // If the WebSocket connection is established and the WebSocket + // closing handshake has not yet started, then the user agent + // must send a WebSocket Message comprised of the data argument + // using a text frame opcode; if the data cannot be sent, e.g. + // because it would need to be buffered but the buffer is full, + // the user agent must flag the WebSocket as full and then close + // the WebSocket connection. Any invocation of this method with a + // string argument that does not throw an exception must increase + // the bufferedAmount attribute by the number of bytes needed to + // express the argument as UTF-8. + + const value = Buffer.from(data) + const frame = new WebsocketFrameSend(value) + const buffer = frame.createFrame(opcodes.TEXT) + + this.#bufferedAmount += value.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength + }) + } else if (types.isArrayBuffer(data)) { + // If the WebSocket connection is established, and the WebSocket + // closing handshake has not yet started, then the user agent must + // send a WebSocket Message comprised of data using a binary frame + // opcode; if the data cannot be sent, e.g. because it would need + // to be buffered but the buffer is full, the user agent must flag + // the WebSocket as full and then close the WebSocket connection. + // The data to be sent is the data stored in the buffer described + // by the ArrayBuffer object. Any invocation of this method with an + // ArrayBuffer argument that does not throw an exception must + // increase the bufferedAmount attribute by the length of the + // ArrayBuffer in bytes. + + const value = Buffer.from(data) + const frame = new WebsocketFrameSend(value) + const buffer = frame.createFrame(opcodes.BINARY) + + this.#bufferedAmount += value.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength + }) + } else if (ArrayBuffer.isView(data)) { + // If the WebSocket connection is established, and the WebSocket + // closing handshake has not yet started, then the user agent must + // send a WebSocket Message comprised of data using a binary frame + // opcode; if the data cannot be sent, e.g. because it would need to + // be buffered but the buffer is full, the user agent must flag the + // WebSocket as full and then close the WebSocket connection. The + // data to be sent is the data stored in the section of the buffer + // described by the ArrayBuffer object that data references. Any + // invocation of this method with this kind of argument that does + // not throw an exception must increase the bufferedAmount attribute + // by the length of data’s buffer in bytes. + + const ab = Buffer.from(data, data.byteOffset, data.byteLength) + + const frame = new WebsocketFrameSend(ab) + const buffer = frame.createFrame(opcodes.BINARY) + + this.#bufferedAmount += ab.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= ab.byteLength + }) + } else if (isBlobLike(data)) { + // If the WebSocket connection is established, and the WebSocket + // closing handshake has not yet started, then the user agent must + // send a WebSocket Message comprised of data using a binary frame + // opcode; if the data cannot be sent, e.g. because it would need to + // be buffered but the buffer is full, the user agent must flag the + // WebSocket as full and then close the WebSocket connection. The data + // to be sent is the raw data represented by the Blob object. Any + // invocation of this method with a Blob argument that does not throw + // an exception must increase the bufferedAmount attribute by the size + // of the Blob object’s raw data, in bytes. + + const frame = new WebsocketFrameSend() + + data.arrayBuffer().then((ab) => { + const value = Buffer.from(ab) + frame.frameData = value + const buffer = frame.createFrame(opcodes.BINARY) + + this.#bufferedAmount += value.byteLength + socket.write(buffer, () => { + this.#bufferedAmount -= value.byteLength + }) + }) + } + } + + get readyState () { + webidl.brandCheck(this, WebSocket) + + // The readyState getter steps are to return this's ready state. + return this[kReadyState] + } + + get bufferedAmount () { + webidl.brandCheck(this, WebSocket) + + return this.#bufferedAmount + } + + get url () { + webidl.brandCheck(this, WebSocket) + + // The url getter steps are to return this's url, serialized. + return URLSerializer(this[kWebSocketURL]) + } + + get extensions () { + webidl.brandCheck(this, WebSocket) + + return this.#extensions + } + + get protocol () { + webidl.brandCheck(this, WebSocket) + + return this.#protocol + } + + get onopen () { + webidl.brandCheck(this, WebSocket) + + return this.#events.open + } + + set onopen (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.open) { + this.removeEventListener('open', this.#events.open) + } + + if (typeof fn === 'function') { + this.#events.open = fn + this.addEventListener('open', fn) + } else { + this.#events.open = null + } + } + + get onerror () { + webidl.brandCheck(this, WebSocket) + + return this.#events.error + } + + set onerror (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.error) { + this.removeEventListener('error', this.#events.error) + } + + if (typeof fn === 'function') { + this.#events.error = fn + this.addEventListener('error', fn) + } else { + this.#events.error = null + } + } + + get onclose () { + webidl.brandCheck(this, WebSocket) + + return this.#events.close + } + + set onclose (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.close) { + this.removeEventListener('close', this.#events.close) + } + + if (typeof fn === 'function') { + this.#events.close = fn + this.addEventListener('close', fn) + } else { + this.#events.close = null + } + } + + get onmessage () { + webidl.brandCheck(this, WebSocket) + + return this.#events.message + } + + set onmessage (fn) { + webidl.brandCheck(this, WebSocket) + + if (this.#events.message) { + this.removeEventListener('message', this.#events.message) + } + + if (typeof fn === 'function') { + this.#events.message = fn + this.addEventListener('message', fn) + } else { + this.#events.message = null + } + } + + get binaryType () { + webidl.brandCheck(this, WebSocket) + + return this[kBinaryType] + } + + set binaryType (type) { + webidl.brandCheck(this, WebSocket) + + if (type !== 'blob' && type !== 'arraybuffer') { + this[kBinaryType] = 'blob' + } else { + this[kBinaryType] = type + } + } + + /** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + */ + #onConnectionEstablished (response) { + // processResponse is called when the "response’s header list has been received and initialized." + // once this happens, the connection is open + this[kResponse] = response + + const parser = new ByteParser(this) + parser.on('drain', function onParserDrain () { + this.ws[kResponse].socket.resume() + }) + + response.socket.ws = this + this[kByteParser] = parser + + // 1. Change the ready state to OPEN (1). + this[kReadyState] = states.OPEN + + // 2. Change the extensions attribute’s value to the extensions in use, if + // it is not the null value. + // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1 + const extensions = response.headersList.get('sec-websocket-extensions') + + if (extensions !== null) { + this.#extensions = extensions + } + + // 3. Change the protocol attribute’s value to the subprotocol in use, if + // it is not the null value. + // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9 + const protocol = response.headersList.get('sec-websocket-protocol') + + if (protocol !== null) { + this.#protocol = protocol + } + + // 4. Fire an event named open at the WebSocket object. + fireEvent('open', this) + } +} + +// https://websockets.spec.whatwg.org/#dom-websocket-connecting +WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING +// https://websockets.spec.whatwg.org/#dom-websocket-open +WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN +// https://websockets.spec.whatwg.org/#dom-websocket-closing +WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING +// https://websockets.spec.whatwg.org/#dom-websocket-closed +WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED + +Object.defineProperties(WebSocket.prototype, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors, + url: kEnumerableProperty, + readyState: kEnumerableProperty, + bufferedAmount: kEnumerableProperty, + onopen: kEnumerableProperty, + onerror: kEnumerableProperty, + onclose: kEnumerableProperty, + close: kEnumerableProperty, + onmessage: kEnumerableProperty, + binaryType: kEnumerableProperty, + send: kEnumerableProperty, + extensions: kEnumerableProperty, + protocol: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'WebSocket', + writable: false, + enumerable: false, + configurable: true + } +}) + +Object.defineProperties(WebSocket, { + CONNECTING: staticPropertyDescriptors, + OPEN: staticPropertyDescriptors, + CLOSING: staticPropertyDescriptors, + CLOSED: staticPropertyDescriptors +}) + +webidl.converters['sequence'] = webidl.sequenceConverter( + webidl.converters.DOMString +) + +webidl.converters['DOMString or sequence'] = function (V) { + if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) { + return webidl.converters['sequence'](V) + } + + return webidl.converters.DOMString(V) +} + +// This implements the propsal made in https://github.com/whatwg/websockets/issues/42 +webidl.converters.WebSocketInit = webidl.dictionaryConverter([ + { + key: 'protocols', + converter: webidl.converters['DOMString or sequence'], + get defaultValue () { + return [] + } + }, + { + key: 'dispatcher', + converter: (V) => V, + get defaultValue () { + return getGlobalDispatcher() + } + }, + { + key: 'headers', + converter: webidl.nullableConverter(webidl.converters.HeadersInit) + } +]) + +webidl.converters['DOMString or sequence or WebSocketInit'] = function (V) { + if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) { + return webidl.converters.WebSocketInit(V) + } + + return { protocols: webidl.converters['DOMString or sequence'](V) } +} + +webidl.converters.WebSocketSendData = function (V) { + if (webidl.util.Type(V) === 'Object') { + if (isBlobLike(V)) { + return webidl.converters.Blob(V, { strict: false }) + } + + if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) { + return webidl.converters.BufferSource(V) + } + } + + return webidl.converters.USVString(V) +} + +module.exports = { + WebSocket +} /***/ }), @@ -441534,7 +483389,7 @@ function getUserAgent() { return navigator.userAgent; } - if (typeof process === "object" && "version" in process) { + if (typeof process === "object" && process.version !== undefined) { return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; } @@ -444332,950 +486187,440 @@ var ZipStream = module.exports = function(options) { if (options.comment && options.comment.length > 0) { this.setComment(options.comment); } -}; - -inherits(ZipStream, ZipArchiveOutputStream); - -/** - * Normalizes entry data with fallbacks for key properties. - * - * @private - * @param {Object} data - * @return {Object} - */ -ZipStream.prototype._normalizeFileData = function(data) { - data = util.defaults(data, { - type: 'file', - name: null, - linkname: null, - date: null, - mode: null, - store: this.options.store, - comment: '' - }); - - var isDir = data.type === 'directory'; - var isSymlink = data.type === 'symlink'; - - if (data.name) { - data.name = util.sanitizePath(data.name); - - if (!isSymlink && data.name.slice(-1) === '/') { - isDir = true; - data.type = 'directory'; - } else if (isDir) { - data.name += '/'; - } - } - - if (isDir || isSymlink) { - data.store = true; - } - - data.date = util.dateify(data.date); - - return data; -}; - -/** - * Appends an entry given an input source (text string, buffer, or stream). - * - * @param {(Buffer|Stream|String)} source The input source. - * @param {Object} data - * @param {String} data.name Sets the entry name including internal path. - * @param {String} [data.comment] Sets the entry comment. - * @param {(String|Date)} [data.date=NOW()] Sets the entry date. - * @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions. - * @param {Boolean} [data.store=options.store] Sets the compression method to STORE. - * @param {String} [data.type=file] Sets the entry type. Defaults to `directory` - * if name ends with trailing slash. - * @param {Function} callback - * @return this - */ -ZipStream.prototype.entry = function(source, data, callback) { - if (typeof callback !== 'function') { - callback = this._emitErrorCallback.bind(this); - } - - data = this._normalizeFileData(data); - - if (data.type !== 'file' && data.type !== 'directory' && data.type !== 'symlink') { - callback(new Error(data.type + ' entries not currently supported')); - return; - } - - if (typeof data.name !== 'string' || data.name.length === 0) { - callback(new Error('entry name must be a non-empty string value')); - return; - } - - if (data.type === 'symlink' && typeof data.linkname !== 'string') { - callback(new Error('entry linkname must be a non-empty string value when type equals symlink')); - return; - } - - var entry = new ZipArchiveEntry(data.name); - entry.setTime(data.date, this.options.forceLocalTime); - - if (data.store) { - entry.setMethod(0); - } - - if (data.comment.length > 0) { - entry.setComment(data.comment); - } - - if (data.type === 'symlink' && typeof data.mode !== 'number') { - data.mode = 40960; // 0120000 - } - - if (typeof data.mode === 'number') { - if (data.type === 'symlink') { - data.mode |= 40960; - } - - entry.setUnixMode(data.mode); - } - - if (data.type === 'symlink' && typeof data.linkname === 'string') { - source = Buffer.from(data.linkname); - } - - return ZipArchiveOutputStream.prototype.entry.call(this, entry, source, callback); -}; - -/** - * Finalizes the instance and prevents further appending to the archive - * structure (queue will continue til drained). - * - * @return void - */ -ZipStream.prototype.finalize = function() { - this.finish(); -}; - -/** - * Returns the current number of bytes written to this stream. - * @function ZipStream#getBytesWritten - * @returns {Number} - */ - -/** - * Compress Commons ZipArchiveOutputStream - * @external ZipArchiveOutputStream - * @see {@link https://github.com/archiverjs/node-compress-commons} - */ - - -/***/ }), - -/***/ 22877: -/***/ ((module) => { - -module.exports = eval("require")("encoding"); - - -/***/ }), - -/***/ 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"); - -/***/ }), - -/***/ 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"); - -/***/ }), - -/***/ 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"); - -/***/ }), - -/***/ 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"); - -/***/ }), - -/***/ 77282: -/***/ ((module) => { - -"use strict"; -module.exports = require("process"); - -/***/ }), - -/***/ 85477: -/***/ ((module) => { - -"use strict"; -module.exports = require("punycode"); - -/***/ }), - -/***/ 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"); - -/***/ }), - -/***/ 71267: -/***/ ((module) => { - -"use strict"; -module.exports = require("worker_threads"); - -/***/ }), - -/***/ 59796: -/***/ ((module) => { - -"use strict"; -module.exports = require("zlib"); - -/***/ }), - -/***/ 85026: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -const defaultOptions = { - sourceType: "script", - sourceFilename: undefined, - startColumn: 0, - startLine: 1, - allowAwaitOutsideFunction: false, - allowReturnOutsideFunction: false, - allowNewTargetOutsideFunction: false, - allowImportExportEverywhere: false, - allowSuperOutsideMethod: false, - allowUndeclaredExports: false, - plugins: [], - strictMode: null, - ranges: false, - tokens: false, - createParenthesizedExpressions: false, - errorRecovery: false, - attachComment: true, - annexB: true -}; -function getOptions(opts) { - if (opts && opts.annexB != null && opts.annexB !== false) { - throw new Error("The `annexB` option can only be set to `false`."); - } - const options = {}; - for (const key of Object.keys(defaultOptions)) { - options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; - } - return options; -} -class TokContext { - constructor(token, preserveSpace) { - this.token = void 0; - this.preserveSpace = void 0; - this.token = token; - this.preserveSpace = !!preserveSpace; - } -} -const types = { - brace: new TokContext("{"), - j_oTag: new TokContext("...", true) -}; -{ - types.template = new TokContext("`", true); -} -const beforeExpr = true; -const startsExpr = true; -const isLoop = true; -const isAssign = true; -const prefix = true; -const postfix = true; -class ExportedTokenType { - constructor(label, conf = {}) { - this.label = void 0; - this.keyword = void 0; - this.beforeExpr = void 0; - this.startsExpr = void 0; - this.rightAssociative = void 0; - this.isLoop = void 0; - this.isAssign = void 0; - this.prefix = void 0; - this.postfix = void 0; - this.binop = void 0; - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.rightAssociative = !!conf.rightAssociative; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop != null ? conf.binop : null; - { - this.updateContext = null; - } - } -} -const keywords$1 = new Map(); -function createKeyword(name, options = {}) { - options.keyword = name; - const token = createToken(name, options); - keywords$1.set(name, token); - return token; -} -function createBinop(name, binop) { - return createToken(name, { - beforeExpr, - binop - }); -} -let tokenTypeCounter = -1; -const tokenTypes = []; -const tokenLabels = []; -const tokenBinops = []; -const tokenBeforeExprs = []; -const tokenStartsExprs = []; -const tokenPrefixes = []; -function createToken(name, options = {}) { - var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; - ++tokenTypeCounter; - tokenLabels.push(name); - tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); - tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); - tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); - tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); - tokenTypes.push(new ExportedTokenType(name, options)); - return tokenTypeCounter; -} -function createKeywordLike(name, options = {}) { - var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; - ++tokenTypeCounter; - keywords$1.set(name, tokenTypeCounter); - tokenLabels.push(name); - tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); - tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); - tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); - tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); - tokenTypes.push(new ExportedTokenType("name", options)); - return tokenTypeCounter; -} -const tt = { - bracketL: createToken("[", { - beforeExpr, - startsExpr - }), - bracketHashL: createToken("#[", { - beforeExpr, - startsExpr - }), - bracketBarL: createToken("[|", { - beforeExpr, - startsExpr - }), - bracketR: createToken("]"), - bracketBarR: createToken("|]"), - braceL: createToken("{", { - beforeExpr, - startsExpr - }), - braceBarL: createToken("{|", { - beforeExpr, - startsExpr - }), - braceHashL: createToken("#{", { - beforeExpr, - startsExpr - }), - braceR: createToken("}"), - braceBarR: createToken("|}"), - parenL: createToken("(", { - beforeExpr, - startsExpr - }), - parenR: createToken(")"), - comma: createToken(",", { - beforeExpr - }), - semi: createToken(";", { - beforeExpr - }), - colon: createToken(":", { - beforeExpr - }), - doubleColon: createToken("::", { - beforeExpr - }), - dot: createToken("."), - question: createToken("?", { - beforeExpr - }), - questionDot: createToken("?."), - arrow: createToken("=>", { - beforeExpr - }), - template: createToken("template"), - ellipsis: createToken("...", { - beforeExpr - }), - backQuote: createToken("`", { - startsExpr - }), - dollarBraceL: createToken("${", { - beforeExpr, - startsExpr - }), - templateTail: createToken("...`", { - startsExpr - }), - templateNonTail: createToken("...${", { - beforeExpr, - startsExpr - }), - at: createToken("@"), - hash: createToken("#", { - startsExpr - }), - interpreterDirective: createToken("#!..."), - eq: createToken("=", { - beforeExpr, - isAssign - }), - assign: createToken("_=", { - beforeExpr, - isAssign - }), - slashAssign: createToken("_=", { - beforeExpr, - isAssign - }), - xorAssign: createToken("_=", { - beforeExpr, - isAssign - }), - moduloAssign: createToken("_=", { - beforeExpr, - isAssign - }), - incDec: createToken("++/--", { - prefix, - postfix, - startsExpr - }), - bang: createToken("!", { - beforeExpr, - prefix, - startsExpr - }), - tilde: createToken("~", { - beforeExpr, - prefix, - startsExpr - }), - doubleCaret: createToken("^^", { - startsExpr - }), - doubleAt: createToken("@@", { - startsExpr - }), - pipeline: createBinop("|>", 0), - nullishCoalescing: createBinop("??", 1), - logicalOR: createBinop("||", 1), - logicalAND: createBinop("&&", 2), - bitwiseOR: createBinop("|", 3), - bitwiseXOR: createBinop("^", 4), - bitwiseAND: createBinop("&", 5), - equality: createBinop("==/!=/===/!==", 6), - lt: createBinop("/<=/>=", 7), - gt: createBinop("/<=/>=", 7), - relational: createBinop("/<=/>=", 7), - bitShift: createBinop("<>/>>>", 8), - bitShiftL: createBinop("<>/>>>", 8), - bitShiftR: createBinop("<>/>>>", 8), - plusMin: createToken("+/-", { - beforeExpr, - binop: 9, - prefix, - startsExpr - }), - modulo: createToken("%", { - binop: 10, - startsExpr - }), - star: createToken("*", { - binop: 10 - }), - slash: createBinop("/", 10), - exponent: createToken("**", { - beforeExpr, - binop: 11, - rightAssociative: true - }), - _in: createKeyword("in", { - beforeExpr, - binop: 7 - }), - _instanceof: createKeyword("instanceof", { - beforeExpr, - binop: 7 - }), - _break: createKeyword("break"), - _case: createKeyword("case", { - beforeExpr - }), - _catch: createKeyword("catch"), - _continue: createKeyword("continue"), - _debugger: createKeyword("debugger"), - _default: createKeyword("default", { - beforeExpr - }), - _else: createKeyword("else", { - beforeExpr - }), - _finally: createKeyword("finally"), - _function: createKeyword("function", { - startsExpr - }), - _if: createKeyword("if"), - _return: createKeyword("return", { - beforeExpr - }), - _switch: createKeyword("switch"), - _throw: createKeyword("throw", { - beforeExpr, - prefix, - startsExpr - }), - _try: createKeyword("try"), - _var: createKeyword("var"), - _const: createKeyword("const"), - _with: createKeyword("with"), - _new: createKeyword("new", { - beforeExpr, - startsExpr - }), - _this: createKeyword("this", { - startsExpr - }), - _super: createKeyword("super", { - startsExpr - }), - _class: createKeyword("class", { - startsExpr - }), - _extends: createKeyword("extends", { - beforeExpr - }), - _export: createKeyword("export"), - _import: createKeyword("import", { - startsExpr - }), - _null: createKeyword("null", { - startsExpr - }), - _true: createKeyword("true", { - startsExpr - }), - _false: createKeyword("false", { - startsExpr - }), - _typeof: createKeyword("typeof", { - beforeExpr, - prefix, - startsExpr - }), - _void: createKeyword("void", { - beforeExpr, - prefix, - startsExpr - }), - _delete: createKeyword("delete", { - beforeExpr, - prefix, - startsExpr - }), - _do: createKeyword("do", { - isLoop, - beforeExpr - }), - _for: createKeyword("for", { - isLoop - }), - _while: createKeyword("while", { - isLoop - }), - _as: createKeywordLike("as", { - startsExpr - }), - _assert: createKeywordLike("assert", { - startsExpr - }), - _async: createKeywordLike("async", { - startsExpr - }), - _await: createKeywordLike("await", { - startsExpr - }), - _from: createKeywordLike("from", { - startsExpr - }), - _get: createKeywordLike("get", { - startsExpr - }), - _let: createKeywordLike("let", { - startsExpr - }), - _meta: createKeywordLike("meta", { - startsExpr - }), - _of: createKeywordLike("of", { - startsExpr - }), - _sent: createKeywordLike("sent", { - startsExpr - }), - _set: createKeywordLike("set", { - startsExpr - }), - _static: createKeywordLike("static", { - startsExpr - }), - _using: createKeywordLike("using", { - startsExpr - }), - _yield: createKeywordLike("yield", { - startsExpr - }), - _asserts: createKeywordLike("asserts", { - startsExpr - }), - _checks: createKeywordLike("checks", { - startsExpr - }), - _exports: createKeywordLike("exports", { - startsExpr - }), - _global: createKeywordLike("global", { - startsExpr - }), - _implements: createKeywordLike("implements", { - startsExpr - }), - _intrinsic: createKeywordLike("intrinsic", { - startsExpr - }), - _infer: createKeywordLike("infer", { - startsExpr - }), - _is: createKeywordLike("is", { - startsExpr - }), - _mixins: createKeywordLike("mixins", { - startsExpr - }), - _proto: createKeywordLike("proto", { - startsExpr - }), - _require: createKeywordLike("require", { - startsExpr - }), - _satisfies: createKeywordLike("satisfies", { - startsExpr - }), - _keyof: createKeywordLike("keyof", { - startsExpr - }), - _readonly: createKeywordLike("readonly", { - startsExpr - }), - _unique: createKeywordLike("unique", { - startsExpr - }), - _abstract: createKeywordLike("abstract", { - startsExpr - }), - _declare: createKeywordLike("declare", { - startsExpr - }), - _enum: createKeywordLike("enum", { - startsExpr - }), - _module: createKeywordLike("module", { - startsExpr - }), - _namespace: createKeywordLike("namespace", { - startsExpr - }), - _interface: createKeywordLike("interface", { - startsExpr - }), - _type: createKeywordLike("type", { - startsExpr - }), - _opaque: createKeywordLike("opaque", { - startsExpr - }), - name: createToken("name", { - startsExpr - }), - string: createToken("string", { - startsExpr - }), - num: createToken("num", { - startsExpr - }), - bigint: createToken("bigint", { - startsExpr - }), - decimal: createToken("decimal", { - startsExpr - }), - regexp: createToken("regexp", { - startsExpr - }), - privateName: createToken("#name", { - startsExpr - }), - eof: createToken("eof"), - jsxName: createToken("jsxName"), - jsxText: createToken("jsxText", { - beforeExpr: true - }), - jsxTagStart: createToken("jsxTagStart", { - startsExpr: true - }), - jsxTagEnd: createToken("jsxTagEnd"), - placeholder: createToken("%%", { - startsExpr: true - }) -}; -function tokenIsIdentifier(token) { - return token >= 93 && token <= 130; -} -function tokenKeywordOrIdentifierIsKeyword(token) { - return token <= 92; -} -function tokenIsKeywordOrIdentifier(token) { - return token >= 58 && token <= 130; -} -function tokenIsLiteralPropertyName(token) { - return token >= 58 && token <= 134; -} -function tokenComesBeforeExpression(token) { - return tokenBeforeExprs[token]; -} -function tokenCanStartExpression(token) { - return tokenStartsExprs[token]; -} -function tokenIsAssignment(token) { - return token >= 29 && token <= 33; -} -function tokenIsFlowInterfaceOrTypeOrOpaque(token) { - return token >= 127 && token <= 129; -} -function tokenIsLoop(token) { - return token >= 90 && token <= 92; -} -function tokenIsKeyword(token) { - return token >= 58 && token <= 92; -} -function tokenIsOperator(token) { - return token >= 39 && token <= 59; -} -function tokenIsPostfix(token) { - return token === 34; -} -function tokenIsPrefix(token) { - return tokenPrefixes[token]; -} -function tokenIsTSTypeOperator(token) { - return token >= 119 && token <= 121; -} -function tokenIsTSDeclarationStart(token) { - return token >= 122 && token <= 128; -} -function tokenLabelName(token) { - return tokenLabels[token]; -} -function tokenOperatorPrecedence(token) { - return tokenBinops[token]; -} -function tokenIsRightAssociative(token) { - return token === 57; -} -function tokenIsTemplate(token) { - return token >= 24 && token <= 25; -} -function getExportedToken(token) { - return tokenTypes[token]; -} -{ - tokenTypes[8].updateContext = context => { - context.pop(); - }; - tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { - context.push(types.brace); - }; - tokenTypes[22].updateContext = context => { - if (context[context.length - 1] === types.template) { - context.pop(); - } else { - context.push(types.template); +}; + +inherits(ZipStream, ZipArchiveOutputStream); + +/** + * Normalizes entry data with fallbacks for key properties. + * + * @private + * @param {Object} data + * @return {Object} + */ +ZipStream.prototype._normalizeFileData = function(data) { + data = util.defaults(data, { + type: 'file', + name: null, + linkname: null, + date: null, + mode: null, + store: this.options.store, + comment: '' + }); + + var isDir = data.type === 'directory'; + var isSymlink = data.type === 'symlink'; + + if (data.name) { + data.name = util.sanitizePath(data.name); + + if (!isSymlink && data.name.slice(-1) === '/') { + isDir = true; + data.type = 'directory'; + } else if (isDir) { + data.name += '/'; } - }; - tokenTypes[140].updateContext = context => { - context.push(types.j_expr, types.j_oTag); - }; -} + } + + if (isDir || isSymlink) { + data.store = true; + } + + data.date = util.dateify(data.date); + + return data; +}; + +/** + * Appends an entry given an input source (text string, buffer, or stream). + * + * @param {(Buffer|Stream|String)} source The input source. + * @param {Object} data + * @param {String} data.name Sets the entry name including internal path. + * @param {String} [data.comment] Sets the entry comment. + * @param {(String|Date)} [data.date=NOW()] Sets the entry date. + * @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions. + * @param {Boolean} [data.store=options.store] Sets the compression method to STORE. + * @param {String} [data.type=file] Sets the entry type. Defaults to `directory` + * if name ends with trailing slash. + * @param {Function} callback + * @return this + */ +ZipStream.prototype.entry = function(source, data, callback) { + if (typeof callback !== 'function') { + callback = this._emitErrorCallback.bind(this); + } + + data = this._normalizeFileData(data); + + if (data.type !== 'file' && data.type !== 'directory' && data.type !== 'symlink') { + callback(new Error(data.type + ' entries not currently supported')); + return; + } + + if (typeof data.name !== 'string' || data.name.length === 0) { + callback(new Error('entry name must be a non-empty string value')); + return; + } + + if (data.type === 'symlink' && typeof data.linkname !== 'string') { + callback(new Error('entry linkname must be a non-empty string value when type equals symlink')); + return; + } + + var entry = new ZipArchiveEntry(data.name); + entry.setTime(data.date, this.options.forceLocalTime); + + if (data.store) { + entry.setMethod(0); + } + + if (data.comment.length > 0) { + entry.setComment(data.comment); + } + + if (data.type === 'symlink' && typeof data.mode !== 'number') { + data.mode = 40960; // 0120000 + } + + if (typeof data.mode === 'number') { + if (data.type === 'symlink') { + data.mode |= 40960; + } + + entry.setUnixMode(data.mode); + } + + if (data.type === 'symlink' && typeof data.linkname === 'string') { + source = Buffer.from(data.linkname); + } + + return ZipArchiveOutputStream.prototype.entry.call(this, entry, source, callback); +}; + +/** + * Finalizes the instance and prevents further appending to the archive + * structure (queue will continue til drained). + * + * @return void + */ +ZipStream.prototype.finalize = function() { + this.finish(); +}; + +/** + * Returns the current number of bytes written to this stream. + * @function ZipStream#getBytesWritten + * @returns {Number} + */ + +/** + * Compress Commons ZipArchiveOutputStream + * @external ZipArchiveOutputStream + * @see {@link https://github.com/archiverjs/node-compress-commons} + */ + + +/***/ }), + +/***/ 22877: +/***/ ((module) => { + +module.exports = eval("require")("encoding"); + + +/***/ }), + +/***/ 39491: +/***/ ((module) => { + +"use strict"; +module.exports = require("assert"); + +/***/ }), + +/***/ 50852: +/***/ ((module) => { + +"use strict"; +module.exports = require("async_hooks"); + +/***/ }), + +/***/ 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"); + +/***/ }), + +/***/ 67643: +/***/ ((module) => { + +"use strict"; +module.exports = require("diagnostics_channel"); + +/***/ }), + +/***/ 82361: +/***/ ((module) => { + +"use strict"; +module.exports = require("events"); + +/***/ }), + +/***/ 57147: +/***/ ((module) => { + +"use strict"; +module.exports = require("fs"); + +/***/ }), + +/***/ 13685: +/***/ ((module) => { + +"use strict"; +module.exports = require("http"); + +/***/ }), + +/***/ 85158: +/***/ ((module) => { + +"use strict"; +module.exports = require("http2"); + +/***/ }), + +/***/ 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"); + +/***/ }), + +/***/ 15673: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:events"); + +/***/ }), + +/***/ 84492: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:stream"); + +/***/ }), + +/***/ 47261: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:util"); + +/***/ }), + +/***/ 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"); + +/***/ }), + +/***/ 77282: +/***/ ((module) => { + +"use strict"; +module.exports = require("process"); + +/***/ }), + +/***/ 85477: +/***/ ((module) => { + +"use strict"; +module.exports = require("punycode"); + +/***/ }), + +/***/ 63477: +/***/ ((module) => { + +"use strict"; +module.exports = require("querystring"); + +/***/ }), + +/***/ 12781: +/***/ ((module) => { + +"use strict"; +module.exports = require("stream"); + +/***/ }), + +/***/ 35356: +/***/ ((module) => { + +"use strict"; +module.exports = require("stream/web"); + +/***/ }), + +/***/ 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"); + +/***/ }), + +/***/ 29830: +/***/ ((module) => { + +"use strict"; +module.exports = require("util/types"); + +/***/ }), + +/***/ 71267: +/***/ ((module) => { + +"use strict"; +module.exports = require("worker_threads"); + +/***/ }), + +/***/ 59796: +/***/ ((module) => { + +"use strict"; +module.exports = require("zlib"); + +/***/ }), + +/***/ 85026: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; @@ -445316,32 +486661,15 @@ function createPositionWithColumnOffset(position, columnOffset) { } = position; return new Position(line, column + columnOffset, index + columnOffset); } -var ParseErrorCode = { - SyntaxError: "BABEL_PARSER_SYNTAX_ERROR", - SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" -}; -const reflect = (keys, last = keys.length - 1) => ({ - get() { - return keys.reduce((object, key) => object[key], this); - }, - set(value) { - keys.reduce((item, key, i) => i === last ? item[key] = value : item[key], this); - } -}); -const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? { - value: descriptor, - enumerable: false -} : typeof descriptor.reflect === "string" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split("."))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({ - configurable: true -}, descriptor)), Object.assign(new constructor(), properties)); +const code = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"; var ModuleErrors = { ImportMetaOutsideModule: { message: `import.meta may appear only with 'sourceType: "module"'`, - code: ParseErrorCode.SourceTypeModuleError + code }, ImportOutsideModule: { message: `'import' and 'export' may appear only with 'sourceType: "module"'`, - code: ParseErrorCode.SourceTypeModuleError + code } }; const NodeDescriptions = { @@ -445382,7 +486710,7 @@ var StandardErrors = { AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", - AwaitInUsingBinding: "'await' is not allowed to be used as a name in 'using' declarations.", + AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncFunction: "'await' is only allowed within async functions.", BadGetterArity: "A 'get' accessor must not have any formal parameters.", @@ -445403,6 +486731,7 @@ var StandardErrors = { DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.", DecoratorSemicolon: "Decorators must not be followed by a semicolon.", DecoratorStaticBlock: "Decorators can't be used with a static block.", + DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.', DeletePrivateField: "Deleting a private field is not allowed.", DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", DuplicateConstructor: "Duplicate constructor in the same class.", @@ -445412,6 +486741,9 @@ var StandardErrors = { }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, DuplicateProto: "Redefinition of __proto__ property.", DuplicateRegExpFlags: "Duplicate regular expression flag.", + DynamicImportPhaseRequiresImportExpressions: ({ + phase + }) => `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`, ElementAfterRest: "Rest element must be last element.", EscapedCharNotAnIdentifier: "Invalid Unicode escape.", ExportBindingIsString: ({ @@ -445431,6 +486763,7 @@ var StandardErrors = { }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", IllegalReturn: "'return' outside of function.", + ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.", ImportBindingIsString: ({ importName }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, @@ -445465,6 +486798,9 @@ var StandardErrors = { InvalidLhsBinding: ({ ancestor }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`, + InvalidLhsOptionalChaining: ({ + ancestor + }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`, InvalidNumber: "Invalid number.", InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", InvalidOrUnexpectedToken: ({ @@ -445480,7 +486816,7 @@ var StandardErrors = { LabelRedeclaration: ({ labelName }) => `Label '${labelName}' is already declared.`, - LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", + LetInLexicalBinding: "'let' is disallowed as a lexically bound name.", LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", MalformedRegExpFlags: "Invalid regular expression flag.", MissingClassName: "A class name is required.", @@ -445530,6 +486866,7 @@ var StandardErrors = { RestTrailingComma: "Unexpected trailing comma after rest element.", SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.", SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", + SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.', StaticPrototype: "Classes may not have static property named prototype.", SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", SuperPrivateField: "Private fields can't be accessed on super.", @@ -445616,50 +486953,56 @@ var PipelineOperatorErrors = { PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.' }; -const _excluded$1 = ["toMessage"], - _excluded2$1 = ["message"]; +const _excluded = ["toMessage"], + _excluded2 = ["message"]; +function defineHidden(obj, key, value) { + Object.defineProperty(obj, key, { + enumerable: false, + configurable: true, + value + }); +} function toParseErrorConstructor(_ref) { let { toMessage } = _ref, - properties = _objectWithoutPropertiesLoose(_ref, _excluded$1); - return function constructor({ - loc, - details - }) { - return instantiate(SyntaxError, Object.assign({}, properties, { - loc - }), { - clone(overrides = {}) { - const loc = overrides.loc || {}; - return constructor({ - loc: new Position("line" in loc ? loc.line : this.loc.line, "column" in loc ? loc.column : this.loc.column, "index" in loc ? loc.index : this.loc.index), - details: Object.assign({}, this.details, overrides.details) - }); - }, - details: { - value: details, - enumerable: false - }, - message: { - get() { - return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`; - }, - set(value) { - Object.defineProperty(this, "message", { - value - }); - } - }, - pos: { - reflect: "loc.index", - enumerable: true + properties = _objectWithoutPropertiesLoose(_ref, _excluded); + return function constructor(loc, details) { + const error = new SyntaxError(); + Object.assign(error, properties, { + loc, + pos: loc.index + }); + if ("missingPlugin" in details) { + Object.assign(error, { + missingPlugin: details.missingPlugin + }); + } + defineHidden(error, "clone", function clone(overrides = {}) { + var _overrides$loc; + const { + line, + column, + index + } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc; + return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details)); + }); + defineHidden(error, "details", details); + Object.defineProperty(error, "message", { + configurable: true, + get() { + const message = `${toMessage(details)} (${loc.line}:${loc.column})`; + this.message = message; + return message; }, - missingPlugin: "missingPlugin" in details && { - reflect: "details.missingPlugin", - enumerable: true + set(value) { + Object.defineProperty(this, "message", { + value, + writable: true + }); } }); + return error; }; } function ParseErrorEnum(argument, syntaxPlugin) { @@ -445677,10 +487020,10 @@ function ParseErrorEnum(argument, syntaxPlugin) { { message } = _ref2, - rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1); + rest = _objectWithoutPropertiesLoose(_ref2, _excluded2); const toMessage = typeof message === "string" ? () => message : message; ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ - code: ParseErrorCode.SyntaxError, + code: "BABEL_PARSER_SYNTAX_ERROR", reasonCode, toMessage }, syntaxPlugin ? { @@ -445922,13 +487265,9 @@ var estree = superClass => class ESTreeParserMixin extends superClass { } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.kind === "get" || prop.kind === "set") { - this.raise(Errors.PatternHasAccessor, { - at: prop.key - }); + this.raise(Errors.PatternHasAccessor, prop.key); } else if (prop.method) { - this.raise(Errors.PatternHasMethod, { - at: prop.key - }); + this.raise(Errors.PatternHasMethod, prop.key); } else { super.toAssignableObjectExpressionProp(prop, isLast, isLHS); } @@ -445938,9 +487277,10 @@ var estree = superClass => class ESTreeParserMixin extends superClass { if (node.callee.type === "Import") { node.type = "ImportExpression"; node.source = node.arguments[0]; - if (this.hasPlugin("importAssertions")) { - var _node$arguments$; - node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null; + if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { + var _node$arguments$, _node$arguments$2; + node.options = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null; + node.attributes = (_node$arguments$2 = node.arguments[1]) != null ? _node$arguments$2 : null; } delete node.arguments; delete node.callee; @@ -445996,6 +487336,12 @@ var estree = superClass => class ESTreeParserMixin extends superClass { } return node; } + isOptionalMemberExpression(node) { + if (node.type === "ChainExpression") { + return node.expression.type === "MemberExpression"; + } + return super.isOptionalMemberExpression(node); + } hasPropertyAsPrivateName(node) { if (node.type === "ChainExpression") { node = node.expression; @@ -446020,12 +487366,578 @@ var estree = superClass => class ESTreeParserMixin extends superClass { toESTreeLocation(node); } }; +class TokContext { + constructor(token, preserveSpace) { + this.token = void 0; + this.preserveSpace = void 0; + this.token = token; + this.preserveSpace = !!preserveSpace; + } +} +const types = { + brace: new TokContext("{"), + j_oTag: new TokContext("...", true) +}; +{ + types.template = new TokContext("`", true); +} +const beforeExpr = true; +const startsExpr = true; +const isLoop = true; +const isAssign = true; +const prefix = true; +const postfix = true; +class ExportedTokenType { + constructor(label, conf = {}) { + this.label = void 0; + this.keyword = void 0; + this.beforeExpr = void 0; + this.startsExpr = void 0; + this.rightAssociative = void 0; + this.isLoop = void 0; + this.isAssign = void 0; + this.prefix = void 0; + this.postfix = void 0; + this.binop = void 0; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.rightAssociative = !!conf.rightAssociative; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop != null ? conf.binop : null; + { + this.updateContext = null; + } + } +} +const keywords$1 = new Map(); +function createKeyword(name, options = {}) { + options.keyword = name; + const token = createToken(name, options); + keywords$1.set(name, token); + return token; +} +function createBinop(name, binop) { + return createToken(name, { + beforeExpr, + binop + }); +} +let tokenTypeCounter = -1; +const tokenTypes = []; +const tokenLabels = []; +const tokenBinops = []; +const tokenBeforeExprs = []; +const tokenStartsExprs = []; +const tokenPrefixes = []; +function createToken(name, options = {}) { + var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; + ++tokenTypeCounter; + tokenLabels.push(name); + tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); + tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); + tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); + tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); + tokenTypes.push(new ExportedTokenType(name, options)); + return tokenTypeCounter; +} +function createKeywordLike(name, options = {}) { + var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; + ++tokenTypeCounter; + keywords$1.set(name, tokenTypeCounter); + tokenLabels.push(name); + tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); + tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); + tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); + tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); + tokenTypes.push(new ExportedTokenType("name", options)); + return tokenTypeCounter; +} +const tt = { + bracketL: createToken("[", { + beforeExpr, + startsExpr + }), + bracketHashL: createToken("#[", { + beforeExpr, + startsExpr + }), + bracketBarL: createToken("[|", { + beforeExpr, + startsExpr + }), + bracketR: createToken("]"), + bracketBarR: createToken("|]"), + braceL: createToken("{", { + beforeExpr, + startsExpr + }), + braceBarL: createToken("{|", { + beforeExpr, + startsExpr + }), + braceHashL: createToken("#{", { + beforeExpr, + startsExpr + }), + braceR: createToken("}"), + braceBarR: createToken("|}"), + parenL: createToken("(", { + beforeExpr, + startsExpr + }), + parenR: createToken(")"), + comma: createToken(",", { + beforeExpr + }), + semi: createToken(";", { + beforeExpr + }), + colon: createToken(":", { + beforeExpr + }), + doubleColon: createToken("::", { + beforeExpr + }), + dot: createToken("."), + question: createToken("?", { + beforeExpr + }), + questionDot: createToken("?."), + arrow: createToken("=>", { + beforeExpr + }), + template: createToken("template"), + ellipsis: createToken("...", { + beforeExpr + }), + backQuote: createToken("`", { + startsExpr + }), + dollarBraceL: createToken("${", { + beforeExpr, + startsExpr + }), + templateTail: createToken("...`", { + startsExpr + }), + templateNonTail: createToken("...${", { + beforeExpr, + startsExpr + }), + at: createToken("@"), + hash: createToken("#", { + startsExpr + }), + interpreterDirective: createToken("#!..."), + eq: createToken("=", { + beforeExpr, + isAssign + }), + assign: createToken("_=", { + beforeExpr, + isAssign + }), + slashAssign: createToken("_=", { + beforeExpr, + isAssign + }), + xorAssign: createToken("_=", { + beforeExpr, + isAssign + }), + moduloAssign: createToken("_=", { + beforeExpr, + isAssign + }), + incDec: createToken("++/--", { + prefix, + postfix, + startsExpr + }), + bang: createToken("!", { + beforeExpr, + prefix, + startsExpr + }), + tilde: createToken("~", { + beforeExpr, + prefix, + startsExpr + }), + doubleCaret: createToken("^^", { + startsExpr + }), + doubleAt: createToken("@@", { + startsExpr + }), + pipeline: createBinop("|>", 0), + nullishCoalescing: createBinop("??", 1), + logicalOR: createBinop("||", 1), + logicalAND: createBinop("&&", 2), + bitwiseOR: createBinop("|", 3), + bitwiseXOR: createBinop("^", 4), + bitwiseAND: createBinop("&", 5), + equality: createBinop("==/!=/===/!==", 6), + lt: createBinop("/<=/>=", 7), + gt: createBinop("/<=/>=", 7), + relational: createBinop("/<=/>=", 7), + bitShift: createBinop("<>/>>>", 8), + bitShiftL: createBinop("<>/>>>", 8), + bitShiftR: createBinop("<>/>>>", 8), + plusMin: createToken("+/-", { + beforeExpr, + binop: 9, + prefix, + startsExpr + }), + modulo: createToken("%", { + binop: 10, + startsExpr + }), + star: createToken("*", { + binop: 10 + }), + slash: createBinop("/", 10), + exponent: createToken("**", { + beforeExpr, + binop: 11, + rightAssociative: true + }), + _in: createKeyword("in", { + beforeExpr, + binop: 7 + }), + _instanceof: createKeyword("instanceof", { + beforeExpr, + binop: 7 + }), + _break: createKeyword("break"), + _case: createKeyword("case", { + beforeExpr + }), + _catch: createKeyword("catch"), + _continue: createKeyword("continue"), + _debugger: createKeyword("debugger"), + _default: createKeyword("default", { + beforeExpr + }), + _else: createKeyword("else", { + beforeExpr + }), + _finally: createKeyword("finally"), + _function: createKeyword("function", { + startsExpr + }), + _if: createKeyword("if"), + _return: createKeyword("return", { + beforeExpr + }), + _switch: createKeyword("switch"), + _throw: createKeyword("throw", { + beforeExpr, + prefix, + startsExpr + }), + _try: createKeyword("try"), + _var: createKeyword("var"), + _const: createKeyword("const"), + _with: createKeyword("with"), + _new: createKeyword("new", { + beforeExpr, + startsExpr + }), + _this: createKeyword("this", { + startsExpr + }), + _super: createKeyword("super", { + startsExpr + }), + _class: createKeyword("class", { + startsExpr + }), + _extends: createKeyword("extends", { + beforeExpr + }), + _export: createKeyword("export"), + _import: createKeyword("import", { + startsExpr + }), + _null: createKeyword("null", { + startsExpr + }), + _true: createKeyword("true", { + startsExpr + }), + _false: createKeyword("false", { + startsExpr + }), + _typeof: createKeyword("typeof", { + beforeExpr, + prefix, + startsExpr + }), + _void: createKeyword("void", { + beforeExpr, + prefix, + startsExpr + }), + _delete: createKeyword("delete", { + beforeExpr, + prefix, + startsExpr + }), + _do: createKeyword("do", { + isLoop, + beforeExpr + }), + _for: createKeyword("for", { + isLoop + }), + _while: createKeyword("while", { + isLoop + }), + _as: createKeywordLike("as", { + startsExpr + }), + _assert: createKeywordLike("assert", { + startsExpr + }), + _async: createKeywordLike("async", { + startsExpr + }), + _await: createKeywordLike("await", { + startsExpr + }), + _defer: createKeywordLike("defer", { + startsExpr + }), + _from: createKeywordLike("from", { + startsExpr + }), + _get: createKeywordLike("get", { + startsExpr + }), + _let: createKeywordLike("let", { + startsExpr + }), + _meta: createKeywordLike("meta", { + startsExpr + }), + _of: createKeywordLike("of", { + startsExpr + }), + _sent: createKeywordLike("sent", { + startsExpr + }), + _set: createKeywordLike("set", { + startsExpr + }), + _source: createKeywordLike("source", { + startsExpr + }), + _static: createKeywordLike("static", { + startsExpr + }), + _using: createKeywordLike("using", { + startsExpr + }), + _yield: createKeywordLike("yield", { + startsExpr + }), + _asserts: createKeywordLike("asserts", { + startsExpr + }), + _checks: createKeywordLike("checks", { + startsExpr + }), + _exports: createKeywordLike("exports", { + startsExpr + }), + _global: createKeywordLike("global", { + startsExpr + }), + _implements: createKeywordLike("implements", { + startsExpr + }), + _intrinsic: createKeywordLike("intrinsic", { + startsExpr + }), + _infer: createKeywordLike("infer", { + startsExpr + }), + _is: createKeywordLike("is", { + startsExpr + }), + _mixins: createKeywordLike("mixins", { + startsExpr + }), + _proto: createKeywordLike("proto", { + startsExpr + }), + _require: createKeywordLike("require", { + startsExpr + }), + _satisfies: createKeywordLike("satisfies", { + startsExpr + }), + _keyof: createKeywordLike("keyof", { + startsExpr + }), + _readonly: createKeywordLike("readonly", { + startsExpr + }), + _unique: createKeywordLike("unique", { + startsExpr + }), + _abstract: createKeywordLike("abstract", { + startsExpr + }), + _declare: createKeywordLike("declare", { + startsExpr + }), + _enum: createKeywordLike("enum", { + startsExpr + }), + _module: createKeywordLike("module", { + startsExpr + }), + _namespace: createKeywordLike("namespace", { + startsExpr + }), + _interface: createKeywordLike("interface", { + startsExpr + }), + _type: createKeywordLike("type", { + startsExpr + }), + _opaque: createKeywordLike("opaque", { + startsExpr + }), + name: createToken("name", { + startsExpr + }), + string: createToken("string", { + startsExpr + }), + num: createToken("num", { + startsExpr + }), + bigint: createToken("bigint", { + startsExpr + }), + decimal: createToken("decimal", { + startsExpr + }), + regexp: createToken("regexp", { + startsExpr + }), + privateName: createToken("#name", { + startsExpr + }), + eof: createToken("eof"), + jsxName: createToken("jsxName"), + jsxText: createToken("jsxText", { + beforeExpr: true + }), + jsxTagStart: createToken("jsxTagStart", { + startsExpr: true + }), + jsxTagEnd: createToken("jsxTagEnd"), + placeholder: createToken("%%", { + startsExpr: true + }) +}; +function tokenIsIdentifier(token) { + return token >= 93 && token <= 132; +} +function tokenKeywordOrIdentifierIsKeyword(token) { + return token <= 92; +} +function tokenIsKeywordOrIdentifier(token) { + return token >= 58 && token <= 132; +} +function tokenIsLiteralPropertyName(token) { + return token >= 58 && token <= 136; +} +function tokenComesBeforeExpression(token) { + return tokenBeforeExprs[token]; +} +function tokenCanStartExpression(token) { + return tokenStartsExprs[token]; +} +function tokenIsAssignment(token) { + return token >= 29 && token <= 33; +} +function tokenIsFlowInterfaceOrTypeOrOpaque(token) { + return token >= 129 && token <= 131; +} +function tokenIsLoop(token) { + return token >= 90 && token <= 92; +} +function tokenIsKeyword(token) { + return token >= 58 && token <= 92; +} +function tokenIsOperator(token) { + return token >= 39 && token <= 59; +} +function tokenIsPostfix(token) { + return token === 34; +} +function tokenIsPrefix(token) { + return tokenPrefixes[token]; +} +function tokenIsTSTypeOperator(token) { + return token >= 121 && token <= 123; +} +function tokenIsTSDeclarationStart(token) { + return token >= 124 && token <= 130; +} +function tokenLabelName(token) { + return tokenLabels[token]; +} +function tokenOperatorPrecedence(token) { + return tokenBinops[token]; +} +function tokenIsRightAssociative(token) { + return token === 57; +} +function tokenIsTemplate(token) { + return token >= 24 && token <= 25; +} +function getExportedToken(token) { + return tokenTypes[token]; +} +{ + tokenTypes[8].updateContext = context => { + context.pop(); + }; + tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { + context.push(types.brace); + }; + tokenTypes[22].updateContext = context => { + if (context[context.length - 1] === types.template) { + context.pop(); + } else { + context.push(types.template); + } + }; + tokenTypes[142].updateContext = context => { + context.push(types.j_expr, types.j_oTag); + }; +} let 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"; -let 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"; +let 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\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\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\uff65"; const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const 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]; +const 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, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; const 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]; function isInAstralSet(code, set) { let pos = 0x10000; @@ -446089,59 +488001,11 @@ const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debu function canBeReservedWord(word) { return reservedWordLikeSet.has(word); } -const SCOPE_OTHER = 0b000000000, - SCOPE_PROGRAM = 0b000000001, - SCOPE_FUNCTION = 0b000000010, - SCOPE_ARROW = 0b000000100, - SCOPE_SIMPLE_CATCH = 0b000001000, - SCOPE_SUPER = 0b000010000, - SCOPE_DIRECT_SUPER = 0b000100000, - SCOPE_CLASS = 0b001000000, - SCOPE_STATIC_BLOCK = 0b010000000, - SCOPE_TS_MODULE = 0b100000000, - SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_STATIC_BLOCK | SCOPE_TS_MODULE; -const BIND_KIND_VALUE = 0b0000000000001, - BIND_KIND_TYPE = 0b0000000000010, - BIND_SCOPE_VAR = 0b0000000000100, - BIND_SCOPE_LEXICAL = 0b0000000001000, - BIND_SCOPE_FUNCTION = 0b0000000010000, - BIND_FLAGS_NONE = 0b00000001000000, - BIND_FLAGS_CLASS = 0b00000010000000, - BIND_FLAGS_TS_ENUM = 0b00000100000000, - BIND_FLAGS_TS_CONST_ENUM = 0b00001000000000, - BIND_FLAGS_TS_EXPORT_ONLY = 0b00010000000000, - BIND_FLAGS_FLOW_DECLARE_FN = 0b00100000000000, - BIND_FLAGS_TS_IMPORT = 0b01000000000000, - BIND_FLAGS_NO_LET_IN_LEXICAL = 0b10000000000000; -const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS | BIND_FLAGS_NO_LET_IN_LEXICAL, - BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | BIND_FLAGS_NO_LET_IN_LEXICAL, - BIND_CATCH_PARAM = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, - BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, - BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, - BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, - BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, - BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM | BIND_FLAGS_NO_LET_IN_LEXICAL, - BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, - BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, - BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, - BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_TS_TYPE_IMPORT = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_TS_IMPORT, - BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; -const CLASS_ELEMENT_FLAG_STATIC = 0b100, - CLASS_ELEMENT_KIND_GETTER = 0b010, - CLASS_ELEMENT_KIND_SETTER = 0b001, - CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; -const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, - CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, - CLASS_ELEMENT_OTHER = 0; class Scope { constructor(flags) { - this.var = new Set(); - this.lexical = new Set(); - this.functions = new Set(); + this.flags = 0; + this.names = new Map(); + this.firstLexicalName = ""; this.flags = flags; } } @@ -446155,39 +488019,39 @@ class ScopeHandler { this.inModule = inModule; } get inTopLevel() { - return (this.currentScope().flags & SCOPE_PROGRAM) > 0; + return (this.currentScope().flags & 1) > 0; } get inFunction() { - return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0; + return (this.currentVarScopeFlags() & 2) > 0; } get allowSuper() { - return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0; + return (this.currentThisScopeFlags() & 16) > 0; } get allowDirectSuper() { - return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0; + return (this.currentThisScopeFlags() & 32) > 0; } get inClass() { - return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0; + return (this.currentThisScopeFlags() & 64) > 0; } get inClassAndNotInNonArrowFunction() { const flags = this.currentThisScopeFlags(); - return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0; + return (flags & 64) > 0 && (flags & 2) === 0; } get inStaticBlock() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; - if (flags & SCOPE_STATIC_BLOCK) { + if (flags & 128) { return true; } - if (flags & (SCOPE_VAR | SCOPE_CLASS)) { + if (flags & (387 | 64)) { return false; } } } get inNonArrowFunction() { - return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0; + return (this.currentThisScopeFlags() & 2) > 0; } get treatFunctionsAsVar() { return this.treatFunctionsAsVarInScope(this.currentScope()); @@ -446203,62 +488067,67 @@ class ScopeHandler { return scope.flags; } treatFunctionsAsVarInScope(scope) { - return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM); + return !!(scope.flags & (2 | 128) || !this.parser.inModule && scope.flags & 1); } declareName(name, bindingType, loc) { let scope = this.currentScope(); - if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) { + if (bindingType & 8 || bindingType & 16) { this.checkRedeclarationInScope(scope, name, bindingType, loc); - if (bindingType & BIND_SCOPE_FUNCTION) { - scope.functions.add(name); + let type = scope.names.get(name) || 0; + if (bindingType & 16) { + type = type | 4; } else { - scope.lexical.add(name); + if (!scope.firstLexicalName) { + scope.firstLexicalName = name; + } + type = type | 2; } - if (bindingType & BIND_SCOPE_LEXICAL) { + scope.names.set(name, type); + if (bindingType & 8) { this.maybeExportDefined(scope, name); } - } else if (bindingType & BIND_SCOPE_VAR) { + } else if (bindingType & 4) { for (let i = this.scopeStack.length - 1; i >= 0; --i) { scope = this.scopeStack[i]; this.checkRedeclarationInScope(scope, name, bindingType, loc); - scope.var.add(name); + scope.names.set(name, (scope.names.get(name) || 0) | 1); this.maybeExportDefined(scope, name); - if (scope.flags & SCOPE_VAR) break; + if (scope.flags & 387) break; } } - if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) { + if (this.parser.inModule && scope.flags & 1) { this.undefinedExports.delete(name); } } maybeExportDefined(scope, name) { - if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) { + if (this.parser.inModule && scope.flags & 1) { this.undefinedExports.delete(name); } } checkRedeclarationInScope(scope, name, bindingType, loc) { if (this.isRedeclaredInScope(scope, name, bindingType)) { - this.parser.raise(Errors.VarRedeclaration, { - at: loc, + this.parser.raise(Errors.VarRedeclaration, loc, { identifierName: name }); } } isRedeclaredInScope(scope, name, bindingType) { - if (!(bindingType & BIND_KIND_VALUE)) return false; - if (bindingType & BIND_SCOPE_LEXICAL) { - return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name); + if (!(bindingType & 1)) return false; + if (bindingType & 8) { + return scope.names.has(name); } - if (bindingType & BIND_SCOPE_FUNCTION) { - return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name); + const type = scope.names.get(name); + if (bindingType & 16) { + return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0; } - return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name); + return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0; } checkLocalExport(id) { const { name } = id; const topLevelScope = this.scopeStack[0]; - if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) { + if (!topLevelScope.names.has(name)) { this.undefinedExports.set(name, id.loc.start); } } @@ -446270,7 +488139,7 @@ class ScopeHandler { const { flags } = this.scopeStack[i]; - if (flags & SCOPE_VAR) { + if (flags & 387) { return flags; } } @@ -446280,7 +488149,7 @@ class ScopeHandler { const { flags } = this.scopeStack[i]; - if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) { + if (flags & (387 | 64) && !(flags & 4)) { return flags; } } @@ -446298,7 +488167,7 @@ class FlowScopeHandler extends ScopeHandler { } declareName(name, bindingType, loc) { const scope = this.currentScope(); - if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { + if (bindingType & 2048) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); scope.declareFunctions.add(name); @@ -446308,8 +488177,9 @@ class FlowScopeHandler extends ScopeHandler { } isRedeclaredInScope(scope, name, bindingType) { if (super.isRedeclaredInScope(scope, name, bindingType)) return true; - if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { - return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name)); + if (bindingType & 2048 && !scope.declareFunctions.has(name)) { + const type = scope.names.get(name); + return (type & 4) > 0 || (type & 2) > 0; } return false; } @@ -446382,7 +488252,12 @@ function adjustInnerComments(node, elements, commentWS) { class CommentsParser extends BaseParser { addComment(comment) { if (this.filename) comment.loc.filename = this.filename; - this.state.comments.push(comment); + const { + commentsLen + } = this.state; + if (this.comments.length != commentsLen) this.comments.length = commentsLen; + this.comments.push(comment); + this.state.commentsLen++; } processComment(node) { const { @@ -446490,6 +488365,20 @@ class CommentsParser extends BaseParser { commentWS.leadingNode = null; } } + resetPreviousIdentifierLeadingComments(node) { + const { + commentStack + } = this.state; + const { + length + } = commentStack; + if (length === 0) return; + if (commentStack[length - 1].trailingNode === node) { + commentStack[length - 1].trailingNode = null; + } else if (length >= 2 && commentStack[length - 2].trailingNode === node) { + commentStack[length - 2].trailingNode = null; + } + } takeSurroundingComments(node, start, end) { const { commentStack @@ -446525,7 +488414,7 @@ function isNewLine(code) { } } const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y; +const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y"); function isWhitespace(code) { switch (code) { @@ -446557,7 +488446,7 @@ function isWhitespace(code) { } class State { constructor() { - this.strict = void 0; + this.flags = 1024; this.curLine = void 0; this.lineStart = void 0; this.startLoc = void 0; @@ -446566,37 +488455,35 @@ class State { this.potentialArrowAt = -1; this.noArrowAt = []; this.noArrowParamsConversionAt = []; - this.maybeInArrowParameters = false; - this.inType = false; - this.noAnonFunctionType = false; - this.hasFlowComment = false; - this.isAmbientContext = false; - this.inAbstractClass = false; - this.inDisallowConditionalTypesContext = false; this.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; - this.soloAwait = false; - this.inFSharpPipelineDirectBody = false; this.labels = []; - this.comments = []; + this.commentsLen = 0; this.commentStack = []; this.pos = 0; - this.type = 137; + this.type = 139; this.value = null; this.start = 0; this.end = 0; this.lastTokEndLoc = null; this.lastTokStartLoc = null; - this.lastTokStart = 0; this.context = [types.brace]; - this.canStartJSXElement = true; - this.containsEsc = false; this.firstInvalidTemplateEscapePos = null; this.strictErrors = new Map(); this.tokensLength = 0; } + get strict() { + return (this.flags & 1) > 0; + } + set strict(value) { + if (value) { + this.flags |= 1; + } else { + this.flags &= ~1; + } + } init({ strictMode, sourceType, @@ -446608,20 +488495,145 @@ class State { this.lineStart = -startColumn; this.startLoc = this.endLoc = new Position(startLine, startColumn, 0); } + get maybeInArrowParameters() { + return (this.flags & 2) > 0; + } + set maybeInArrowParameters(value) { + if (value) { + this.flags |= 2; + } else { + this.flags &= ~2; + } + } + get inType() { + return (this.flags & 4) > 0; + } + set inType(value) { + if (value) { + this.flags |= 4; + } else { + this.flags &= ~4; + } + } + get noAnonFunctionType() { + return (this.flags & 8) > 0; + } + set noAnonFunctionType(value) { + if (value) { + this.flags |= 8; + } else { + this.flags &= ~8; + } + } + get hasFlowComment() { + return (this.flags & 16) > 0; + } + set hasFlowComment(value) { + if (value) { + this.flags |= 16; + } else { + this.flags &= ~16; + } + } + get isAmbientContext() { + return (this.flags & 32) > 0; + } + set isAmbientContext(value) { + if (value) { + this.flags |= 32; + } else { + this.flags &= ~32; + } + } + get inAbstractClass() { + return (this.flags & 64) > 0; + } + set inAbstractClass(value) { + if (value) { + this.flags |= 64; + } else { + this.flags &= ~64; + } + } + get inDisallowConditionalTypesContext() { + return (this.flags & 128) > 0; + } + set inDisallowConditionalTypesContext(value) { + if (value) { + this.flags |= 128; + } else { + this.flags &= ~128; + } + } + get soloAwait() { + return (this.flags & 256) > 0; + } + set soloAwait(value) { + if (value) { + this.flags |= 256; + } else { + this.flags &= ~256; + } + } + get inFSharpPipelineDirectBody() { + return (this.flags & 512) > 0; + } + set inFSharpPipelineDirectBody(value) { + if (value) { + this.flags |= 512; + } else { + this.flags &= ~512; + } + } + get canStartJSXElement() { + return (this.flags & 1024) > 0; + } + set canStartJSXElement(value) { + if (value) { + this.flags |= 1024; + } else { + this.flags &= ~1024; + } + } + get containsEsc() { + return (this.flags & 2048) > 0; + } + set containsEsc(value) { + if (value) { + this.flags |= 2048; + } else { + this.flags &= ~2048; + } + } curPosition() { return new Position(this.curLine, this.pos - this.lineStart, this.pos); } - clone(skipArrays) { + clone() { const state = new State(); - const keys = Object.keys(this); - for (let i = 0, length = keys.length; i < length; i++) { - const key = keys[i]; - let val = this[key]; - if (!skipArrays && Array.isArray(val)) { - val = val.slice(); - } - state[key] = val; - } + state.flags = this.flags; + state.curLine = this.curLine; + state.lineStart = this.lineStart; + state.startLoc = this.startLoc; + state.endLoc = this.endLoc; + state.errors = this.errors.slice(); + state.potentialArrowAt = this.potentialArrowAt; + state.noArrowAt = this.noArrowAt.slice(); + state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(); + state.topicContext = this.topicContext; + state.labels = this.labels.slice(); + state.commentsLen = this.commentsLen; + state.commentStack = this.commentStack.slice(); + state.pos = this.pos; + state.type = this.type; + state.value = this.value; + state.start = this.start; + state.end = this.end; + state.lastTokEndLoc = this.lastTokEndLoc; + state.lastTokStartLoc = this.lastTokStartLoc; + state.context = this.context.slice(); + state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos; + state.strictErrors = this.strictErrors; + state.tokensLength = this.tokensLength; return state; } } @@ -446910,8 +488922,6 @@ function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { pos }; } -const _excluded = ["at"], - _excluded2 = ["at"]; function buildPosition(pos, lineStart, curLine) { return new Position(curLine, pos - lineStart, pos); } @@ -446933,8 +488943,7 @@ class Tokenizer extends CommentsParser { this.errorHandlers_readInt = { invalidDigit: (pos, lineStart, curLine, radix) => { if (!this.options.errorRecovery) return false; - this.raise(Errors.InvalidDigit, { - at: buildPosition(pos, lineStart, curLine), + this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), { radix }); return true; @@ -446948,28 +488957,23 @@ class Tokenizer extends CommentsParser { }); this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: (pos, lineStart, curLine) => { - this.recordStrictModeErrors(Errors.StrictNumericEscape, { - at: buildPosition(pos, lineStart, curLine) - }); + this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine)); }, unterminated: (pos, lineStart, curLine) => { - throw this.raise(Errors.UnterminatedString, { - at: buildPosition(pos - 1, lineStart, curLine) - }); + throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine)); } }); this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape), unterminated: (pos, lineStart, curLine) => { - throw this.raise(Errors.UnterminatedTemplate, { - at: buildPosition(pos, lineStart, curLine) - }); + throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine)); } }); this.state = new State(); this.state.init(options); this.input = input; this.length = input.length; + this.comments = []; this.isLookahead = false; } pushToken(token) { @@ -446982,7 +488986,6 @@ class Tokenizer extends CommentsParser { if (this.options.tokens) { this.pushToken(new Token(this.state)); } - this.state.lastTokStart = this.state.start; this.state.lastTokEndLoc = this.state.endLoc; this.state.lastTokStartLoc = this.state.startLoc; this.nextToken(); @@ -447034,6 +489037,16 @@ class Tokenizer extends CommentsParser { lookaheadCharCode() { return this.input.charCodeAt(this.nextTokenStart()); } + nextTokenInLineStart() { + return this.nextTokenInLineStartSince(this.state.pos); + } + nextTokenInLineStartSince(pos) { + skipWhiteSpaceInLine.lastIndex = pos; + return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos; + } + lookaheadInLineCharCode() { + return this.input.charCodeAt(this.nextTokenInLineStart()); + } codePointAtPos(pos) { let cp = this.input.charCodeAt(pos); if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { @@ -447047,9 +489060,7 @@ class Tokenizer extends CommentsParser { setStrict(strict) { this.state.strict = strict; if (strict) { - this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, { - at - })); + this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, at)); this.state.strictErrors.clear(); } } @@ -447061,7 +489072,7 @@ class Tokenizer extends CommentsParser { this.state.start = this.state.pos; if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); if (this.state.pos >= this.length) { - this.finishToken(137); + this.finishToken(139); return; } this.getTokenFromCode(this.codePointAtPos(this.state.pos)); @@ -447072,9 +489083,7 @@ class Tokenizer extends CommentsParser { const start = this.state.pos; const end = this.input.indexOf(commentEnd, start + 2); if (end === -1) { - throw this.raise(Errors.UnterminatedComment, { - at: this.state.curPosition() - }); + throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); } this.state.pos = end + commentEnd.length; lineBreakG.lastIndex = start + 2; @@ -447226,16 +489235,12 @@ class Tokenizer extends CommentsParser { const nextPos = this.state.pos + 1; const next = this.codePointAtPos(nextPos); if (next >= 48 && next <= 57) { - throw this.raise(Errors.UnexpectedDigitAfterHash, { - at: this.state.curPosition() - }); + throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition()); } if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { this.expectPlugin("recordAndTuple"); if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") { - throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, { - at: this.state.curPosition() - }); + throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition()); } this.state.pos += 2; if (next === 123) { @@ -447245,10 +489250,10 @@ class Tokenizer extends CommentsParser { } } else if (isIdentifierStart(next)) { ++this.state.pos; - this.finishToken(136, this.readWord1(next)); + this.finishToken(138, this.readWord1(next)); } else if (next === 92) { ++this.state.pos; - this.finishToken(136, this.readWord1()); + this.finishToken(138, this.readWord1()); } else { this.finishOp(27, 1); } @@ -447320,9 +489325,7 @@ class Tokenizer extends CommentsParser { } if (this.hasPlugin("recordAndTuple") && next === 125) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, { - at: this.state.curPosition() - }); + throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(9); @@ -447330,9 +489333,7 @@ class Tokenizer extends CommentsParser { } if (this.hasPlugin("recordAndTuple") && next === 93) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, { - at: this.state.curPosition() - }); + throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(4); @@ -447478,9 +489479,7 @@ class Tokenizer extends CommentsParser { case 91: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, { - at: this.state.curPosition() - }); + throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(2); @@ -447496,9 +489495,7 @@ class Tokenizer extends CommentsParser { case 123: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, { - at: this.state.curPosition() - }); + throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(6); @@ -447602,8 +489599,7 @@ class Tokenizer extends CommentsParser { return; } } - throw this.raise(Errors.InvalidOrUnexpectedToken, { - at: this.state.curPosition(), + throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), { unexpected: String.fromCodePoint(code) }); } @@ -447621,15 +489617,11 @@ class Tokenizer extends CommentsParser { } = this.state; for (;; ++pos) { if (pos >= this.length) { - throw this.raise(Errors.UnterminatedRegExp, { - at: createPositionWithColumnOffset(startLoc, 1) - }); + throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); } const ch = this.input.charCodeAt(pos); if (isNewLine(ch)) { - throw this.raise(Errors.UnterminatedRegExp, { - at: createPositionWithColumnOffset(startLoc, 1) - }); + throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); } if (escaped) { escaped = false; @@ -447653,28 +489645,19 @@ class Tokenizer extends CommentsParser { const char = String.fromCharCode(cp); if (VALID_REGEX_FLAGS.has(cp)) { if (cp === 118) { - this.expectPlugin("regexpUnicodeSets", nextPos()); if (mods.includes("u")) { - this.raise(Errors.IncompatibleRegExpUVFlags, { - at: nextPos() - }); + this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); } } else if (cp === 117) { if (mods.includes("v")) { - this.raise(Errors.IncompatibleRegExpUVFlags, { - at: nextPos() - }); + this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); } } if (mods.includes(char)) { - this.raise(Errors.DuplicateRegExpFlags, { - at: nextPos() - }); + this.raise(Errors.DuplicateRegExpFlags, nextPos()); } } else if (isIdentifierChar(cp) || cp === 92) { - this.raise(Errors.MalformedRegExpFlags, { - at: nextPos() - }); + this.raise(Errors.MalformedRegExpFlags, nextPos()); } else { break; } @@ -447682,7 +489665,7 @@ class Tokenizer extends CommentsParser { mods += char; } this.state.pos = pos; - this.finishToken(135, { + this.finishToken(137, { pattern: content, flags: mods }); @@ -447701,8 +489684,7 @@ class Tokenizer extends CommentsParser { this.state.pos += 2; const val = this.readInt(radix); if (val == null) { - this.raise(Errors.InvalidDigit, { - at: createPositionWithColumnOffset(startLoc, 2), + this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), { radix }); } @@ -447711,21 +489693,17 @@ class Tokenizer extends CommentsParser { ++this.state.pos; isBigInt = true; } else if (next === 109) { - throw this.raise(Errors.InvalidDecimal, { - at: startLoc - }); + throw this.raise(Errors.InvalidDecimal, startLoc); } if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { - throw this.raise(Errors.NumberIdentifier, { - at: this.state.curPosition() - }); + throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); } if (isBigInt) { const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, ""); - this.finishToken(133, str); + this.finishToken(135, str); return; } - this.finishToken(132, val); + this.finishToken(134, val); } readNumber(startsWithDot) { const start = this.state.pos; @@ -447736,22 +489714,16 @@ class Tokenizer extends CommentsParser { let hasExponent = false; let isOctal = false; if (!startsWithDot && this.readInt(10) === null) { - this.raise(Errors.InvalidNumber, { - at: this.state.curPosition() - }); + this.raise(Errors.InvalidNumber, this.state.curPosition()); } const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; if (hasLeadingZero) { const integer = this.input.slice(start, this.state.pos); - this.recordStrictModeErrors(Errors.StrictOctalLiteral, { - at: startLoc - }); + this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc); if (!this.state.strict) { const underscorePos = integer.indexOf("_"); if (underscorePos > 0) { - this.raise(Errors.ZeroDigitNumericSeparator, { - at: createPositionWithColumnOffset(startLoc, underscorePos) - }); + this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos)); } } isOctal = hasLeadingZero && !/[89]/.test(integer); @@ -447769,9 +489741,7 @@ class Tokenizer extends CommentsParser { ++this.state.pos; } if (this.readInt(10) === null) { - this.raise(Errors.InvalidOrMissingExponent, { - at: startLoc - }); + this.raise(Errors.InvalidOrMissingExponent, startLoc); } isFloat = true; hasExponent = true; @@ -447779,9 +489749,7 @@ class Tokenizer extends CommentsParser { } if (next === 110) { if (isFloat || hasLeadingZero) { - this.raise(Errors.InvalidBigIntLiteral, { - at: startLoc - }); + this.raise(Errors.InvalidBigIntLiteral, startLoc); } ++this.state.pos; isBigInt = true; @@ -447789,29 +489757,25 @@ class Tokenizer extends CommentsParser { if (next === 109) { this.expectPlugin("decimal", this.state.curPosition()); if (hasExponent || hasLeadingZero) { - this.raise(Errors.InvalidDecimal, { - at: startLoc - }); + this.raise(Errors.InvalidDecimal, startLoc); } ++this.state.pos; isDecimal = true; } if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { - throw this.raise(Errors.NumberIdentifier, { - at: this.state.curPosition() - }); + throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); } const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); if (isBigInt) { - this.finishToken(133, str); + this.finishToken(135, str); return; } if (isDecimal) { - this.finishToken(134, str); + this.finishToken(136, str); return; } const val = isOctal ? parseInt(str, 8) : parseFloat(str); - this.finishToken(132, val); + this.finishToken(134, val); } readCodePoint(throwOnInvalid) { const { @@ -447831,7 +489795,7 @@ class Tokenizer extends CommentsParser { this.state.pos = pos + 1; this.state.lineStart = lineStart; this.state.curLine = curLine; - this.finishToken(131, str); + this.finishToken(133, str); } readTemplateContinuation() { if (!this.match(8)) { @@ -447862,14 +489826,10 @@ class Tokenizer extends CommentsParser { this.finishToken(25, firstInvalidLoc ? null : opening + str + "${"); } } - recordStrictModeErrors(toParseError, { - at - }) { + recordStrictModeErrors(toParseError, at) { const index = at.index; if (this.state.strict && !this.state.strictErrors.has(index)) { - this.raise(toParseError, { - at - }); + this.raise(toParseError, at); } else { this.state.strictErrors.set(index, [toParseError, at]); } @@ -447892,9 +489852,7 @@ class Tokenizer extends CommentsParser { const escStart = this.state.curPosition(); const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; if (this.input.charCodeAt(++this.state.pos) !== 117) { - this.raise(Errors.MissingUnicodeEscape, { - at: this.state.curPosition() - }); + this.raise(Errors.MissingUnicodeEscape, this.state.curPosition()); chunkStart = this.state.pos - 1; continue; } @@ -447902,9 +489860,7 @@ class Tokenizer extends CommentsParser { const esc = this.readCodePoint(true); if (esc !== null) { if (!identifierCheck(esc)) { - this.raise(Errors.EscapedCharNotAnIdentifier, { - at: escStart - }); + this.raise(Errors.EscapedCharNotAnIdentifier, escStart); } word += String.fromCodePoint(esc); } @@ -447921,7 +489877,7 @@ class Tokenizer extends CommentsParser { if (type !== undefined) { this.finishToken(type, tokenLabelName(type)); } else { - this.finishToken(130, word); + this.finishToken(132, word); } } checkKeywordEscapes() { @@ -447929,75 +489885,55 @@ class Tokenizer extends CommentsParser { type } = this.state; if (tokenIsKeyword(type) && this.state.containsEsc) { - this.raise(Errors.InvalidEscapedReservedWord, { - at: this.state.startLoc, + this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, { reservedWord: tokenLabelName(type) }); } } - raise(toParseError, raiseProperties) { - const { - at - } = raiseProperties, - details = _objectWithoutPropertiesLoose(raiseProperties, _excluded); + raise(toParseError, at, details = {}) { const loc = at instanceof Position ? at : at.loc.start; - const error = toParseError({ - loc, - details - }); + const error = toParseError(loc, details); if (!this.options.errorRecovery) throw error; if (!this.isLookahead) this.state.errors.push(error); return error; } - raiseOverwrite(toParseError, raiseProperties) { - const { - at - } = raiseProperties, - details = _objectWithoutPropertiesLoose(raiseProperties, _excluded2); + raiseOverwrite(toParseError, at, details = {}) { const loc = at instanceof Position ? at : at.loc.start; const pos = loc.index; const errors = this.state.errors; for (let i = errors.length - 1; i >= 0; i--) { const error = errors[i]; if (error.loc.index === pos) { - return errors[i] = toParseError({ - loc, - details - }); + return errors[i] = toParseError(loc, details); } if (error.loc.index < pos) break; } - return this.raise(toParseError, raiseProperties); + return this.raise(toParseError, at, details); } updateContext(prevType) {} unexpected(loc, type) { - throw this.raise(Errors.UnexpectedToken, { - expected: type ? tokenLabelName(type) : null, - at: loc != null ? loc : this.state.startLoc + throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, { + expected: type ? tokenLabelName(type) : null }); } expectPlugin(pluginName, loc) { if (this.hasPlugin(pluginName)) { return true; } - throw this.raise(Errors.MissingPlugin, { - at: loc != null ? loc : this.state.startLoc, + throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, { missingPlugin: [pluginName] }); } expectOnePlugin(pluginNames) { if (!pluginNames.some(name => this.hasPlugin(name))) { - throw this.raise(Errors.MissingOneOfPlugins, { - at: this.state.startLoc, + throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, { missingPlugin: pluginNames }); } } errorBuilder(error) { return (pos, lineStart, curLine) => { - this.raise(error, { - at: buildPosition(pos, lineStart, curLine) - }); + this.raise(error, buildPosition(pos, lineStart, curLine)); }; } } @@ -448030,8 +489966,7 @@ class ClassScopeHandler { current.undefinedPrivateNames.set(name, loc); } } else { - this.parser.raise(Errors.InvalidPrivateFieldResolution, { - at: loc, + this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { identifierName: name }); } @@ -448044,13 +489979,13 @@ class ClassScopeHandler { undefinedPrivateNames } = this.current(); let redefined = privateNames.has(name); - if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) { + if (elementType & 3) { const accessor = redefined && loneAccessors.get(name); if (accessor) { - const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC; - const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC; - const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR; - const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR; + const oldStatic = accessor & 4; + const newStatic = elementType & 4; + const oldKind = accessor & 3; + const newKind = elementType & 3; redefined = oldKind === newKind || oldStatic !== newStatic; if (!redefined) loneAccessors.delete(name); } else if (!redefined) { @@ -448058,8 +489993,7 @@ class ClassScopeHandler { } } if (redefined) { - this.parser.raise(Errors.PrivateNameRedeclaration, { - at: loc, + this.parser.raise(Errors.PrivateNameRedeclaration, loc, { identifierName: name }); } @@ -448074,27 +490008,21 @@ class ClassScopeHandler { if (classScope) { classScope.undefinedPrivateNames.set(name, loc); } else { - this.parser.raise(Errors.InvalidPrivateFieldResolution, { - at: loc, + this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { identifierName: name }); } } } -const kExpression = 0, - kMaybeArrowParameterDeclaration = 1, - kMaybeAsyncArrowParameterDeclaration = 2, - kParameterDeclaration = 3; class ExpressionScope { - constructor(type = kExpression) { - this.type = void 0; + constructor(type = 0) { this.type = type; } canBeArrowParameterDeclaration() { - return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration; + return this.type === 2 || this.type === 1; } isCertainlyParameterDeclaration() { - return this.type === kParameterDeclaration; + return this.type === 3; } } class ArrowHeadParsingScope extends ExpressionScope { @@ -448102,9 +490030,7 @@ class ArrowHeadParsingScope extends ExpressionScope { super(type); this.declarationErrors = new Map(); } - recordDeclarationError(ParsingErrorClass, { - at - }) { + recordDeclarationError(ParsingErrorClass, at) { const index = at.index; this.declarationErrors.set(index, [ParsingErrorClass, at]); } @@ -448127,12 +490053,8 @@ class ExpressionScopeHandler { exit() { this.stack.pop(); } - recordParameterInitializerError(toParseError, { - at: node - }) { - const origin = { - at: node.loc.start - }; + recordParameterInitializerError(toParseError, node) { + const origin = node.loc.start; const { stack } = this; @@ -448148,16 +490070,12 @@ class ExpressionScopeHandler { } this.parser.raise(toParseError, origin); } - recordArrowParameterBindingError(error, { - at: node - }) { + recordArrowParameterBindingError(error, node) { const { stack } = this; const scope = stack[stack.length - 1]; - const origin = { - at: node.loc.start - }; + const origin = node.loc.start; if (scope.isCertainlyParameterDeclaration()) { this.parser.raise(error, origin); } else if (scope.canBeArrowParameterDeclaration()) { @@ -448166,19 +490084,15 @@ class ExpressionScopeHandler { return; } } - recordAsyncArrowParametersError({ - at - }) { + recordAsyncArrowParametersError(at) { const { stack } = this; let i = stack.length - 1; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { - if (scope.type === kMaybeAsyncArrowParameterDeclaration) { - scope.recordDeclarationError(Errors.AwaitBindingIdentifier, { - at - }); + if (scope.type === 2) { + scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at); } scope = stack[--i]; } @@ -448190,9 +490104,7 @@ class ExpressionScopeHandler { const currentScope = stack[stack.length - 1]; if (!currentScope.canBeArrowParameterDeclaration()) return; currentScope.iterateErrors(([toParseError, loc]) => { - this.parser.raise(toParseError, { - at: loc - }); + this.parser.raise(toParseError, loc); let i = stack.length - 2; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { @@ -448203,22 +490115,17 @@ class ExpressionScopeHandler { } } function newParameterDeclarationScope() { - return new ExpressionScope(kParameterDeclaration); + return new ExpressionScope(3); } function newArrowHeadScope() { - return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration); + return new ArrowHeadParsingScope(1); } function newAsyncArrowScope() { - return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration); + return new ArrowHeadParsingScope(2); } function newExpressionScope() { return new ExpressionScope(); } -const PARAM = 0b0000, - PARAM_YIELD = 0b0001, - PARAM_AWAIT = 0b0010, - PARAM_RETURN = 0b0100, - PARAM_IN = 0b1000; class ProductionParameterHandler { constructor() { this.stacks = []; @@ -448233,20 +490140,20 @@ class ProductionParameterHandler { return this.stacks[this.stacks.length - 1]; } get hasAwait() { - return (this.currentFlags() & PARAM_AWAIT) > 0; + return (this.currentFlags() & 2) > 0; } get hasYield() { - return (this.currentFlags() & PARAM_YIELD) > 0; + return (this.currentFlags() & 1) > 0; } get hasReturn() { - return (this.currentFlags() & PARAM_RETURN) > 0; + return (this.currentFlags() & 4) > 0; } get hasIn() { - return (this.currentFlags() & PARAM_IN) > 0; + return (this.currentFlags() & 8) > 0; } } function functionFlags(isAsync, isGenerator) { - return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0); + return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0); } class UtilParser extends Tokenizer { addExtra(node, key, value, enumerable = true) { @@ -448286,15 +490193,13 @@ class UtilParser extends Tokenizer { expectContextual(token, toParseError) { if (!this.eatContextual(token)) { if (toParseError != null) { - throw this.raise(toParseError, { - at: this.state.startLoc - }); + throw this.raise(toParseError, this.state.startLoc); } this.unexpected(null, token); } } canInsertSemicolon() { - return this.match(137) || this.match(8) || this.hasPrecedingLineBreak(); + return this.match(139) || this.match(8) || this.hasPrecedingLineBreak(); } hasPrecedingLineBreak() { return lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start)); @@ -448308,9 +490213,7 @@ class UtilParser extends Tokenizer { } semicolon(allowAsi = true) { if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; - this.raise(Errors.MissingSemicolon, { - at: this.state.lastTokEndLoc - }); + this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc); } expect(type, loc) { this.eat(type) || this.unexpected(loc, type); @@ -448380,19 +490283,13 @@ class UtilParser extends Tokenizer { return hasErrors; } if (shorthandAssignLoc != null) { - this.raise(Errors.InvalidCoverInitializedName, { - at: shorthandAssignLoc - }); + this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); } if (doubleProtoLoc != null) { - this.raise(Errors.DuplicateProto, { - at: doubleProtoLoc - }); + this.raise(Errors.DuplicateProto, doubleProtoLoc); } if (privateKeyLoc != null) { - this.raise(Errors.UnexpectedPrivateField, { - at: privateKeyLoc - }); + this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); } if (optionalParametersLoc != null) { this.unexpected(optionalParametersLoc); @@ -448443,11 +490340,11 @@ class UtilParser extends Tokenizer { }; } enterInitialScopes() { - let paramFlags = PARAM; + let paramFlags = 0; if (this.inModule) { - paramFlags |= PARAM_AWAIT; + paramFlags |= 2; } - this.scope.enter(SCOPE_PROGRAM); + this.scope.enter(1); this.prodParam.enter(paramFlags); } checkDestructuringPrivate(refExpressionErrors) { @@ -448545,7 +490442,8 @@ function cloneStringLiteral(node) { } class NodeUtils extends UtilParser { startNode() { - return new Node(this, this.state.start, this.state.startLoc); + const loc = this.state.startLoc; + return new Node(this, loc.index, loc); } startNodeAt(loc) { return new Node(this, loc.index, loc); @@ -448628,7 +490526,7 @@ const FlowErrors = ParseErrorEnum`flow`({ enumName, memberName }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, - EnumStringMemberInconsistentlyInitailized: ({ + EnumStringMemberInconsistentlyInitialized: ({ enumName }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", @@ -448678,9 +490576,6 @@ function isEsModuleType(bodyElement) { function hasTypeImportKind(node) { return node.importKind === "type" || node.importKind === "typeof"; } -function isMaybeDefaultImport(type) { - return tokenIsKeywordOrIdentifier(type) && type !== 97; -} const exportSuggestions = { const: "declare export var", let: "declare export var", @@ -448711,7 +490606,7 @@ var flow = superClass => class FlowParserMixin extends superClass { return !!this.getPluginOption("flow", "enums"); } finishToken(type, val) { - if (type !== 131 && type !== 13 && type !== 28) { + if (type !== 133 && type !== 13 && type !== 28) { if (this.flowPragma === undefined) { this.flowPragma = null; } @@ -448743,11 +490638,9 @@ var flow = superClass => class FlowParserMixin extends superClass { const node = this.startNode(); const moduloLoc = this.state.startLoc; this.next(); - this.expectContextual(108); - if (this.state.lastTokStart > moduloLoc.index + 1) { - this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, { - at: moduloLoc - }); + this.expectContextual(110); + if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) { + this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc); } if (this.eat(10)) { node.value = super.parseExpression(); @@ -448801,7 +490694,7 @@ var flow = superClass => class FlowParserMixin extends superClass { id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); this.resetEndLocation(id); this.semicolon(); - this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.loc.start); + this.scope.declareName(node.id.name, 2048, node.id.loc.start); return this.finishNode(node, "DeclareFunction"); } flowParseDeclare(node, insideModule) { @@ -448811,22 +490704,20 @@ var flow = superClass => class FlowParserMixin extends superClass { return this.flowParseDeclareFunction(node); } else if (this.match(74)) { return this.flowParseDeclareVariable(node); - } else if (this.eatContextual(125)) { + } else if (this.eatContextual(127)) { if (this.match(16)) { return this.flowParseDeclareModuleExports(node); } else { if (insideModule) { - this.raise(FlowErrors.NestedDeclareModule, { - at: this.state.lastTokStartLoc - }); + this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc); } return this.flowParseDeclareModule(node); } - } else if (this.isContextual(128)) { + } else if (this.isContextual(130)) { return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual(129)) { + } else if (this.isContextual(131)) { return this.flowParseDeclareOpaqueType(node); - } else if (this.isContextual(127)) { + } else if (this.isContextual(129)) { return this.flowParseDeclareInterface(node); } else if (this.match(82)) { return this.flowParseDeclareExportDeclaration(node, insideModule); @@ -448837,13 +490728,13 @@ var flow = superClass => class FlowParserMixin extends superClass { flowParseDeclareVariable(node) { this.next(); node.id = this.flowParseTypeAnnotatableIdentifier(true); - this.scope.declareName(node.id.name, BIND_VAR, node.id.loc.start); + this.scope.declareName(node.id.name, 5, node.id.loc.start); this.semicolon(); return this.finishNode(node, "DeclareVariable"); } flowParseDeclareModule(node) { - this.scope.enter(SCOPE_OTHER); - if (this.match(131)) { + this.scope.enter(0); + if (this.match(133)) { node.id = super.parseExprAtom(); } else { node.id = this.parseIdentifier(); @@ -448855,14 +490746,12 @@ var flow = superClass => class FlowParserMixin extends superClass { let bodyNode = this.startNode(); if (this.match(83)) { this.next(); - if (!this.isContextual(128) && !this.match(87)) { - this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, { - at: this.state.lastTokStartLoc - }); + if (!this.isContextual(130) && !this.match(87)) { + this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc); } super.parseImport(bodyNode); } else { - this.expectContextual(123, FlowErrors.UnsupportedStatementInDeclareModule); + this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule); bodyNode = this.flowParseDeclare(bodyNode, true); } body.push(bodyNode); @@ -448875,21 +490764,15 @@ var flow = superClass => class FlowParserMixin extends superClass { body.forEach(bodyElement => { if (isEsModuleType(bodyElement)) { if (kind === "CommonJS") { - this.raise(FlowErrors.AmbiguousDeclareModuleKind, { - at: bodyElement - }); + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); } kind = "ES"; } else if (bodyElement.type === "DeclareModuleExports") { if (hasModuleExport) { - this.raise(FlowErrors.DuplicateDeclareModuleExports, { - at: bodyElement - }); + this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement); } if (kind === "ES") { - this.raise(FlowErrors.AmbiguousDeclareModuleKind, { - at: bodyElement - }); + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); } kind = "CommonJS"; hasModuleExport = true; @@ -448910,19 +490793,18 @@ var flow = superClass => class FlowParserMixin extends superClass { node.default = true; return this.finishNode(node, "DeclareExportDeclaration"); } else { - if (this.match(75) || this.isLet() || (this.isContextual(128) || this.isContextual(127)) && !insideModule) { + if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) { const label = this.state.value; - throw this.raise(FlowErrors.UnsupportedDeclareExportKind, { - at: this.state.startLoc, + throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, { unsupportedExportKind: label, suggestion: exportSuggestions[label] }); } - if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(129)) { + if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) { node.declaration = this.flowParseDeclare(this.startNode()); node.default = false; return this.finishNode(node, "DeclareExportDeclaration"); - } else if (this.match(55) || this.match(5) || this.isContextual(127) || this.isContextual(128) || this.isContextual(129)) { + } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) { node = this.parseExport(node, null); if (node.type === "ExportNamedDeclaration") { node.type = "ExportDeclaration"; @@ -448937,7 +490819,7 @@ var flow = superClass => class FlowParserMixin extends superClass { } flowParseDeclareModuleExports(node) { this.next(); - this.expectContextual(109); + this.expectContextual(111); node.typeAnnotation = this.flowParseTypeAnnotation(); this.semicolon(); return this.finishNode(node, "DeclareModuleExports"); @@ -448961,27 +490843,27 @@ var flow = superClass => class FlowParserMixin extends superClass { } flowParseInterfaceish(node, isClass) { node.id = this.flowParseRestrictedIdentifier(!isClass, true); - this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.loc.start); + this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.extends = []; - node.implements = []; - node.mixins = []; if (this.eat(81)) { do { node.extends.push(this.flowParseInterfaceExtends()); } while (!isClass && this.eat(12)); } if (isClass) { - if (this.eatContextual(115)) { + node.implements = []; + node.mixins = []; + if (this.eatContextual(117)) { do { node.mixins.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } - if (this.eatContextual(111)) { + if (this.eatContextual(113)) { do { node.implements.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); @@ -449011,15 +490893,12 @@ var flow = superClass => class FlowParserMixin extends superClass { } checkNotUnderscore(word) { if (word === "_") { - this.raise(FlowErrors.UnexpectedReservedUnderscore, { - at: this.state.startLoc - }); + this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc); } } checkReservedType(word, startLoc, declaration) { if (!reservedTypes.has(word)) return; - this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, { - at: startLoc, + this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { reservedType: word }); } @@ -449029,7 +490908,7 @@ var flow = superClass => class FlowParserMixin extends superClass { } flowParseTypeAlias(node) { node.id = this.flowParseRestrictedIdentifier(false, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { @@ -449040,9 +490919,9 @@ var flow = superClass => class FlowParserMixin extends superClass { return this.finishNode(node, "TypeAlias"); } flowParseOpaqueType(node, declare) { - this.expectContextual(128); + this.expectContextual(130); node.id = this.flowParseRestrictedIdentifier(true, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { @@ -449072,9 +490951,7 @@ var flow = superClass => class FlowParserMixin extends superClass { node.default = this.flowParseType(); } else { if (requireDefault) { - this.raise(FlowErrors.MissingTypeParamDefault, { - at: nodeStartLoc - }); + this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc); } } return this.finishNode(node, "TypeParameter"); @@ -449084,7 +490961,7 @@ var flow = superClass => class FlowParserMixin extends superClass { const node = this.startNode(); node.params = []; this.state.inType = true; - if (this.match(47) || this.match(140)) { + if (this.match(47) || this.match(142)) { this.next(); } else { this.unexpected(); @@ -449141,7 +491018,7 @@ var flow = superClass => class FlowParserMixin extends superClass { } flowParseInterfaceType() { const node = this.startNode(); - this.expectContextual(127); + this.expectContextual(129); node.extends = []; if (this.eat(81)) { do { @@ -449158,7 +491035,7 @@ var flow = superClass => class FlowParserMixin extends superClass { return this.finishNode(node, "InterfaceTypeAnnotation"); } flowParseObjectPropertyKey() { - return this.match(132) || this.match(131) ? super.parseExprAtom() : this.parseIdentifier(true); + return this.match(134) || this.match(133) ? super.parseExprAtom() : this.parseIdentifier(true); } flowParseObjectTypeIndexer(node, isStatic, variance) { node.static = isStatic; @@ -449259,7 +491136,7 @@ var flow = superClass => class FlowParserMixin extends superClass { let protoStartLoc = null; let inexactStartLoc = null; const node = this.startNode(); - if (allowProto && this.isContextual(116)) { + if (allowProto && this.isContextual(118)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); @@ -449267,7 +491144,7 @@ var flow = superClass => class FlowParserMixin extends superClass { allowStatic = false; } } - if (allowStatic && this.isContextual(104)) { + if (allowStatic && this.isContextual(106)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); @@ -449297,7 +491174,7 @@ var flow = superClass => class FlowParserMixin extends superClass { nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { let kind = "init"; - if (this.isContextual(98) || this.isContextual(103)) { + if (this.isContextual(99) || this.isContextual(104)) { const lookahead = this.lookahead(); if (tokenIsLiteralPropertyName(lookahead.type)) { kind = this.state.value; @@ -449314,9 +491191,7 @@ var flow = superClass => class FlowParserMixin extends superClass { } this.flowObjectTypeSemicolon(); if (inexactStartLoc && !this.match(8) && !this.match(9)) { - this.raise(FlowErrors.UnexpectedExplicitInexactInObject, { - at: inexactStartLoc - }); + this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc); } } this.expect(endDelim); @@ -449332,33 +491207,23 @@ var flow = superClass => class FlowParserMixin extends superClass { const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); if (isInexactToken) { if (!allowSpread) { - this.raise(FlowErrors.InexactInsideNonObject, { - at: this.state.lastTokStartLoc - }); + this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc); } else if (!allowInexact) { - this.raise(FlowErrors.InexactInsideExact, { - at: this.state.lastTokStartLoc - }); + this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc); } if (variance) { - this.raise(FlowErrors.InexactVariance, { - at: variance - }); + this.raise(FlowErrors.InexactVariance, variance); } return null; } if (!allowSpread) { - this.raise(FlowErrors.UnexpectedSpreadType, { - at: this.state.lastTokStartLoc - }); + this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc); } if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { - this.raise(FlowErrors.SpreadVariance, { - at: variance - }); + this.raise(FlowErrors.SpreadVariance, variance); } node.argument = this.flowParseType(); return this.finishNode(node, "ObjectTypeSpreadProperty"); @@ -449381,9 +491246,7 @@ var flow = superClass => class FlowParserMixin extends superClass { this.flowCheckGetterSetterParams(node); } if (!allowSpread && node.key.name === "constructor" && node.value.this) { - this.raise(FlowErrors.ThisParamBannedInConstructor, { - at: node.value.this - }); + this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this); } } else { if (kind !== "init") this.unexpected(); @@ -449402,19 +491265,13 @@ var flow = superClass => class FlowParserMixin extends superClass { const paramCount = property.kind === "get" ? 0 : 1; const length = property.value.params.length + (property.value.rest ? 1 : 0); if (property.value.this) { - this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, { - at: property.value.this - }); + this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this); } if (length !== paramCount) { - this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, { - at: property - }); + this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property); } if (property.kind === "set" && property.value.rest) { - this.raise(Errors.BadSetterRestParameter, { - at: property - }); + this.raise(Errors.BadSetterRestParameter, property); } } flowObjectTypeSemicolon() { @@ -449470,17 +491327,13 @@ var flow = superClass => class FlowParserMixin extends superClass { const isThis = this.state.type === 78; if (lh.type === 14 || lh.type === 17) { if (isThis && !first) { - this.raise(FlowErrors.ThisParamMustBeFirst, { - at: node - }); + this.raise(FlowErrors.ThisParamMustBeFirst, node); } name = this.parseIdentifier(isThis); if (this.eat(17)) { optional = true; if (isThis) { - this.raise(FlowErrors.ThisParamMayNotBeOptional, { - at: node - }); + this.raise(FlowErrors.ThisParamMayNotBeOptional, node); } } typeAnnotation = this.flowParseTypeInitialiser(); @@ -449620,7 +491473,7 @@ var flow = superClass => class FlowParserMixin extends superClass { node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); - case 131: + case 133: return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); case 85: case 86: @@ -449630,21 +491483,19 @@ var flow = superClass => class FlowParserMixin extends superClass { case 53: if (this.state.value === "-") { this.next(); - if (this.match(132)) { + if (this.match(134)) { return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); } - if (this.match(133)) { + if (this.match(135)) { return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); } - throw this.raise(FlowErrors.UnexpectedSubtractionOperand, { - at: this.state.startLoc - }); + throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc); } this.unexpected(); return; - case 132: + case 134: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - case 133: + case 135: return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); case 88: this.next(); @@ -449666,7 +491517,7 @@ var flow = superClass => class FlowParserMixin extends superClass { this.next(); return super.createIdentifier(node, label); } else if (tokenIsIdentifier(this.state.type)) { - if (this.isContextual(127)) { + if (this.isContextual(129)) { return this.flowParseInterfaceType(); } return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); @@ -449751,7 +491602,7 @@ var flow = superClass => class FlowParserMixin extends superClass { return type; } flowParseTypeOrImplicitInstantiation() { - if (this.state.type === 130 && this.state.value === "_") { + if (this.state.type === 132 && this.state.value === "_") { const startLoc = this.state.startLoc; const node = this.parseIdentifier(); return this.flowParseGenericType(startLoc, node); @@ -449807,14 +491658,14 @@ var flow = superClass => class FlowParserMixin extends superClass { return super.parseFunctionBodyAndFinish(node, type, isMethod); } parseStatementLike(flags) { - if (this.state.strict && this.isContextual(127)) { + if (this.state.strict && this.isContextual(129)) { const lookahead = this.lookahead(); if (tokenIsKeywordOrIdentifier(lookahead.type)) { const node = this.startNode(); this.next(); return this.flowParseInterface(node); } - } else if (this.shouldParseEnums() && this.isContextual(124)) { + } else if (this.shouldParseEnums() && this.isContextual(126)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); @@ -449847,7 +491698,7 @@ var flow = superClass => class FlowParserMixin extends superClass { const { type } = this.state; - if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) { + if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 126) { return !this.state.containsEsc; } return super.shouldParseExportDeclaration(); @@ -449856,13 +491707,13 @@ var flow = superClass => class FlowParserMixin extends superClass { const { type } = this.state; - if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) { + if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 126) { return this.state.containsEsc; } return super.isExportDefaultSpecifier(); } parseExportDefaultExpression() { - if (this.shouldParseEnums() && this.isContextual(124)) { + if (this.shouldParseEnums() && this.isContextual(126)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); @@ -449902,9 +491753,7 @@ var flow = superClass => class FlowParserMixin extends superClass { [valid, invalid] = this.getArrowLikeExpressions(consequent); } if (failed && valid.length > 1) { - this.raise(FlowErrors.AmbiguousConditionalArrow, { - at: state.startLoc - }); + this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc); } if (failed && valid.length === 1) { this.state = state; @@ -449960,7 +491809,7 @@ var flow = superClass => class FlowParserMixin extends superClass { finishArrowValidation(node) { var _node$extra; this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); - this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); + this.scope.enter(2 | 4); super.checkParams(node, false, true); this.scope.exit(); } @@ -449995,15 +491844,8 @@ var flow = superClass => class FlowParserMixin extends superClass { } super.assertModuleNodeAllowed(node); } - parseExport(node, decorators) { - const decl = super.parseExport(node, decorators); - if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { - decl.exportKind = decl.exportKind || "value"; - } - return decl; - } parseExportDeclaration(node) { - if (this.isContextual(128)) { + if (this.isContextual(130)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); @@ -450014,17 +491856,17 @@ var flow = superClass => class FlowParserMixin extends superClass { } else { return this.flowParseTypeAlias(declarationNode); } - } else if (this.isContextual(129)) { + } else if (this.isContextual(131)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseOpaqueType(declarationNode, false); - } else if (this.isContextual(127)) { + } else if (this.isContextual(129)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseInterface(declarationNode); - } else if (this.shouldParseEnums() && this.isContextual(124)) { + } else if (this.shouldParseEnums() && this.isContextual(126)) { node.exportKind = "value"; const declarationNode = this.startNode(); this.next(); @@ -450035,7 +491877,7 @@ var flow = superClass => class FlowParserMixin extends superClass { } eatExportStar(node) { if (super.eatExportStar(node)) return true; - if (this.isContextual(128) && this.lookahead().type === 55) { + if (this.isContextual(130) && this.lookahead().type === 55) { node.exportKind = "type"; this.next(); this.next(); @@ -450063,7 +491905,7 @@ var flow = superClass => class FlowParserMixin extends superClass { const { startLoc } = this.state; - if (this.isContextual(123)) { + if (this.isContextual(125)) { if (super.parseClassMemberFromModifier(classBody, member)) { return; } @@ -450072,13 +491914,9 @@ var flow = superClass => class FlowParserMixin extends superClass { super.parseClassMember(classBody, member, state); if (member.declare) { if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { - this.raise(FlowErrors.DeclareClassElement, { - at: startLoc - }); + this.raise(FlowErrors.DeclareClassElement, startLoc); } else if (member.value) { - this.raise(FlowErrors.DeclareClassFieldInitializer, { - at: member.value - }); + this.raise(FlowErrors.DeclareClassFieldInitializer, member.value); } } } @@ -450089,12 +491927,11 @@ var flow = superClass => class FlowParserMixin extends superClass { const word = super.readWord1(); const fullWord = "@@" + word; if (!this.isIterator(word) || !this.state.inType) { - this.raise(Errors.InvalidIdentifier, { - at: this.state.curPosition(), + this.raise(Errors.InvalidIdentifier, this.state.curPosition(), { identifierName: fullWord }); } - this.finishToken(130, fullWord); + this.finishToken(132, fullWord); } getTokenFromCode(code) { const next = this.input.charCodeAt(this.state.pos + 1); @@ -450142,9 +491979,7 @@ var flow = superClass => class FlowParserMixin extends superClass { var _expr$extra; const expr = exprList[i]; if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { - this.raise(FlowErrors.TypeCastInPattern, { - at: expr.typeAnnotation - }); + this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation); } } return exprList; @@ -450192,16 +492027,12 @@ var flow = superClass => class FlowParserMixin extends superClass { if (method.params && isConstructor) { const params = method.params; if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(FlowErrors.ThisParamBannedInConstructor, { - at: method - }); + this.raise(FlowErrors.ThisParamBannedInConstructor, method); } } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { const params = method.value.params; if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(FlowErrors.ThisParamBannedInConstructor, { - at: method - }); + this.raise(FlowErrors.ThisParamBannedInConstructor, method); } } } @@ -450220,7 +492051,7 @@ var flow = superClass => class FlowParserMixin extends superClass { if (node.superClass && this.match(47)) { node.superTypeParameters = this.flowParseTypeParameterInstantiation(); } - if (this.isContextual(111)) { + if (this.isContextual(113)) { this.next(); const implemented = node.implements = []; do { @@ -450241,13 +492072,9 @@ var flow = superClass => class FlowParserMixin extends superClass { if (params.length > 0) { const param = params[0]; if (this.isThisParam(param) && method.kind === "get") { - this.raise(FlowErrors.GetterMayNotHaveThisParam, { - at: param - }); + this.raise(FlowErrors.GetterMayNotHaveThisParam, param); } else if (this.isThisParam(param)) { - this.raise(FlowErrors.SetterMayNotHaveThisParam, { - at: param - }); + this.raise(FlowErrors.SetterMayNotHaveThisParam, param); } } } @@ -450273,28 +492100,20 @@ var flow = superClass => class FlowParserMixin extends superClass { parseAssignableListItemTypes(param) { if (this.eat(17)) { if (param.type !== "Identifier") { - this.raise(FlowErrors.PatternIsOptional, { - at: param - }); + this.raise(FlowErrors.PatternIsOptional, param); } if (this.isThisParam(param)) { - this.raise(FlowErrors.ThisParamMayNotBeOptional, { - at: param - }); + this.raise(FlowErrors.ThisParamMayNotBeOptional, param); } param.optional = true; } if (this.match(14)) { param.typeAnnotation = this.flowParseTypeAnnotation(); } else if (this.isThisParam(param)) { - this.raise(FlowErrors.ThisParamAnnotationRequired, { - at: param - }); + this.raise(FlowErrors.ThisParamAnnotationRequired, param); } if (this.match(29) && this.isThisParam(param)) { - this.raise(FlowErrors.ThisParamNoDefault, { - at: param - }); + this.raise(FlowErrors.ThisParamNoDefault, param); } this.resetEndLocation(param); return param; @@ -450302,52 +492121,40 @@ var flow = superClass => class FlowParserMixin extends superClass { parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(FlowErrors.TypeBeforeInitializer, { - at: node.typeAnnotation - }); + this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation); } return node; } - shouldParseDefaultImport(node) { - if (!hasTypeImportKind(node)) { - return super.shouldParseDefaultImport(node); - } - return isMaybeDefaultImport(this.state.type); - } checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { - this.raise(FlowErrors.ImportReflectionHasImportType, { - at: node.specifiers[0].loc.start - }); + this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); } } parseImportSpecifierLocal(node, specifier, type) { specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } - maybeParseDefaultImportSpecifier(node) { - node.importKind = "value"; - let kind = null; - if (this.match(87)) { - kind = "typeof"; - } else if (this.isContextual(128)) { - kind = "type"; + isPotentialImportPhase(isExport) { + if (super.isPotentialImportPhase(isExport)) return true; + if (this.isContextual(130)) { + if (!isExport) return true; + const ch = this.lookaheadCharCode(); + return ch === 123 || ch === 42; } - if (kind) { - const lh = this.lookahead(); - const { - type - } = lh; - if (kind === "type" && type === 55) { - this.unexpected(null, lh.type); - } - if (isMaybeDefaultImport(type) || type === 5 || type === 55) { - this.next(); - node.importKind = kind; + return !isExport && this.isContextual(87); + } + applyImportPhase(node, isExport, phase, loc) { + super.applyImportPhase(node, isExport, phase, loc); + if (isExport) { + if (!phase && this.match(65)) { + return; } + node.exportKind = phase === "type" ? phase : "value"; + } else { + if (phase === "type" && this.match(55)) this.unexpected(); + node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; } - return super.maybeParseDefaultImportSpecifier(node); } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { const firstIdent = specifier.imported; @@ -450377,8 +492184,7 @@ var flow = superClass => class FlowParserMixin extends superClass { specifier.importKind = specifierTypeKind; } else { if (importedIsString) { - throw this.raise(Errors.ImportBindingIsString, { - at: specifier, + throw this.raise(Errors.ImportBindingIsString, specifier, { importName: firstIdent.value }); } @@ -450394,9 +492200,7 @@ var flow = superClass => class FlowParserMixin extends superClass { } const specifierIsTypeImport = hasTypeImportKind(specifier); if (isInTypeOnlyImport && specifierIsTypeImport) { - this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, { - at: specifier - }); + this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier); } if (isInTypeOnlyImport || specifierIsTypeImport) { this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); @@ -450444,7 +492248,7 @@ var flow = superClass => class FlowParserMixin extends superClass { var _jsx; let state = null; let jsx; - if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) { + if (this.hasPlugin("jsx") && (this.match(142) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; @@ -450479,9 +492283,7 @@ var flow = superClass => class FlowParserMixin extends superClass { if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { if (!arrow.error && !arrow.aborted) { if (arrow.node.async) { - this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, { - at: typeParameters - }); + this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters); } return arrow.node; } @@ -450497,9 +492299,7 @@ var flow = superClass => class FlowParserMixin extends superClass { } if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; if (arrow.thrown) throw arrow.error; - throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, { - at: typeParameters - }); + throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters); } return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); } @@ -450537,9 +492337,7 @@ var flow = superClass => class FlowParserMixin extends superClass { } for (let i = 0; i < node.params.length; i++) { if (this.isThisParam(node.params[i]) && i > 0) { - this.raise(FlowErrors.ThisParamMustBeFirst, { - at: node.params[i] - }); + this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]); } } super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); @@ -450641,18 +492439,14 @@ var flow = superClass => class FlowParserMixin extends superClass { parseTopLevel(file, program) { const fileNode = super.parseTopLevel(file, program); if (this.state.hasFlowComment) { - this.raise(FlowErrors.UnterminatedFlowComment, { - at: this.state.curPosition() - }); + this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition()); } return fileNode; } skipBlockComment() { if (this.hasPlugin("flowComments") && this.skipFlowComment()) { if (this.state.hasFlowComment) { - throw this.raise(FlowErrors.NestedFlowComment, { - at: this.state.startLoc - }); + throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc); } this.hasFlowCommentCompletion(); const commentSkip = this.skipFlowComment(); @@ -450688,49 +492482,32 @@ var flow = superClass => class FlowParserMixin extends superClass { hasFlowCommentCompletion() { const end = this.input.indexOf("*/", this.state.pos); if (end === -1) { - throw this.raise(Errors.UnterminatedComment, { - at: this.state.curPosition() - }); + throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); } } flowEnumErrorBooleanMemberNotInitialized(loc, { enumName, memberName }) { - this.raise(FlowErrors.EnumBooleanMemberNotInitialized, { - at: loc, + this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, { memberName, enumName }); } flowEnumErrorInvalidMemberInitializer(loc, enumContext) { - return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, Object.assign({ - at: loc - }, enumContext)); + return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext); } - flowEnumErrorNumberMemberNotInitialized(loc, { - enumName, - memberName - }) { - this.raise(FlowErrors.EnumNumberMemberNotInitialized, { - at: loc, - enumName, - memberName - }); + flowEnumErrorNumberMemberNotInitialized(loc, details) { + this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details); } - flowEnumErrorStringMemberInconsistentlyInitailized(node, { - enumName - }) { - this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, { - at: node, - enumName - }); + flowEnumErrorStringMemberInconsistentlyInitialized(node, details) { + this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details); } flowEnumMemberInit() { const startLoc = this.state.startLoc; const endOfInit = () => this.match(12) || this.match(8); switch (this.state.type) { - case 132: + case 134: { const literal = this.parseNumericLiteral(this.state.value); if (endOfInit()) { @@ -450745,7 +492522,7 @@ var flow = superClass => class FlowParserMixin extends superClass { loc: startLoc }; } - case 131: + case 133: { const literal = this.parseStringLiteral(this.state.value); if (endOfInit()) { @@ -450833,16 +492610,14 @@ var flow = superClass => class FlowParserMixin extends superClass { continue; } if (/^[a-z]/.test(memberName)) { - this.raise(FlowErrors.EnumInvalidMemberName, { - at: id, + this.raise(FlowErrors.EnumInvalidMemberName, id, { memberName, suggestion: memberName[0].toUpperCase() + memberName.slice(1), enumName }); } if (seenNames.has(memberName)) { - this.raise(FlowErrors.EnumDuplicateMemberName, { - at: id, + this.raise(FlowErrors.EnumDuplicateMemberName, id, { memberName, enumName }); @@ -450912,14 +492687,14 @@ var flow = superClass => class FlowParserMixin extends superClass { return initializedMembers; } else if (defaultedMembers.length > initializedMembers.length) { for (const member of initializedMembers) { - this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { enumName }); } return defaultedMembers; } else { for (const member of defaultedMembers) { - this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { enumName }); } @@ -450929,10 +492704,9 @@ var flow = superClass => class FlowParserMixin extends superClass { flowEnumParseExplicitType({ enumName }) { - if (!this.eatContextual(101)) return null; + if (!this.eatContextual(102)) return null; if (!tokenIsIdentifier(this.state.type)) { - throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, { - at: this.state.startLoc, + throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { enumName }); } @@ -450941,8 +492715,7 @@ var flow = superClass => class FlowParserMixin extends superClass { } = this.state; this.next(); if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { - this.raise(FlowErrors.EnumInvalidExplicitType, { - at: this.state.startLoc, + this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, { enumName, invalidEnumType: value }); @@ -451027,8 +492800,7 @@ var flow = superClass => class FlowParserMixin extends superClass { this.expect(8); return this.finishNode(node, "EnumNumberBody"); } else { - this.raise(FlowErrors.EnumInconsistentMemberValues, { - at: nameLoc, + this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, { enumName }); return empty(); @@ -451346,9 +493118,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { let chunkStart = this.state.pos; for (;;) { if (this.state.pos >= this.length) { - throw this.raise(JsxErrors.UnterminatedJsxContent, { - at: this.state.startLoc - }); + throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc); } const ch = this.input.charCodeAt(this.state.pos); switch (ch) { @@ -451357,14 +493127,14 @@ var jsx = superClass => class JSXParserMixin extends superClass { if (this.state.pos === this.state.start) { if (ch === 60 && this.state.canStartJSXElement) { ++this.state.pos; - this.finishToken(140); + this.finishToken(142); } else { super.getTokenFromCode(ch); } return; } out += this.input.slice(chunkStart, this.state.pos); - this.finishToken(139, out); + this.finishToken(141, out); return; case 38: out += this.input.slice(chunkStart, this.state.pos); @@ -451403,9 +493173,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { let chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.length) { - throw this.raise(Errors.UnterminatedString, { - at: this.state.startLoc - }); + throw this.raise(Errors.UnterminatedString, this.state.startLoc); } const ch = this.input.charCodeAt(this.state.pos); if (ch === quote) break; @@ -451422,7 +493190,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { } } out += this.input.slice(chunkStart, this.state.pos++); - this.finishToken(131, out); + this.finishToken(133, out); } jsxReadEntity() { const startPos = ++this.state.pos; @@ -451462,11 +493230,11 @@ var jsx = superClass => class JSXParserMixin extends superClass { do { ch = this.input.charCodeAt(++this.state.pos); } while (isIdentifierChar(ch) || ch === 45); - this.finishToken(138, this.input.slice(start, this.state.pos)); + this.finishToken(140, this.input.slice(start, this.state.pos)); } jsxParseIdentifier() { const node = this.startNode(); - if (this.match(138)) { + if (this.match(140)) { node.name = this.state.value; } else if (tokenIsKeyword(this.state.type)) { node.name = tokenLabelName(this.state.type); @@ -451508,18 +493276,14 @@ var jsx = superClass => class JSXParserMixin extends superClass { this.next(); node = this.jsxParseExpressionContainer(node, types.j_oTag); if (node.expression.type === "JSXEmptyExpression") { - this.raise(JsxErrors.AttributeIsEmpty, { - at: node - }); + this.raise(JsxErrors.AttributeIsEmpty, node); } return node; - case 140: - case 131: + case 142: + case 133: return this.parseExprAtom(); default: - throw this.raise(JsxErrors.UnsupportedJsxValue, { - at: this.state.startLoc - }); + throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc); } } jsxParseEmptyExpression() { @@ -451564,7 +493328,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { } jsxParseOpeningElementAt(startLoc) { const node = this.startNodeAt(startLoc); - if (this.eat(141)) { + if (this.eat(143)) { return this.finishNode(node, "JSXOpeningFragment"); } node.name = this.jsxParseElementName(); @@ -451572,21 +493336,21 @@ var jsx = superClass => class JSXParserMixin extends superClass { } jsxParseOpeningElementAfterName(node) { const attributes = []; - while (!this.match(56) && !this.match(141)) { + while (!this.match(56) && !this.match(143)) { attributes.push(this.jsxParseAttribute()); } node.attributes = attributes; node.selfClosing = this.eat(56); - this.expect(141); + this.expect(143); return this.finishNode(node, "JSXOpeningElement"); } jsxParseClosingElementAt(startLoc) { const node = this.startNodeAt(startLoc); - if (this.eat(141)) { + if (this.eat(143)) { return this.finishNode(node, "JSXClosingFragment"); } node.name = this.jsxParseElementName(); - this.expect(141); + this.expect(143); return this.finishNode(node, "JSXClosingElement"); } jsxParseElementAt(startLoc) { @@ -451597,7 +493361,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { if (!openingElement.selfClosing) { contents: for (;;) { switch (this.state.type) { - case 140: + case 142: startLoc = this.state.startLoc; this.next(); if (this.eat(56)) { @@ -451606,7 +493370,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { } children.push(this.jsxParseElementAt(startLoc)); break; - case 139: + case 141: children.push(this.parseExprAtom()); break; case 5: @@ -451626,18 +493390,14 @@ var jsx = superClass => class JSXParserMixin extends superClass { } } if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { - this.raise(JsxErrors.MissingClosingTagFragment, { - at: closingElement - }); + this.raise(JsxErrors.MissingClosingTagFragment, closingElement); } else if (!isFragment(openingElement) && isFragment(closingElement)) { - this.raise(JsxErrors.MissingClosingTagElement, { - at: closingElement, + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { openingTagName: getQualifiedJSXName(openingElement.name) }); } else if (!isFragment(openingElement) && !isFragment(closingElement)) { if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { - this.raise(JsxErrors.MissingClosingTagElement, { - at: closingElement, + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { openingTagName: getQualifiedJSXName(openingElement.name) }); } @@ -451652,9 +493412,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { } node.children = children; if (this.match(47)) { - throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, { - at: this.state.startLoc - }); + throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc); } return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); } @@ -451670,12 +493428,12 @@ var jsx = superClass => class JSXParserMixin extends superClass { context[context.length - 1] = newContext; } parseExprAtom(refExpressionErrors) { - if (this.match(139)) { + if (this.match(141)) { return this.parseLiteral(this.state.value, "JSXText"); - } else if (this.match(140)) { + } else if (this.match(142)) { return this.jsxParseElement(); } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { - this.replaceToken(140); + this.replaceToken(142); return this.jsxParseElement(); } else { return super.parseExprAtom(refExpressionErrors); @@ -451698,7 +493456,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { } if (code === 62) { ++this.state.pos; - this.finishToken(141); + this.finishToken(143); return; } if ((code === 34 || code === 39) && context === types.j_oTag) { @@ -451708,7 +493466,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { } if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { ++this.state.pos; - this.finishToken(140); + this.finishToken(142); return; } super.getTokenFromCode(code); @@ -451718,12 +493476,12 @@ var jsx = superClass => class JSXParserMixin extends superClass { context, type } = this.state; - if (type === 56 && prevType === 140) { + if (type === 56 && prevType === 142) { context.splice(-2, 2, types.j_cTag); this.state.canStartJSXElement = false; - } else if (type === 140) { + } else if (type === 142) { context.push(types.j_oTag); - } else if (type === 141) { + } else if (type === 143) { const out = context[context.length - 1]; if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { context.pop(); @@ -451740,11 +493498,7 @@ var jsx = superClass => class JSXParserMixin extends superClass { class TypeScriptScope extends Scope { constructor(...args) { super(...args); - this.types = new Set(); - this.enums = new Set(); - this.constEnums = new Set(); - this.classes = new Set(); - this.exportOnlyBindings = new Set(); + this.tsNames = new Map(); } } class TypeScriptScopeHandler extends ScopeHandler { @@ -451757,14 +493511,14 @@ class TypeScriptScopeHandler extends ScopeHandler { return new TypeScriptScope(flags); } enter(flags) { - if (flags == SCOPE_TS_MODULE) { + if (flags == 256) { this.importsStack.push(new Set()); } super.enter(flags); } exit() { const flags = super.exit(); - if (flags == SCOPE_TS_MODULE) { + if (flags == 256) { this.importsStack.pop(); } return flags; @@ -451782,10 +493536,9 @@ class TypeScriptScopeHandler extends ScopeHandler { return false; } declareName(name, bindingType, loc) { - if (bindingType & BIND_FLAGS_TS_IMPORT) { + if (bindingType & 4096) { if (this.hasImport(name, true)) { - this.parser.raise(Errors.VarRedeclaration, { - at: loc, + this.parser.raise(Errors.VarRedeclaration, loc, { identifierName: name }); } @@ -451793,40 +493546,49 @@ class TypeScriptScopeHandler extends ScopeHandler { return; } const scope = this.currentScope(); - if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) { + let type = scope.tsNames.get(name) || 0; + if (bindingType & 1024) { this.maybeExportDefined(scope, name); - scope.exportOnlyBindings.add(name); + scope.tsNames.set(name, type | 16); return; } super.declareName(name, bindingType, loc); - if (bindingType & BIND_KIND_TYPE) { - if (!(bindingType & BIND_KIND_VALUE)) { + if (bindingType & 2) { + if (!(bindingType & 1)) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); } - scope.types.add(name); + type = type | 1; + } + if (bindingType & 256) { + type = type | 2; + } + if (bindingType & 512) { + type = type | 4; } - if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name); - if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name); - if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name); + if (bindingType & 128) { + type = type | 8; + } + if (type) scope.tsNames.set(name, type); } isRedeclaredInScope(scope, name, bindingType) { - if (scope.enums.has(name)) { - if (bindingType & BIND_FLAGS_TS_ENUM) { - const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM); - const wasConst = scope.constEnums.has(name); + const type = scope.tsNames.get(name); + if ((type & 2) > 0) { + if (bindingType & 256) { + const isConst = !!(bindingType & 512); + const wasConst = (type & 4) > 0; return isConst !== wasConst; } return true; } - if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) { - if (scope.lexical.has(name)) { - return !!(bindingType & BIND_KIND_VALUE); + if (bindingType & 128 && (type & 8) > 0) { + if (scope.names.get(name) & 2) { + return !!(bindingType & 1); } else { return false; } } - if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) { + if (bindingType & 2 && (type & 1) > 0) { return true; } return super.isRedeclaredInScope(scope, name, bindingType); @@ -451839,12 +493601,15 @@ class TypeScriptScopeHandler extends ScopeHandler { const len = this.scopeStack.length; for (let i = len - 1; i >= 0; i--) { const scope = this.scopeStack[i]; - if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return; + const type = scope.tsNames.get(name); + if ((type & 1) > 0 || (type & 16) > 0) { + return; + } } super.checkLocalExport(id); } } -const getOwn$1 = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; +const getOwn$1 = (object, key) => hasOwnProperty.call(object, key) && object[key]; const unwrapParenthesizedExpression = node => { return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; }; @@ -451856,18 +493621,12 @@ class LValParser extends NodeUtils { parenthesized = unwrapParenthesizedExpression(node); if (isLHS) { if (parenthesized.type === "Identifier") { - this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, { - at: node - }); - } else if (parenthesized.type !== "MemberExpression") { - this.raise(Errors.InvalidParenthesizedAssignment, { - at: node - }); + this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node); + } else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) { + this.raise(Errors.InvalidParenthesizedAssignment, node); } } else { - this.raise(Errors.InvalidParenthesizedAssignment, { - at: node - }); + this.raise(Errors.InvalidParenthesizedAssignment, node); } } switch (node.type) { @@ -451885,9 +493644,7 @@ class LValParser extends NodeUtils { const isLast = i === last; this.toAssignableObjectExpressionProp(prop, isLast, isLHS); if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { - this.raise(Errors.RestTrailingComma, { - at: node.extra.trailingCommaLoc - }); + this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc); } } break; @@ -451913,9 +493670,7 @@ class LValParser extends NodeUtils { break; case "AssignmentExpression": if (node.operator !== "=") { - this.raise(Errors.MissingEqInAssignment, { - at: node.left.loc.end - }); + this.raise(Errors.MissingEqInAssignment, node.left.loc.end); } node.type = "AssignmentPattern"; delete node.operator; @@ -451928,18 +493683,14 @@ class LValParser extends NodeUtils { } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.type === "ObjectMethod") { - this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, { - at: prop.key - }); + this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key); } else if (prop.type === "SpreadElement") { prop.type = "RestElement"; const arg = prop.argument; this.checkToRestConversion(arg, false); this.toAssignable(arg, isLHS); if (!isLast) { - this.raise(Errors.RestTrailingComma, { - at: prop - }); + this.raise(Errors.RestTrailingComma, prop); } } else { this.toAssignable(prop, isLHS); @@ -451960,13 +493711,9 @@ class LValParser extends NodeUtils { } if (elt.type === "RestElement") { if (i < end) { - this.raise(Errors.RestTrailingComma, { - at: elt - }); + this.raise(Errors.RestTrailingComma, elt); } else if (trailingCommaLoc) { - this.raise(Errors.RestTrailingComma, { - at: trailingCommaLoc - }); + this.raise(Errors.RestTrailingComma, trailingCommaLoc); } } } @@ -452063,9 +493810,7 @@ class LValParser extends NodeUtils { } else { const decorators = []; if (this.match(26) && this.hasPlugin("decorators")) { - this.raise(Errors.UnsupportedParameterDecorator, { - at: this.state.startLoc - }); + this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc); } while (this.match(26)) { decorators.push(this.parseDecorator()); @@ -452089,7 +493834,7 @@ class LValParser extends NodeUtils { } = this.state; if (type === 21) { return this.parseBindingRestProperty(prop); - } else if (type === 136) { + } else if (type === 138) { this.expectPlugin("destructuringPrivate", startLoc); this.classScope.usePrivateName(this.state.value, startLoc); prop.key = this.parsePrivateName(); @@ -452131,9 +493876,12 @@ class LValParser extends NodeUtils { ObjectPattern: "properties" }, type); } + isOptionalMemberExpression(expression) { + return expression.type === "OptionalMemberExpression"; + } checkLVal(expression, { in: ancestor, - binding = BIND_NONE, + binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false @@ -452141,11 +493889,18 @@ class LValParser extends NodeUtils { var _expression$extra; const type = expression.type; if (this.isObjectMethod(expression)) return; - if (type === "MemberExpression") { - if (binding !== BIND_NONE) { - this.raise(Errors.InvalidPropertyBindingPattern, { - at: expression - }); + const isOptionalMemberExpression = this.isOptionalMemberExpression(expression); + if (isOptionalMemberExpression || type === "MemberExpression") { + if (isOptionalMemberExpression) { + this.expectPlugin("optionalChainingAssign", expression.loc.start); + if (ancestor.type !== "AssignmentExpression") { + this.raise(Errors.InvalidLhsOptionalChaining, expression, { + ancestor + }); + } + } + if (binding !== 64) { + this.raise(Errors.InvalidPropertyBindingPattern, expression); } return; } @@ -452156,9 +493911,7 @@ class LValParser extends NodeUtils { } = expression; if (checkClashes) { if (checkClashes.has(name)) { - this.raise(Errors.ParamDupe, { - at: expression - }); + this.raise(Errors.ParamDupe, expression); } else { checkClashes.add(name); } @@ -452168,15 +493921,14 @@ class LValParser extends NodeUtils { const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); if (validity === true) return; if (validity === false) { - const ParseErrorClass = binding === BIND_NONE ? Errors.InvalidLhs : Errors.InvalidLhsBinding; - this.raise(ParseErrorClass, { - at: expression, + const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding; + this.raise(ParseErrorClass, expression, { ancestor }); return; } const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === "ParenthesizedExpression"]; - const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" || type === "ParenthesizedExpression" ? { + const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? { type } : ancestor; for (const child of [].concat(expression[key])) { @@ -452193,24 +493945,20 @@ class LValParser extends NodeUtils { } checkIdentifier(at, bindingType, strictModeChanged = false) { if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) { - if (bindingType === BIND_NONE) { - this.raise(Errors.StrictEvalArguments, { - at, + if (bindingType === 64) { + this.raise(Errors.StrictEvalArguments, at, { referenceName: at.name }); } else { - this.raise(Errors.StrictEvalArgumentsBinding, { - at, + this.raise(Errors.StrictEvalArgumentsBinding, at, { bindingName: at.name }); } } - if (bindingType & BIND_FLAGS_NO_LET_IN_LEXICAL && at.name === "let") { - this.raise(Errors.LetInLexicalBinding, { - at - }); + if (bindingType & 8192 && at.name === "let") { + this.raise(Errors.LetInLexicalBinding, at); } - if (!(bindingType & BIND_NONE)) { + if (!(bindingType & 64)) { this.declareNameFromIdentifier(at, bindingType); } } @@ -452229,22 +493977,18 @@ class LValParser extends NodeUtils { case "ObjectExpression": if (allowPattern) break; default: - this.raise(Errors.InvalidRestAssignmentPattern, { - at: node - }); + this.raise(Errors.InvalidRestAssignmentPattern, node); } } checkCommaAfterRest(close) { if (!this.match(12)) { return false; } - this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, { - at: this.state.startLoc - }); + this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc); return true; } } -const getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; +const getOwn = (object, key) => hasOwnProperty.call(object, key) && object[key]; function nonNull(x) { if (x == null) { throw new Error(`Unexpected ${x} value.`); @@ -452315,7 +494059,6 @@ const TSErrors = ParseErrorEnum`typescript`({ InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.", InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", MissingInterfaceName: "'interface' declarations must be followed by an identifier.", - MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.", NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", @@ -452408,7 +494151,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return tokenIsIdentifier(this.state.type); } tsTokenCanFollowModifier() { - return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(136) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); + return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(138) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); } tsNextTokenCanFollowModifier() { this.next(); @@ -452437,16 +494180,14 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { }, modified) { const enforceOrder = (loc, modifier, before, after) => { if (modifier === before && modified[after]) { - this.raise(TSErrors.InvalidModifiersOrder, { - at: loc, + this.raise(TSErrors.InvalidModifiersOrder, loc, { orderedModifiers: [before, after] }); } }; const incompatible = (loc, modifier, mod1, mod2) => { if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { - this.raise(TSErrors.IncompatibleModifiers, { - at: loc, + this.raise(TSErrors.IncompatibleModifiers, loc, { modifiers: [mod1, mod2] }); } @@ -452459,8 +494200,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (!modifier) break; if (tsIsAccessModifier(modifier)) { if (modified.accessibility) { - this.raise(TSErrors.DuplicateAccessibilityModifier, { - at: startLoc, + this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, { modifier }); } else { @@ -452471,17 +494211,15 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } } else if (tsIsVarianceAnnotations(modifier)) { if (modified[modifier]) { - this.raise(TSErrors.DuplicateModifier, { - at: startLoc, + this.raise(TSErrors.DuplicateModifier, startLoc, { modifier }); } modified[modifier] = true; enforceOrder(startLoc, modifier, "in", "out"); } else { - if (Object.hasOwnProperty.call(modified, modifier)) { - this.raise(TSErrors.DuplicateModifier, { - at: startLoc, + if (hasOwnProperty.call(modified, modifier)) { + this.raise(TSErrors.DuplicateModifier, startLoc, { modifier }); } else { @@ -452495,8 +494233,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { modified[modifier] = true; } if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { - this.raise(errorTemplate, { - at: startLoc, + this.raise(errorTemplate, startLoc, { modifier }); } @@ -452539,7 +494276,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } result.push(element); if (this.eat(12)) { - trailingCommaPos = this.state.lastTokStart; + trailingCommaPos = this.state.lastTokStartLoc.index; continue; } if (this.tsIsListTerminator(kind)) { @@ -452575,12 +494312,20 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const node = this.startNode(); this.expect(83); this.expect(10); - if (!this.match(131)) { - this.raise(TSErrors.UnsupportedImportTypeArgument, { - at: this.state.startLoc - }); + if (!this.match(133)) { + this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc); } node.argument = super.parseExprAtom(); + if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { + node.options = null; + } + if (this.eat(12)) { + this.expectImportAttributesPlugin(); + if (!this.match(11)) { + node.options = super.parseMaybeAssignAllowIn(); + this.eat(12); + } + } this.expect(11); if (this.eat(16)) { node.qualifier = this.tsParseEntityName(); @@ -452649,7 +494394,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParseTypeParameters(parseModifiers) { const node = this.startNode(); - if (this.match(47) || this.match(140)) { + if (this.match(47) || this.match(142)) { this.next(); } else { this.unexpected(); @@ -452659,9 +494404,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { }; node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos); if (node.params.length === 0) { - this.raise(TSErrors.EmptyTypeParameters, { - at: node - }); + this.raise(TSErrors.EmptyTypeParameters, node); } if (refTrailingCommaPos.value !== -1) { this.addExtra(node, "trailingComma", refTrailingCommaPos.value); @@ -452682,15 +494425,18 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } } tsParseBindingListForSignature() { - return super.parseBindingList(11, 41, 2).map(pattern => { - if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") { - this.raise(TSErrors.UnsupportedSignatureParameterKind, { - at: pattern, - type: pattern.type + const list = super.parseBindingList(11, 41, 2); + for (const pattern of list) { + const { + type + } = pattern; + if (type === "AssignmentPattern" || type === "TSParameterProperty") { + this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, { + type }); } - return pattern; - }); + } + return list; } tsParseTypeMemberSemicolon() { if (!this.eat(12) && !this.isLineTerminator()) { @@ -452712,7 +494458,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsTryParseIndexSignature(node) { if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { - return undefined; + return; } this.expect(0); const id = this.parseIdentifier(); @@ -452730,15 +494476,11 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const nodeAny = node; if (this.match(10) || this.match(47)) { if (readonly) { - this.raise(TSErrors.ReadonlyForMethodSignature, { - at: node - }); + this.raise(TSErrors.ReadonlyForMethodSignature, node); } const method = nodeAny; if (method.kind && this.match(47)) { - this.raise(TSErrors.AccesorCannotHaveTypeParameters, { - at: this.state.curPosition() - }); + this.raise(TSErrors.AccesorCannotHaveTypeParameters, this.state.curPosition()); } this.tsFillSignature(14, method); this.tsParseTypeMemberSemicolon(); @@ -452746,42 +494488,28 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const returnTypeKey = "typeAnnotation"; if (method.kind === "get") { if (method[paramsKey].length > 0) { - this.raise(Errors.BadGetterArity, { - at: this.state.curPosition() - }); + this.raise(Errors.BadGetterArity, this.state.curPosition()); if (this.isThisParam(method[paramsKey][0])) { - this.raise(TSErrors.AccesorCannotDeclareThisParameter, { - at: this.state.curPosition() - }); + this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition()); } } } else if (method.kind === "set") { if (method[paramsKey].length !== 1) { - this.raise(Errors.BadSetterArity, { - at: this.state.curPosition() - }); + this.raise(Errors.BadSetterArity, this.state.curPosition()); } else { const firstParameter = method[paramsKey][0]; if (this.isThisParam(firstParameter)) { - this.raise(TSErrors.AccesorCannotDeclareThisParameter, { - at: this.state.curPosition() - }); + this.raise(TSErrors.AccesorCannotDeclareThisParameter, this.state.curPosition()); } if (firstParameter.type === "Identifier" && firstParameter.optional) { - this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, { - at: this.state.curPosition() - }); + this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, this.state.curPosition()); } if (firstParameter.type === "RestElement") { - this.raise(TSErrors.SetAccesorCannotHaveRestParameter, { - at: this.state.curPosition() - }); + this.raise(TSErrors.SetAccesorCannotHaveRestParameter, this.state.curPosition()); } } if (method[returnTypeKey]) { - this.raise(TSErrors.SetAccesorCannotHaveReturnType, { - at: method[returnTypeKey] - }); + this.raise(TSErrors.SetAccesorCannotHaveReturnType, method[returnTypeKey]); } } else { method.kind = "method"; @@ -452840,9 +494568,9 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { tsIsStartOfMappedType() { this.next(); if (this.eat(53)) { - return this.isContextual(120); + return this.isContextual(122); } - if (this.isContextual(120)) { + if (this.isContextual(122)) { this.next(); } if (!this.match(0)) { @@ -452867,8 +494595,8 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (this.match(53)) { node.readonly = this.state.value; this.next(); - this.expectContextual(120); - } else if (this.eatContextual(120)) { + this.expectContextual(122); + } else if (this.eatContextual(122)) { node.readonly = true; } this.expect(0); @@ -452891,30 +494619,14 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const node = this.startNode(); node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); let seenOptionalElement = false; - let labeledElements = null; node.elementTypes.forEach(elementNode => { - var _labeledElements; const { type } = elementNode; if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { - this.raise(TSErrors.OptionalTypeBeforeRequired, { - at: elementNode - }); + this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode); } seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"); - let checkType = type; - if (type === "TSRestType") { - elementNode = elementNode.typeAnnotation; - checkType = elementNode.type; - } - const isLabeled = checkType === "TSNamedTupleMember"; - (_labeledElements = labeledElements) != null ? _labeledElements : labeledElements = isLabeled; - if (labeledElements !== isLabeled) { - this.raise(TSErrors.MixedLabeledAndUnlabeledElements, { - at: elementNode - }); - } }); return this.finishNode(node, "TSTupleType"); } @@ -452965,16 +494677,12 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { labeledNode.elementType = type; if (this.eat(17)) { labeledNode.optional = true; - this.raise(TSErrors.TupleOptionalAfterType, { - at: this.state.lastTokStartLoc - }); + this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc); } } else { labeledNode = this.startNodeAtNode(type); labeledNode.optional = optional; - this.raise(TSErrors.InvalidTupleMemberLabel, { - at: type - }); + this.raise(TSErrors.InvalidTupleMemberLabel, type); labeledNode.label = type; labeledNode.elementType = this.tsParseType(); } @@ -453010,18 +494718,17 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParseLiteralTypeNode() { const node = this.startNode(); - node.literal = (() => { - switch (this.state.type) { - case 132: - case 133: - case 131: - case 85: - case 86: - return super.parseExprAtom(); - default: - this.unexpected(); - } - })(); + switch (this.state.type) { + case 134: + case 135: + case 133: + case 85: + case 86: + node.literal = super.parseExprAtom(); + break; + default: + this.unexpected(); + } return this.finishNode(node, "TSLiteralType"); } tsParseTemplateLiteralType() { @@ -453035,7 +494742,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParseThisTypeOrThisTypePredicate() { const thisKeyword = this.tsParseThisTypeNode(); - if (this.isContextual(114) && !this.hasPrecedingLineBreak()) { + if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { return this.tsParseThisTypePredicate(thisKeyword); } else { return thisKeyword; @@ -453043,9 +494750,9 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParseNonArrayType() { switch (this.state.type) { - case 131: - case 132: case 133: + case 134: + case 135: case 85: case 86: return this.tsParseLiteralTypeNode(); @@ -453053,7 +494760,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (this.state.value === "-") { const node = this.startNode(); const nextToken = this.lookahead(); - if (nextToken.type !== 132 && nextToken.type !== 133) { + if (nextToken.type !== 134 && nextToken.type !== 135) { this.unexpected(); } node.literal = this.parseMaybeUnary(); @@ -453128,14 +494835,12 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { case "TSArrayType": return; default: - this.raise(TSErrors.UnexpectedReadonly, { - at: node - }); + this.raise(TSErrors.UnexpectedReadonly, node); } } tsParseInferType() { const node = this.startNode(); - this.expectContextual(113); + this.expectContextual(115); const typeParameter = this.startNode(); typeParameter.name = this.tsParseTypeParameterName(); typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); @@ -453152,7 +494857,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParseTypeOperatorOrHigher() { const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc; - return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(113) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); + return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(115) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); } tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { const node = this.startNode(); @@ -453269,23 +494974,27 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { }); } tsTryParseTypeOrTypePredicateAnnotation() { - return this.match(14) ? this.tsParseTypeOrTypePredicateAnnotation(14) : undefined; + if (this.match(14)) { + return this.tsParseTypeOrTypePredicateAnnotation(14); + } } tsTryParseTypeAnnotation() { - return this.match(14) ? this.tsParseTypeAnnotation() : undefined; + if (this.match(14)) { + return this.tsParseTypeAnnotation(); + } } tsTryParseType() { return this.tsEatThenParseType(14); } tsParseTypePredicatePrefix() { const id = this.parseIdentifier(); - if (this.isContextual(114) && !this.hasPrecedingLineBreak()) { + if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { this.next(); return id; } } tsParseTypePredicateAsserts() { - if (this.state.type !== 107) { + if (this.state.type !== 109) { return false; } const containsEsc = this.state.containsEsc; @@ -453294,8 +495003,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return false; } if (containsEsc) { - this.raise(Errors.InvalidEscapedReservedWord, { - at: this.state.lastTokStartLoc, + this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, { reservedWord: "asserts" }); } @@ -453324,7 +495032,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return this.finishNode(node, "TSConditionalType"); } isAbstractConstructorSignature() { - return this.isContextual(122) && this.lookahead().type === 77; + return this.isContextual(124) && this.lookahead().type === 77; } tsParseNonConditionalType() { if (this.tsIsStartOfFunctionType()) { @@ -453339,9 +495047,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParseTypeAssertion() { if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { - this.raise(TSErrors.ReservedTypeAssertion, { - at: this.state.startLoc - }); + this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc); } const node = this.startNode(); node.typeAnnotation = this.tsInType(() => { @@ -453363,8 +495069,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return this.finishNode(node, "TSExpressionWithTypeArguments"); }); if (!delimitedList.length) { - this.raise(TSErrors.EmptyHeritageClauseType, { - at: originalStartLoc, + this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, { token }); } @@ -453372,16 +495077,14 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParseInterfaceDeclaration(node, properties = {}) { if (this.hasFollowingLineBreak()) return null; - this.expectContextual(127); + this.expectContextual(129); if (properties.declare) node.declare = true; if (tokenIsIdentifier(this.state.type)) { node.id = this.parseIdentifier(); - this.checkIdentifier(node.id, BIND_TS_INTERFACE); + this.checkIdentifier(node.id, 130); } else { node.id = null; - this.raise(TSErrors.MissingInterfaceName, { - at: this.state.startLoc - }); + this.raise(TSErrors.MissingInterfaceName, this.state.startLoc); } node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (this.eat(81)) { @@ -453394,11 +495097,11 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParseTypeAliasDeclaration(node) { node.id = this.parseIdentifier(); - this.checkIdentifier(node.id, BIND_TS_TYPE); + this.checkIdentifier(node.id, 2); node.typeAnnotation = this.tsInType(() => { node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers); this.expect(29); - if (this.isContextual(112) && this.lookahead().type !== 16) { + if (this.isContextual(114) && this.lookahead().type !== 16) { const node = this.startNode(); this.next(); return this.finishNode(node, "TSIntrinsicKeyword"); @@ -453445,23 +495148,25 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } } tsEatThenParseType(token) { - return !this.match(token) ? undefined : this.tsNextThenParseType(); + if (this.match(token)) { + return this.tsNextThenParseType(); + } } tsExpectThenParseType(token) { - return this.tsDoThenParseType(() => this.expect(token)); + return this.tsInType(() => { + this.expect(token); + return this.tsParseType(); + }); } tsNextThenParseType() { - return this.tsDoThenParseType(() => this.next()); - } - tsDoThenParseType(cb) { return this.tsInType(() => { - cb(); + this.next(); return this.tsParseType(); }); } tsParseEnumMember() { const node = this.startNode(); - node.id = this.match(131) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); + node.id = this.match(133) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); if (this.eat(29)) { node.initializer = super.parseMaybeAssignAllowIn(); } @@ -453470,9 +495175,9 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { tsParseEnumDeclaration(node, properties = {}) { if (properties.const) node.const = true; if (properties.declare) node.declare = true; - this.expectContextual(124); + this.expectContextual(126); node.id = this.parseIdentifier(); - this.checkIdentifier(node.id, node.const ? BIND_TS_CONST_ENUM : BIND_TS_ENUM); + this.checkIdentifier(node.id, node.const ? 8971 : 8459); this.expect(5); node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); this.expect(8); @@ -453480,7 +495185,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsParseModuleBlock() { const node = this.startNode(); - this.scope.enter(SCOPE_OTHER); + this.scope.enter(0); this.expect(5); super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); this.scope.exit(); @@ -453489,15 +495194,15 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { tsParseModuleOrNamespaceDeclaration(node, nested = false) { node.id = this.parseIdentifier(); if (!nested) { - this.checkIdentifier(node.id, BIND_TS_NAMESPACE); + this.checkIdentifier(node.id, 1024); } if (this.eat(16)) { const inner = this.startNode(); this.tsParseModuleOrNamespaceDeclaration(inner, true); node.body = inner; } else { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); + this.scope.enter(256); + this.prodParam.enter(0); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); @@ -453505,17 +495210,17 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return this.finishNode(node, "TSModuleDeclaration"); } tsParseAmbientExternalModuleDeclaration(node) { - if (this.isContextual(110)) { + if (this.isContextual(112)) { node.global = true; node.id = this.parseIdentifier(); - } else if (this.match(131)) { + } else if (this.match(133)) { node.id = super.parseStringLiteral(this.state.value); } else { this.unexpected(); } if (this.match(5)) { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); + this.scope.enter(256); + this.prodParam.enter(0); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); @@ -453524,36 +495229,35 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } return this.finishNode(node, "TSModuleDeclaration"); } - tsParseImportEqualsDeclaration(node, isExport) { + tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) { node.isExport = isExport || false; - node.id = this.parseIdentifier(); - this.checkIdentifier(node.id, BIND_FLAGS_TS_IMPORT); + node.id = maybeDefaultIdentifier || this.parseIdentifier(); + this.checkIdentifier(node.id, 4096); this.expect(29); const moduleReference = this.tsParseModuleReference(); if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { - this.raise(TSErrors.ImportAliasHasImportType, { - at: moduleReference - }); + this.raise(TSErrors.ImportAliasHasImportType, moduleReference); } node.moduleReference = moduleReference; this.semicolon(); return this.finishNode(node, "TSImportEqualsDeclaration"); } tsIsExternalModuleReference() { - return this.isContextual(117) && this.lookaheadCharCode() === 40; + return this.isContextual(119) && this.lookaheadCharCode() === 40; } tsParseModuleReference() { return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); } tsParseExternalModuleReference() { const node = this.startNode(); - this.expectContextual(117); + this.expectContextual(119); this.expect(10); - if (!this.match(131)) { + if (!this.match(133)) { this.unexpected(); } node.expression = super.parseExprAtom(); this.expect(11); + this.sawUnambiguousESM = true; return this.finishNode(node, "TSExternalModuleReference"); } tsLookAhead(f) { @@ -453564,7 +495268,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } tsTryParseAndCatch(f) { const result = this.tryParse(abort => f() || abort()); - if (result.aborted || !result.node) return undefined; + if (result.aborted || !result.node) return; if (result.error) this.state = result.failState; return result.node; } @@ -453573,57 +495277,55 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const result = f(); if (result !== undefined && result !== false) { return result; - } else { - this.state = state; - return undefined; } + this.state = state; } tsTryParseDeclare(nany) { if (this.isLineTerminator()) { return; } - let starttype = this.state.type; + let startType = this.state.type; let kind; - if (this.isContextual(99)) { - starttype = 74; + if (this.isContextual(100)) { + startType = 74; kind = "let"; } return this.tsInAmbientContext(() => { - if (starttype === 68) { - nany.declare = true; - return super.parseFunctionStatement(nany, false, false); - } - if (starttype === 80) { - nany.declare = true; - return this.parseClass(nany, true, false); - } - if (starttype === 124) { - return this.tsParseEnumDeclaration(nany, { - declare: true - }); - } - if (starttype === 110) { - return this.tsParseAmbientExternalModuleDeclaration(nany); - } - if (starttype === 75 || starttype === 74) { - if (!this.match(75) || !this.isLookaheadContextual("enum")) { + switch (startType) { + case 68: nany.declare = true; - return this.parseVarStatement(nany, kind || this.state.value, true); - } - this.expect(75); - return this.tsParseEnumDeclaration(nany, { - const: true, - declare: true - }); - } - if (starttype === 127) { - const result = this.tsParseInterfaceDeclaration(nany, { - declare: true - }); - if (result) return result; - } - if (tokenIsIdentifier(starttype)) { - return this.tsParseDeclaration(nany, this.state.value, true, null); + return super.parseFunctionStatement(nany, false, false); + case 80: + nany.declare = true; + return this.parseClass(nany, true, false); + case 126: + return this.tsParseEnumDeclaration(nany, { + declare: true + }); + case 112: + return this.tsParseAmbientExternalModuleDeclaration(nany); + case 75: + case 74: + if (!this.match(75) || !this.isLookaheadContextual("enum")) { + nany.declare = true; + return this.parseVarStatement(nany, kind || this.state.value, true); + } + this.expect(75); + return this.tsParseEnumDeclaration(nany, { + const: true, + declare: true + }); + case 129: + { + const result = this.tsParseInterfaceDeclaration(nany, { + declare: true + }); + if (result) return result; + } + default: + if (tokenIsIdentifier(startType)) { + return this.tsParseDeclaration(nany, this.state.value, true, null); + } } }); } @@ -453637,14 +495339,13 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const declaration = this.tsTryParseDeclare(node); if (declaration) { declaration.declare = true; - return declaration; } - break; + return declaration; } case "global": if (this.match(5)) { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); + this.scope.enter(256); + this.prodParam.enter(0); const mod = node; mod.global = true; mod.id = expr; @@ -453667,7 +495368,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { break; case "module": if (this.tsCheckLineTerminator(next)) { - if (this.match(131)) { + if (this.match(133)) { return this.tsParseAmbientExternalModuleDeclaration(node); } else if (tokenIsIdentifier(this.state.type)) { return this.tsParseModuleOrNamespaceDeclaration(node); @@ -453695,9 +495396,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return !this.isLineTerminator(); } tsTryParseGenericAsyncArrowFunction(startLoc) { - if (!this.match(47)) { - return undefined; - } + if (!this.match(47)) return; const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = true; const res = this.tsTryParseAndCatch(() => { @@ -453709,15 +495408,11 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return node; }); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - if (!res) { - return undefined; - } + if (!res) return; return super.parseArrowExpression(res, null, true); } tsParseTypeArgumentsInExpression() { - if (this.reScan_lt() !== 47) { - return undefined; - } + if (this.reScan_lt() !== 47) return; return this.tsParseTypeArguments(); } tsParseTypeArguments() { @@ -453727,9 +495422,9 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); })); if (node.params.length === 0) { - this.raise(TSErrors.EmptyTypeArguments, { - at: node - }); + this.raise(TSErrors.EmptyTypeArguments, node); + } else if (!this.state.inType && this.curContext() === types.brace) { + this.reScan_lt_gt(); } this.expect(48); return this.finishNode(node, "TSTypeParameterInstantiation"); @@ -453751,9 +495446,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const override = modified.override; const readonly = modified.readonly; if (!(flags & 4) && (accessibility || readonly || override)) { - this.raise(TSErrors.UnexpectedParameterModifier, { - at: startLoc - }); + this.raise(TSErrors.UnexpectedParameterModifier, startLoc); } const left = this.parseMaybeDefault(); this.parseAssignableListItemTypes(left, flags); @@ -453767,9 +495460,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (readonly) pp.readonly = readonly; if (override) pp.override = override; if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { - this.raise(TSErrors.UnsupportedParameterPropertyKind, { - at: pp - }); + this.raise(TSErrors.UnsupportedParameterPropertyKind, pp); } pp.parameter = elt; return this.finishNode(pp, "TSParameterProperty"); @@ -453785,9 +495476,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { tsDisallowOptionalPattern(node) { for (const param of node.params) { if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) { - this.raise(TSErrors.PatternIsOptional, { - at: param - }); + this.raise(TSErrors.PatternIsOptional, param); } } } @@ -453804,9 +495493,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return this.finishNode(node, bodilessType); } if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { - this.raise(TSErrors.DeclareFunctionHasImplementation, { - at: node - }); + this.raise(TSErrors.DeclareFunctionHasImplementation, node); if (node.declare) { return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); } @@ -453816,7 +495503,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } registerFunctionStatementId(node) { if (!node.body && node.id) { - this.checkIdentifier(node.id, BIND_TS_AMBIENT); + this.checkIdentifier(node.id, 1024); } else { super.registerFunctionStatementId(node); } @@ -453824,9 +495511,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { tsCheckForInvalidTypeCasts(items) { items.forEach(node => { if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { - this.raise(TSErrors.UnexpectedTypeAnnotation, { - at: node.typeAnnotation - }); + this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation); } }); } @@ -453903,9 +495588,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } if (result) { if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) { - this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, { - at: this.state.startLoc - }); + this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc); } return result; } @@ -453925,15 +495608,14 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } parseExprOp(left, leftStartLoc, minPrec) { let isSatisfies; - if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(118)))) { + if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(120)))) { const node = this.startNodeAt(leftStartLoc); node.expression = left; node.typeAnnotation = this.tsInType(() => { this.next(); if (this.match(75)) { if (isSatisfies) { - this.raise(Errors.UnexpectedKeyword, { - at: this.state.startLoc, + this.raise(Errors.UnexpectedKeyword, this.state.startLoc, { keyword: "const" }); } @@ -453955,68 +495637,78 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { - this.raise(TSErrors.ImportReflectionHasImportType, { - at: node.specifiers[0].loc.start - }); + this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); } } checkDuplicateExports() {} + isPotentialImportPhase(isExport) { + if (super.isPotentialImportPhase(isExport)) return true; + if (this.isContextual(130)) { + const ch = this.lookaheadCharCode(); + return isExport ? ch === 123 || ch === 42 : ch !== 61; + } + return !isExport && this.isContextual(87); + } + applyImportPhase(node, isExport, phase, loc) { + super.applyImportPhase(node, isExport, phase, loc); + if (isExport) { + node.exportKind = phase === "type" ? "type" : "value"; + } else { + node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; + } + } parseImport(node) { - node.importKind = "value"; - if (tokenIsIdentifier(this.state.type) || this.match(55) || this.match(5)) { - let ahead = this.lookahead(); - if (this.isContextual(128) && ahead.type !== 12 && ahead.type !== 97 && ahead.type !== 29) { - node.importKind = "type"; - this.next(); - ahead = this.lookahead(); - } - if (tokenIsIdentifier(this.state.type) && ahead.type === 29) { - return this.tsParseImportEqualsDeclaration(node); + if (this.match(133)) { + node.importKind = "value"; + return super.parseImport(node); + } + let importNode; + if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) { + node.importKind = "value"; + return this.tsParseImportEqualsDeclaration(node); + } else if (this.isContextual(130)) { + const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); + if (this.lookaheadCharCode() === 61) { + return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier); + } else { + importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier); } + } else { + importNode = super.parseImport(node); } - const importNode = super.parseImport(node); if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { - this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, { - at: importNode - }); + this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode); } return importNode; } parseExport(node, decorators) { if (this.match(83)) { this.next(); - if (this.isContextual(128) && this.lookaheadCharCode() !== 61) { - node.importKind = "type"; - this.next(); + let maybeDefaultIdentifier = null; + if (this.isContextual(130) && this.isPotentialImportPhase(false)) { + maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); } else { node.importKind = "value"; } - return this.tsParseImportEqualsDeclaration(node, true); + return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, true); } else if (this.eat(29)) { const assign = node; assign.expression = super.parseExpression(); this.semicolon(); + this.sawUnambiguousESM = true; return this.finishNode(assign, "TSExportAssignment"); } else if (this.eatContextual(93)) { const decl = node; - this.expectContextual(126); + this.expectContextual(128); decl.id = this.parseIdentifier(); this.semicolon(); return this.finishNode(decl, "TSNamespaceExportDeclaration"); } else { - node.exportKind = "value"; - if (this.isContextual(128)) { - const ch = this.lookaheadCharCode(); - if (ch === 123 || ch === 42) { - this.next(); - node.exportKind = "type"; - } - } return super.parseExport(node, decorators); } } isAbstractClass() { - return this.isContextual(122) && this.lookahead().type === 80; + return this.isContextual(124) && this.lookahead().type === 80; } parseExportDefaultExpression() { if (this.isAbstractClass()) { @@ -454025,7 +495717,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { cls.abstract = true; return this.parseClass(cls, true, true); } - if (this.match(127)) { + if (this.match(129)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } @@ -454043,13 +495735,9 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } of declaration.declarations) { if (!init) continue; if (kind !== "const" || !!id.typeAnnotation) { - this.raise(TSErrors.InitializerNotAllowedInAmbientContext, { - at: init - }); + this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init); } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { - this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, { - at: init - }); + this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init); } } return declaration; @@ -454062,10 +495750,10 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const: true }); } - if (this.isContextual(124)) { + if (this.isContextual(126)) { return this.tsParseEnumDeclaration(this.startNode()); } - if (this.isContextual(127)) { + if (this.isContextual(129)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } @@ -454083,7 +495771,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { }); } tsIsStartOfStaticBlocks() { - return this.isContextual(104) && this.lookaheadCharCode() === 123; + return this.isContextual(106) && this.lookaheadCharCode() === 123; } parseClassMember(classBody, member, state) { const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; @@ -454098,9 +495786,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { this.next(); this.next(); if (this.tsHasSomeModifiers(member, modifiers)) { - this.raise(TSErrors.StaticBlockCannotHaveModifier, { - at: this.state.curPosition() - }); + this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition()); } super.parseClassStaticBlock(classBody, member); } else { @@ -454118,38 +495804,27 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (idx) { classBody.body.push(idx); if (member.abstract) { - this.raise(TSErrors.IndexSignatureHasAbstract, { - at: member - }); + this.raise(TSErrors.IndexSignatureHasAbstract, member); } if (member.accessibility) { - this.raise(TSErrors.IndexSignatureHasAccessibility, { - at: member, + this.raise(TSErrors.IndexSignatureHasAccessibility, member, { modifier: member.accessibility }); } if (member.declare) { - this.raise(TSErrors.IndexSignatureHasDeclare, { - at: member - }); + this.raise(TSErrors.IndexSignatureHasDeclare, member); } if (member.override) { - this.raise(TSErrors.IndexSignatureHasOverride, { - at: member - }); + this.raise(TSErrors.IndexSignatureHasOverride, member); } return; } if (!this.state.inAbstractClass && member.abstract) { - this.raise(TSErrors.NonAbstractClassHasAbstractMethod, { - at: member - }); + this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member); } if (member.override) { if (!state.hadSuperClass) { - this.raise(TSErrors.OverrideNotInSubClass, { - at: member - }); + this.raise(TSErrors.OverrideNotInSubClass, member); } } super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); @@ -454158,14 +495833,10 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const optional = this.eat(17); if (optional) methodOrProp.optional = true; if (methodOrProp.readonly && this.match(10)) { - this.raise(TSErrors.ClassMethodHasReadonly, { - at: methodOrProp - }); + this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp); } if (methodOrProp.declare && this.match(10)) { - this.raise(TSErrors.ClassMethodHasDeclare, { - at: methodOrProp - }); + this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp); } } parseExpressionStatement(node, expr, decorators) { @@ -454205,15 +495876,13 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return node; } parseExportDeclaration(node) { - if (!this.state.isAmbientContext && this.isContextual(123)) { + if (!this.state.isAmbientContext && this.isContextual(125)) { return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); } const startLoc = this.state.startLoc; - const isDeclare = this.eatContextual(123); - if (isDeclare && (this.isContextual(123) || !this.shouldParseExportDeclaration())) { - throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, { - at: this.state.startLoc - }); + const isDeclare = this.eatContextual(125); + if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) { + throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc); } const isIdentifier = tokenIsIdentifier(this.state.type); const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); @@ -454228,10 +495897,10 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return declaration; } parseClassId(node, isStatement, optionalId, bindingType) { - if ((!isStatement || optionalId) && this.isContextual(111)) { + if ((!isStatement || optionalId) && this.isContextual(113)) { return; } - super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS); + super.parseClassId(node, isStatement, optionalId, node.declare ? 1024 : 8331); const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (typeParameters) node.typeParameters = typeParameters; } @@ -454249,16 +495918,13 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { parseClassProperty(node) { this.parseClassPropertyAnnotation(node); if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) { - this.raise(TSErrors.DeclareClassFieldHasInitializer, { - at: this.state.startLoc - }); + this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc); } if (node.abstract && this.match(29)) { const { key } = node; - this.raise(TSErrors.AbstractPropertyHasInitializer, { - at: this.state.startLoc, + this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, { propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` }); } @@ -454266,13 +495932,10 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } parseClassPrivateProperty(node) { if (node.abstract) { - this.raise(TSErrors.PrivateElementHasAbstract, { - at: node - }); + this.raise(TSErrors.PrivateElementHasAbstract, node); } if (node.accessibility) { - this.raise(TSErrors.PrivateElementHasAccessibility, { - at: node, + this.raise(TSErrors.PrivateElementHasAccessibility, node, { modifier: node.accessibility }); } @@ -454282,26 +495945,21 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { parseClassAccessorProperty(node) { this.parseClassPropertyAnnotation(node); if (node.optional) { - this.raise(TSErrors.AccessorCannotBeOptional, { - at: node - }); + this.raise(TSErrors.AccessorCannotBeOptional, node); } return super.parseClassAccessorProperty(node); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters && isConstructor) { - this.raise(TSErrors.ConstructorHasTypeParameters, { - at: typeParameters - }); + this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters); } const { declare = false, kind } = method; if (declare && (kind === "get" || kind === "set")) { - this.raise(TSErrors.DeclareAccessor, { - at: method, + this.raise(TSErrors.DeclareAccessor, method, { kind }); } @@ -454323,7 +495981,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (node.superClass && (this.match(47) || this.match(51))) { node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); } - if (this.eatContextual(111)) { + if (this.eatContextual(113)) { node.implements = this.tsParseHeritageClause("implements"); } } @@ -454355,11 +496013,11 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return super.parseAsyncArrowFromCallExpression(node, call); } parseMaybeAssign(refExpressionErrors, afterLeftParse) { - var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3; + var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2; let state; let jsx; let typeCast; - if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) { + if (this.hasPlugin("jsx") && (this.match(142) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; @@ -454411,25 +496069,19 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { this.state = typeCast.failState; return typeCast.node; } - if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - if ((_typeCast2 = typeCast) != null && _typeCast2.thrown) throw typeCast.error; - throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error); + throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error); } reportReservedArrowTypeParam(node) { var _node$extra; if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { - this.raise(TSErrors.ReservedArrowTypeParam, { - at: node - }); + this.raise(TSErrors.ReservedArrowTypeParam, node); } } parseMaybeUnary(refExpressionErrors, sawUnary) { if (!this.hasPlugin("jsx") && this.match(47)) { return this.tsParseTypeAssertion(); - } else { - return super.parseMaybeUnary(refExpressionErrors, sawUnary); } + return super.parseMaybeUnary(refExpressionErrors, sawUnary); } parseArrow(node) { if (this.match(14)) { @@ -454476,13 +496128,9 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { case "TSNonNullExpression": case "TSTypeAssertion": if (isLHS) { - this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, { - at: node - }); + this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node); } else { - this.raise(TSErrors.UnexpectedTypeCastInParameter, { - at: node - }); + this.raise(TSErrors.UnexpectedTypeCastInParameter, node); } this.toAssignable(node.expression, isLHS); break; @@ -454524,18 +496172,16 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { TSTypeCastExpression: true, TSParameterProperty: "parameter", TSNonNullExpression: "expression", - TSAsExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true], - TSSatisfiesExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true], - TSTypeAssertion: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true] + TSAsExpression: (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true], + TSSatisfiesExpression: (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true], + TSTypeAssertion: (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true] }, type) || super.isValidLVal(type, isUnparenthesizedInAssign, binding); } parseBindingAtom() { - switch (this.state.type) { - case 78: - return this.parseIdentifier(true); - default: - return super.parseBindingAtom(); + if (this.state.type === 78) { + return this.parseIdentifier(true); } + return super.parseBindingAtom(); } parseMaybeDecoratorArguments(expr) { if (this.match(47) || this.match(51)) { @@ -454553,9 +496199,8 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { this.next(); return false; - } else { - return super.checkCommaAfterRest(close); } + return super.checkCommaAfterRest(close); } isClassMethod() { return this.match(47) || super.isClassMethod(); @@ -454566,9 +496211,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(TSErrors.TypeAnnotationAfterAssign, { - at: node.typeAnnotation - }); + this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation); } return node; } @@ -454679,12 +496322,10 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { if (this.match(80)) { node.abstract = true; return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false)); - } else if (this.isContextual(127)) { + } else if (this.isContextual(129)) { if (!this.hasFollowingLineBreak()) { node.abstract = true; - this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, { - at: node - }); + this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, node); return this.tsParseInterfaceDeclaration(node); } } else { @@ -454699,8 +496340,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { const { key } = method; - this.raise(TSErrors.AbstractMethodHasImplementation, { - at: method, + this.raise(TSErrors.AbstractMethodHasImplementation, method, { methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` }); } @@ -454740,7 +496380,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { return this.finishNode(specifier, "ImportSpecifier"); } specifier.importKind = "value"; - return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT); + return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096); } parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { const leftOfAsKey = isImport ? "imported" : "local"; @@ -454782,9 +496422,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { } } if (hasTypeSpecifier && isInTypeOnlyImportExport) { - this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, { - at: loc - }); + this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc); } node[leftOfAsKey] = leftOfAs; node[rightOfAsKey] = rightOfAs; @@ -454797,7 +496435,7 @@ var typescript = superClass => class TypeScriptParserMixin extends superClass { node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]); } if (isImport) { - this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT); + this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096); } } }; @@ -454848,9 +496486,8 @@ function isValidAmbientConstInitializer(expression, estree) { function isNumber(expression, estree) { if (estree) { return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression); - } else { - return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral"; } + return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral"; } function isNegativeNumber(expression, estree) { if (expression.type === "UnaryExpression") { @@ -454866,8 +496503,9 @@ function isNegativeNumber(expression, estree) { } function isUncomputedMemberExpressionChain(expression) { if (expression.type === "Identifier") return true; - if (expression.type !== "MemberExpression") return false; - if (expression.computed) return false; + if (expression.type !== "MemberExpression" || expression.computed) { + return false; + } return isUncomputedMemberExpressionChain(expression.object); } const PlaceholderErrors = ParseErrorEnum`placeholders`({ @@ -454876,13 +496514,13 @@ const PlaceholderErrors = ParseErrorEnum`placeholders`({ }); var placeholders = superClass => class PlaceholdersParserMixin extends superClass { parsePlaceholder(expectedNode) { - if (this.match(142)) { + if (this.match(144)) { const node = this.startNode(); this.next(); this.assertNoSpace(); node.name = super.parseIdentifier(true); this.assertNoSpace(); - this.expect(142); + this.expect(144); return this.finishPlaceholder(node, expectedNode); } } @@ -454893,7 +496531,7 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas } getTokenFromCode(code) { if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { - this.finishOp(142, 2); + this.finishOp(144, 2); } else { super.getTokenFromCode(code); } @@ -454927,7 +496565,7 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas return true; } const nextToken = this.lookahead(); - if (nextToken.type === 142) { + if (nextToken.type === 144) { return true; } return false; @@ -454937,7 +496575,8 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas super.verifyBreakContinue(node, isBreak); } parseExpressionStatement(node, expr) { - if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) { + var _expr$extra; + if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { return super.parseExpressionStatement(node, expr); } if (this.match(14)) { @@ -454963,16 +496602,14 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas const oldStrict = this.state.strict; const placeholder = this.parsePlaceholder("Identifier"); if (placeholder) { - if (this.match(81) || this.match(142) || this.match(5)) { + if (this.match(81) || this.match(144) || this.match(5)) { node.id = placeholder; } else if (optionalId || !isStatement) { node.id = null; node.body = this.finishPlaceholder(placeholder, "ClassBody"); return this.finishNode(node, type); } else { - throw this.raise(PlaceholderErrors.ClassNameIsRequired, { - at: this.state.startLoc - }); + throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc); } } else { this.parseClassId(node, isStatement, optionalId); @@ -454984,7 +496621,7 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas parseExport(node, decorators) { const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseExport(node, decorators); - if (!this.isContextual(97) && !this.match(12)) { + if (!this.isContextual(98) && !this.match(12)) { node.specifiers = []; node.source = null; node.declaration = this.finishPlaceholder(placeholder, "Declaration"); @@ -455000,18 +496637,19 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas if (this.match(65)) { const next = this.nextTokenStart(); if (this.isUnparsedContextual(next, "from")) { - if (this.input.startsWith(tokenLabelName(142), this.nextTokenStartSince(next + 4))) { + if (this.input.startsWith(tokenLabelName(144), this.nextTokenStartSince(next + 4))) { return true; } } } return super.isExportDefaultSpecifier(); } - maybeParseExportDefaultSpecifier(node) { - if (node.specifiers && node.specifiers.length > 0) { + maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { + var _specifiers; + if ((_specifiers = node.specifiers) != null && _specifiers.length) { return true; } - return super.maybeParseExportDefaultSpecifier(node); + return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); } checkExport(node) { const { @@ -455027,7 +496665,7 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseImport(node); node.specifiers = []; - if (!this.isContextual(97) && !this.match(12)) { + if (!this.isContextual(98) && !this.match(12)) { node.source = this.finishPlaceholder(placeholder, "StringLiteral"); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); @@ -455039,7 +496677,7 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas const hasStarImport = this.maybeParseStarImportSpecifier(node); if (!hasStarImport) this.parseNamedImportSpecifiers(node); } - this.expectContextual(97); + this.expectContextual(98); node.source = this.parseImportSource(); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); @@ -455049,9 +496687,7 @@ var placeholders = superClass => class PlaceholdersParserMixin extends superClas } assertNoSpace() { if (this.state.start > this.state.lastTokEndLoc.index) { - this.raise(PlaceholderErrors.UnexpectedSpace, { - at: this.state.lastTokEndLoc - }); + this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc); } } }; @@ -455163,8 +496799,8 @@ function validatePlugins(plugins) { } if (hasPlugin(plugins, "moduleAttributes")) { { - if (hasPlugin(plugins, "importAssertions")) { - throw new Error("Cannot combine importAssertions and moduleAttributes plugins."); + if (hasPlugin(plugins, "importAssertions") || hasPlugin(plugins, "importAttributes")) { + throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins."); } const moduleAttributesVersionPluginOption = getPluginOption(plugins, "moduleAttributes", "version"); if (moduleAttributesVersionPluginOption !== "may-2020") { @@ -455172,6 +496808,9 @@ function validatePlugins(plugins) { } } } + if (hasPlugin(plugins, "importAssertions") && hasPlugin(plugins, "importAttributes")) { + throw new Error("Cannot combine importAssertions and importAttributes plugins."); + } if (hasPlugin(plugins, "recordAndTuple") && getPluginOption(plugins, "recordAndTuple", "syntaxType") != null && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) { throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); } @@ -455180,6 +496819,9 @@ function validatePlugins(plugins) { error.missingPlugins = "doExpressions"; throw error; } + if (hasPlugin(plugins, "optionalChainingAssign") && getPluginOption(plugins, "optionalChainingAssign", "version") !== "2023-07") { + throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is '2023-07'."); + } } const mixinPlugins = { estree, @@ -455190,6 +496832,41 @@ const mixinPlugins = { placeholders }; const mixinPluginNames = Object.keys(mixinPlugins); +const defaultOptions = { + sourceType: "script", + sourceFilename: undefined, + startColumn: 0, + startLine: 1, + allowAwaitOutsideFunction: false, + allowReturnOutsideFunction: false, + allowNewTargetOutsideFunction: false, + allowImportExportEverywhere: false, + allowSuperOutsideMethod: false, + allowUndeclaredExports: false, + plugins: [], + strictMode: null, + ranges: false, + tokens: false, + createImportExpressions: false, + createParenthesizedExpressions: false, + errorRecovery: false, + attachComment: true, + annexB: true +}; +function getOptions(opts) { + if (opts == null) { + return Object.assign({}, defaultOptions); + } + if (opts.annexB != null && opts.annexB !== false) { + throw new Error("The `annexB` option can only be set to `false`."); + } + const options = {}; + for (const key of Object.keys(defaultOptions)) { + var _opts$key; + options[key] = (_opts$key = opts[key]) != null ? _opts$key : defaultOptions[key]; + } + return options; +} class ExpressionParser extends LValParser { checkProto(prop, isRecord, protoRef, refExpressionErrors) { if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { @@ -455199,9 +496876,7 @@ class ExpressionParser extends LValParser { const name = key.type === "Identifier" ? key.name : key.value; if (name === "__proto__") { if (isRecord) { - this.raise(Errors.RecordNoProto, { - at: key - }); + this.raise(Errors.RecordNoProto, key); return; } if (protoRef.used) { @@ -455210,9 +496885,7 @@ class ExpressionParser extends LValParser { refExpressionErrors.doubleProtoLoc = key.loc.start; } } else { - this.raise(Errors.DuplicateProto, { - at: key - }); + this.raise(Errors.DuplicateProto, key); } } protoRef.used = true; @@ -455225,11 +496898,11 @@ class ExpressionParser extends LValParser { this.enterInitialScopes(); this.nextToken(); const expr = this.parseExpression(); - if (!this.match(137)) { + if (!this.match(139)) { this.unexpected(); } this.finalizeRemainingComments(); - expr.comments = this.state.comments; + expr.comments = this.comments; expr.errors = this.state.errors; if (this.options.tokens) { expr.tokens = this.tokens; @@ -455268,7 +496941,7 @@ class ExpressionParser extends LValParser { } parseMaybeAssign(refExpressionErrors, afterLeftParse) { const startLoc = this.state.startLoc; - if (this.isContextual(106)) { + if (this.isContextual(108)) { if (this.prodParam.hasYield) { let left = this.parseYield(); if (afterLeftParse) { @@ -455347,7 +497020,7 @@ class ExpressionParser extends LValParser { return expr; } parseMaybeUnaryOrPrivate(refExpressionErrors) { - return this.match(136) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); + return this.match(138) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); } parseExprOps(refExpressionErrors) { const startLoc = this.state.startLoc; @@ -455362,8 +497035,7 @@ class ExpressionParser extends LValParser { if (this.isPrivateName(left)) { const value = this.getPrivateNameSV(left); if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) { - this.raise(Errors.PrivateInExpectedIn, { - at: left, + this.raise(Errors.PrivateInExpectedIn, left, { identifierName: value }); } @@ -455393,18 +497065,14 @@ class ExpressionParser extends LValParser { proposal: "minimal" }])) { if (this.state.type === 96 && this.prodParam.hasAwait) { - throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, { - at: this.state.startLoc - }); + throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc); } } node.right = this.parseExprOpRightExpr(op, prec); const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); const nextOp = this.state.type; if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { - throw this.raise(Errors.MixingCoalesceWithLogical, { - at: this.state.startLoc - }); + throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc); } return this.parseExprOp(finishedNode, leftStartLoc, minPrec); } @@ -455422,10 +497090,8 @@ class ExpressionParser extends LValParser { }); case "smart": return this.withTopicBindingContext(() => { - if (this.prodParam.hasYield && this.isContextual(106)) { - throw this.raise(Errors.PipeBodyIsTighter, { - at: this.state.startLoc - }); + if (this.prodParam.hasYield && this.isContextual(108)) { + throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc); } return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc); }); @@ -455450,23 +497116,18 @@ class ExpressionParser extends LValParser { const body = this.parseMaybeAssign(); const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type); if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { - this.raise(Errors.PipeUnparenthesizedBody, { - at: startLoc, + this.raise(Errors.PipeUnparenthesizedBody, startLoc, { type: body.type }); } if (!this.topicReferenceWasUsedInCurrentContext()) { - this.raise(Errors.PipeTopicUnused, { - at: startLoc - }); + this.raise(Errors.PipeTopicUnused, startLoc); } return body; } checkExponentialAfterUnary(node) { if (this.match(57)) { - this.raise(Errors.UnexpectedTokenUnaryExponentiation, { - at: node.argument - }); + this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument); } } parseMaybeUnary(refExpressionErrors, sawUnary) { @@ -455493,13 +497154,9 @@ class ExpressionParser extends LValParser { if (this.state.strict && isDelete) { const arg = node.argument; if (arg.type === "Identifier") { - this.raise(Errors.StrictDelete, { - at: node - }); + this.raise(Errors.StrictDelete, node); } else if (this.hasPropertyAsPrivateName(arg)) { - this.raise(Errors.DeletePrivateField, { - at: node - }); + this.raise(Errors.DeletePrivateField, node); } } if (!update) { @@ -455516,9 +497173,7 @@ class ExpressionParser extends LValParser { } = this.state; const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); if (startsExpr && !this.isAmbiguousAwait()) { - this.raiseOverwrite(Errors.AwaitNotInAsyncContext, { - at: startLoc - }); + this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc); return this.parseAwait(startLoc); } } @@ -455580,9 +497235,7 @@ class ExpressionParser extends LValParser { let optional = false; if (type === 18) { if (noCalls) { - this.raise(Errors.OptionalChainingNoNew, { - at: this.state.startLoc - }); + this.raise(Errors.OptionalChainingNoNew, this.state.startLoc); if (this.lookaheadCharCode() === 40) { state.stop = true; return base; @@ -455610,11 +497263,9 @@ class ExpressionParser extends LValParser { if (computed) { node.property = this.parseExpression(); this.expect(3); - } else if (this.match(136)) { + } else if (this.match(138)) { if (base.type === "Super") { - this.raise(Errors.SuperPrivateField, { - at: startLoc - }); + this.raise(Errors.SuperPrivateField, startLoc); } this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); @@ -455684,35 +497335,35 @@ class ExpressionParser extends LValParser { node.tag = base; node.quasi = this.parseTemplate(true); if (state.optionalChainMember) { - this.raise(Errors.OptionalChainingNoTemplate, { - at: startLoc - }); + this.raise(Errors.OptionalChainingNoTemplate, startLoc); } return this.finishNode(node, "TaggedTemplateExpression"); } atPossibleAsyncArrow(base) { return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt; } + expectImportAttributesPlugin() { + if (!this.hasPlugin("importAssertions")) { + this.expectPlugin("importAttributes"); + } + } finishCallExpression(node, optional) { if (node.callee.type === "Import") { if (node.arguments.length === 2) { { if (!this.hasPlugin("moduleAttributes")) { - this.expectPlugin("importAssertions"); + this.expectImportAttributesPlugin(); } } } if (node.arguments.length === 0 || node.arguments.length > 2) { - this.raise(Errors.ImportCallArity, { - at: node, - maxArgumentCount: this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1 + this.raise(Errors.ImportCallArity, node, { + maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1 }); } else { for (const arg of node.arguments) { if (arg.type === "SpreadElement") { - this.raise(Errors.ImportCallSpreadArgument, { - at: arg - }); + this.raise(Errors.ImportCallSpreadArgument, arg); } } } @@ -455730,10 +497381,8 @@ class ExpressionParser extends LValParser { } else { this.expect(12); if (this.match(close)) { - if (dynamicImport && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { - this.raise(Errors.ImportCallArgumentTrailingComma, { - at: this.state.lastTokStartLoc - }); + if (dynamicImport && !this.hasPlugin("importAttributes") && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { + this.raise(Errors.ImportCallArgumentTrailingComma, this.state.lastTokStartLoc); } if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); @@ -455782,12 +497431,16 @@ class ExpressionParser extends LValParser { if (this.match(16)) { return this.parseImportMetaProperty(node); } - if (!this.match(10)) { - this.raise(Errors.UnsupportedImport, { - at: this.state.lastTokStartLoc - }); + if (this.match(10)) { + if (this.options.createImportExpressions) { + return this.parseImportCall(node); + } else { + return this.finishNode(node, "Import"); + } + } else { + this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc); + return this.finishNode(node, "Import"); } - return this.finishNode(node, "Import"); case 78: node = this.startNode(); this.next(); @@ -455802,13 +497455,13 @@ class ExpressionParser extends LValParser { this.readRegexp(); return this.parseRegExpLiteral(this.state.value); } - case 132: + case 134: return this.parseNumericLiteral(this.state.value); - case 133: + case 135: return this.parseBigIntLiteral(this.state.value); - case 134: + case 136: return this.parseDecimalLiteral(this.state.value); - case 131: + case 133: return this.parseStringLiteral(this.state.value); case 84: return this.parseNullLiteral(); @@ -455859,15 +497512,12 @@ class ExpressionParser extends LValParser { if (callee.type === "MemberExpression") { return this.finishNode(node, "BindExpression"); } else { - throw this.raise(Errors.UnsupportedBind, { - at: callee - }); + throw this.raise(Errors.UnsupportedBind, callee); } } - case 136: + case 138: { - this.raise(Errors.PrivateInExpectedIn, { - at: this.state.startLoc, + this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, { identifierName: this.state.value }); return this.parsePrivateName(); @@ -455908,7 +497558,7 @@ class ExpressionParser extends LValParser { } default: if (tokenIsIdentifier(type)) { - if (this.isContextual(125) && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) { + if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) { return this.parseModuleExpression(); } const canBeArrow = this.state.potentialArrowAt === this.state.start; @@ -455967,15 +497617,12 @@ class ExpressionParser extends LValParser { if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference"; if (!this.topicReferenceIsAllowedInCurrentContext()) { - this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, { - at: startLoc - }); + this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, startLoc); } this.registerTopicReference(); return this.finishNode(node, nodeType); } else { - throw this.raise(Errors.PipeTopicUnconfiguredToken, { - at: startLoc, + throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, { token: tokenLabelName(tokenType) }); } @@ -455991,9 +497638,7 @@ class ExpressionParser extends LValParser { case "smart": return tokenType === 27; default: - throw this.raise(Errors.PipeTopicRequiresHackPipes, { - at: startLoc - }); + throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc); } } parseAsyncArrowUnaryFunction(node) { @@ -456001,9 +497646,7 @@ class ExpressionParser extends LValParser { const params = [this.parseIdentifier()]; this.prodParam.exit(); if (this.hasPrecedingLineBreak()) { - this.raise(Errors.LineTerminatorBeforeArrow, { - at: this.state.curPosition() - }); + this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition()); } this.expect(19); return this.parseArrowExpression(node, params, true); @@ -456018,7 +497661,7 @@ class ExpressionParser extends LValParser { const oldLabels = this.state.labels; this.state.labels = []; if (isAsync) { - this.prodParam.enter(PARAM_AWAIT); + this.prodParam.enter(2); node.body = this.parseBlock(); this.prodParam.exit(); } else { @@ -456031,18 +497674,12 @@ class ExpressionParser extends LValParser { const node = this.startNode(); this.next(); if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { - this.raise(Errors.SuperNotAllowed, { - at: node - }); + this.raise(Errors.SuperNotAllowed, node); } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { - this.raise(Errors.UnexpectedSuper, { - at: node - }); + this.raise(Errors.UnexpectedSuper, node); } if (!this.match(10) && !this.match(0) && !this.match(16)) { - this.raise(Errors.UnsupportedSuper, { - at: node - }); + this.raise(Errors.UnsupportedSuper, node); } return this.finishNode(node, "Super"); } @@ -456060,7 +497697,7 @@ class ExpressionParser extends LValParser { if (this.prodParam.hasYield && this.match(16)) { const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); this.next(); - if (this.match(102)) { + if (this.match(103)) { this.expectPlugin("functionSent"); } else if (!this.hasPlugin("functionSent")) { this.unexpected(); @@ -456074,8 +497711,7 @@ class ExpressionParser extends LValParser { const containsEsc = this.state.containsEsc; node.property = this.parseIdentifier(true); if (node.property.name !== propertyName || containsEsc) { - this.raise(Errors.UnsupportedMetaProperty, { - at: node.property, + this.raise(Errors.UnsupportedMetaProperty, node.property, { target: meta.name, onlyValidPropertyName: propertyName }); @@ -456085,13 +497721,23 @@ class ExpressionParser extends LValParser { parseImportMetaProperty(node) { const id = this.createIdentifier(this.startNodeAtNode(node), "import"); this.next(); - if (this.isContextual(100)) { + if (this.isContextual(101)) { if (!this.inModule) { - this.raise(Errors.ImportMetaOutsideModule, { - at: id - }); + this.raise(Errors.ImportMetaOutsideModule, id); } this.sawUnambiguousESM = true; + } else if (this.isContextual(105) || this.isContextual(97)) { + const isSource = this.isContextual(105); + if (!isSource) this.unexpected(); + this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"); + if (!this.options.createImportExpressions) { + throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, { + phase: this.state.value + }); + } + this.next(); + node.phase = isSource ? "source" : "defer"; + return this.parseImportCall(node); } return this.parseMetaProperty(node, id, "meta"); } @@ -456231,9 +497877,7 @@ class ExpressionParser extends LValParser { this.next(); const metaProp = this.parseMetaProperty(node, meta, "target"); if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) { - this.raise(Errors.UnexpectedNewTarget, { - at: metaProp - }); + this.raise(Errors.UnexpectedNewTarget, metaProp); } return metaProp; } @@ -456251,11 +497895,11 @@ class ExpressionParser extends LValParser { return this.finishNode(node, "NewExpression"); } parseNewCallee(node) { - node.callee = this.parseNoCallExpr(); - if (node.callee.type === "Import") { - this.raise(Errors.ImportCallNotNewExpression, { - at: node.callee - }); + const isImport = this.match(83); + const callee = this.parseNoCallExpr(); + node.callee = callee; + if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) { + this.raise(Errors.ImportCallNotNewExpression, callee); } } parseTemplateElement(isTagged) { @@ -456269,9 +497913,7 @@ class ExpressionParser extends LValParser { const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1)); if (value === null) { if (!isTagged) { - this.raise(Errors.InvalidEscapeSequenceTemplate, { - at: createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1) - }); + this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)); } } const isTail = this.match(24); @@ -456331,9 +497973,7 @@ class ExpressionParser extends LValParser { this.checkProto(prop, isRecord, propHash, refExpressionErrors); } if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { - this.raise(Errors.InvalidRecordProperty, { - at: prop - }); + this.raise(Errors.InvalidRecordProperty, prop); } if (prop.shorthand) { this.addExtra(prop, "shorthand", true); @@ -456351,7 +497991,7 @@ class ExpressionParser extends LValParser { return this.finishNode(node, type); } addTrailingCommaExtraToNode(node) { - this.addExtra(node, "trailingComma", this.state.lastTokStart); + this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index); this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); } maybeAsyncOrAccessorProp(prop) { @@ -456361,9 +498001,7 @@ class ExpressionParser extends LValParser { let decorators = []; if (this.match(26)) { if (this.hasPlugin("decorators")) { - this.raise(Errors.UnsupportedPropertyDecorator, { - at: this.state.startLoc - }); + this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc); } while (this.match(26)) { decorators.push(this.parseDecorator()); @@ -456403,8 +498041,7 @@ class ExpressionParser extends LValParser { prop.kind = keyName; if (this.match(55)) { isGenerator = true; - this.raise(Errors.AccessorIsGenerator, { - at: this.state.curPosition(), + this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), { kind: keyName }); this.next(); @@ -456425,14 +498062,10 @@ class ExpressionParser extends LValParser { const paramCount = this.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); if (params.length !== paramCount) { - this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, { - at: method - }); + this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method); } if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { - this.raise(Errors.BadSetterRestParameter, { - at: method - }); + this.raise(Errors.BadSetterRestParameter, method); } } parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { @@ -456465,9 +498098,7 @@ class ExpressionParser extends LValParser { refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; } } else { - this.raise(Errors.InvalidCoverInitializedName, { - at: shorthandAssignLoc - }); + this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); } prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); } else { @@ -456497,19 +498128,19 @@ class ExpressionParser extends LValParser { key = this.parseIdentifier(true); } else { switch (type) { - case 132: + case 134: key = this.parseNumericLiteral(value); break; - case 131: + case 133: key = this.parseStringLiteral(value); break; - case 133: + case 135: key = this.parseBigIntLiteral(value); break; - case 134: + case 136: key = this.parseDecimalLiteral(value); break; - case 136: + case 138: { const privateKeyLoc = this.state.startLoc; if (refExpressionErrors != null) { @@ -456517,9 +498148,7 @@ class ExpressionParser extends LValParser { refExpressionErrors.privateKeyLoc = privateKeyLoc; } } else { - this.raise(Errors.UnexpectedPrivateField, { - at: privateKeyLoc - }); + this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); } key = this.parsePrivateName(); break; @@ -456529,7 +498158,7 @@ class ExpressionParser extends LValParser { } } prop.key = key; - if (type !== 136) { + if (type !== 138) { prop.computed = false; } } @@ -456543,7 +498172,7 @@ class ExpressionParser extends LValParser { parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { this.initFunction(node, isAsync); node.generator = isGenerator; - this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + this.scope.enter(2 | 16 | (inClassScope ? 64 : 0) | (allowDirectSuper ? 32 : 0)); this.prodParam.enter(functionFlags(isAsync, node.generator)); this.parseFunctionParams(node, isConstructor); const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); @@ -456564,10 +498193,10 @@ class ExpressionParser extends LValParser { return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); } parseArrowExpression(node, params, isAsync, trailingCommaLoc) { - this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); + this.scope.enter(2 | 4); let flags = functionFlags(isAsync, false); if (!this.match(5) && this.prodParam.hasIn) { - flags |= PARAM_IN; + flags |= 8; } this.prodParam.enter(flags); this.initFunction(node, isAsync); @@ -456601,18 +498230,16 @@ class ExpressionParser extends LValParser { const oldStrict = this.state.strict; const oldLabels = this.state.labels; this.state.labels = []; - this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN); + this.prodParam.enter(this.prodParam.currentFlags() | 4); node.body = this.parseBlock(true, false, hasStrictModeDirective => { const nonSimple = !this.isSimpleParamList(node.params); if (hasStrictModeDirective && nonSimple) { - this.raise(Errors.IllegalLanguageModeDirective, { - at: (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node - }); + this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node); } const strictModeChanged = !oldStrict && this.state.strict; this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); if (this.state.strict && node.id) { - this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged); + this.checkIdentifier(node.id, 65, strictModeChanged); } }); this.prodParam.exit(); @@ -456637,7 +498264,7 @@ class ExpressionParser extends LValParser { for (const param of node.params) { this.checkLVal(param, { in: formalParameters, - binding: BIND_VAR, + binding: 5, checkClashes, strictModeChanged }); @@ -456667,8 +498294,7 @@ class ExpressionParser extends LValParser { let elt; if (this.match(12)) { if (!allowEmpty) { - this.raise(Errors.UnexpectedToken, { - at: this.state.curPosition(), + this.raise(Errors.UnexpectedToken, this.state.curPosition(), { unexpected: "," }); } @@ -456679,9 +498305,7 @@ class ExpressionParser extends LValParser { } else if (this.match(17)) { this.expectPlugin("partialApplication"); if (!allowPlaceholder) { - this.raise(Errors.UnexpectedArgumentPlaceholder, { - at: this.state.startLoc - }); + this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc); } const node = this.startNode(); this.next(); @@ -456715,7 +498339,7 @@ class ExpressionParser extends LValParser { const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type); if (liberal) { if (tokenIsKeyword) { - this.replaceToken(130); + this.replaceToken(132); } } else { this.checkReservedWord(name, startLoc, tokenIsKeyword, false); @@ -456731,47 +498355,35 @@ class ExpressionParser extends LValParser { return; } if (checkKeywords && isKeyword(word)) { - this.raise(Errors.UnexpectedKeyword, { - at: startLoc, + this.raise(Errors.UnexpectedKeyword, startLoc, { keyword: word }); return; } const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; if (reservedTest(word, this.inModule)) { - this.raise(Errors.UnexpectedReservedWord, { - at: startLoc, + this.raise(Errors.UnexpectedReservedWord, startLoc, { reservedWord: word }); return; } else if (word === "yield") { if (this.prodParam.hasYield) { - this.raise(Errors.YieldBindingIdentifier, { - at: startLoc - }); + this.raise(Errors.YieldBindingIdentifier, startLoc); return; } } else if (word === "await") { if (this.prodParam.hasAwait) { - this.raise(Errors.AwaitBindingIdentifier, { - at: startLoc - }); + this.raise(Errors.AwaitBindingIdentifier, startLoc); return; } if (this.scope.inStaticBlock) { - this.raise(Errors.AwaitBindingIdentifierInStaticBlock, { - at: startLoc - }); + this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc); return; } - this.expressionScope.recordAsyncArrowParametersError({ - at: startLoc - }); + this.expressionScope.recordAsyncArrowParametersError(startLoc); } else if (word === "arguments") { if (this.scope.inClassAndNotInNonArrowFunction) { - this.raise(Errors.ArgumentsInClass, { - at: startLoc - }); + this.raise(Errors.ArgumentsInClass, startLoc); return; } } @@ -456785,13 +498397,9 @@ class ExpressionParser extends LValParser { } parseAwait(startLoc) { const node = this.startNodeAt(startLoc); - this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, { - at: node - }); + this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node); if (this.eat(55)) { - this.raise(Errors.ObsoleteAwaitStar, { - at: node - }); + this.raise(Errors.ObsoleteAwaitStar, node); } if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { if (this.isAmbiguousAwait()) { @@ -456810,13 +498418,11 @@ class ExpressionParser extends LValParser { const { type } = this.state; - return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 101 && !this.state.containsEsc || type === 135 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; + return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 137 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; } parseYield() { const node = this.startNode(); - this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, { - at: node - }); + this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node); this.next(); let delegating = false; let argument = null; @@ -456824,7 +498430,7 @@ class ExpressionParser extends LValParser { delegating = this.eat(55); switch (this.state.type) { case 13: - case 137: + case 139: case 8: case 11: case 3: @@ -456840,14 +498446,28 @@ class ExpressionParser extends LValParser { node.argument = argument; return this.finishNode(node, "YieldExpression"); } + parseImportCall(node) { + this.next(); + node.source = this.parseMaybeAssignAllowIn(); + if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { + node.options = null; + } + if (this.eat(12)) { + this.expectImportAttributesPlugin(); + if (!this.match(11)) { + node.options = this.parseMaybeAssignAllowIn(); + this.eat(12); + } + } + this.expect(11); + return this.finishNode(node, "ImportExpression"); + } checkPipelineAtInfixOperator(left, leftStartLoc) { if (this.hasPlugin(["pipelineOperator", { proposal: "smart" }])) { if (left.type === "SequenceExpression") { - this.raise(Errors.PipelineHeadSequenceExpression, { - at: leftStartLoc - }); + this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc); } } } @@ -456875,14 +498495,10 @@ class ExpressionParser extends LValParser { } checkSmartPipeTopicBodyEarlyErrors(startLoc) { if (this.match(19)) { - throw this.raise(Errors.PipelineBodyNoArrow, { - at: this.state.startLoc - }); + throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc); } if (!this.topicReferenceWasUsedInCurrentContext()) { - this.raise(Errors.PipelineTopicUnused, { - at: startLoc - }); + this.raise(Errors.PipelineTopicUnused, startLoc); } } withTopicBindingContext(callback) { @@ -456926,9 +498542,9 @@ class ExpressionParser extends LValParser { } allowInAnd(callback) { const flags = this.prodParam.currentFlags(); - const prodParamToSet = PARAM_IN & ~flags; + const prodParamToSet = 8 & ~flags; if (prodParamToSet) { - this.prodParam.enter(flags | PARAM_IN); + this.prodParam.enter(flags | 8); try { return callback(); } finally { @@ -456939,9 +498555,9 @@ class ExpressionParser extends LValParser { } disallowInAnd(callback) { const flags = this.prodParam.currentFlags(); - const prodParamToClear = PARAM_IN & flags; + const prodParamToClear = 8 & flags; if (prodParamToClear) { - this.prodParam.enter(flags & ~PARAM_IN); + this.prodParam.enter(flags & ~8); try { return callback(); } finally { @@ -456989,10 +498605,10 @@ class ExpressionParser extends LValParser { parsePropertyNamePrefixOperator(prop) {} } const loopLabel = { - kind: "loop" + kind: 1 }, switchLabel = { - kind: "switch" + kind: 2 }; const loneSurrogate = /[\uD800-\uDFFF]/u; const keywordRelationalOperator = /in(?:stanceof)?/y; @@ -457004,7 +498620,7 @@ function babel7CompatTokens(tokens, input) { } = token; if (typeof type === "number") { { - if (type === 136) { + if (type === 138) { const { loc, start, @@ -457021,7 +498637,7 @@ function babel7CompatTokens(tokens, input) { startLoc: loc.start, endLoc: hashEndLoc }), new Token({ - type: getExportedToken(130), + type: getExportedToken(132), value: value, start: hashEndPos, end: end, @@ -457106,26 +498722,25 @@ function babel7CompatTokens(tokens, input) { class StatementParser extends ExpressionParser { parseTopLevel(file, program) { file.program = this.parseProgram(program); - file.comments = this.state.comments; + file.comments = this.comments; if (this.options.tokens) { file.tokens = babel7CompatTokens(this.tokens, this.input); } return this.finishNode(file, "File"); } - parseProgram(program, end = 137, sourceType = this.options.sourceType) { + parseProgram(program, end = 139, sourceType = this.options.sourceType) { program.sourceType = sourceType; program.interpreter = this.parseInterpreterDirective(); this.parseBlockBody(program, true, true, end); if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { for (const [localName, at] of Array.from(this.scope.undefinedExports)) { - this.raise(Errors.ModuleExportUndefined, { - at, + this.raise(Errors.ModuleExportUndefined, at, { localName }); } } let finishedProgram; - if (end === 137) { + if (end === 139) { finishedProgram = this.finishNode(program, "Program"); } else { finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)); @@ -457157,7 +498772,7 @@ class StatementParser extends ExpressionParser { return this.finishNode(node, "InterpreterDirective"); } isLet() { - if (!this.isContextual(99)) { + if (!this.isContextual(100)) { return false; } return this.hasFollowingBindingAtom(); @@ -457186,20 +498801,35 @@ class StatementParser extends ExpressionParser { const nextCh = this.codePointAtPos(next); return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next); } - hasFollowingBindingIdentifier() { - const next = this.nextTokenStart(); + hasInLineFollowingBindingIdentifier() { + const next = this.nextTokenInLineStart(); const nextCh = this.codePointAtPos(next); return this.chStartsBindingIdentifier(nextCh, next); } startsUsingForOf() { - const lookahead = this.lookahead(); - if (lookahead.type === 101 && !lookahead.containsEsc) { + const { + type, + containsEsc + } = this.lookahead(); + if (type === 102 && !containsEsc) { return false; - } else { + } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) { this.expectPlugin("explicitResourceManagement"); return true; } } + startsAwaitUsing() { + let next = this.nextTokenInLineStart(); + if (this.isUnparsedContextual(next, "using")) { + next = this.nextTokenInLineStartSince(next + 5); + const nextCh = this.codePointAtPos(next); + if (this.chStartsBindingIdentifier(nextCh, next)) { + this.expectPlugin("explicitResourceManagement"); + return true; + } + } + return false; + } parseModuleItem() { return this.parseStatementLike(1 | 2 | 4 | 8); } @@ -457246,9 +498876,7 @@ class StatementParser extends ExpressionParser { case 68: if (this.lookaheadCharCode() === 46) break; if (!allowFunctionDeclaration) { - this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, { - at: this.state.startLoc - }); + this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc); } return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration); case 80: @@ -457264,22 +498892,29 @@ class StatementParser extends ExpressionParser { return this.parseThrowStatement(node); case 73: return this.parseTryStatement(node); - case 105: - if (this.hasFollowingLineBreak() || this.state.containsEsc || !this.hasFollowingBindingIdentifier()) { + case 96: + if (!this.state.containsEsc && this.startsAwaitUsing()) { + if (!this.isAwaitAllowed()) { + this.raise(Errors.AwaitUsingNotInAsyncContext, node); + } else if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, node); + } + this.next(); + return this.parseVarStatement(node, "await using"); + } + break; + case 107: + if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifier()) { break; } this.expectPlugin("explicitResourceManagement"); if (!this.scope.inModule && this.scope.inTopLevel) { - this.raise(Errors.UnexpectedUsingDeclaration, { - at: this.state.startLoc - }); + this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc); } else if (!allowDeclaration) { - this.raise(Errors.UnexpectedLexicalDeclaration, { - at: this.state.startLoc - }); + this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); } return this.parseVarStatement(node, "using"); - case 99: + case 100: { if (this.state.containsEsc) { break; @@ -457296,9 +498931,7 @@ class StatementParser extends ExpressionParser { case 75: { if (!allowDeclaration) { - this.raise(Errors.UnexpectedLexicalDeclaration, { - at: this.state.startLoc - }); + this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); } } case 74: @@ -457324,9 +498957,7 @@ class StatementParser extends ExpressionParser { case 82: { if (!this.options.allowImportExportEverywhere && !topLevel) { - this.raise(Errors.UnexpectedImportExport, { - at: this.state.startLoc - }); + this.raise(Errors.UnexpectedImportExport, this.state.startLoc); } this.next(); let result; @@ -457348,9 +498979,7 @@ class StatementParser extends ExpressionParser { { if (this.isAsyncFunction()) { if (!allowDeclaration) { - this.raise(Errors.AsyncFunctionInSingleStatementContext, { - at: this.state.startLoc - }); + this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc); } this.next(); return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration); @@ -457367,9 +498996,7 @@ class StatementParser extends ExpressionParser { } assertModuleNodeAllowed(node) { if (!this.options.allowImportExportEverywhere && !this.inModule) { - this.raise(Errors.ImportOutsideModule, { - at: node - }); + this.raise(Errors.ImportOutsideModule, node); } } decoratorsEnabledBeforeExport() { @@ -457380,9 +499007,7 @@ class StatementParser extends ExpressionParser { if (maybeDecorators) { if (classNode.decorators && classNode.decorators.length > 0) { if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") { - this.raise(Errors.DecoratorsBeforeAfterExport, { - at: classNode.decorators[0] - }); + this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]); } classNode.decorators.unshift(...maybeDecorators); } else { @@ -457406,14 +499031,10 @@ class StatementParser extends ExpressionParser { this.unexpected(); } if (!this.decoratorsEnabledBeforeExport()) { - this.raise(Errors.DecoratorExportClass, { - at: this.state.startLoc - }); + this.raise(Errors.DecoratorExportClass, this.state.startLoc); } } else if (!this.canHaveLeadingDecorator()) { - throw this.raise(Errors.UnexpectedLeadingDecorator, { - at: this.state.startLoc - }); + throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc); } return decorators; } @@ -457433,16 +499054,14 @@ class StatementParser extends ExpressionParser { const paramsStartLoc = this.state.startLoc; node.expression = this.parseMaybeDecoratorArguments(expr); if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) { - this.raise(Errors.DecoratorArgumentsOutsideParentheses, { - at: paramsStartLoc - }); + this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc); } } else { expr = this.parseIdentifier(false); while (this.eat(16)) { const node = this.startNodeAt(startLoc); node.object = expr; - if (this.match(136)) { + if (this.match(138)) { this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); } else { @@ -457484,14 +499103,15 @@ class StatementParser extends ExpressionParser { for (i = 0; i < this.state.labels.length; ++i) { const lab = this.state.labels[i]; if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break; + if (lab.kind != null && (isBreak || lab.kind === 1)) { + break; + } if (node.label && isBreak) break; } } if (i === this.state.labels.length) { const type = isBreak ? "BreakStatement" : "ContinueStatement"; - this.raise(Errors.IllegalBreakContinue, { - at: node, + this.raise(Errors.IllegalBreakContinue, node, { type }); } @@ -457524,7 +499144,7 @@ class StatementParser extends ExpressionParser { if (this.isAwaitAllowed() && this.eatContextual(96)) { awaitAt = this.state.lastTokStartLoc; } - this.scope.enter(SCOPE_OTHER); + this.scope.enter(0); this.expect(10); if (this.match(13)) { if (awaitAt !== null) { @@ -457532,43 +499152,49 @@ class StatementParser extends ExpressionParser { } return this.parseFor(node, null); } - const startsWithLet = this.isContextual(99); - const startsWithUsing = this.isContextual(105) && !this.hasFollowingLineBreak(); - const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || startsWithUsing && this.hasFollowingBindingIdentifier() && this.startsUsingForOf(); - if (this.match(74) || this.match(75) || isLetOrUsing) { - const initNode = this.startNode(); - const kind = this.state.value; - this.next(); - this.parseVar(initNode, true, kind); - const init = this.finishNode(initNode, "VariableDeclaration"); - const isForIn = this.match(58); - if (isForIn && startsWithUsing) { - this.raise(Errors.ForInUsing, { - at: init - }); - } - if ((isForIn || this.isContextual(101)) && init.declarations.length === 1) { - return this.parseForIn(node, init, awaitAt); - } - if (awaitAt !== null) { - this.unexpected(awaitAt); + const startsWithLet = this.isContextual(100); + { + const startsWithAwaitUsing = this.isContextual(96) && this.startsAwaitUsing(); + const starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(107) && this.startsUsingForOf(); + const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration; + if (this.match(74) || this.match(75) || isLetOrUsing) { + const initNode = this.startNode(); + let kind; + if (startsWithAwaitUsing) { + kind = "await using"; + if (!this.isAwaitAllowed()) { + this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc); + } + this.next(); + } else { + kind = this.state.value; + } + this.next(); + this.parseVar(initNode, true, kind); + const init = this.finishNode(initNode, "VariableDeclaration"); + const isForIn = this.match(58); + if (isForIn && starsWithUsingDeclaration) { + this.raise(Errors.ForInUsing, init); + } + if ((isForIn || this.isContextual(102)) && init.declarations.length === 1) { + return this.parseForIn(node, init, awaitAt); + } + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); } - return this.parseFor(node, init); } const startsWithAsync = this.isContextual(95); const refExpressionErrors = new ExpressionErrors(); const init = this.parseExpression(true, refExpressionErrors); - const isForOf = this.isContextual(101); + const isForOf = this.isContextual(102); if (isForOf) { if (startsWithLet) { - this.raise(Errors.ForOfLet, { - at: init - }); + this.raise(Errors.ForOfLet, init); } if (awaitAt === null && startsWithAsync && init.type === "Identifier") { - this.raise(Errors.ForOfAsync, { - at: init - }); + this.raise(Errors.ForOfAsync, init); } } if (isForOf || this.match(58)) { @@ -457602,9 +499228,7 @@ class StatementParser extends ExpressionParser { } parseReturnStatement(node) { if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { - this.raise(Errors.IllegalReturn, { - at: this.state.startLoc - }); + this.raise(Errors.IllegalReturn, this.state.startLoc); } this.next(); if (this.isLineTerminator()) { @@ -457621,7 +499245,7 @@ class StatementParser extends ExpressionParser { const cases = node.cases = []; this.expect(5); this.state.labels.push(switchLabel); - this.scope.enter(SCOPE_OTHER); + this.scope.enter(0); let cur; for (let sawDefault; !this.match(8);) { if (this.match(61) || this.match(65)) { @@ -457634,9 +499258,7 @@ class StatementParser extends ExpressionParser { cur.test = this.parseExpression(); } else { if (sawDefault) { - this.raise(Errors.MultipleDefaultsInSwitch, { - at: this.state.lastTokStartLoc - }); + this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc); } sawDefault = true; cur.test = null; @@ -457659,9 +499281,7 @@ class StatementParser extends ExpressionParser { parseThrowStatement(node) { this.next(); if (this.hasPrecedingLineBreak()) { - this.raise(Errors.NewlineAfterThrow, { - at: this.state.lastTokEndLoc - }); + this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc); } node.argument = this.parseExpression(); this.semicolon(); @@ -457669,12 +499289,12 @@ class StatementParser extends ExpressionParser { } parseCatchClauseParam() { const param = this.parseBindingAtom(); - this.scope.enter(this.options.annexB && param.type === "Identifier" ? SCOPE_SIMPLE_CATCH : 0); + this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0); this.checkLVal(param, { in: { type: "CatchClause" }, - binding: BIND_CATCH_PARAM + binding: 9 }); return param; } @@ -457691,7 +499311,7 @@ class StatementParser extends ExpressionParser { this.expect(11); } else { clause.param = null; - this.scope.enter(SCOPE_OTHER); + this.scope.enter(0); } clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); this.scope.exit(); @@ -457699,9 +499319,7 @@ class StatementParser extends ExpressionParser { } node.finalizer = this.eat(67) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { - this.raise(Errors.NoCatchOrFinally, { - at: node - }); + this.raise(Errors.NoCatchOrFinally, node); } return this.finishNode(node, "TryStatement"); } @@ -457721,9 +499339,7 @@ class StatementParser extends ExpressionParser { } parseWithStatement(node) { if (this.state.strict) { - this.raise(Errors.StrictWith, { - at: this.state.startLoc - }); + this.raise(Errors.StrictWith, this.state.startLoc); } this.next(); node.object = this.parseHeaderExpression(); @@ -457737,13 +499353,12 @@ class StatementParser extends ExpressionParser { parseLabeledStatement(node, maybeName, expr, flags) { for (const label of this.state.labels) { if (label.name === maybeName) { - this.raise(Errors.LabelRedeclaration, { - at: expr, + this.raise(Errors.LabelRedeclaration, expr, { labelName: maybeName }); } } - const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(71) ? "switch" : null; + const kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null; for (let i = this.state.labels.length - 1; i >= 0; i--) { const label = this.state.labels[i]; if (label.statementStart === node.start) { @@ -457775,7 +499390,7 @@ class StatementParser extends ExpressionParser { } this.expect(5); if (createNewLexicalScope) { - this.scope.enter(SCOPE_OTHER); + this.scope.enter(0); } this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); if (createNewLexicalScope) { @@ -457812,9 +499427,7 @@ class StatementParser extends ExpressionParser { } body.push(stmt); } - if (afterBlockParse) { - afterBlockParse.call(this, hasStrictModeDirective); - } + afterBlockParse == null || afterBlockParse.call(this, hasStrictModeDirective); if (!oldStrict) { this.setStrict(false); } @@ -457841,14 +499454,12 @@ class StatementParser extends ExpressionParser { node.await = awaitAt !== null; } if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { - this.raise(Errors.ForInOfLoopInitializer, { - at: init, + this.raise(Errors.ForInOfLoopInitializer, init, { type: isForIn ? "ForInStatement" : "ForOfStatement" }); } if (init.type === "AssignmentPattern") { - this.raise(Errors.InvalidLhs, { - at: init, + this.raise(Errors.InvalidLhs, init, { ancestor: { type: "ForStatement" } @@ -457870,14 +499481,12 @@ class StatementParser extends ExpressionParser { this.parseVarId(decl, kind); decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); if (decl.init === null && !allowMissingInitializer) { - if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(101)))) { - this.raise(Errors.DeclarationMissingInitializer, { - at: this.state.lastTokEndLoc, + if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) { + this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { kind: "destructuring" }); - } else if (kind === "const" && !(this.match(58) || this.isContextual(101))) { - this.raise(Errors.DeclarationMissingInitializer, { - at: this.state.lastTokEndLoc, + } else if (kind === "const" && !(this.match(58) || this.isContextual(102))) { + this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { kind: "const" }); } @@ -457888,17 +499497,12 @@ class StatementParser extends ExpressionParser { return node; } parseVarId(decl, kind) { - if (kind === "using" && !this.inModule && this.match(96)) { - this.raise(Errors.AwaitInUsingBinding, { - at: this.state.startLoc - }); - } const id = this.parseBindingAtom(); this.checkLVal(id, { in: { type: "VariableDeclarator" }, - binding: kind === "var" ? BIND_VAR : BIND_LEXICAL + binding: kind === "var" ? 5 : 8201 }); decl.id = id; } @@ -457913,9 +499517,7 @@ class StatementParser extends ExpressionParser { this.initFunction(node, isAsync); if (this.match(55)) { if (hangingDeclaration) { - this.raise(Errors.GeneratorInSingleStatementContext, { - at: this.state.startLoc - }); + this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc); } this.next(); node.generator = true; @@ -457925,7 +499527,7 @@ class StatementParser extends ExpressionParser { } const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = false; - this.scope.enter(SCOPE_FUNCTION); + this.scope.enter(2); this.prodParam.enter(functionFlags(isAsync, node.generator)); if (!isDeclaration) { node.id = this.parseFunctionId(); @@ -457953,7 +499555,7 @@ class StatementParser extends ExpressionParser { } registerFunctionStatementId(node) { if (!node.id) return; - this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.loc.start); + this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.loc.start); } parseClass(node, isStatement, optionalId) { this.next(); @@ -457987,9 +499589,7 @@ class StatementParser extends ExpressionParser { while (!this.match(8)) { if (this.eat(13)) { if (decorators.length > 0) { - throw this.raise(Errors.DecoratorSemicolon, { - at: this.state.lastTokEndLoc - }); + throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc); } continue; } @@ -458005,18 +499605,14 @@ class StatementParser extends ExpressionParser { } this.parseClassMember(classBody, member, state); if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { - this.raise(Errors.DecoratorConstructor, { - at: member - }); + this.raise(Errors.DecoratorConstructor, member); } } }); this.state.strict = oldStrict; this.next(); if (decorators.length) { - throw this.raise(Errors.TrailingDecorator, { - at: this.state.startLoc - }); + throw this.raise(Errors.TrailingDecorator, this.state.startLoc); } this.classScope.exit(); return this.finishNode(classBody, "ClassBody"); @@ -458043,7 +499639,7 @@ class StatementParser extends ExpressionParser { return false; } parseClassMember(classBody, member, state) { - const isStatic = this.isContextual(104); + const isStatic = this.isContextual(106); if (isStatic) { if (this.parseClassMemberFromModifier(classBody, member)) { return; @@ -458067,22 +499663,20 @@ class StatementParser extends ExpressionParser { this.parsePropertyNamePrefixOperator(member); if (this.eat(55)) { method.kind = "method"; - const isPrivateName = this.match(136); + const isPrivateName = this.match(138); this.parseClassElementName(method); if (isPrivateName) { this.pushClassPrivateMethod(classBody, privateMethod, true, false); return; } if (this.isNonstaticConstructor(publicMethod)) { - this.raise(Errors.ConstructorIsGenerator, { - at: publicMethod.key - }); + this.raise(Errors.ConstructorIsGenerator, publicMethod.key); } this.pushClassMethod(classBody, publicMethod, true, false, false, false); return; } const isContextual = tokenIsIdentifier(this.state.type) && !this.state.containsEsc; - const isPrivate = this.match(136); + const isPrivate = this.match(138); const key = this.parseClassElementName(member); const maybeQuestionTokenStartLoc = this.state.startLoc; this.parsePostMemberNameModifiers(publicMember); @@ -458097,14 +499691,10 @@ class StatementParser extends ExpressionParser { if (isConstructor) { publicMethod.kind = "constructor"; if (state.hadConstructor && !this.hasPlugin("typescript")) { - this.raise(Errors.DuplicateConstructor, { - at: key - }); + this.raise(Errors.DuplicateConstructor, key); } if (isConstructor && this.hasPlugin("typescript") && member.override) { - this.raise(Errors.OverrideOnConstructor, { - at: key - }); + this.raise(Errors.OverrideOnConstructor, key); } state.hadConstructor = true; allowsDirectSuper = state.hadSuperClass; @@ -458123,31 +499713,27 @@ class StatementParser extends ExpressionParser { this.unexpected(maybeQuestionTokenStartLoc); } method.kind = "method"; - const isPrivate = this.match(136); + const isPrivate = this.match(138); this.parseClassElementName(method); this.parsePostMemberNameModifiers(publicMember); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); } else { if (this.isNonstaticConstructor(publicMethod)) { - this.raise(Errors.ConstructorIsAsync, { - at: publicMethod.key - }); + this.raise(Errors.ConstructorIsAsync, publicMethod.key); } this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); } } else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(55) && this.isLineTerminator())) { this.resetPreviousNodeTrailingComments(key); method.kind = key.name; - const isPrivate = this.match(136); + const isPrivate = this.match(138); this.parseClassElementName(publicMethod); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, false, false); } else { if (this.isNonstaticConstructor(publicMethod)) { - this.raise(Errors.ConstructorIsAccessor, { - at: publicMethod.key - }); + this.raise(Errors.ConstructorIsAccessor, publicMethod.key); } this.pushClassMethod(classBody, publicMethod, false, false, false, false); } @@ -458155,7 +499741,7 @@ class StatementParser extends ExpressionParser { } else if (isContextual && key.name === "accessor" && !this.isLineTerminator()) { this.expectPlugin("decoratorAutoAccessors"); this.resetPreviousNodeTrailingComments(key); - const isPrivate = this.match(136); + const isPrivate = this.match(138); this.parseClassElementName(publicProp); this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); } else if (this.isLineTerminator()) { @@ -458173,16 +499759,12 @@ class StatementParser extends ExpressionParser { type, value } = this.state; - if ((type === 130 || type === 131) && member.static && value === "prototype") { - this.raise(Errors.StaticPrototype, { - at: this.state.startLoc - }); + if ((type === 132 || type === 133) && member.static && value === "prototype") { + this.raise(Errors.StaticPrototype, this.state.startLoc); } - if (type === 136) { + if (type === 138) { if (value === "constructor") { - this.raise(Errors.ConstructorClassPrivateField, { - at: this.state.startLoc - }); + this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc); } const key = this.parsePrivateName(); member.key = key; @@ -458192,10 +499774,10 @@ class StatementParser extends ExpressionParser { } parseClassStaticBlock(classBody, member) { var _member$decorators; - this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER); + this.scope.enter(64 | 128 | 16); const oldLabels = this.state.labels; this.state.labels = []; - this.prodParam.enter(PARAM); + this.prodParam.enter(0); const body = member.body = []; this.parseBlockOrModuleBlockBody(body, undefined, false, 8); this.prodParam.exit(); @@ -458203,37 +499785,31 @@ class StatementParser extends ExpressionParser { this.state.labels = oldLabels; classBody.body.push(this.finishNode(member, "StaticBlock")); if ((_member$decorators = member.decorators) != null && _member$decorators.length) { - this.raise(Errors.DecoratorStaticBlock, { - at: member - }); + this.raise(Errors.DecoratorStaticBlock, member); } } pushClassProperty(classBody, prop) { if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) { - this.raise(Errors.ConstructorClassField, { - at: prop.key - }); + this.raise(Errors.ConstructorClassField, prop.key); } classBody.body.push(this.parseClassProperty(prop)); } pushClassPrivateProperty(classBody, prop) { const node = this.parseClassPrivateProperty(prop); classBody.body.push(node); - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start); + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); } pushClassAccessorProperty(classBody, prop, isPrivate) { if (!isPrivate && !prop.computed) { const key = prop.key; if (key.name === "constructor" || key.value === "constructor") { - this.raise(Errors.ConstructorClassField, { - at: key - }); + this.raise(Errors.ConstructorClassField, key); } } const node = this.parseClassAccessorProperty(prop); classBody.body.push(node); if (isPrivate) { - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start); + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); } } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { @@ -458242,7 +499818,7 @@ class StatementParser extends ExpressionParser { pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); classBody.body.push(node); - const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER; + const kind = node.kind === "get" ? node.static ? 6 : 2 : node.kind === "set" ? node.static ? 5 : 1 : 0; this.declareClassPrivateMethodInScope(node, kind); } declareClassPrivateMethodInScope(node, kind) { @@ -458265,15 +499841,15 @@ class StatementParser extends ExpressionParser { return this.finishNode(node, "ClassAccessorProperty"); } parseInitializer(node) { - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); + this.scope.enter(64 | 16); this.expressionScope.enter(newExpressionScope()); - this.prodParam.enter(PARAM); + this.prodParam.enter(0); node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; this.expressionScope.exit(); this.prodParam.exit(); this.scope.exit(); } - parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) { + parseClassId(node, isStatement, optionalId, bindingType = 8331) { if (tokenIsIdentifier(this.state.type)) { node.id = this.parseIdentifier(); if (isStatement) { @@ -458283,9 +499859,7 @@ class StatementParser extends ExpressionParser { if (optionalId || !isStatement) { node.id = null; } else { - throw this.raise(Errors.MissingClassName, { - at: this.state.startLoc - }); + throw this.raise(Errors.MissingClassName, this.state.startLoc); } } } @@ -458293,7 +499867,8 @@ class StatementParser extends ExpressionParser { node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; } parseExport(node, decorators) { - const hasDefault = this.maybeParseExportDefaultSpecifier(node); + const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true); + const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); const parseAfterDefault = !hasDefault || this.eat(12); const hasStar = parseAfterDefault && this.eatExportStar(node); const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); @@ -458302,9 +499877,7 @@ class StatementParser extends ExpressionParser { if (hasStar && !hasNamespace) { if (hasDefault) this.unexpected(); if (decorators) { - throw this.raise(Errors.UnsupportedDecoratorExport, { - at: node - }); + throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.parseExportFrom(node, true); return this.finishNode(node, "ExportAllDeclaration"); @@ -458314,15 +499887,13 @@ class StatementParser extends ExpressionParser { this.unexpected(null, 5); } if (hasNamespace && parseAfterNamespace) { - this.unexpected(null, 97); + this.unexpected(null, 98); } let hasDeclaration; if (isFromRequired || hasSpecifiers) { hasDeclaration = false; if (decorators) { - throw this.raise(Errors.UnsupportedDecoratorExport, { - at: node - }); + throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.parseExportFrom(node, isFromRequired); } else { @@ -458335,9 +499906,7 @@ class StatementParser extends ExpressionParser { if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") { this.maybeTakeDecorators(decorators, node2.declaration, node2); } else if (decorators) { - throw this.raise(Errors.UnsupportedDecoratorExport, { - at: node - }); + throw this.raise(Errors.UnsupportedDecoratorExport, node); } return this.finishNode(node2, "ExportNamedDeclaration"); } @@ -458348,9 +499917,7 @@ class StatementParser extends ExpressionParser { if (decl.type === "ClassDeclaration") { this.maybeTakeDecorators(decorators, decl, node2); } else if (decorators) { - throw this.raise(Errors.UnsupportedDecoratorExport, { - at: node - }); + throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.checkExport(node2, true, true); return this.finishNode(node2, "ExportDefaultDeclaration"); @@ -458360,11 +499927,12 @@ class StatementParser extends ExpressionParser { eatExportStar(node) { return this.eat(55); } - maybeParseExportDefaultSpecifier(node) { - if (this.isExportDefaultSpecifier()) { - this.expectPlugin("exportDefaultFrom"); - const specifier = this.startNode(); - specifier.exported = this.parseIdentifier(true); + maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { + if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) { + this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start); + const id = maybeDefaultIdentifier || this.parseIdentifier(true); + const specifier = this.startNodeAtNode(id); + specifier.exported = id; node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; return true; } @@ -458409,8 +499977,8 @@ class StatementParser extends ExpressionParser { } isAsyncFunction() { if (!this.isContextual(95)) return false; - const next = this.nextTokenStart(); - return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function"); + const next = this.nextTokenInLineStart(); + return this.isUnparsedContextual(next, "function"); } parseExportDefaultExpression() { const expr = this.startNode(); @@ -458427,16 +499995,12 @@ class StatementParser extends ExpressionParser { } if (this.match(26)) { if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { - this.raise(Errors.DecoratorBeforeExport, { - at: this.state.startLoc - }); + this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); } return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); } if (this.match(75) || this.match(74) || this.isLet()) { - throw this.raise(Errors.UnsupportedDefaultExport, { - at: this.state.startLoc - }); + throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc); } const res = this.parseMaybeAssignAllowIn(); this.semicolon(); @@ -458454,14 +500018,14 @@ class StatementParser extends ExpressionParser { type } = this.state; if (tokenIsIdentifier(type)) { - if (type === 95 && !this.state.containsEsc || type === 99) { + if (type === 95 && !this.state.containsEsc || type === 100) { return false; } - if ((type === 128 || type === 127) && !this.state.containsEsc) { + if ((type === 130 || type === 129) && !this.state.containsEsc) { const { type: nextType } = this.lookahead(); - if (tokenIsIdentifier(nextType) && nextType !== 97 || nextType === 5) { + if (tokenIsIdentifier(nextType) && nextType !== 98 || nextType === 5) { this.expectOnePlugin(["flow", "typescript"]); return false; } @@ -458481,14 +500045,11 @@ class StatementParser extends ExpressionParser { return false; } parseExportFrom(node, expect) { - if (this.eatContextual(97)) { + if (this.eatContextual(98)) { node.source = this.parseImportSource(); this.checkExport(node); - const assertions = this.maybeParseImportAssertions(); - if (assertions) { - node.assertions = assertions; - this.checkJSONModuleImport(node); - } + this.maybeParseImportAttributes(node); + this.checkJSONModuleImport(node); } else if (expect) { this.unexpected(); } @@ -458502,9 +500063,7 @@ class StatementParser extends ExpressionParser { this.expectOnePlugin(["decorators", "decorators-legacy"]); if (this.hasPlugin("decorators")) { if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { - this.raise(Errors.DecoratorBeforeExport, { - at: this.state.startLoc - }); + this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); } return true; } @@ -458513,18 +500072,17 @@ class StatementParser extends ExpressionParser { } checkExport(node, checkNames, isDefault, isFrom) { if (checkNames) { + var _node$specifiers; if (isDefault) { this.checkDuplicateExports(node, "default"); if (this.hasPlugin("exportDefaultFrom")) { var _declaration$extra; const declaration = node.declaration; if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { - this.raise(Errors.ExportDefaultFromAsIdentifier, { - at: declaration - }); + this.raise(Errors.ExportDefaultFromAsIdentifier, declaration); } } - } else if (node.specifiers && node.specifiers.length) { + } else if ((_node$specifiers = node.specifiers) != null && _node$specifiers.length) { for (const specifier of node.specifiers) { const { exported @@ -458536,8 +500094,7 @@ class StatementParser extends ExpressionParser { local } = specifier; if (local.type !== "Identifier") { - this.raise(Errors.ExportBindingIsString, { - at: specifier, + this.raise(Errors.ExportBindingIsString, specifier, { localName: local.value, exportName }); @@ -458584,12 +500141,9 @@ class StatementParser extends ExpressionParser { checkDuplicateExports(node, exportName) { if (this.exportedIdentifiers.has(exportName)) { if (exportName === "default") { - this.raise(Errors.DuplicateDefaultExport, { - at: node - }); + this.raise(Errors.DuplicateDefaultExport, node); } else { - this.raise(Errors.DuplicateExport, { - at: node, + this.raise(Errors.DuplicateExport, node, { exportName }); } @@ -458607,8 +500161,8 @@ class StatementParser extends ExpressionParser { this.expect(12); if (this.eat(8)) break; } - const isMaybeTypeOnly = this.isContextual(128); - const isString = this.match(131); + const isMaybeTypeOnly = this.isContextual(130); + const isString = this.match(133); const node = this.startNode(); node.local = this.parseModuleExportName(); nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); @@ -458626,12 +500180,11 @@ class StatementParser extends ExpressionParser { return this.finishNode(node, "ExportSpecifier"); } parseModuleExportName() { - if (this.match(131)) { + if (this.match(133)) { const result = this.parseStringLiteral(this.state.value); const surrogate = result.value.match(loneSurrogate); if (surrogate) { - this.raise(Errors.ModuleExportNameHasLoneSurrogate, { - at: result, + this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, { surrogateCharCode: surrogate[0].charCodeAt(0) }); } @@ -458651,17 +500204,25 @@ class StatementParser extends ExpressionParser { return false; } checkImportReflection(node) { - if (node.module) { + const { + specifiers + } = node; + const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null; + if (node.phase === "source") { + if (singleBindingType !== "ImportDefaultSpecifier") { + this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start); + } + } else if (node.phase === "defer") { + if (singleBindingType !== "ImportNamespaceSpecifier") { + this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start); + } + } else if (node.module) { var _node$assertions; - if (node.specifiers.length !== 1 || node.specifiers[0].type !== "ImportDefaultSpecifier") { - this.raise(Errors.ImportReflectionNotBinding, { - at: node.specifiers[0].loc.start - }); + if (singleBindingType !== "ImportDefaultSpecifier") { + this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start); } if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) { - this.raise(Errors.ImportReflectionHasAssertion, { - at: node.specifiers[0].loc.start - }); + this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start); } } } @@ -458683,76 +500244,94 @@ class StatementParser extends ExpressionParser { } }); if (nonDefaultNamedSpecifier !== undefined) { - this.raise(Errors.ImportJSONBindingNotDefault, { - at: nonDefaultNamedSpecifier.loc.start - }); + this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start); } } } } - parseMaybeImportReflection(node) { - let isImportReflection = false; - if (this.isContextual(125)) { - const lookahead = this.lookahead(); - const nextType = lookahead.type; - if (tokenIsIdentifier(nextType)) { - if (nextType !== 97) { - isImportReflection = true; - } else { - const nextNextTokenFirstChar = this.input.charCodeAt(this.nextTokenStartSince(lookahead.end)); - if (nextNextTokenFirstChar === 102) { - isImportReflection = true; - } - } - } else if (nextType !== 12) { - isImportReflection = true; - } + isPotentialImportPhase(isExport) { + if (isExport) return false; + return this.isContextual(105) || this.isContextual(97) || this.isContextual(127); + } + applyImportPhase(node, isExport, phase, loc) { + if (isExport) { + return; } - if (isImportReflection) { - this.expectPlugin("importReflection"); - this.next(); + if (phase === "module") { + this.expectPlugin("importReflection", loc); node.module = true; } else if (this.hasPlugin("importReflection")) { node.module = false; } + if (phase === "source") { + this.expectPlugin("sourcePhaseImports", loc); + node.phase = "source"; + } else if (phase === "defer") { + this.expectPlugin("deferredImportEvaluation", loc); + node.phase = "defer"; + } else if (this.hasPlugin("sourcePhaseImports")) { + node.phase = null; + } } - parseImport(node) { - node.specifiers = []; - if (!this.match(131)) { - this.parseMaybeImportReflection(node); - const hasDefault = this.maybeParseDefaultImportSpecifier(node); - const parseNext = !hasDefault || this.eat(12); - const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); - if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); - this.expectContextual(97); + parseMaybeImportPhase(node, isExport) { + if (!this.isPotentialImportPhase(isExport)) { + this.applyImportPhase(node, isExport, null); + return null; } - node.source = this.parseImportSource(); - const assertions = this.maybeParseImportAssertions(); - if (assertions) { - node.assertions = assertions; + const phaseIdentifier = this.parseIdentifier(true); + const { + type + } = this.state; + const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; + if (isImportPhase) { + this.resetPreviousIdentifierLeadingComments(phaseIdentifier); + this.applyImportPhase(node, isExport, phaseIdentifier.name, phaseIdentifier.loc.start); + return null; } else { - const attributes = this.maybeParseModuleAttributes(); - if (attributes) { - node.attributes = attributes; - } + this.applyImportPhase(node, isExport, null); + return phaseIdentifier; + } + } + isPrecedingIdImportPhase(phase) { + const { + type + } = this.state; + return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; + } + parseImport(node) { + if (this.match(133)) { + return this.parseImportSourceAndAttributes(node); } + return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false)); + } + parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) { + node.specifiers = []; + const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier); + const parseNext = !hasDefault || this.eat(12); + const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); + if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); + this.expectContextual(98); + return this.parseImportSourceAndAttributes(node); + } + parseImportSourceAndAttributes(node) { + var _node$specifiers2; + (_node$specifiers2 = node.specifiers) != null ? _node$specifiers2 : node.specifiers = []; + node.source = this.parseImportSource(); + this.maybeParseImportAttributes(node); this.checkImportReflection(node); this.checkJSONModuleImport(node); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } parseImportSource() { - if (!this.match(131)) this.unexpected(); + if (!this.match(133)) this.unexpected(); return this.parseExprAtom(); } - shouldParseDefaultImport(node) { - return tokenIsIdentifier(this.state.type); - } parseImportSpecifierLocal(node, specifier, type) { specifier.local = this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } - finishImportSpecifier(specifier, type, bindingType = BIND_LEXICAL) { + finishImportSpecifier(specifier, type, bindingType = 8201) { this.checkLVal(specifier.local, { in: { type @@ -458761,7 +500340,8 @@ class StatementParser extends ExpressionParser { }); return this.finishNode(specifier, type); } - parseAssertEntries() { + parseImportAttributes() { + this.expect(5); const attrs = []; const attrNames = new Set(); do { @@ -458771,80 +500351,98 @@ class StatementParser extends ExpressionParser { const node = this.startNode(); const keyName = this.state.value; if (attrNames.has(keyName)) { - this.raise(Errors.ModuleAttributesWithDuplicateKeys, { - at: this.state.startLoc, + this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, { key: keyName }); } attrNames.add(keyName); - if (this.match(131)) { + if (this.match(133)) { node.key = this.parseStringLiteral(keyName); } else { node.key = this.parseIdentifier(true); } this.expect(14); - if (!this.match(131)) { - throw this.raise(Errors.ModuleAttributeInvalidValue, { - at: this.state.startLoc - }); + if (!this.match(133)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); } node.value = this.parseStringLiteral(this.state.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); + this.expect(8); return attrs; } - maybeParseModuleAttributes() { - if (this.match(76) && !this.hasPrecedingLineBreak()) { - this.expectPlugin("moduleAttributes"); - this.next(); - } else { - if (this.hasPlugin("moduleAttributes")) return []; - return null; - } + parseModuleAttributes() { const attrs = []; const attributes = new Set(); do { const node = this.startNode(); node.key = this.parseIdentifier(true); if (node.key.name !== "type") { - this.raise(Errors.ModuleAttributeDifferentFromType, { - at: node.key - }); + this.raise(Errors.ModuleAttributeDifferentFromType, node.key); } if (attributes.has(node.key.name)) { - this.raise(Errors.ModuleAttributesWithDuplicateKeys, { - at: node.key, + this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, { key: node.key.name }); } attributes.add(node.key.name); this.expect(14); - if (!this.match(131)) { - throw this.raise(Errors.ModuleAttributeInvalidValue, { - at: this.state.startLoc - }); + if (!this.match(133)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); } node.value = this.parseStringLiteral(this.state.value); - this.finishNode(node, "ImportAttribute"); - attrs.push(node); + attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); return attrs; } - maybeParseImportAssertions() { - if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { - this.expectPlugin("importAssertions"); + maybeParseImportAttributes(node) { + let attributes; + let useWith = false; + if (this.match(76)) { + if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) { + return; + } + this.next(); + { + if (this.hasPlugin("moduleAttributes")) { + attributes = this.parseModuleAttributes(); + } else { + this.expectImportAttributesPlugin(); + attributes = this.parseImportAttributes(); + } + } + useWith = true; + } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { + if (this.hasPlugin("importAttributes")) { + if (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== true) { + this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc); + } + this.addExtra(node, "deprecatedAssertSyntax", true); + } else { + this.expectOnePlugin(["importAttributes", "importAssertions"]); + } this.next(); + attributes = this.parseImportAttributes(); + } else if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { + attributes = []; } else { - if (this.hasPlugin("importAssertions")) return []; - return null; + if (this.hasPlugin("moduleAttributes")) { + attributes = []; + } else return; + } + if (!useWith && this.hasPlugin("importAssertions")) { + node.assertions = attributes; + } else { + node.attributes = attributes; } - this.eat(5); - const attrs = this.parseAssertEntries(); - this.eat(8); - return attrs; } - maybeParseDefaultImportSpecifier(node) { - if (this.shouldParseDefaultImport(node)) { + maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) { + if (maybeDefaultIdentifier) { + const specifier = this.startNodeAtNode(maybeDefaultIdentifier); + specifier.local = maybeDefaultIdentifier; + node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier")); + return true; + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); return true; } @@ -458868,16 +500466,14 @@ class StatementParser extends ExpressionParser { first = false; } else { if (this.eat(14)) { - throw this.raise(Errors.DestructureNamedImport, { - at: this.state.startLoc - }); + throw this.raise(Errors.DestructureNamedImport, this.state.startLoc); } this.expect(12); if (this.eat(8)) break; } const specifier = this.startNode(); - const importedIsString = this.match(131); - const isMaybeTypeOnly = this.isContextual(128); + const importedIsString = this.match(133); + const isMaybeTypeOnly = this.isContextual(130); specifier.imported = this.parseModuleExportName(); const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined); node.specifiers.push(importSpecifier); @@ -458891,8 +500487,7 @@ class StatementParser extends ExpressionParser { imported } = specifier; if (importedIsString) { - throw this.raise(Errors.ImportBindingIsString, { - at: specifier, + throw this.raise(Errors.ImportBindingIsString, specifier, { importName: imported.value }); } @@ -458927,6 +500522,7 @@ class Parser extends StatementParser { file.errors = null; this.parseTopLevel(file, program); file.errors = this.state.errors; + file.comments.length = this.state.commentsLen; return file; } } @@ -459012,13 +500608,1638 @@ exports.tokTypes = tokTypes; //# sourceMappingURL=index.js.map +/***/ }), + +/***/ 92960: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const WritableStream = (__nccwpck_require__(84492).Writable) +const inherits = (__nccwpck_require__(47261).inherits) + +const StreamSearch = __nccwpck_require__(51142) + +const PartStream = __nccwpck_require__(81620) +const HeaderParser = __nccwpck_require__(92032) + +const DASH = 45 +const B_ONEDASH = Buffer.from('-') +const B_CRLF = Buffer.from('\r\n') +const EMPTY_FN = function () {} + +function Dicer (cfg) { + if (!(this instanceof Dicer)) { return new Dicer(cfg) } + WritableStream.call(this, cfg) + + if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') } + + if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined } + + this._headerFirst = cfg.headerFirst + + this._dashes = 0 + this._parts = 0 + this._finished = false + this._realFinish = false + this._isPreamble = true + this._justMatched = false + this._firstWrite = true + this._inHeader = true + this._part = undefined + this._cb = undefined + this._ignoreData = false + this._partOpts = { highWaterMark: cfg.partHwm } + this._pause = false + + const self = this + this._hparser = new HeaderParser(cfg) + this._hparser.on('header', function (header) { + self._inHeader = false + self._part.emit('header', header) + }) +} +inherits(Dicer, WritableStream) + +Dicer.prototype.emit = function (ev) { + if (ev === 'finish' && !this._realFinish) { + if (!this._finished) { + const self = this + process.nextTick(function () { + self.emit('error', new Error('Unexpected end of multipart data')) + if (self._part && !self._ignoreData) { + const type = (self._isPreamble ? 'Preamble' : 'Part') + self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data')) + self._part.push(null) + process.nextTick(function () { + self._realFinish = true + self.emit('finish') + self._realFinish = false + }) + return + } + self._realFinish = true + self.emit('finish') + self._realFinish = false + }) + } + } else { WritableStream.prototype.emit.apply(this, arguments) } +} + +Dicer.prototype._write = function (data, encoding, cb) { + // ignore unexpected data (e.g. extra trailer data after finished) + if (!this._hparser && !this._bparser) { return cb() } + + if (this._headerFirst && this._isPreamble) { + if (!this._part) { + this._part = new PartStream(this._partOpts) + if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() } + } + const r = this._hparser.push(data) + if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } + } + + // allows for "easier" testing + if (this._firstWrite) { + this._bparser.push(B_CRLF) + this._firstWrite = false + } + + this._bparser.push(data) + + if (this._pause) { this._cb = cb } else { cb() } +} + +Dicer.prototype.reset = function () { + this._part = undefined + this._bparser = undefined + this._hparser = undefined +} + +Dicer.prototype.setBoundary = function (boundary) { + const self = this + this._bparser = new StreamSearch('\r\n--' + boundary) + this._bparser.on('info', function (isMatch, data, start, end) { + self._oninfo(isMatch, data, start, end) + }) +} + +Dicer.prototype._ignore = function () { + if (this._part && !this._ignoreData) { + this._ignoreData = true + this._part.on('error', EMPTY_FN) + // we must perform some kind of read on the stream even though we are + // ignoring the data, otherwise node's Readable stream will not emit 'end' + // after pushing null to the stream + this._part.resume() + } +} + +Dicer.prototype._oninfo = function (isMatch, data, start, end) { + let buf; const self = this; let i = 0; let r; let shouldWriteMore = true + + if (!this._part && this._justMatched && data) { + while (this._dashes < 2 && (start + i) < end) { + if (data[start + i] === DASH) { + ++i + ++this._dashes + } else { + if (this._dashes) { buf = B_ONEDASH } + this._dashes = 0 + break + } + } + if (this._dashes === 2) { + if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) } + this.reset() + this._finished = true + // no more parts will be added + if (self._parts === 0) { + self._realFinish = true + self.emit('finish') + self._realFinish = false + } + } + if (this._dashes) { return } + } + if (this._justMatched) { this._justMatched = false } + if (!this._part) { + this._part = new PartStream(this._partOpts) + this._part._read = function (n) { + self._unpause() + } + if (this._isPreamble && this.listenerCount('preamble') !== 0) { + this.emit('preamble', this._part) + } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) { + this.emit('part', this._part) + } else { + this._ignore() + } + if (!this._isPreamble) { this._inHeader = true } + } + if (data && start < end && !this._ignoreData) { + if (this._isPreamble || !this._inHeader) { + if (buf) { shouldWriteMore = this._part.push(buf) } + shouldWriteMore = this._part.push(data.slice(start, end)) + if (!shouldWriteMore) { this._pause = true } + } else if (!this._isPreamble && this._inHeader) { + if (buf) { this._hparser.push(buf) } + r = this._hparser.push(data.slice(start, end)) + if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) } + } + } + if (isMatch) { + this._hparser.reset() + if (this._isPreamble) { this._isPreamble = false } else { + if (start !== end) { + ++this._parts + this._part.on('end', function () { + if (--self._parts === 0) { + if (self._finished) { + self._realFinish = true + self.emit('finish') + self._realFinish = false + } else { + self._unpause() + } + } + }) + } + } + this._part.push(null) + this._part = undefined + this._ignoreData = false + this._justMatched = true + this._dashes = 0 + } +} + +Dicer.prototype._unpause = function () { + if (!this._pause) { return } + + this._pause = false + if (this._cb) { + const cb = this._cb + this._cb = undefined + cb() + } +} + +module.exports = Dicer + + +/***/ }), + +/***/ 92032: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const EventEmitter = (__nccwpck_require__(15673).EventEmitter) +const inherits = (__nccwpck_require__(47261).inherits) +const getLimit = __nccwpck_require__(21467) + +const StreamSearch = __nccwpck_require__(51142) + +const B_DCRLF = Buffer.from('\r\n\r\n') +const RE_CRLF = /\r\n/g +const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex + +function HeaderParser (cfg) { + EventEmitter.call(this) + + cfg = cfg || {} + const self = this + this.nread = 0 + this.maxed = false + this.npairs = 0 + this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000) + this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024) + this.buffer = '' + this.header = {} + this.finished = false + this.ss = new StreamSearch(B_DCRLF) + this.ss.on('info', function (isMatch, data, start, end) { + if (data && !self.maxed) { + if (self.nread + end - start >= self.maxHeaderSize) { + end = self.maxHeaderSize - self.nread + start + self.nread = self.maxHeaderSize + self.maxed = true + } else { self.nread += (end - start) } + + self.buffer += data.toString('binary', start, end) + } + if (isMatch) { self._finish() } + }) +} +inherits(HeaderParser, EventEmitter) + +HeaderParser.prototype.push = function (data) { + const r = this.ss.push(data) + if (this.finished) { return r } +} + +HeaderParser.prototype.reset = function () { + this.finished = false + this.buffer = '' + this.header = {} + this.ss.reset() +} + +HeaderParser.prototype._finish = function () { + if (this.buffer) { this._parseHeader() } + this.ss.matches = this.ss.maxMatches + const header = this.header + this.header = {} + this.buffer = '' + this.finished = true + this.nread = this.npairs = 0 + this.maxed = false + this.emit('header', header) +} + +HeaderParser.prototype._parseHeader = function () { + if (this.npairs === this.maxHeaderPairs) { return } + + const lines = this.buffer.split(RE_CRLF) + const len = lines.length + let m, h + + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var + if (lines[i].length === 0) { continue } + if (lines[i][0] === '\t' || lines[i][0] === ' ') { + // folded header content + // RFC2822 says to just remove the CRLF and not the whitespace following + // it, so we follow the RFC and include the leading whitespace ... + if (h) { + this.header[h][this.header[h].length - 1] += lines[i] + continue + } + } + + const posColon = lines[i].indexOf(':') + if ( + posColon === -1 || + posColon === 0 + ) { + return + } + m = RE_HDR.exec(lines[i]) + h = m[1].toLowerCase() + this.header[h] = this.header[h] || [] + this.header[h].push((m[2] || '')) + if (++this.npairs === this.maxHeaderPairs) { break } + } +} + +module.exports = HeaderParser + + +/***/ }), + +/***/ 81620: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const inherits = (__nccwpck_require__(47261).inherits) +const ReadableStream = (__nccwpck_require__(84492).Readable) + +function PartStream (opts) { + ReadableStream.call(this, opts) +} +inherits(PartStream, ReadableStream) + +PartStream.prototype._read = function (n) {} + +module.exports = PartStream + + +/***/ }), + +/***/ 51142: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +/** + * Copyright Brian White. All rights reserved. + * + * @see https://github.com/mscdex/streamsearch + * + * 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. + * + * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation + * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool + */ +const EventEmitter = (__nccwpck_require__(15673).EventEmitter) +const inherits = (__nccwpck_require__(47261).inherits) + +function SBMH (needle) { + if (typeof needle === 'string') { + needle = Buffer.from(needle) + } + + if (!Buffer.isBuffer(needle)) { + throw new TypeError('The needle has to be a String or a Buffer.') + } + + const needleLength = needle.length + + if (needleLength === 0) { + throw new Error('The needle cannot be an empty String/Buffer.') + } + + if (needleLength > 256) { + throw new Error('The needle cannot have a length bigger than 256.') + } + + this.maxMatches = Infinity + this.matches = 0 + + this._occ = new Array(256) + .fill(needleLength) // Initialize occurrence table. + this._lookbehind_size = 0 + this._needle = needle + this._bufpos = 0 + + this._lookbehind = Buffer.alloc(needleLength) + + // Populate occurrence table with analysis of the needle, + // ignoring last letter. + for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var + this._occ[needle[i]] = needleLength - 1 - i + } +} +inherits(SBMH, EventEmitter) + +SBMH.prototype.reset = function () { + this._lookbehind_size = 0 + this.matches = 0 + this._bufpos = 0 +} + +SBMH.prototype.push = function (chunk, pos) { + if (!Buffer.isBuffer(chunk)) { + chunk = Buffer.from(chunk, 'binary') + } + const chlen = chunk.length + this._bufpos = pos || 0 + let r + while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) } + return r +} + +SBMH.prototype._sbmh_feed = function (data) { + const len = data.length + const needle = this._needle + const needleLength = needle.length + const lastNeedleChar = needle[needleLength - 1] + + // Positive: points to a position in `data` + // pos == 3 points to data[3] + // Negative: points to a position in the lookbehind buffer + // pos == -2 points to lookbehind[lookbehind_size - 2] + let pos = -this._lookbehind_size + let ch + + if (pos < 0) { + // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool + // search with character lookup code that considers both the + // lookbehind buffer and the current round's haystack data. + // + // Loop until + // there is a match. + // or until + // we've moved past the position that requires the + // lookbehind buffer. In this case we switch to the + // optimized loop. + // or until + // the character to look at lies outside the haystack. + while (pos < 0 && pos <= len - needleLength) { + ch = this._sbmh_lookup_char(data, pos + needleLength - 1) + + if ( + ch === lastNeedleChar && + this._sbmh_memcmp(data, pos, needleLength - 1) + ) { + this._lookbehind_size = 0 + ++this.matches + this.emit('info', true) + + return (this._bufpos = pos + needleLength) + } + pos += this._occ[ch] + } + + // No match. + + if (pos < 0) { + // There's too few data for Boyer-Moore-Horspool to run, + // so let's use a different algorithm to skip as much as + // we can. + // Forward pos until + // the trailing part of lookbehind + data + // looks like the beginning of the needle + // or until + // pos == 0 + while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos } + } + + if (pos >= 0) { + // Discard lookbehind buffer. + this.emit('info', false, this._lookbehind, 0, this._lookbehind_size) + this._lookbehind_size = 0 + } else { + // Cut off part of the lookbehind buffer that has + // been processed and append the entire haystack + // into it. + const bytesToCutOff = this._lookbehind_size + pos + if (bytesToCutOff > 0) { + // The cut off data is guaranteed not to contain the needle. + this.emit('info', false, this._lookbehind, 0, bytesToCutOff) + } + + this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff, + this._lookbehind_size - bytesToCutOff) + this._lookbehind_size -= bytesToCutOff + + data.copy(this._lookbehind, this._lookbehind_size) + this._lookbehind_size += len + + this._bufpos = len + return len + } + } + + pos += (pos >= 0) * this._bufpos + + // Lookbehind buffer is now empty. We only need to check if the + // needle is in the haystack. + if (data.indexOf(needle, pos) !== -1) { + pos = data.indexOf(needle, pos) + ++this.matches + if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) } + + return (this._bufpos = pos + needleLength) + } else { + pos = len - needleLength + } + + // There was no match. If there's trailing haystack data that we cannot + // match yet using the Boyer-Moore-Horspool algorithm (because the trailing + // data is less than the needle size) then match using a modified + // algorithm that starts matching from the beginning instead of the end. + // Whatever trailing data is left after running this algorithm is added to + // the lookbehind buffer. + while ( + pos < len && + ( + data[pos] !== needle[0] || + ( + (Buffer.compare( + data.subarray(pos, pos + len - pos), + needle.subarray(0, len - pos) + ) !== 0) + ) + ) + ) { + ++pos + } + if (pos < len) { + data.copy(this._lookbehind, 0, pos, pos + (len - pos)) + this._lookbehind_size = len - pos + } + + // Everything until pos is guaranteed not to contain needle data. + if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) } + + this._bufpos = len + return len +} + +SBMH.prototype._sbmh_lookup_char = function (data, pos) { + return (pos < 0) + ? this._lookbehind[this._lookbehind_size + pos] + : data[pos] +} + +SBMH.prototype._sbmh_memcmp = function (data, pos, len) { + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var + if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false } + } + return true +} + +module.exports = SBMH + + +/***/ }), + +/***/ 50727: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const WritableStream = (__nccwpck_require__(84492).Writable) +const { inherits } = __nccwpck_require__(47261) +const Dicer = __nccwpck_require__(92960) + +const MultipartParser = __nccwpck_require__(32183) +const UrlencodedParser = __nccwpck_require__(78306) +const parseParams = __nccwpck_require__(31854) + +function Busboy (opts) { + if (!(this instanceof Busboy)) { return new Busboy(opts) } + + if (typeof opts !== 'object') { + throw new TypeError('Busboy expected an options-Object.') + } + if (typeof opts.headers !== 'object') { + throw new TypeError('Busboy expected an options-Object with headers-attribute.') + } + if (typeof opts.headers['content-type'] !== 'string') { + throw new TypeError('Missing Content-Type-header.') + } + + const { + headers, + ...streamOptions + } = opts + + this.opts = { + autoDestroy: false, + ...streamOptions + } + WritableStream.call(this, this.opts) + + this._done = false + this._parser = this.getParserByHeaders(headers) + this._finished = false +} +inherits(Busboy, WritableStream) + +Busboy.prototype.emit = function (ev) { + if (ev === 'finish') { + if (!this._done) { + this._parser?.end() + return + } else if (this._finished) { + return + } + this._finished = true + } + WritableStream.prototype.emit.apply(this, arguments) +} + +Busboy.prototype.getParserByHeaders = function (headers) { + const parsed = parseParams(headers['content-type']) + + const cfg = { + defCharset: this.opts.defCharset, + fileHwm: this.opts.fileHwm, + headers, + highWaterMark: this.opts.highWaterMark, + isPartAFile: this.opts.isPartAFile, + limits: this.opts.limits, + parsedConType: parsed, + preservePath: this.opts.preservePath + } + + if (MultipartParser.detect.test(parsed[0])) { + return new MultipartParser(this, cfg) + } + if (UrlencodedParser.detect.test(parsed[0])) { + return new UrlencodedParser(this, cfg) + } + throw new Error('Unsupported Content-Type.') +} + +Busboy.prototype._write = function (chunk, encoding, cb) { + this._parser.write(chunk, cb) +} + +module.exports = Busboy +module.exports["default"] = Busboy +module.exports.Busboy = Busboy + +module.exports.Dicer = Dicer + + +/***/ }), + +/***/ 32183: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +// TODO: +// * support 1 nested multipart level +// (see second multipart example here: +// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data) +// * support limits.fieldNameSize +// -- this will require modifications to utils.parseParams + +const { Readable } = __nccwpck_require__(84492) +const { inherits } = __nccwpck_require__(47261) + +const Dicer = __nccwpck_require__(92960) + +const parseParams = __nccwpck_require__(31854) +const decodeText = __nccwpck_require__(84619) +const basename = __nccwpck_require__(48647) +const getLimit = __nccwpck_require__(21467) + +const RE_BOUNDARY = /^boundary$/i +const RE_FIELD = /^form-data$/i +const RE_CHARSET = /^charset$/i +const RE_FILENAME = /^filename$/i +const RE_NAME = /^name$/i + +Multipart.detect = /^multipart\/form-data/i +function Multipart (boy, cfg) { + let i + let len + const self = this + let boundary + const limits = cfg.limits + const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined)) + const parsedConType = cfg.parsedConType || [] + const defCharset = cfg.defCharset || 'utf8' + const preservePath = cfg.preservePath + const fileOpts = { highWaterMark: cfg.fileHwm } + + for (i = 0, len = parsedConType.length; i < len; ++i) { + if (Array.isArray(parsedConType[i]) && + RE_BOUNDARY.test(parsedConType[i][0])) { + boundary = parsedConType[i][1] + break + } + } + + function checkFinished () { + if (nends === 0 && finished && !boy._done) { + finished = false + self.end() + } + } + + if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') } + + const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) + const fileSizeLimit = getLimit(limits, 'fileSize', Infinity) + const filesLimit = getLimit(limits, 'files', Infinity) + const fieldsLimit = getLimit(limits, 'fields', Infinity) + const partsLimit = getLimit(limits, 'parts', Infinity) + const headerPairsLimit = getLimit(limits, 'headerPairs', 2000) + const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024) + + let nfiles = 0 + let nfields = 0 + let nends = 0 + let curFile + let curField + let finished = false + + this._needDrain = false + this._pause = false + this._cb = undefined + this._nparts = 0 + this._boy = boy + + const parserCfg = { + boundary, + maxHeaderPairs: headerPairsLimit, + maxHeaderSize: headerSizeLimit, + partHwm: fileOpts.highWaterMark, + highWaterMark: cfg.highWaterMark + } + + this.parser = new Dicer(parserCfg) + this.parser.on('drain', function () { + self._needDrain = false + if (self._cb && !self._pause) { + const cb = self._cb + self._cb = undefined + cb() + } + }).on('part', function onPart (part) { + if (++self._nparts > partsLimit) { + self.parser.removeListener('part', onPart) + self.parser.on('part', skipPart) + boy.hitPartsLimit = true + boy.emit('partsLimit') + return skipPart(part) + } + + // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let + // us emit 'end' early since we know the part has ended if we are already + // seeing the next part + if (curField) { + const field = curField + field.emit('end') + field.removeAllListeners('end') + } + + part.on('header', function (header) { + let contype + let fieldname + let parsed + let charset + let encoding + let filename + let nsize = 0 + + if (header['content-type']) { + parsed = parseParams(header['content-type'][0]) + if (parsed[0]) { + contype = parsed[0].toLowerCase() + for (i = 0, len = parsed.length; i < len; ++i) { + if (RE_CHARSET.test(parsed[i][0])) { + charset = parsed[i][1].toLowerCase() + break + } + } + } + } + + if (contype === undefined) { contype = 'text/plain' } + if (charset === undefined) { charset = defCharset } + + if (header['content-disposition']) { + parsed = parseParams(header['content-disposition'][0]) + if (!RE_FIELD.test(parsed[0])) { return skipPart(part) } + for (i = 0, len = parsed.length; i < len; ++i) { + if (RE_NAME.test(parsed[i][0])) { + fieldname = parsed[i][1] + } else if (RE_FILENAME.test(parsed[i][0])) { + filename = parsed[i][1] + if (!preservePath) { filename = basename(filename) } + } + } + } else { return skipPart(part) } + + if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' } + + let onData, + onEnd + + if (isPartAFile(fieldname, contype, filename)) { + // file/binary field + if (nfiles === filesLimit) { + if (!boy.hitFilesLimit) { + boy.hitFilesLimit = true + boy.emit('filesLimit') + } + return skipPart(part) + } + + ++nfiles + + if (boy.listenerCount('file') === 0) { + self.parser._ignore() + return + } + + ++nends + const file = new FileStream(fileOpts) + curFile = file + file.on('end', function () { + --nends + self._pause = false + checkFinished() + if (self._cb && !self._needDrain) { + const cb = self._cb + self._cb = undefined + cb() + } + }) + file._read = function (n) { + if (!self._pause) { return } + self._pause = false + if (self._cb && !self._needDrain) { + const cb = self._cb + self._cb = undefined + cb() + } + } + boy.emit('file', fieldname, file, filename, encoding, contype) + + onData = function (data) { + if ((nsize += data.length) > fileSizeLimit) { + const extralen = fileSizeLimit - nsize + data.length + if (extralen > 0) { file.push(data.slice(0, extralen)) } + file.truncated = true + file.bytesRead = fileSizeLimit + part.removeAllListeners('data') + file.emit('limit') + return + } else if (!file.push(data)) { self._pause = true } + + file.bytesRead = nsize + } + + onEnd = function () { + curFile = undefined + file.push(null) + } + } else { + // non-file field + if (nfields === fieldsLimit) { + if (!boy.hitFieldsLimit) { + boy.hitFieldsLimit = true + boy.emit('fieldsLimit') + } + return skipPart(part) + } + + ++nfields + ++nends + let buffer = '' + let truncated = false + curField = part + + onData = function (data) { + if ((nsize += data.length) > fieldSizeLimit) { + const extralen = (fieldSizeLimit - (nsize - data.length)) + buffer += data.toString('binary', 0, extralen) + truncated = true + part.removeAllListeners('data') + } else { buffer += data.toString('binary') } + } + + onEnd = function () { + curField = undefined + if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) } + boy.emit('field', fieldname, buffer, false, truncated, encoding, contype) + --nends + checkFinished() + } + } + + /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become + broken. Streams2/streams3 is a huge black box of confusion, but + somehow overriding the sync state seems to fix things again (and still + seems to work for previous node versions). + */ + part._readableState.sync = false + + part.on('data', onData) + part.on('end', onEnd) + }).on('error', function (err) { + if (curFile) { curFile.emit('error', err) } + }) + }).on('error', function (err) { + boy.emit('error', err) + }).on('finish', function () { + finished = true + checkFinished() + }) +} + +Multipart.prototype.write = function (chunk, cb) { + const r = this.parser.write(chunk) + if (r && !this._pause) { + cb() + } else { + this._needDrain = !r + this._cb = cb + } +} + +Multipart.prototype.end = function () { + const self = this + + if (self.parser.writable) { + self.parser.end() + } else if (!self._boy._done) { + process.nextTick(function () { + self._boy._done = true + self._boy.emit('finish') + }) + } +} + +function skipPart (part) { + part.resume() +} + +function FileStream (opts) { + Readable.call(this, opts) + + this.bytesRead = 0 + + this.truncated = false +} + +inherits(FileStream, Readable) + +FileStream.prototype._read = function (n) {} + +module.exports = Multipart + + +/***/ }), + +/***/ 78306: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const Decoder = __nccwpck_require__(27100) +const decodeText = __nccwpck_require__(84619) +const getLimit = __nccwpck_require__(21467) + +const RE_CHARSET = /^charset$/i + +UrlEncoded.detect = /^application\/x-www-form-urlencoded/i +function UrlEncoded (boy, cfg) { + const limits = cfg.limits + const parsedConType = cfg.parsedConType + this.boy = boy + + this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024) + this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100) + this.fieldsLimit = getLimit(limits, 'fields', Infinity) + + let charset + for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var + if (Array.isArray(parsedConType[i]) && + RE_CHARSET.test(parsedConType[i][0])) { + charset = parsedConType[i][1].toLowerCase() + break + } + } + + if (charset === undefined) { charset = cfg.defCharset || 'utf8' } + + this.decoder = new Decoder() + this.charset = charset + this._fields = 0 + this._state = 'key' + this._checkingBytes = true + this._bytesKey = 0 + this._bytesVal = 0 + this._key = '' + this._val = '' + this._keyTrunc = false + this._valTrunc = false + this._hitLimit = false +} + +UrlEncoded.prototype.write = function (data, cb) { + if (this._fields === this.fieldsLimit) { + if (!this.boy.hitFieldsLimit) { + this.boy.hitFieldsLimit = true + this.boy.emit('fieldsLimit') + } + return cb() + } + + let idxeq; let idxamp; let i; let p = 0; const len = data.length + + while (p < len) { + if (this._state === 'key') { + idxeq = idxamp = undefined + for (i = p; i < len; ++i) { + if (!this._checkingBytes) { ++p } + if (data[i] === 0x3D/* = */) { + idxeq = i + break + } else if (data[i] === 0x26/* & */) { + idxamp = i + break + } + if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { + this._hitLimit = true + break + } else if (this._checkingBytes) { ++this._bytesKey } + } + + if (idxeq !== undefined) { + // key with assignment + if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) } + this._state = 'val' + + this._hitLimit = false + this._checkingBytes = true + this._val = '' + this._bytesVal = 0 + this._valTrunc = false + this.decoder.reset() + + p = idxeq + 1 + } else if (idxamp !== undefined) { + // key with no assignment + ++this._fields + let key; const keyTrunc = this._keyTrunc + if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key } + + this._hitLimit = false + this._checkingBytes = true + this._key = '' + this._bytesKey = 0 + this._keyTrunc = false + this.decoder.reset() + + if (key.length) { + this.boy.emit('field', decodeText(key, 'binary', this.charset), + '', + keyTrunc, + false) + } + + p = idxamp + 1 + if (this._fields === this.fieldsLimit) { return cb() } + } else if (this._hitLimit) { + // we may not have hit the actual limit if there are encoded bytes... + if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) } + p = i + if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { + // yep, we actually did hit the limit + this._checkingBytes = false + this._keyTrunc = true + } + } else { + if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) } + p = len + } + } else { + idxamp = undefined + for (i = p; i < len; ++i) { + if (!this._checkingBytes) { ++p } + if (data[i] === 0x26/* & */) { + idxamp = i + break + } + if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { + this._hitLimit = true + break + } else if (this._checkingBytes) { ++this._bytesVal } + } + + if (idxamp !== undefined) { + ++this._fields + if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) } + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), + decodeText(this._val, 'binary', this.charset), + this._keyTrunc, + this._valTrunc) + this._state = 'key' + + this._hitLimit = false + this._checkingBytes = true + this._key = '' + this._bytesKey = 0 + this._keyTrunc = false + this.decoder.reset() + + p = idxamp + 1 + if (this._fields === this.fieldsLimit) { return cb() } + } else if (this._hitLimit) { + // we may not have hit the actual limit if there are encoded bytes... + if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) } + p = i + if ((this._val === '' && this.fieldSizeLimit === 0) || + (this._bytesVal = this._val.length) === this.fieldSizeLimit) { + // yep, we actually did hit the limit + this._checkingBytes = false + this._valTrunc = true + } + } else { + if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) } + p = len + } + } + } + cb() +} + +UrlEncoded.prototype.end = function () { + if (this.boy._done) { return } + + if (this._state === 'key' && this._key.length > 0) { + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), + '', + this._keyTrunc, + false) + } else if (this._state === 'val') { + this.boy.emit('field', decodeText(this._key, 'binary', this.charset), + decodeText(this._val, 'binary', this.charset), + this._keyTrunc, + this._valTrunc) + } + this.boy._done = true + this.boy.emit('finish') +} + +module.exports = UrlEncoded + + +/***/ }), + +/***/ 27100: +/***/ ((module) => { + +"use strict"; + + +const RE_PLUS = /\+/g + +const HEX = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +] + +function Decoder () { + this.buffer = undefined +} +Decoder.prototype.write = function (str) { + // Replace '+' with ' ' before decoding + str = str.replace(RE_PLUS, ' ') + let res = '' + let i = 0; let p = 0; const len = str.length + for (; i < len; ++i) { + if (this.buffer !== undefined) { + if (!HEX[str.charCodeAt(i)]) { + res += '%' + this.buffer + this.buffer = undefined + --i // retry character + } else { + this.buffer += str[i] + ++p + if (this.buffer.length === 2) { + res += String.fromCharCode(parseInt(this.buffer, 16)) + this.buffer = undefined + } + } + } else if (str[i] === '%') { + if (i > p) { + res += str.substring(p, i) + p = i + } + this.buffer = '' + ++p + } + } + if (p < len && this.buffer === undefined) { res += str.substring(p) } + return res +} +Decoder.prototype.reset = function () { + this.buffer = undefined +} + +module.exports = Decoder + + +/***/ }), + +/***/ 48647: +/***/ ((module) => { + +"use strict"; + + +module.exports = function basename (path) { + if (typeof path !== 'string') { return '' } + for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var + switch (path.charCodeAt(i)) { + case 0x2F: // '/' + case 0x5C: // '\' + path = path.slice(i + 1) + return (path === '..' || path === '.' ? '' : path) + } + } + return (path === '..' || path === '.' ? '' : path) +} + + +/***/ }), + +/***/ 84619: +/***/ (function(module) { + +"use strict"; + + +// Node has always utf-8 +const utf8Decoder = new TextDecoder('utf-8') +const textDecoders = new Map([ + ['utf-8', utf8Decoder], + ['utf8', utf8Decoder] +]) + +function getDecoder (charset) { + let lc + while (true) { + switch (charset) { + case 'utf-8': + case 'utf8': + return decoders.utf8 + case 'latin1': + case 'ascii': // TODO: Make these a separate, strict decoder? + case 'us-ascii': + case 'iso-8859-1': + case 'iso8859-1': + case 'iso88591': + case 'iso_8859-1': + case 'windows-1252': + case 'iso_8859-1:1987': + case 'cp1252': + case 'x-cp1252': + return decoders.latin1 + case 'utf16le': + case 'utf-16le': + case 'ucs2': + case 'ucs-2': + return decoders.utf16le + case 'base64': + return decoders.base64 + default: + if (lc === undefined) { + lc = true + charset = charset.toLowerCase() + continue + } + return decoders.other.bind(charset) + } + } +} + +const decoders = { + utf8: (data, sourceEncoding) => { + if (data.length === 0) { + return '' + } + if (typeof data === 'string') { + data = Buffer.from(data, sourceEncoding) + } + return data.utf8Slice(0, data.length) + }, + + latin1: (data, sourceEncoding) => { + if (data.length === 0) { + return '' + } + if (typeof data === 'string') { + return data + } + return data.latin1Slice(0, data.length) + }, + + utf16le: (data, sourceEncoding) => { + if (data.length === 0) { + return '' + } + if (typeof data === 'string') { + data = Buffer.from(data, sourceEncoding) + } + return data.ucs2Slice(0, data.length) + }, + + base64: (data, sourceEncoding) => { + if (data.length === 0) { + return '' + } + if (typeof data === 'string') { + data = Buffer.from(data, sourceEncoding) + } + return data.base64Slice(0, data.length) + }, + + other: (data, sourceEncoding) => { + if (data.length === 0) { + return '' + } + if (typeof data === 'string') { + data = Buffer.from(data, sourceEncoding) + } + + if (textDecoders.has(this.toString())) { + try { + return textDecoders.get(this).decode(data) + } catch {} + } + return typeof data === 'string' + ? data + : data.toString() + } +} + +function decodeText (text, sourceEncoding, destEncoding) { + if (text) { + return getDecoder(destEncoding)(text, sourceEncoding) + } + return text +} + +module.exports = decodeText + + +/***/ }), + +/***/ 21467: +/***/ ((module) => { + +"use strict"; + + +module.exports = function getLimit (limits, name, defaultLimit) { + if ( + !limits || + limits[name] === undefined || + limits[name] === null + ) { return defaultLimit } + + if ( + typeof limits[name] !== 'number' || + isNaN(limits[name]) + ) { throw new TypeError('Limit ' + name + ' is not a valid number') } + + return limits[name] +} + + +/***/ }), + +/***/ 31854: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; +/* eslint-disable object-property-newline */ + + +const decodeText = __nccwpck_require__(84619) + +const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g + +const EncodedLookup = { + '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04', + '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09', + '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c', + '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e', + '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12', + '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17', + '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b', + '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d', + '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20', + '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25', + '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a', + '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c', + '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f', + '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33', + '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38', + '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b', + '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e', + '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41', + '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46', + '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a', + '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d', + '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f', + '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54', + '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59', + '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c', + '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e', + '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62', + '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67', + '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b', + '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d', + '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70', + '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75', + '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a', + '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c', + '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f', + '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83', + '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88', + '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b', + '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e', + '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91', + '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96', + '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a', + '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d', + '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f', + '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2', + '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4', + '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7', + '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9', + '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab', + '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac', + '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad', + '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae', + '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0', + '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2', + '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5', + '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7', + '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba', + '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb', + '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc', + '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd', + '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf', + '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0', + '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3', + '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5', + '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8', + '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca', + '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb', + '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc', + '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce', + '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf', + '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1', + '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3', + '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6', + '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8', + '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda', + '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb', + '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd', + '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde', + '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf', + '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1', + '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4', + '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6', + '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9', + '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea', + '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec', + '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed', + '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee', + '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef', + '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2', + '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4', + '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7', + '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9', + '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb', + '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc', + '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd', + '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe', + '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff' +} + +function encodedReplacer (match) { + return EncodedLookup[match] +} + +const STATE_KEY = 0 +const STATE_VALUE = 1 +const STATE_CHARSET = 2 +const STATE_LANG = 3 + +function parseParams (str) { + const res = [] + let state = STATE_KEY + let charset = '' + let inquote = false + let escaping = false + let p = 0 + let tmp = '' + const len = str.length + + for (var i = 0; i < len; ++i) { // eslint-disable-line no-var + const char = str[i] + if (char === '\\' && inquote) { + if (escaping) { escaping = false } else { + escaping = true + continue + } + } else if (char === '"') { + if (!escaping) { + if (inquote) { + inquote = false + state = STATE_KEY + } else { inquote = true } + continue + } else { escaping = false } + } else { + if (escaping && inquote) { tmp += '\\' } + escaping = false + if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") { + if (state === STATE_CHARSET) { + state = STATE_LANG + charset = tmp.substring(1) + } else { state = STATE_VALUE } + tmp = '' + continue + } else if (state === STATE_KEY && + (char === '*' || char === '=') && + res.length) { + state = char === '*' + ? STATE_CHARSET + : STATE_VALUE + res[p] = [tmp, undefined] + tmp = '' + continue + } else if (!inquote && char === ';') { + state = STATE_KEY + if (charset) { + if (tmp.length) { + tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), + 'binary', + charset) + } + charset = '' + } else if (tmp.length) { + tmp = decodeText(tmp, 'binary', 'utf8') + } + if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp } + tmp = '' + ++p + continue + } else if (!inquote && (char === ' ' || char === '\t')) { continue } + } + tmp += char + } + if (charset && tmp.length) { + tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer), + 'binary', + charset) + } else if (tmp) { + tmp = decodeText(tmp, 'binary', 'utf8') + } + + if (res[p] === undefined) { + if (tmp) { res[p] = tmp } + } else { res[p][1] = tmp } + + return res +} + +module.exports = parseParams + + /***/ }), /***/ 76490: /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"swagger":"2.0","info":{"version":"2.15.1","title":"Netlify\'s API documentation","description":"Netlify is a hosting service for the programmable web. It understands your documents and provides an API to handle atomic deploys of websites, manage form submissions, inject JavaScript snippets, and much more. This is a REST-style API that uses JSON for serialization and OAuth 2 for authentication.\\n\\nThis document is an OpenAPI reference for the Netlify API that you can explore. For more detailed instructions for common uses, please visit the [online documentation](https://www.netlify.com/docs/api/). Visit our Community forum to join the conversation about [understanding and using Netlify’s API](https://community.netlify.com/t/common-issue-understanding-and-using-netlifys-api/160).\\n\\nAdditionally, we have two API clients for your convenience:\\n- [Go Client](https://github.com/netlify/open-api#go-client)\\n- [JS Client](https://github.com/netlify/js-client)","termsOfService":"https://www.netlify.com/legal/terms-of-use/","x-logo":{"url":"netlify-logo.png","href":"https://www.netlify.com/docs/","altText":"Netlify"}},"externalDocs":{"url":"https://www.netlify.com/docs/api/","description":"Online documentation"},"securityDefinitions":{"netlifyAuth":{"type":"oauth2","flow":"implicit","authorizationUrl":"https://app.netlify.com/authorize"}},"security":[{"netlifyAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"schemes":["https"],"responses":{"error":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"host":"api.netlify.com","basePath":"/api/v1","paths":{"/sites":{"get":{"operationId":"listSites","tags":["site"],"parameters":[{"name":"name","in":"query","type":"string"},{"name":"filter","in":"query","type":"string","enum":["all","owner","guest"]},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values will soon be moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables."},"post":{"operationId":"createSite","tags":["site"],"consumes":["application/json"],"parameters":[{"name":"site","in":"body","schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}},{"properties":{"repo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}}}}]},"required":true},{"name":"configure_dns","type":"boolean","in":"query"}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values will soon be moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site."}},"/sites/{site_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSite","tags":["site"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values will soon be moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables."},"patch":{"operationId":"updateSite","tags":["site"],"consumes":["application/json"],"parameters":[{"name":"site","in":"body","schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}},{"properties":{"repo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}}}}]},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values will soon be moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [updateEnvVar](#tag/environmentVariables/operation/updateEnvVar) to update a site\'s environment variables."},"delete":{"operationId":"deleteSite","tags":["site"],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/ssl":{"post":{"operationId":"provisionSiteTLSCertificate","tags":["sniCertificate"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"certificate","type":"string","in":"query"},{"name":"key","type":"string","in":"query"},{"name":"ca_certificates","type":"string","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"state":{"type":"string"},"domains":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"expires_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"get":{"operationId":"showSiteTLSCertificate","tags":["sniCertificate"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"state":{"type":"string"},"domains":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"expires_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts/{account_id}/env":{"get":{"tags":["environmentVariables"],"operationId":"getEnvVars","parameters":[{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"context_name","description":"Filter by deploy context","type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"required":false,"in":"query"},{"name":"scope","description":"Filter by scope","type":"string","enum":["builds","functions","runtime","post-processing"],"required":false,"in":"query"},{"name":"site_id","description":"If specified, only return environment variables set on this site","type":"string","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI."},"post":{"tags":["environmentVariables"],"operationId":"createEnvVars","description":"Creates new environment variables. Granular scopes are available on Pro plans and above. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI.","parameters":[{"in":"body","name":"env_vars","schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The existing or new name of the key, if you wish to rename it (case-sensitive)"},"scopes":{"description":"The scopes that this environment variable is set to (Pro plans and above)","type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]}},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."}},"description":"Environment variable value model definition"}}}}}},{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"site_id","description":"If provided, create an environment variable on the site level, not the account level","type":"string","required":false,"in":"query"}],"responses":{"201":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts/{account_id}/env/{key}":{"get":{"tags":["environmentVariables"],"operationId":"getEnvVar","parameters":[{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"key","description":"The environment variable key (case-sensitive)","type":"string","required":true,"in":"path"},{"name":"site_id","description":"If provided, return the environment variable for a specific site (no merging is performed)","type":"string","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"Returns an individual environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI."},"put":{"tags":["environmentVariables"],"operationId":"updateEnvVar","description":"Updates an existing environment variable and all of its values. Existing values will be replaced by values provided. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI.","parameters":[{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"key","description":"The existing environment variable key name (case-sensitive)","type":"string","required":true,"in":"path"},{"in":"body","name":"env_var","schema":{"type":"object","properties":{"key":{"type":"string","description":"The existing or new name of the key, if you wish to rename it (case-sensitive)"},"scopes":{"description":"The scopes that this environment variable is set to (Pro plans and above)","type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]}},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."}},"description":"Environment variable value model definition"}}}}},{"name":"site_id","description":"If provided, update an environment variable set on this site","type":"string","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"patch":{"tags":["environmentVariables"],"operationId":"setEnvVarValue","description":"Updates or creates a new value for an existing environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI.","parameters":[{"name":"account_id","description":"Scope response to account_id","required":true,"type":"string","in":"path"},{"name":"key","description":"The existing environment variable key name (case-sensitive)","required":true,"type":"string","in":"path"},{"name":"site_id","description":"If provided, update an environment variable set on this site","in":"query","type":"string"},{"in":"body","name":"env_var","schema":{"type":"object","properties":{"context":{"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`.","type":"string","enum":["dev","branch-deploy","deploy-preview","production"]},"value":{"description":"The environment variable\'s unencrypted value","type":"string"}}}}],"responses":{"201":{"description":"Created (success)","schema":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"tags":["environmentVariables"],"operationId":"deleteEnvVar","parameters":[{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"key","description":"The environment variable key (case-sensitive)","type":"string","required":true,"in":"path"},{"name":"site_id","description":"If provided, delete the environment variable from this site","type":"string","required":false,"in":"query"}],"responses":{"204":{"description":"No Content (success)"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"Deletes an environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI."}},"/accounts/{account_id}/env/{key}/value/{id}":{"delete":{"tags":["environmentVariables"],"operationId":"deleteEnvVarValue","parameters":[{"name":"account_id","description":"Scope response to account_id","required":true,"in":"path","type":"string"},{"name":"id","description":"The environment variable value\'s ID","type":"string","required":true,"in":"path"},{"name":"key","description":"The environment variable key name (case-sensitive)","type":"string","required":true,"in":"path"},{"name":"site_id","description":"If provided, delete the value from an environment variable on this site","type":"string","required":false,"in":"query"}],"responses":{"204":{"description":"No Content (success)"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"Deletes a specific environment variable value. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI."}},"/sites/{site_id}/forms":{"get":{"operationId":"listSiteForms","tags":["form"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"paths":{"type":"array","items":{"type":"string"}},"submission_count":{"type":"integer","format":"int32"},"fields":{"type":"array","items":{"type":"object"}},"created_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/forms/{form_id}":{"delete":{"operationId":"deleteSiteForm","tags":["form"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"form_id","type":"string","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/submissions":{"get":{"operationId":"listSiteSubmissions","tags":["submission"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","format":"int32"},"email":{"type":"string"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"summary":{"type":"string"},"body":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"site_url":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/files":{"get":{"operationId":"listSiteFiles","tags":["file"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","format":"int64"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/assets":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteAssets","tags":["asset"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteAsset","tags":["asset"],"parameters":[{"name":"name","type":"string","in":"query","required":true},{"name":"size","type":"integer","format":"int64","in":"query","required":true},{"name":"content_type","type":"string","in":"query","required":true},{"name":"visibility","type":"string","in":"query"}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"form":{"type":"object","properties":{"url":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}}}},"asset":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/assets/{asset_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"asset_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteAssetInfo","tags":["asset"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteAsset","tags":["asset"],"parameters":[{"name":"state","type":"string","in":"query","required":true}],"responses":{"200":{"description":"Updated","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSiteAsset","tags":["asset"],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/assets/{asset_id}/public_signature":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"asset_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteAssetPublicSignature","tags":["assetPublicSignature"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"url":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/files/{file_path}":{"get":{"operationId":"getSiteFileByPathName","tags":["file"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"file_path","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","format":"int64"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/snippets":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteSnippets","tags":["snippet"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteSnippet","tags":["snippet"],"consumes":["application/json"],"parameters":[{"name":"snippet","in":"body","schema":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}},"required":true}],"responses":{"201":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/snippets/{snippet_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"snippet_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteSnippet","tags":["snippet"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteSnippet","tags":["snippet"],"consumes":["application/json"],"parameters":[{"name":"snippet","in":"body","schema":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}},"required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSiteSnippet","tags":["snippet"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/metadata":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteMetadata","tags":["metadata"],"responses":{"200":{"description":"OK","schema":{"type":"object"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteMetadata","tags":["metadata"],"parameters":[{"name":"metadata","in":"body","schema":{"type":"object"},"required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/build_hooks":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteBuildHooks","tags":["buildHook"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"branch":{"type":"string"},"url":{"type":"string"},"site_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteBuildHook","tags":["buildHook"],"consumes":["application/json"],"parameters":[{"name":"buildHook","in":"body","schema":{"type":"object","properties":{"title":{"type":"string"},"branch":{"type":"string"}}},"required":true}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"branch":{"type":"string"},"url":{"type":"string"},"site_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/build_hooks/{id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteBuildHook","tags":["buildHook"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"branch":{"type":"string"},"url":{"type":"string"},"site_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteBuildHook","tags":["buildHook"],"consumes":["application/json"],"parameters":[{"name":"buildHook","in":"body","schema":{"type":"object","properties":{"title":{"type":"string"},"branch":{"type":"string"}}},"required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSiteBuildHook","tags":["buildHook"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/deploys":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"deploy-previews","type":"boolean","in":"query"},{"name":"production","type":"boolean","in":"query"},{"name":"state","type":"string","enum":["new","pending_review","accepted","rejected","enqueued","building","uploading","uploaded","preparing","prepared","processing","ready","error","retrying"],"in":"query"},{"name":"branch","type":"string","in":"query"},{"name":"latest-published","type":"boolean","in":"query"}],"get":{"operationId":"listSiteDeploys","tags":["deploy"],"parameters":[{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteDeploy","tags":["deploy"],"parameters":[{"name":"title","type":"string","in":"query"},{"name":"deploy","in":"body","schema":{"type":"object","properties":{"files":{"type":"object"},"draft":{"type":"boolean"},"async":{"type":"boolean"},"functions":{"type":"object"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}},"functions_config":{"type":"object","additionalProperties":{"type":"object","properties":{"display_name":{"type":"string"},"generator":{"type":"string"}}}},"branch":{"type":"string"},"framework":{"type":"string"}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/deploys/{deploy_id}":{"get":{"operationId":"getSiteDeploy","tags":["deploy"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteDeploy","tags":["deploy"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"deploy","in":"body","schema":{"type":"object","properties":{"files":{"type":"object"},"draft":{"type":"boolean"},"async":{"type":"boolean"},"functions":{"type":"object"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}},"functions_config":{"type":"object","additionalProperties":{"type":"object","properties":{"display_name":{"type":"string"},"generator":{"type":"string"}}}},"branch":{"type":"string"},"framework":{"type":"string"}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSiteDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"site_id","type":"string","in":"path","required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/cancel":{"post":{"operationId":"cancelSiteDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"201":{"description":"Cancelled","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/deploys/{deploy_id}/restore":{"post":{"operationId":"restoreSiteDeploy","tags":["deploy"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/builds":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteBuilds","tags":["build"],"parameters":[{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"sha":{"type":"string"},"done":{"type":"boolean"},"error":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteBuild","tags":["build"],"parameters":[{"name":"build","in":"body","schema":{"type":"object","properties":{"image":{"type":"string"},"clear_cache":{"type":"boolean"}}},"required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"sha":{"type":"string"},"done":{"type":"boolean"},"error":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/deployed-branches":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteDeployedBranches","tags":["deployedBranch"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/unlink_repo":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"put":{"operationId":"unlinkSiteRepo","tags":["site"],"description":"[Beta] Unlinks the repo from the site.\\n\\nThis action will also:\\n- Delete associated deploy keys\\n- Delete outgoing webhooks for the repo\\n- Delete the site\'s build hooks","responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}}},"404":{"description":"Site not found"}}}},"/builds/{build_id}":{"parameters":[{"name":"build_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteBuild","tags":["build"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"sha":{"type":"string"},"done":{"type":"boolean"},"error":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/builds/{build_id}/log":{"parameters":[{"name":"build_id","type":"string","in":"path","required":true},{"name":"msg","in":"body","schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"boolean"},"section":{"type":"string","enum":["initializing","building","deploying","cleanup","postprocessing"]}}},"required":true}],"post":{"operationId":"updateSiteBuildLog","tags":["buildLogMsg"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/builds/{build_id}/start":{"parameters":[{"name":"build_id","type":"string","in":"path","required":true}],"post":{"operationId":"notifyBuildStart","tags":["build"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/{account_id}/builds/status":{"parameters":[{"name":"account_id","type":"string","in":"path","required":true}],"get":{"operationId":"getAccountBuildStatus","tags":["build"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"active":{"type":"integer"},"pending_concurrency":{"type":"integer"},"enqueued":{"type":"integer"},"build_count":{"type":"integer"},"minutes":{"type":"object","properties":{"current":{"type":"integer"},"current_average_sec":{"type":"integer"},"previous":{"type":"integer"},"period_start_date":{"type":"string","format":"dateTime"},"period_end_date":{"type":"string","format":"dateTime"},"last_updated_at":{"type":"string","format":"dateTime"},"included_minutes":{"type":"string"},"included_minutes_with_packs":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/dns":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"getDNSForSite","tags":["dnsZone"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"configureDNSForSite","tags":["dnsZone"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/rollback":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"put":{"operationId":"rollbackSiteDeploy","tags":["deploy"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}":{"get":{"operationId":"getDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/lock":{"post":{"operationId":"lockDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/unlock":{"post":{"operationId":"unlockDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/files/{path}":{"put":{"operationId":"uploadDeployFile","tags":["file"],"consumes":["application/octet-stream"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"path","type":"string","in":"path","required":true},{"name":"size","type":"integer","in":"query"},{"name":"file_body","in":"body","schema":{"type":"string","format":"binary"},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","format":"int64"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/functions/{name}":{"put":{"operationId":"uploadDeployFunction","tags":["function"],"consumes":["application/octet-stream"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"name","type":"string","in":"path","required":true},{"name":"runtime","type":"string","in":"query"},{"name":"size","type":"integer","in":"query"},{"name":"file_body","in":"body","schema":{"type":"string","format":"binary"},"required":true},{"name":"X-Nf-Retry-Count","type":"integer","in":"header"}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sha":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/plugins/{package}":{"put":{"operationId":"updatePlugin","tags":["x-internal"],"description":"This is an internal-only endpoint.","parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"package","type":"string","in":"path","required":true},{"name":"plugin_params","in":"body","schema":{"type":"object","properties":{"pinned_version":{"type":"string"}}}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"package":{"type":"string"},"pinned_version":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/plugin_runs/latest":{"get":{"operationId":"getLatestPluginRuns","tags":["x-internal"],"description":"This is an internal-only endpoint.","parameters":[{"name":"site_id","in":"path","type":"string","required":true},{"name":"packages","in":"query","type":"array","items":{"type":"string"},"required":true},{"name":"state","in":"query","type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"allOf":[{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}},{"type":"object","properties":{"deploy_id":{"type":"string"}}}]}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/plugin_runs":{"post":{"operationId":"createPluginRun","tags":["x-internal"],"description":"This is an internal-only endpoint.","parameters":[{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"plugin_run","in":"body","schema":{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}}}],"responses":{"201":{"description":"CREATED","schema":{"allOf":[{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}},{"type":"object","properties":{"deploy_id":{"type":"string"}}}]}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/forms/{form_id}/submissions":{"get":{"operationId":"listFormSubmissions","tags":["submission"],"parameters":[{"name":"form_id","type":"string","in":"path","required":true},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","format":"int32"},"email":{"type":"string"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"summary":{"type":"string"},"body":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"site_url":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/hooks":{"get":{"operationId":"listHooksBySiteId","tags":["hook"],"parameters":[{"name":"site_id","in":"query","type":"string","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createHookBySiteId","tags":["hook"],"consumes":["application/json"],"parameters":[{"name":"site_id","type":"string","in":"query","required":true},{"name":"hook","in":"body","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}},"required":true}],"responses":{"201":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/hooks/{hook_id}":{"parameters":[{"name":"hook_id","type":"string","in":"path","required":true}],"get":{"operationId":"getHook","tags":["hook"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateHook","tags":["hook"],"parameters":[{"name":"hook","in":"body","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteHook","tags":["hook"],"responses":{"204":{"description":"No content"}}}},"/hooks/{hook_id}/enable":{"parameters":[{"name":"hook_id","type":"string","in":"path","required":true}],"post":{"operationId":"enableHook","tags":["hook"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/hooks/types":{"get":{"operationId":"listHookTypes","tags":["hookType"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object"}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/oauth/tickets":{"post":{"operationId":"createTicket","tags":["ticket"],"parameters":[{"name":"client_id","type":"string","in":"query","required":true}],"responses":{"201":{"description":"ok","schema":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"authorized":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/oauth/tickets/{ticket_id}":{"get":{"operationId":"showTicket","tags":["ticket"],"parameters":[{"name":"ticket_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"ok","schema":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"authorized":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/oauth/tickets/{ticket_id}/exchange":{"post":{"operationId":"exchangeTicket","tags":["accessToken"],"parameters":[{"name":"ticket_id","type":"string","in":"path","required":true}],"responses":{"201":{"description":"ok","schema":{"type":"object","properties":{"id":{"type":"string"},"access_token":{"type":"string"},"user_id":{"type":"string"},"user_email":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploy_keys":{"get":{"operationId":"listDeployKeys","tags":["deployKey"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createDeployKey","tags":["deployKey"],"consumes":["application/json"],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploy_keys/{key_id}":{"parameters":[{"name":"key_id","type":"string","in":"path","required":true}],"get":{"operationId":"getDeployKey","tags":["deployKey"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteDeployKey","tags":["deployKey"],"responses":{"204":{"description":"Not Content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/{account_slug}/sites":{"post":{"operationId":"createSiteInTeam","tags":["site"],"consumes":["application/json"],"parameters":[{"name":"site","in":"body","schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}},{"properties":{"repo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}}}}]}},{"name":"configure_dns","type":"boolean","in":"query"},{"name":"account_slug","in":"path","type":"string","required":true}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values will soon be moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site."},"get":{"operationId":"listSitesForAccount","tags":["site"],"parameters":[{"name":"name","in":"query","type":"string"},{"name":"account_slug","in":"path","type":"string","required":true},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values will soon be moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables."}},"/{account_slug}/members":{"parameters":[{"name":"account_slug","in":"path","type":"string","required":true}],"get":{"operationId":"listMembersForAccount","tags":["member"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"addMemberToAccount","tags":["member"],"consumes":["application/json"],"parameters":[{"name":"accountAddMemberSetup","in":"body","schema":{"type":"object","properties":{"role":{"type":"string","enum":["Owner","Collaborator","Controller"]},"email":{"type":"string"}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/{account_slug}/members/{member_id}":{"parameters":[{"name":"account_slug","in":"path","type":"string","required":true},{"name":"member_id","in":"path","type":"string","required":true}],"get":{"operationId":"getAccountMember","tags":["member"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateAccountMember","tags":["member"],"consumes":["application/json"],"parameters":[{"name":"accountUpdateMemberSetup","in":"body","schema":{"type":"object","properties":{"role":{"type":"string","enum":["Owner","Collaborator","Controller"]},"site_access":{"type":"string","enum":["all","none","selected"]},"site_ids":{"type":"array","items":{"type":"string"}}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"removeAccountMember","tags":["member"],"responses":{"204":{"description":"Not Content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/billing/payment_methods":{"get":{"operationId":"listPaymentMethodsForUser","tags":["paymentMethod"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"method_name":{"type":"string"},"type":{"type":"string"},"state":{"type":"string"},"data":{"type":"object","properties":{"card_type":{"type":"string"},"last4":{"type":"string"},"email":{"type":"string"}}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts/types":{"get":{"operationId":"listAccountTypesForUser","tags":["accountType"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"object"},"monthly_dollar_price":{"type":"integer"},"yearly_dollar_price":{"type":"integer"},"monthly_seats_addon_dollar_price":{"type":"integer"},"yearly_seats_addon_dollar_price":{"type":"integer"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts":{"get":{"operationId":"listAccountsForUser","tags":["accountMembership"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createAccount","tags":["accountMembership"],"parameters":[{"name":"accountSetup","in":"body","schema":{"type":"object","required":["name","type_id"],"properties":{"name":{"type":"string"},"type_id":{"type":"string"},"payment_method_id":{"type":"string"},"period":{"type":"string","enum":["monthly","yearly"]},"extra_seats_block":{"type":"integer"}}},"required":true}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts/{account_id}":{"parameters":[{"name":"account_id","type":"string","in":"path","required":true}],"get":{"operationId":"getAccount","tags":["accountMembership"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateAccount","tags":["accountMembership"],"parameters":[{"name":"accountUpdateSetup","in":"body","schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"type_id":{"type":"string"},"extra_seats_block":{"type":"integer"},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"}}}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"cancelAccount","tags":["accountMembership"],"responses":{"204":{"description":"Not Content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts/{account_id}/audit":{"parameters":[{"name":"account_id","type":"string","in":"path","required":true}],"get":{"operationId":"listAccountAuditEvents","tags":["auditLog"],"parameters":[{"name":"query","type":"string","in":"query"},{"name":"log_type","type":"string","in":"query"},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"payload":{"type":"object","properties":{"actor_id":{"type":"string"},"actor_name":{"type":"string"},"actor_email":{"type":"string"},"action":{"type":"string"},"timestamp":{"type":"string","format":"dateTime"},"log_type":{"type":"string"}},"additionalProperties":{"type":"object"}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/submissions/{submission_id}":{"parameters":[{"name":"submission_id","type":"string","in":"path","required":true}],"get":{"operationId":"listFormSubmission","tags":["submission"],"parameters":[{"name":"query","type":"string","in":"query"},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","format":"int32"},"email":{"type":"string"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"summary":{"type":"string"},"body":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"site_url":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSubmission","tags":["submission"],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/service-instances":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listServiceInstancesForSite","tags":["serviceInstance"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"object"},"external_attributes":{"type":"object"},"service_slug":{"type":"string"},"service_path":{"type":"string"},"service_name":{"type":"string"},"env":{"type":"object"},"snippets":{"type":"array","items":{"type":"object"}},"auth_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/services/{addon}/instances":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"addon","type":"string","in":"path","required":true}],"post":{"operationId":"createServiceInstance","tags":["serviceInstance"],"consumes":["application/json"],"parameters":[{"name":"config","in":"body","required":true,"schema":{"type":"object"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"object"},"external_attributes":{"type":"object"},"service_slug":{"type":"string"},"service_path":{"type":"string"},"service_name":{"type":"string"},"env":{"type":"object"},"snippets":{"type":"array","items":{"type":"object"}},"auth_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/services/{addon}/instances/{instance_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"addon","type":"string","in":"path","required":true},{"name":"instance_id","type":"string","in":"path","required":true}],"get":{"operationId":"showServiceInstance","tags":["serviceInstance"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"object"},"external_attributes":{"type":"object"},"service_slug":{"type":"string"},"service_path":{"type":"string"},"service_name":{"type":"string"},"env":{"type":"object"},"snippets":{"type":"array","items":{"type":"object"}},"auth_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateServiceInstance","tags":["serviceInstance"],"consumes":["application/json"],"parameters":[{"name":"config","in":"body","required":true,"schema":{"type":"object"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteServiceInstance","tags":["serviceInstance"],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/services/":{"parameters":[{"name":"search","type":"string","in":"query"}],"get":{"operationId":"getServices","tags":["service"],"responses":{"200":{"description":"services","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"service_path":{"type":"string"},"long_description":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"type":"object"}},"tags":{"type":"array","items":{"type":"string"}},"icon":{"type":"string"},"manifest_url":{"type":"string"},"environments":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/services/{addonName}":{"parameters":[{"name":"addonName","type":"string","in":"path","required":true}],"get":{"operationId":"showService","tags":["service"],"responses":{"200":{"description":"services","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"service_path":{"type":"string"},"long_description":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"type":"object"}},"tags":{"type":"array","items":{"type":"string"}},"icon":{"type":"string"},"manifest_url":{"type":"string"},"environments":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/services/{addonName}/manifest":{"parameters":[{"name":"addonName","type":"string","in":"path","required":true}],"get":{"operationId":"showServiceManifest","tags":["service"],"responses":{"201":{"description":"retrieving from provider","schema":{"type":"object"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/user":{"get":{"operationId":"getCurrentUser","tags":["user"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"full_name":{"type":"string"},"avatar_url":{"type":"string"},"email":{"type":"string"},"affiliate_id":{"type":"string"},"site_count":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"last_login":{"type":"string","format":"dateTime"},"login_providers":{"type":"array","items":{"type":"string"}},"onboarding_progress":{"type":"object","properties":{"slides":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/traffic_splits":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"post":{"operationId":"createSplitTest","tags":["splitTest"],"consumes":["application/json"],"parameters":[{"name":"branch_tests","in":"body","required":true,"schema":{"type":"object","properties":{"branch_tests":{"type":"object"}}}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"get":{"operationId":"getSplitTests","tags":["splitTest"],"responses":{"200":{"description":"split_tests","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/traffic_splits/{split_test_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"split_test_id","type":"string","in":"path","required":true}],"put":{"operationId":"updateSplitTest","tags":["splitTest"],"consumes":["application/json"],"parameters":[{"name":"branch_tests","in":"body","required":true,"schema":{"type":"object","properties":{"branch_tests":{"type":"object"}}}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"get":{"operationId":"getSplitTest","tags":["splitTest"],"responses":{"200":{"description":"split_test","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/traffic_splits/{split_test_id}/publish":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"split_test_id","type":"string","in":"path","required":true}],"post":{"operationId":"enableSplitTest","tags":["splitTest"],"responses":{"204":{"description":"enable"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/traffic_splits/{split_test_id}/unpublish":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"split_test_id","type":"string","in":"path","required":true}],"post":{"operationId":"disableSplitTest","tags":["splitTest"],"responses":{"204":{"description":"disabled"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones":{"post":{"operationId":"createDnsZone","tags":["dnsZone"],"consumes":["application/json"],"parameters":[{"name":"DnsZoneParams","in":"body","required":true,"schema":{"type":"object","properties":{"account_slug":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"}}}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"get":{"operationId":"getDnsZones","tags":["dnsZone"],"parameters":[{"name":"account_slug","in":"query","type":"string","required":false}],"responses":{"200":{"description":"get all DNS zones the user has access to","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones/{zone_id}":{"parameters":[{"name":"zone_id","type":"string","in":"path","required":true}],"get":{"operationId":"getDnsZone","tags":["dnsZone"],"responses":{"200":{"description":"get a single DNS zone","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteDnsZone","tags":["dnsZone"],"responses":{"204":{"description":"delete a single DNS zone"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones/{zone_id}/transfer":{"parameters":[{"name":"zone_id","type":"string","in":"path","required":true},{"name":"account_id","type":"string","in":"query","description":"the account of the dns zone","required":true},{"name":"transfer_account_id","type":"string","in":"query","description":"the account you want to transfer the dns zone to","required":true},{"name":"transfer_user_id","type":"string","in":"query","description":"the user you want to transfer the dns zone to","required":true}],"put":{"operationId":"transferDnsZone","tags":["dnsZone"],"responses":{"200":{"description":"transfer a DNS zone to another account","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones/{zone_id}/dns_records":{"parameters":[{"name":"zone_id","type":"string","in":"path","required":true}],"get":{"operationId":"getDnsRecords","tags":["dnsZone"],"responses":{"200":{"description":"get all DNS records for a single DNS zone","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createDnsRecord","tags":["dnsZone"],"consumes":["application/json"],"parameters":[{"name":"dns_record","in":"body","required":true,"schema":{"type":"object","properties":{"type":{"type":"string"},"hostname":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"weight":{"type":"integer","format":"int64"},"port":{"type":"integer","format":"int64"},"flag":{"type":"integer","format":"int64"},"tag":{"type":"string"}}}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones/{zone_id}/dns_records/{dns_record_id}":{"parameters":[{"name":"zone_id","type":"string","in":"path","required":true},{"name":"dns_record_id","type":"string","in":"path","required":true}],"get":{"operationId":"getIndividualDnsRecord","tags":["dnsZone"],"responses":{"200":{"description":"get a single DNS record","schema":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteDnsRecord","tags":["dnsZone"],"responses":{"204":{"description":"record deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}}},"definitions":{"splitTestSetup":{"type":"object","properties":{"branch_tests":{"type":"object"}}},"splitTests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}},"splitTest":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}},"serviceInstance":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"object"},"external_attributes":{"type":"object"},"service_slug":{"type":"string"},"service_path":{"type":"string"},"service_name":{"type":"string"},"env":{"type":"object"},"snippets":{"type":"array","items":{"type":"object"}},"auth_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"service":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"service_path":{"type":"string"},"long_description":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"type":"object"}},"tags":{"type":"array","items":{"type":"string"}},"icon":{"type":"string"},"manifest_url":{"type":"string"},"environments":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"site":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}},"siteSetup":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"skip":{"type":"boolean"},"css":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"js":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"images":{"type":"object","properties":{"optimize":{"type":"boolean"}}},"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"}}},{"properties":{"repo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}}}}]},"repoInfo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"submission":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","format":"int32"},"email":{"type":"string"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"summary":{"type":"string"},"body":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"site_url":{"type":"string"}}},"envVar":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"},"envVarValue":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."}},"description":"Environment variable value model definition"},"envVarUser":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}},"form":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"paths":{"type":"array","items":{"type":"string"}},"submission_count":{"type":"integer","format":"int32"},"fields":{"type":"array","items":{"type":"object"}},"created_at":{"type":"string","format":"dateTime"}}},"hookType":{"type":"object","properties":{"name":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object"}}}},"hook":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}},"file":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","format":"int64"}}},"function":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sha":{"type":"string"}}},"snippet":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}},"deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"site_capabilities":{"type":"object","properties":{"large_media_enabled":{"type":"boolean"}}},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"deployFiles":{"type":"object","properties":{"files":{"type":"object"},"draft":{"type":"boolean"},"async":{"type":"boolean"},"functions":{"type":"object"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}},"functions_config":{"type":"object","additionalProperties":{"type":"object","properties":{"display_name":{"type":"string"},"generator":{"type":"string"}}}},"branch":{"type":"string"},"framework":{"type":"string"}}},"pluginParams":{"type":"object","properties":{"pinned_version":{"type":"string"}}},"plugin":{"type":"object","properties":{"package":{"type":"string"},"pinned_version":{"type":"string"}}},"buildStatus":{"type":"object","properties":{"active":{"type":"integer"},"pending_concurrency":{"type":"integer"},"enqueued":{"type":"integer"},"build_count":{"type":"integer"},"minutes":{"type":"object","properties":{"current":{"type":"integer"},"current_average_sec":{"type":"integer"},"previous":{"type":"integer"},"period_start_date":{"type":"string","format":"dateTime"},"period_end_date":{"type":"string","format":"dateTime"},"last_updated_at":{"type":"string","format":"dateTime"},"included_minutes":{"type":"string"},"included_minutes_with_packs":{"type":"string"}}}}},"build":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"sha":{"type":"string"},"done":{"type":"boolean"},"error":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}},"buildLogMsg":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"boolean"},"section":{"type":"string","enum":["initializing","building","deploying","cleanup","postprocessing"]}}},"pluginRunData":{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}},"pluginRun":{"allOf":[{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}},{"type":"object","properties":{"deploy_id":{"type":"string"}}}]},"metadata":{"type":"object"},"dnsZoneSetup":{"type":"object","properties":{"account_slug":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"}}},"dnsZones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}},"dnsZone":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}},"dnsRecordCreate":{"type":"object","properties":{"type":{"type":"string"},"hostname":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"weight":{"type":"integer","format":"int64"},"port":{"type":"integer","format":"int64"},"flag":{"type":"integer","format":"int64"},"tag":{"type":"string"}}},"dnsRecords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dnsRecord":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}},"sniCertificate":{"type":"object","properties":{"state":{"type":"string"},"domains":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"expires_at":{"type":"string","format":"dateTime"}}},"ticket":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"authorized":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"}}},"accessToken":{"type":"object","properties":{"id":{"type":"string"},"access_token":{"type":"string"},"user_id":{"type":"string"},"user_email":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}},"asset":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"assetForm":{"type":"object","properties":{"url":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}}}},"assetSignature":{"type":"object","properties":{"form":{"type":"object","properties":{"url":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}}}},"asset":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"assetPublicSignature":{"type":"object","properties":{"url":{"type":"string"}}},"deployKey":{"type":"object","properties":{"id":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}},"member":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}},"paymentMethod":{"type":"object","properties":{"id":{"type":"string"},"method_name":{"type":"string"},"type":{"type":"string"},"state":{"type":"string"},"data":{"type":"object","properties":{"card_type":{"type":"string"},"last4":{"type":"string"},"email":{"type":"string"}}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"accountType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"object"},"monthly_dollar_price":{"type":"integer"},"yearly_dollar_price":{"type":"integer"},"monthly_seats_addon_dollar_price":{"type":"integer"},"yearly_seats_addon_dollar_price":{"type":"integer"}}},"accountSetup":{"type":"object","required":["name","type_id"],"properties":{"name":{"type":"string"},"type_id":{"type":"string"},"payment_method_id":{"type":"string"},"period":{"type":"string","enum":["monthly","yearly"]},"extra_seats_block":{"type":"integer"}}},"accountUpdateSetup":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"type_id":{"type":"string"},"extra_seats_block":{"type":"integer"},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"}}},"accountAddMemberSetup":{"type":"object","properties":{"role":{"type":"string","enum":["Owner","Collaborator","Controller"]},"email":{"type":"string"}}},"accountUpdateMemberSetup":{"type":"object","properties":{"role":{"type":"string","enum":["Owner","Collaborator","Controller"]},"site_access":{"type":"string","enum":["all","none","selected"]},"site_ids":{"type":"array","items":{"type":"string"}}}},"accountMembership":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"auditLog":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"payload":{"type":"object","properties":{"actor_id":{"type":"string"},"actor_name":{"type":"string"},"actor_email":{"type":"string"},"action":{"type":"string"},"timestamp":{"type":"string","format":"dateTime"},"log_type":{"type":"string"}},"additionalProperties":{"type":"object"}}}},"accountUsageCapability":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"minifyOptions":{"type":"object","properties":{"bundle":{"type":"boolean"},"minify":{"type":"boolean"}}},"buildSetup":{"type":"object","properties":{"image":{"type":"string"},"clear_cache":{"type":"boolean"}}},"buildHookSetup":{"type":"object","properties":{"title":{"type":"string"},"branch":{"type":"string"}}},"buildHook":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"branch":{"type":"string"},"url":{"type":"string"},"site_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}},"deployedBranch":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"}}},"user":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"full_name":{"type":"string"},"avatar_url":{"type":"string"},"email":{"type":"string"},"affiliate_id":{"type":"string"},"site_count":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"last_login":{"type":"string","format":"dateTime"},"login_providers":{"type":"array","items":{"type":"string"}},"onboarding_progress":{"type":"object","properties":{"slides":{"type":"string"}}}}},"error":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}},"functionSchedule":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}},"functionConfig":{"type":"object","properties":{"display_name":{"type":"string"},"generator":{"type":"string"}}}},"parameters":{"page":{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},"perPage":{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"},"retryCount":{"name":"X-Nf-Retry-Count","type":"integer","in":"header"}},"x-tagGroups":[{"name":"OAuth","tags":["ticket","accessToken"]},{"name":"User accounts","tags":["user","accountMembership","member","accountType","paymentMethod","auditLog"]},{"name":"Site","tags":["site","environmentVariables","file","metadata","snippet"]},{"name":"Domain names","tags":["dnsZone","sniCertificate"]},{"name":"Deploys","tags":["deploy","deployedBranch","deployKey"]},{"name":"Builds","tags":["build","buildLogMsg"]},{"name":"Webhooks and notifications","tags":["hook","hookType","buildHook"]},{"name":"Services","tags":["service","serviceInstance"]},{"name":"Functions","tags":["function"]},{"name":"Forms","tags":["form","submission"]},{"name":"Split tests","tags":["splitTest"]},{"name":"Large media","tags":["asset","assetPublicSignature"]}],"tags":[{"name":"ticket","x-displayName":"Ticket"},{"name":"accessToken","x-displayName":"Access token"},{"name":"user","x-displayName":"User"},{"name":"accountMembership","x-displayName":"Accounts"},{"name":"member","x-displayName":"Member"},{"name":"accountType","x-displayName":"Access type"},{"name":"paymentMethod","x-displayName":"Payment method"},{"name":"auditLog","x-displayName":"Audit log"},{"name":"site","x-displayName":"Site"},{"name":"environmentVariables","x-displayName":"Environment variables"},{"name":"file","x-displayName":"File"},{"name":"metadata","x-displayName":"Metadata"},{"name":"snippet","x-displayName":"Snippet"},{"name":"dnsZone","x-displayName":"DNS zone"},{"name":"sniCertificate","x-displayName":"SNI certificate"},{"name":"deploy","x-displayName":"Deploy"},{"name":"deployedBranch","x-displayName":"Deployed branch"},{"name":"deployKey","x-displayName":"Deploy key"},{"name":"build","x-displayName":"Build"},{"name":"buildLogMsg","x-displayName":"Build log message"},{"name":"hook","x-displayName":"Hook"},{"name":"hookType","x-displayName":"Hook type"},{"name":"buildHook","x-displayName":"Build hook"},{"name":"service","x-displayName":"Service"},{"name":"serviceInstance","x-displayName":"Service instance"},{"name":"function","x-displayName":"Function"},{"name":"form","x-displayName":"Form"},{"name":"submission","x-displayName":"Form submission"},{"name":"splitTest","x-displayName":"Split test"},{"name":"asset","x-displayName":"Asset"},{"name":"assetPublicSignature","x-displayName":"Asset public signature"}]}'); +module.exports = JSON.parse('{"swagger":"2.0","info":{"version":"2.28.0","title":"Netlify\'s API documentation","description":"Netlify is a hosting service for the programmable web. It understands your documents and provides an API to handle atomic deploys of websites, manage form submissions, inject JavaScript snippets, and much more. This is a REST-style API that uses JSON for serialization and OAuth 2 for authentication.\\n\\nThis document is an OpenAPI reference for the Netlify API that you can explore. For more detailed instructions for common uses, please visit the [online documentation](https://www.netlify.com/docs/api/). Visit our Community forum to join the conversation about [understanding and using Netlify’s API](https://community.netlify.com/t/common-issue-understanding-and-using-netlifys-api/160).\\n\\nAdditionally, we have two API clients for your convenience:\\n- [Go Client](https://github.com/netlify/open-api#go-client)\\n- [JS Client](https://github.com/netlify/build/tree/main/packages/js-client)","termsOfService":"https://www.netlify.com/legal/terms-of-use/","x-logo":{"url":"netlify-logo.png","href":"https://www.netlify.com/docs/","altText":"Netlify"}},"externalDocs":{"url":"https://www.netlify.com/docs/api/","description":"Online documentation"},"securityDefinitions":{"netlifyAuth":{"type":"oauth2","flow":"implicit","authorizationUrl":"https://app.netlify.com/authorize"}},"security":[{"netlifyAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"schemes":["https"],"responses":{"error":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"host":"api.netlify.com","basePath":"/api/v1","paths":{"/sites":{"get":{"operationId":"listSites","tags":["site"],"parameters":[{"name":"name","in":"query","type":"string"},{"name":"filter","in":"query","type":"string","enum":["all","owner","guest"]},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables."},"post":{"operationId":"createSite","tags":["site"],"consumes":["application/json"],"parameters":[{"name":"site","in":"body","schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}},{"properties":{"repo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}}}}]},"required":true},{"name":"configure_dns","type":"boolean","in":"query"}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site."}},"/sites/{site_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSite","tags":["site"],"parameters":[{"name":"feature_flags","x-internal":true,"type":"string","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables."},"patch":{"operationId":"updateSite","tags":["site"],"consumes":["application/json"],"parameters":[{"name":"site","in":"body","schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}},{"properties":{"repo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}}}}]},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [updateEnvVar](#tag/environmentVariables/operation/updateEnvVar) to update a site\'s environment variables."},"delete":{"operationId":"deleteSite","tags":["site"],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/ssl":{"post":{"operationId":"provisionSiteTLSCertificate","tags":["sniCertificate"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"certificate","type":"string","in":"query"},{"name":"key","type":"string","in":"query"},{"name":"ca_certificates","type":"string","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"state":{"type":"string"},"domains":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"expires_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"get":{"operationId":"showSiteTLSCertificate","tags":["sniCertificate"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"state":{"type":"string"},"domains":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"expires_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts/{account_id}/env":{"get":{"tags":["environmentVariables"],"operationId":"getEnvVars","parameters":[{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"context_name","description":"Filter by deploy context","type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"],"required":false,"in":"query"},{"name":"scope","description":"Filter by scope","type":"string","enum":["builds","functions","runtime","post-processing"],"required":false,"in":"query"},{"name":"site_id","description":"If specified, only return environment variables set on this site","type":"string","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"is_secret":{"type":"boolean","description":"Secret values are only readable by code running on Netlify’s systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. (Enterprise plans only)"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI."},"post":{"tags":["environmentVariables"],"operationId":"createEnvVars","description":"Creates new environment variables. Granular scopes are available on Pro plans and above. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI.","parameters":[{"in":"body","name":"env_vars","schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The existing or new name of the key, if you wish to rename it (case-sensitive)"},"scopes":{"description":"The scopes that this environment variable is set to (Pro plans and above)","type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]}},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"}},"is_secret":{"type":"boolean","description":"Secret values are only readable by code running on Netlify’s systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. (Enterprise plans only)"}}}}},{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"site_id","description":"If provided, create an environment variable on the site level, not the account level","type":"string","required":false,"in":"query"}],"responses":{"201":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"is_secret":{"type":"boolean","description":"Secret values are only readable by code running on Netlify’s systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. (Enterprise plans only)"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/api/v1/sites/{site_id}/env":{"get":{"tags":["environmentVariables"],"operationId":"getSiteEnvVars","parameters":[{"name":"context_name","description":"Filter by deploy context","required":false,"in":"query","type":"string","enum":["all","dev","branch-deploy","deploy-preview","production"]},{"name":"scope","description":"Filter by scope","required":false,"in":"query","type":"string","enum":["builds","functions","runtime","post_processing"]},{"name":"site_id","description":"Scope response to site_id","required":true,"type":"string","in":"path"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"is_secret":{"type":"boolean","description":"Secret values are only readable by code running on Netlify’s systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. (Enterprise plans only)"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars` but doesn\'t require an `account_id` as input."}},"/accounts/{account_id}/env/{key}":{"get":{"tags":["environmentVariables"],"operationId":"getEnvVar","parameters":[{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"key","description":"The environment variable key (case-sensitive)","type":"string","required":true,"in":"path"},{"name":"site_id","description":"If provided, return the environment variable for a specific site (no merging is performed)","type":"string","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"is_secret":{"type":"boolean","description":"Secret values are only readable by code running on Netlify’s systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. (Enterprise plans only)"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"Returns an individual environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI."},"put":{"tags":["environmentVariables"],"operationId":"updateEnvVar","description":"Updates an existing environment variable and all of its values. Existing values will be replaced by values provided. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI.","parameters":[{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"key","description":"The existing environment variable key name (case-sensitive)","type":"string","required":true,"in":"path"},{"in":"body","name":"env_var","schema":{"type":"object","properties":{"key":{"type":"string","description":"The existing or new name of the key, if you wish to rename it (case-sensitive)"},"scopes":{"description":"The scopes that this environment variable is set to (Pro plans and above)","type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]}},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"}},"is_secret":{"type":"boolean","description":"Secret values are only readable by code running on Netlify’s systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. (Enterprise plans only)"}}}},{"name":"site_id","description":"If provided, update an environment variable set on this site","type":"string","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"is_secret":{"type":"boolean","description":"Secret values are only readable by code running on Netlify’s systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. (Enterprise plans only)"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"patch":{"tags":["environmentVariables"],"operationId":"setEnvVarValue","description":"Updates or creates a new value for an existing environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI.","parameters":[{"name":"account_id","description":"Scope response to account_id","required":true,"type":"string","in":"path"},{"name":"key","description":"The existing environment variable key name (case-sensitive)","required":true,"type":"string","in":"path"},{"name":"site_id","description":"If provided, update an environment variable set on this site","in":"query","type":"string"},{"in":"body","name":"env_var","schema":{"type":"object","properties":{"context":{"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. `branch` must be provided with a value in `context_parameter`.","type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"]},"context_parameter":{"description":"An additional parameter for custom branches. Currently, this is used for providing a branch name when `context=branch`.","type":"string"},"value":{"description":"The environment variable\'s unencrypted value","type":"string"}}}}],"responses":{"201":{"description":"Created (success)","schema":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"is_secret":{"type":"boolean","description":"Secret values are only readable by code running on Netlify’s systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. (Enterprise plans only)"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"tags":["environmentVariables"],"operationId":"deleteEnvVar","parameters":[{"name":"account_id","description":"Scope response to account_id","type":"string","required":true,"in":"path"},{"name":"key","description":"The environment variable key (case-sensitive)","type":"string","required":true,"in":"path"},{"name":"site_id","description":"If provided, delete the environment variable from this site","type":"string","required":false,"in":"query"}],"responses":{"204":{"description":"No Content (success)"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"Deletes an environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI."}},"/accounts/{account_id}/env/{key}/value/{id}":{"delete":{"tags":["environmentVariables"],"operationId":"deleteEnvVarValue","parameters":[{"name":"account_id","description":"Scope response to account_id","required":true,"in":"path","type":"string"},{"name":"id","description":"The environment variable value\'s ID","type":"string","required":true,"in":"path"},{"name":"key","description":"The environment variable key name (case-sensitive)","type":"string","required":true,"in":"path"},{"name":"site_id","description":"If provided, delete the value from an environment variable on this site","type":"string","required":false,"in":"query"}],"responses":{"204":{"description":"No Content (success)"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"Deletes a specific environment variable value. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Netlify UI."}},"/sites/{site_id}/functions":{"get":{"operationId":"searchSiteFunctions","tags":["function"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"filter","type":"string","in":"query","required":false}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"branch":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"functions":{"type":"array","items":{"type":"object"}},"id":{"type":"string"},"log_type":{"type":"string"},"provider":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/forms":{"get":{"operationId":"listSiteForms","tags":["form"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"paths":{"type":"array","items":{"type":"string"}},"submission_count":{"type":"integer","format":"int32"},"fields":{"type":"array","items":{"type":"object"}},"created_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/forms/{form_id}":{"delete":{"operationId":"deleteSiteForm","tags":["form"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"form_id","type":"string","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/submissions":{"get":{"operationId":"listSiteSubmissions","tags":["submission"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","format":"int32"},"email":{"type":"string"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"summary":{"type":"string"},"body":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"site_url":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/files":{"get":{"operationId":"listSiteFiles","tags":["file"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","format":"int64"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/assets":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteAssets","tags":["asset"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteAsset","tags":["asset"],"parameters":[{"name":"name","type":"string","in":"query","required":true},{"name":"size","type":"integer","format":"int64","in":"query","required":true},{"name":"content_type","type":"string","in":"query","required":true},{"name":"visibility","type":"string","in":"query"}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"form":{"type":"object","properties":{"url":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}}}},"asset":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/assets/{asset_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"asset_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteAssetInfo","tags":["asset"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteAsset","tags":["asset"],"parameters":[{"name":"state","type":"string","in":"query","required":true}],"responses":{"200":{"description":"Updated","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSiteAsset","tags":["asset"],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/assets/{asset_id}/public_signature":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"asset_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteAssetPublicSignature","tags":["assetPublicSignature"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"url":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/files/{file_path}":{"get":{"operationId":"getSiteFileByPathName","tags":["file"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"file_path","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","format":"int64"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/purge":{"post":{"operationId":"purgeCache","description":"Purges cached content from Netlify\'s CDN. Supports purging by Cache-Tag.","tags":["purge"],"consumes":["application/json"],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"site_id":{"type":"string"},"site_slug":{"type":"string"},"cache_tags":{"type":"array","items":{"type":"string"}}}},"required":true}],"responses":{"202":{"description":"OK"},"400":{"description":"Invalid request parameters"},"404":{"description":"Site not found"}}}},"/sites/{site_id}/snippets":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteSnippets","tags":["snippet"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteSnippet","tags":["snippet"],"consumes":["application/json"],"parameters":[{"name":"snippet","in":"body","schema":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}},"required":true}],"responses":{"201":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/snippets/{snippet_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"snippet_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteSnippet","tags":["snippet"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteSnippet","tags":["snippet"],"consumes":["application/json"],"parameters":[{"name":"snippet","in":"body","schema":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}},"required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSiteSnippet","tags":["snippet"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/metadata":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteMetadata","tags":["metadata"],"responses":{"200":{"description":"OK","schema":{"type":"object"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteMetadata","tags":["metadata"],"parameters":[{"name":"metadata","in":"body","schema":{"type":"object"},"required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/build_hooks":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteBuildHooks","tags":["buildHook"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"branch":{"type":"string"},"url":{"type":"string"},"site_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteBuildHook","tags":["buildHook"],"consumes":["application/json"],"parameters":[{"name":"buildHook","in":"body","schema":{"type":"object","properties":{"title":{"type":"string"},"branch":{"type":"string"}}},"required":true}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"branch":{"type":"string"},"url":{"type":"string"},"site_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/build_hooks/{id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteBuildHook","tags":["buildHook"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"branch":{"type":"string"},"url":{"type":"string"},"site_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteBuildHook","tags":["buildHook"],"consumes":["application/json"],"parameters":[{"name":"buildHook","in":"body","schema":{"type":"object","properties":{"title":{"type":"string"},"branch":{"type":"string"}}},"required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSiteBuildHook","tags":["buildHook"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/deploys":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"deploy-previews","type":"boolean","in":"query"},{"name":"production","type":"boolean","in":"query"},{"name":"state","type":"string","enum":["new","pending_review","accepted","rejected","enqueued","building","uploading","uploaded","preparing","prepared","processing","processed","ready","error","retrying"],"in":"query"},{"name":"branch","type":"string","in":"query"},{"name":"latest-published","type":"boolean","in":"query"}],"get":{"operationId":"listSiteDeploys","tags":["deploy"],"parameters":[{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteDeploy","tags":["deploy"],"parameters":[{"name":"title","type":"string","in":"query"},{"name":"deploy","in":"body","schema":{"type":"object","properties":{"files":{"type":"object"},"draft":{"type":"boolean"},"async":{"type":"boolean"},"functions":{"type":"object"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}},"functions_config":{"type":"object","additionalProperties":{"type":"object","properties":{"display_name":{"type":"string"},"generator":{"type":"string"},"build_data":{"type":"object"},"routes":{"type":"array","items":{"type":"object","properties":{"pattern":{"type":"string"},"literal":{"type":"string"},"expression":{"type":"string"},"methods":{"type":"array","items":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE","OPTIONS"]}},"prefer_static":{"type":"boolean"}}}},"priority":{"type":"integer"}}}},"branch":{"type":"string"},"framework":{"type":"string"},"framework_version":{"type":"string"}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/deploys/{deploy_id}":{"get":{"operationId":"getSiteDeploy","tags":["deploy"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateSiteDeploy","tags":["deploy"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"deploy","in":"body","schema":{"type":"object","properties":{"files":{"type":"object"},"draft":{"type":"boolean"},"async":{"type":"boolean"},"functions":{"type":"object"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}},"functions_config":{"type":"object","additionalProperties":{"type":"object","properties":{"display_name":{"type":"string"},"generator":{"type":"string"},"build_data":{"type":"object"},"routes":{"type":"array","items":{"type":"object","properties":{"pattern":{"type":"string"},"literal":{"type":"string"},"expression":{"type":"string"},"methods":{"type":"array","items":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE","OPTIONS"]}},"prefer_static":{"type":"boolean"}}}},"priority":{"type":"integer"}}}},"branch":{"type":"string"},"framework":{"type":"string"},"framework_version":{"type":"string"}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSiteDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"site_id","type":"string","in":"path","required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/cancel":{"post":{"operationId":"cancelSiteDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"201":{"description":"Cancelled","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/deploys/{deploy_id}/restore":{"post":{"operationId":"restoreSiteDeploy","tags":["deploy"],"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/builds":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteBuilds","tags":["build"],"parameters":[{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"sha":{"type":"string"},"done":{"type":"boolean"},"error":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createSiteBuild","tags":["build"],"parameters":[{"name":"build","in":"body","schema":{"type":"object","properties":{"image":{"type":"string"},"clear_cache":{"type":"boolean"}}},"required":false}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"sha":{"type":"string"},"done":{"type":"boolean"},"error":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/deployed-branches":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listSiteDeployedBranches","tags":["deployedBranch"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/unlink_repo":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"put":{"operationId":"unlinkSiteRepo","tags":["site"],"description":"[Beta] Unlinks the repo from the site.\\n\\nThis action will also:\\n- Delete associated deploy keys\\n- Delete outgoing webhooks for the repo\\n- Delete the site\'s build hooks","responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}}},"404":{"description":"Site not found"}}}},"/builds/{build_id}":{"parameters":[{"name":"build_id","type":"string","in":"path","required":true}],"get":{"operationId":"getSiteBuild","tags":["build"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"sha":{"type":"string"},"done":{"type":"boolean"},"error":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/builds/{build_id}/log":{"parameters":[{"name":"build_id","type":"string","in":"path","required":true},{"name":"msg","in":"body","schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"boolean"},"section":{"type":"string","enum":["initializing","building","deploying","cleanup","postprocessing"]}}},"required":true}],"post":{"operationId":"updateSiteBuildLog","tags":["buildLogMsg"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/builds/{build_id}/start":{"parameters":[{"name":"build_id","type":"string","in":"path","required":true},{"name":"buildbot_version","type":"string","in":"query","required":false},{"name":"build_version","type":"string","in":"query","required":false}],"post":{"operationId":"notifyBuildStart","tags":["build"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/{account_id}/builds/status":{"parameters":[{"name":"account_id","type":"string","in":"path","required":true}],"get":{"operationId":"getAccountBuildStatus","tags":["build"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"active":{"type":"integer"},"pending_concurrency":{"type":"integer"},"enqueued":{"type":"integer"},"build_count":{"type":"integer"},"minutes":{"type":"object","properties":{"current":{"type":"integer"},"current_average_sec":{"type":"integer"},"previous":{"type":"integer"},"period_start_date":{"type":"string","format":"dateTime"},"period_end_date":{"type":"string","format":"dateTime"},"last_updated_at":{"type":"string","format":"dateTime"},"included_minutes":{"type":"string"},"included_minutes_with_packs":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/dns":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"getDNSForSite","tags":["dnsZone"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"configureDNSForSite","tags":["dnsZone"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/rollback":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"put":{"operationId":"rollbackSiteDeploy","tags":["deploy"],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}":{"get":{"operationId":"getDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"204":{"description":"No content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/lock":{"post":{"operationId":"lockDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/unlock":{"post":{"operationId":"unlockDeploy","tags":["deploy"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/files/{path}":{"put":{"operationId":"uploadDeployFile","tags":["file"],"consumes":["application/octet-stream"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"path","type":"string","in":"path","required":true},{"name":"size","type":"integer","in":"query"},{"name":"file_body","in":"body","schema":{"type":"string","format":"binary"},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","format":"int64"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/functions/{name}":{"put":{"operationId":"uploadDeployFunction","tags":["function"],"consumes":["application/octet-stream"],"parameters":[{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"name","type":"string","in":"path","required":true},{"name":"runtime","type":"string","in":"query"},{"name":"invocation_mode","in":"query","type":"string"},{"name":"size","type":"integer","in":"query"},{"name":"file_body","in":"body","schema":{"type":"string","format":"binary"},"required":true},{"name":"X-Nf-Retry-Count","type":"integer","in":"header"}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sha":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/plugins/{package}":{"put":{"x-internal":true,"operationId":"updatePlugin","tags":["x-internal"],"description":"This is an internal-only endpoint.","parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"package","type":"string","in":"path","required":true},{"name":"plugin_params","in":"body","schema":{"type":"object","properties":{"pinned_version":{"type":"string"}}}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"package":{"type":"string"},"pinned_version":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/plugin_runs/latest":{"get":{"x-internal":true,"operationId":"getLatestPluginRuns","tags":["x-internal"],"description":"This is an internal-only endpoint.","parameters":[{"name":"site_id","in":"path","type":"string","required":true},{"name":"packages","in":"query","type":"array","items":{"type":"string"},"required":true},{"name":"state","in":"query","type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"allOf":[{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}},{"type":"object","properties":{"deploy_id":{"type":"string"}}}]}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploys/{deploy_id}/plugin_runs":{"post":{"x-internal":true,"operationId":"createPluginRun","tags":["x-internal"],"description":"This is an internal-only endpoint.","parameters":[{"name":"deploy_id","type":"string","in":"path","required":true},{"name":"plugin_run","in":"body","schema":{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}}}],"responses":{"201":{"description":"CREATED","schema":{"allOf":[{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}},{"type":"object","properties":{"deploy_id":{"type":"string"}}}]}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/forms/{form_id}/submissions":{"get":{"operationId":"listFormSubmissions","tags":["submission"],"parameters":[{"name":"form_id","type":"string","in":"path","required":true},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","format":"int32"},"email":{"type":"string"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"summary":{"type":"string"},"body":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"site_url":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/hooks":{"get":{"operationId":"listHooksBySiteId","tags":["hook"],"parameters":[{"name":"site_id","in":"query","type":"string","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createHookBySiteId","tags":["hook"],"consumes":["application/json"],"parameters":[{"name":"site_id","type":"string","in":"query","required":true},{"name":"hook","in":"body","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}},"required":true}],"responses":{"201":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/hooks/{hook_id}":{"parameters":[{"name":"hook_id","type":"string","in":"path","required":true}],"get":{"operationId":"getHook","tags":["hook"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateHook","tags":["hook"],"parameters":[{"name":"hook","in":"body","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteHook","tags":["hook"],"responses":{"204":{"description":"No content"}}}},"/hooks/{hook_id}/enable":{"parameters":[{"name":"hook_id","type":"string","in":"path","required":true}],"post":{"operationId":"enableHook","tags":["hook"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/hooks/types":{"get":{"operationId":"listHookTypes","tags":["hookType"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object"}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/oauth/tickets":{"post":{"operationId":"createTicket","tags":["ticket"],"parameters":[{"name":"client_id","type":"string","in":"query","required":true}],"responses":{"201":{"description":"ok","schema":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"authorized":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/oauth/tickets/{ticket_id}":{"get":{"operationId":"showTicket","tags":["ticket"],"parameters":[{"name":"ticket_id","type":"string","in":"path","required":true}],"responses":{"200":{"description":"ok","schema":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"authorized":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/oauth/tickets/{ticket_id}/exchange":{"post":{"operationId":"exchangeTicket","tags":["accessToken"],"parameters":[{"name":"ticket_id","type":"string","in":"path","required":true}],"responses":{"201":{"description":"ok","schema":{"type":"object","properties":{"id":{"type":"string"},"access_token":{"type":"string"},"user_id":{"type":"string"},"user_email":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploy_keys":{"get":{"operationId":"listDeployKeys","tags":["deployKey"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createDeployKey","tags":["deployKey"],"consumes":["application/json"],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/deploy_keys/{key_id}":{"parameters":[{"name":"key_id","type":"string","in":"path","required":true}],"get":{"operationId":"getDeployKey","tags":["deployKey"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteDeployKey","tags":["deployKey"],"responses":{"204":{"description":"Not Content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/{account_slug}/sites":{"post":{"operationId":"createSiteInTeam","tags":["site"],"consumes":["application/json"],"parameters":[{"name":"site","in":"body","schema":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}},{"properties":{"repo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}}}}]}},{"name":"configure_dns","type":"boolean","in":"query"},{"name":"account_slug","in":"path","type":"string","required":true}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [createEnvVars](#tag/environmentVariables/operation/createEnvVars) to create environment variables for a site."},"get":{"operationId":"listSitesForAccount","tags":["site"],"parameters":[{"name":"name","in":"query","type":"string"},{"name":"account_slug","in":"path","type":"string","required":true},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}},"description":"**Note:** Environment variable keys and values have moved from `build_settings.env` and `repo.env` to a new endpoint. Please use [getEnvVars](#tag/environmentVariables/operation/getEnvVars) to retrieve site environment variables."}},"/{account_slug}/members":{"parameters":[{"name":"account_slug","in":"path","type":"string","required":true}],"get":{"operationId":"listMembersForAccount","tags":["member"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"addMemberToAccount","tags":["member"],"consumes":["application/json"],"parameters":[{"name":"accountAddMemberSetup","in":"body","schema":{"type":"object","properties":{"role":{"type":"string","enum":["Owner","Collaborator","Controller"]},"email":{"type":"string"}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/{account_slug}/members/{member_id}":{"parameters":[{"name":"account_slug","in":"path","type":"string","required":true},{"name":"member_id","in":"path","type":"string","required":true}],"get":{"operationId":"getAccountMember","tags":["member"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateAccountMember","tags":["member"],"consumes":["application/json"],"parameters":[{"name":"accountUpdateMemberSetup","in":"body","schema":{"type":"object","properties":{"role":{"type":"string","enum":["Owner","Collaborator","Controller"]},"site_access":{"type":"string","enum":["all","none","selected"]},"site_ids":{"type":"array","items":{"type":"string"}}}},"required":true}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"removeAccountMember","tags":["member"],"responses":{"204":{"description":"Not Content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/billing/payment_methods":{"get":{"operationId":"listPaymentMethodsForUser","tags":["paymentMethod"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"method_name":{"type":"string"},"type":{"type":"string"},"state":{"type":"string"},"data":{"type":"object","properties":{"card_type":{"type":"string"},"last4":{"type":"string"},"email":{"type":"string"}}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts/types":{"get":{"operationId":"listAccountTypesForUser","tags":["accountType"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"object"},"monthly_dollar_price":{"type":"integer"},"yearly_dollar_price":{"type":"integer"},"monthly_seats_addon_dollar_price":{"type":"integer"},"yearly_seats_addon_dollar_price":{"type":"integer"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts":{"get":{"operationId":"listAccountsForUser","tags":["accountMembership"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createAccount","tags":["accountMembership"],"parameters":[{"name":"accountSetup","in":"body","schema":{"type":"object","required":["name","type_id"],"properties":{"name":{"type":"string"},"type_id":{"type":"string"},"payment_method_id":{"type":"string"},"period":{"type":"string","enum":["monthly","yearly"]},"extra_seats_block":{"type":"integer"}}},"required":true}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts/{account_id}":{"parameters":[{"name":"account_id","type":"string","in":"path","required":true}],"get":{"operationId":"getAccount","tags":["accountMembership"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateAccount","tags":["accountMembership"],"parameters":[{"name":"accountUpdateSetup","in":"body","schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"type_id":{"type":"string"},"extra_seats_block":{"type":"integer"},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"}}}}],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"cancelAccount","tags":["accountMembership"],"responses":{"204":{"description":"Not Content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/accounts/{account_id}/audit":{"parameters":[{"name":"account_id","type":"string","in":"path","required":true}],"get":{"operationId":"listAccountAuditEvents","tags":["auditLog"],"parameters":[{"name":"query","type":"string","in":"query"},{"name":"log_type","type":"string","in":"query"},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"payload":{"type":"object","properties":{"actor_id":{"type":"string"},"actor_name":{"type":"string"},"actor_email":{"type":"string"},"action":{"type":"string"},"timestamp":{"type":"string","format":"dateTime"},"log_type":{"type":"string"}},"additionalProperties":{"type":"object"}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/submissions/{submission_id}":{"parameters":[{"name":"submission_id","type":"string","in":"path","required":true}],"get":{"operationId":"listFormSubmission","tags":["submission"],"parameters":[{"name":"query","type":"string","in":"query"},{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","format":"int32"},"email":{"type":"string"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"summary":{"type":"string"},"body":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"site_url":{"type":"string"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteSubmission","tags":["submission"],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/service-instances":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"get":{"operationId":"listServiceInstancesForSite","tags":["serviceInstance"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"object"},"external_attributes":{"type":"object"},"service_slug":{"type":"string"},"service_path":{"type":"string"},"service_name":{"type":"string"},"env":{"type":"object"},"snippets":{"type":"array","items":{"type":"object"}},"auth_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/services/{addon}/instances":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"addon","type":"string","in":"path","required":true}],"post":{"operationId":"createServiceInstance","tags":["serviceInstance"],"consumes":["application/json"],"parameters":[{"name":"config","in":"body","required":true,"schema":{"type":"object"}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"object"},"external_attributes":{"type":"object"},"service_slug":{"type":"string"},"service_path":{"type":"string"},"service_name":{"type":"string"},"env":{"type":"object"},"snippets":{"type":"array","items":{"type":"object"}},"auth_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/services/{addon}/instances/{instance_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"addon","type":"string","in":"path","required":true},{"name":"instance_id","type":"string","in":"path","required":true}],"get":{"operationId":"showServiceInstance","tags":["serviceInstance"],"responses":{"200":{"description":"OK","schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"object"},"external_attributes":{"type":"object"},"service_slug":{"type":"string"},"service_path":{"type":"string"},"service_name":{"type":"string"},"env":{"type":"object"},"snippets":{"type":"array","items":{"type":"object"}},"auth_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"put":{"operationId":"updateServiceInstance","tags":["serviceInstance"],"consumes":["application/json"],"parameters":[{"name":"config","in":"body","required":true,"schema":{"type":"object"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteServiceInstance","tags":["serviceInstance"],"responses":{"204":{"description":"Deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/services/":{"parameters":[{"name":"search","type":"string","in":"query"}],"get":{"operationId":"getServices","tags":["service"],"responses":{"200":{"description":"services","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"service_path":{"type":"string"},"long_description":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"type":"object"}},"tags":{"type":"array","items":{"type":"string"}},"icon":{"type":"string"},"manifest_url":{"type":"string"},"environments":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/services/{addonName}":{"parameters":[{"name":"addonName","type":"string","in":"path","required":true}],"get":{"operationId":"showService","tags":["service"],"responses":{"200":{"description":"services","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"service_path":{"type":"string"},"long_description":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"type":"object"}},"tags":{"type":"array","items":{"type":"string"}},"icon":{"type":"string"},"manifest_url":{"type":"string"},"environments":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/services/{addonName}/manifest":{"parameters":[{"name":"addonName","type":"string","in":"path","required":true}],"get":{"operationId":"showServiceManifest","tags":["service"],"responses":{"201":{"description":"retrieving from provider","schema":{"type":"object"}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/user":{"get":{"operationId":"getCurrentUser","tags":["user"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"full_name":{"type":"string"},"avatar_url":{"type":"string"},"email":{"type":"string"},"affiliate_id":{"type":"string"},"site_count":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"last_login":{"type":"string","format":"dateTime"},"login_providers":{"type":"array","items":{"type":"string"}},"onboarding_progress":{"type":"object","properties":{"slides":{"type":"string"}}}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/traffic_splits":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true}],"post":{"operationId":"createSplitTest","tags":["splitTest"],"consumes":["application/json"],"parameters":[{"name":"branch_tests","in":"body","required":true,"schema":{"type":"object","properties":{"branch_tests":{"type":"object"}}}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"get":{"operationId":"getSplitTests","tags":["splitTest"],"responses":{"200":{"description":"split_tests","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/traffic_splits/{split_test_id}":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"split_test_id","type":"string","in":"path","required":true}],"put":{"operationId":"updateSplitTest","tags":["splitTest"],"consumes":["application/json"],"parameters":[{"name":"branch_tests","in":"body","required":true,"schema":{"type":"object","properties":{"branch_tests":{"type":"object"}}}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"get":{"operationId":"getSplitTest","tags":["splitTest"],"responses":{"200":{"description":"split_test","schema":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/traffic_splits/{split_test_id}/publish":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"split_test_id","type":"string","in":"path","required":true}],"post":{"operationId":"enableSplitTest","tags":["splitTest"],"responses":{"204":{"description":"enable"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/sites/{site_id}/traffic_splits/{split_test_id}/unpublish":{"parameters":[{"name":"site_id","type":"string","in":"path","required":true},{"name":"split_test_id","type":"string","in":"path","required":true}],"post":{"operationId":"disableSplitTest","tags":["splitTest"],"responses":{"204":{"description":"disabled"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones":{"post":{"operationId":"createDnsZone","tags":["dnsZone"],"consumes":["application/json"],"parameters":[{"name":"DnsZoneParams","in":"body","required":true,"schema":{"type":"object","properties":{"account_slug":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"}}}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"get":{"operationId":"getDnsZones","tags":["dnsZone"],"parameters":[{"name":"account_slug","in":"query","type":"string","required":false}],"responses":{"200":{"description":"get all DNS zones the user has access to","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones/{zone_id}":{"parameters":[{"name":"zone_id","type":"string","in":"path","required":true}],"get":{"operationId":"getDnsZone","tags":["dnsZone"],"responses":{"200":{"description":"get a single DNS zone","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteDnsZone","tags":["dnsZone"],"responses":{"204":{"description":"delete a single DNS zone"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones/{zone_id}/transfer":{"parameters":[{"name":"zone_id","type":"string","in":"path","required":true},{"name":"account_id","type":"string","in":"query","description":"the account of the dns zone","required":true},{"name":"transfer_account_id","type":"string","in":"query","description":"the account you want to transfer the dns zone to","required":true},{"name":"transfer_user_id","type":"string","in":"query","description":"the user you want to transfer the dns zone to","required":true}],"put":{"operationId":"transferDnsZone","tags":["dnsZone"],"responses":{"200":{"description":"transfer a DNS zone to another account","schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones/{zone_id}/dns_records":{"parameters":[{"name":"zone_id","type":"string","in":"path","required":true}],"get":{"operationId":"getDnsRecords","tags":["dnsZone"],"responses":{"200":{"description":"get all DNS records for a single DNS zone","schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"post":{"operationId":"createDnsRecord","tags":["dnsZone"],"consumes":["application/json"],"parameters":[{"name":"dns_record","in":"body","required":true,"schema":{"type":"object","properties":{"type":{"type":"string"},"hostname":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"weight":{"type":"integer","format":"int64"},"port":{"type":"integer","format":"int64"},"flag":{"type":"integer","format":"int64"},"tag":{"type":"string"}}}}],"responses":{"201":{"description":"Created","schema":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}},"/dns_zones/{zone_id}/dns_records/{dns_record_id}":{"parameters":[{"name":"zone_id","type":"string","in":"path","required":true},{"name":"dns_record_id","type":"string","in":"path","required":true}],"get":{"operationId":"getIndividualDnsRecord","tags":["dnsZone"],"responses":{"200":{"description":"get a single DNS record","schema":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}},"delete":{"operationId":"deleteDnsRecord","tags":["dnsZone"],"responses":{"204":{"description":"record deleted"},"default":{"description":"error","schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}}}}}}},"definitions":{"splitTestSetup":{"type":"object","properties":{"branch_tests":{"type":"object"}}},"splitTests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}}},"splitTest":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"branches":{"type":"array","items":{"type":"object"}},"active":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"unpublished_at":{"type":"string","format":"dateTime"}}},"serviceInstance":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"config":{"type":"object"},"external_attributes":{"type":"object"},"service_slug":{"type":"string"},"service_path":{"type":"string"},"service_name":{"type":"string"},"env":{"type":"object"},"snippets":{"type":"array","items":{"type":"object"}},"auth_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"service":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"service_path":{"type":"string"},"long_description":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"type":"object"}},"tags":{"type":"array","items":{"type":"string"}},"icon":{"type":"string"},"manifest_url":{"type":"string"},"environments":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"site":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}},"siteSetup":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"plan":{"type":"string"},"name":{"type":"string"},"custom_domain":{"type":"string"},"domain_aliases":{"type":"array","items":{"type":"string"}},"branch_deploy_custom_domain":{"type":"string"},"deploy_preview_custom_domain":{"type":"string"},"password":{"type":"string"},"notification_email":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"screenshot_url":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"user_id":{"type":"string"},"session_id":{"type":"string"},"ssl":{"type":"boolean"},"force_ssl":{"type":"boolean"},"managed_dns":{"type":"boolean"},"deploy_url":{"type":"string"},"published_deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"account_name":{"type":"string"},"account_slug":{"type":"string"},"git_provider":{"type":"string"},"deploy_hook":{"type":"string"},"capabilities":{"type":"object","additionalProperties":{"type":"object"}},"processing_settings":{"type":"object","properties":{"html":{"type":"object","properties":{"pretty_urls":{"type":"boolean"}}}}},"build_settings":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"id_domain":{"type":"string"},"default_hooks_data":{"type":"object","properties":{"access_token":{"type":"string"}}},"build_image":{"type":"string"},"prerender":{"type":"string"},"functions_region":{"type":"string"}}},{"properties":{"repo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}}}}]},"repoInfo":{"type":"object","properties":{"id":{"type":"integer"},"provider":{"type":"string"},"deploy_key_id":{"type":"string"},"repo_path":{"type":"string"},"repo_branch":{"type":"string"},"dir":{"type":"string"},"functions_dir":{"type":"string"},"cmd":{"type":"string"},"allowed_branches":{"type":"array","items":{"type":"string"}},"public_repo":{"type":"boolean"},"private_logs":{"type":"boolean"},"repo_url":{"type":"string"},"env":{"type":"object","additionalProperties":{"type":"string"}},"installation_id":{"type":"integer"},"stop_builds":{"type":"boolean"}}},"submission":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"integer","format":"int32"},"email":{"type":"string"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"summary":{"type":"string"},"body":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"site_url":{"type":"string"}}},"envVar":{"type":"object","properties":{"key":{"type":"string","description":"The environment variable key, like ALGOLIA_ID (case-sensitive)","x-faker":"commerce.productName"},"scopes":{"type":"array","items":{"type":"string","enum":["builds","functions","runtime","post-processing"]},"description":"The scopes that this environment variable is set to"},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"},"description":"An array of Value objects containing values and metadata","x-faker":"internet.password"},"is_secret":{"type":"boolean","description":"Secret values are only readable by code running on Netlify’s systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. (Enterprise plans only)"},"updated_at":{"type":"string","format":"date-time","description":"The timestamp of when the value was last updated","x-faker":"date.past"},"updated_by":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}}},"description":"Environment variable model definition"},"envVarValue":{"type":"object","properties":{"id":{"type":"string","description":"The environment variable value\'s universally unique ID","x-faker":"datatype.uuid"},"value":{"type":"string","description":"The environment variable\'s unencrypted value","x-faker":"internet.password"},"context":{"type":"string","enum":["all","dev","branch-deploy","deploy-preview","production","branch"],"description":"The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`."},"context_parameter":{"type":"string","description":"An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`."}},"description":"Environment variable value model definition"},"envVarUser":{"type":"object","properties":{"id":{"type":"string","description":"The user\'s unique identifier","x-faker":"datatype.number"},"full_name":{"type":"string","description":"The user\'s full name (first and last)","x-faker":"name.findName"},"email":{"type":"string","description":"The user\'s email address","x-faker":"internet.email"},"avatar_url":{"type":"string","description":"A URL pointing to the user\'s avatar","x-faker":"internet.avatar"}}},"form":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"},"paths":{"type":"array","items":{"type":"string"}},"submission_count":{"type":"integer","format":"int32"},"fields":{"type":"array","items":{"type":"object"}},"created_at":{"type":"string","format":"dateTime"}}},"hookType":{"type":"object","properties":{"name":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object"}}}},"hook":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"type":{"type":"string"},"event":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"disabled":{"type":"boolean"}}},"file":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"},"sha":{"type":"string"},"mime_type":{"type":"string"},"size":{"type":"integer","format":"int64"}}},"function":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sha":{"type":"string"}}},"snippet":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"site_id":{"type":"string"},"title":{"type":"string"},"general":{"type":"string"},"general_position":{"type":"string"},"goal":{"type":"string"},"goal_position":{"type":"string"}}},"purge":{"type":"object","properties":{"site_id":{"type":"string"},"site_slug":{"type":"string"},"cache_tags":{"type":"array","items":{"type":"string"}}}},"deploy":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"user_id":{"type":"string"},"build_id":{"type":"string"},"state":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"},"admin_url":{"type":"string"},"deploy_url":{"type":"string"},"deploy_ssl_url":{"type":"string"},"screenshot_url":{"type":"string"},"review_id":{"type":"number"},"draft":{"type":"boolean"},"required":{"type":"array","items":{"type":"string"}},"required_functions":{"type":"array","items":{"type":"string"}},"error_message":{"type":"string"},"branch":{"type":"string"},"commit_ref":{"type":"string"},"commit_url":{"type":"string"},"skipped":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"published_at":{"type":"string","format":"dateTime"},"title":{"type":"string"},"context":{"type":"string"},"locked":{"type":"boolean"},"review_url":{"type":"string"},"framework":{"type":"string"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}}}},"deployFiles":{"type":"object","properties":{"files":{"type":"object"},"draft":{"type":"boolean"},"async":{"type":"boolean"},"functions":{"type":"object"},"function_schedules":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}}},"functions_config":{"type":"object","additionalProperties":{"type":"object","properties":{"display_name":{"type":"string"},"generator":{"type":"string"},"build_data":{"type":"object"},"routes":{"type":"array","items":{"type":"object","properties":{"pattern":{"type":"string"},"literal":{"type":"string"},"expression":{"type":"string"},"methods":{"type":"array","items":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE","OPTIONS"]}},"prefer_static":{"type":"boolean"}}}},"priority":{"type":"integer"}}}},"branch":{"type":"string"},"framework":{"type":"string"},"framework_version":{"type":"string"}}},"pluginParams":{"type":"object","properties":{"pinned_version":{"type":"string"}}},"plugin":{"type":"object","properties":{"package":{"type":"string"},"pinned_version":{"type":"string"}}},"buildStatus":{"type":"object","properties":{"active":{"type":"integer"},"pending_concurrency":{"type":"integer"},"enqueued":{"type":"integer"},"build_count":{"type":"integer"},"minutes":{"type":"object","properties":{"current":{"type":"integer"},"current_average_sec":{"type":"integer"},"previous":{"type":"integer"},"period_start_date":{"type":"string","format":"dateTime"},"period_end_date":{"type":"string","format":"dateTime"},"last_updated_at":{"type":"string","format":"dateTime"},"included_minutes":{"type":"string"},"included_minutes_with_packs":{"type":"string"}}}}},"build":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"sha":{"type":"string"},"done":{"type":"boolean"},"error":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}},"buildLogMsg":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"boolean"},"section":{"type":"string","enum":["initializing","building","deploying","cleanup","postprocessing"]}}},"pluginRunData":{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}},"pluginRun":{"allOf":[{"type":"object","properties":{"package":{"type":"string"},"version":{"type":"string"},"state":{"type":"string"},"reporting_event":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"text":{"type":"string"}}},{"type":"object","properties":{"deploy_id":{"type":"string"}}}]},"metadata":{"type":"object"},"dnsZoneSetup":{"type":"object","properties":{"account_slug":{"type":"string"},"site_id":{"type":"string"},"name":{"type":"string"}}},"dnsZones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}}},"dnsZone":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"supported_record_types":{"type":"array","items":{"type":"string"}},"user_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dns_servers":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"site_id":{"type":"string"},"account_slug":{"type":"string"},"account_name":{"type":"string"},"domain":{"type":"string"},"ipv6_enabled":{"type":"boolean"},"dedicated":{"type":"boolean"}}},"dnsRecordCreate":{"type":"object","properties":{"type":{"type":"string"},"hostname":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"weight":{"type":"integer","format":"int64"},"port":{"type":"integer","format":"int64"},"flag":{"type":"integer","format":"int64"},"tag":{"type":"string"}}},"dnsRecords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}}},"dnsRecord":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"ttl":{"type":"integer","format":"int64"},"priority":{"type":"integer","format":"int64"},"dns_zone_id":{"type":"string"},"site_id":{"type":"string"},"flag":{"type":"integer"},"tag":{"type":"string"},"managed":{"type":"boolean"}}},"sniCertificate":{"type":"object","properties":{"state":{"type":"string"},"domains":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"},"expires_at":{"type":"string","format":"dateTime"}}},"ticket":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"authorized":{"type":"boolean"},"created_at":{"type":"string","format":"dateTime"}}},"accessToken":{"type":"object","properties":{"id":{"type":"string"},"access_token":{"type":"string"},"user_id":{"type":"string"},"user_email":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}},"asset":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"assetForm":{"type":"object","properties":{"url":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}}}},"assetSignature":{"type":"object","properties":{"form":{"type":"object","properties":{"url":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}}}},"asset":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"creator_id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"content_type":{"type":"string"},"url":{"type":"string"},"key":{"type":"string"},"visibility":{"type":"string"},"size":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}}}},"assetPublicSignature":{"type":"object","properties":{"url":{"type":"string"}}},"deployKey":{"type":"object","properties":{"id":{"type":"string"},"public_key":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}},"member":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string"}}},"paymentMethod":{"type":"object","properties":{"id":{"type":"string"},"method_name":{"type":"string"},"type":{"type":"string"},"state":{"type":"string"},"data":{"type":"object","properties":{"card_type":{"type":"string"},"last4":{"type":"string"},"email":{"type":"string"}}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"accountType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"object"},"monthly_dollar_price":{"type":"integer"},"yearly_dollar_price":{"type":"integer"},"monthly_seats_addon_dollar_price":{"type":"integer"},"yearly_seats_addon_dollar_price":{"type":"integer"}}},"accountSetup":{"type":"object","required":["name","type_id"],"properties":{"name":{"type":"string"},"type_id":{"type":"string"},"payment_method_id":{"type":"string"},"period":{"type":"string","enum":["monthly","yearly"]},"extra_seats_block":{"type":"integer"}}},"accountUpdateSetup":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"type_id":{"type":"string"},"extra_seats_block":{"type":"integer"},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"}}},"accountAddMemberSetup":{"type":"object","properties":{"role":{"type":"string","enum":["Owner","Collaborator","Controller"]},"email":{"type":"string"}}},"accountUpdateMemberSetup":{"type":"object","properties":{"role":{"type":"string","enum":["Owner","Collaborator","Controller"]},"site_access":{"type":"string","enum":["all","none","selected"]},"site_ids":{"type":"array","items":{"type":"string"}}}},"accountMembership":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"capabilities":{"type":"object","properties":{"sites":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"collaborators":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}}}},"billing_name":{"type":"string"},"billing_email":{"type":"string"},"billing_details":{"type":"string"},"billing_period":{"type":"string"},"payment_method_id":{"type":"string"},"type_name":{"type":"string"},"type_id":{"type":"string"},"owner_ids":{"type":"array","items":{"type":"string"}},"roles_allowed":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string","format":"dateTime"},"updated_at":{"type":"string","format":"dateTime"}}},"auditLog":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"payload":{"type":"object","properties":{"actor_id":{"type":"string"},"actor_name":{"type":"string"},"actor_email":{"type":"string"},"action":{"type":"string"},"timestamp":{"type":"string","format":"dateTime"},"log_type":{"type":"string"}},"additionalProperties":{"type":"object"}}}},"accountUsageCapability":{"type":"object","properties":{"included":{"type":"integer"},"used":{"type":"integer"}}},"buildSetup":{"type":"object","properties":{"image":{"type":"string"},"clear_cache":{"type":"boolean"}}},"buildHookSetup":{"type":"object","properties":{"title":{"type":"string"},"branch":{"type":"string"}}},"buildHook":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"branch":{"type":"string"},"url":{"type":"string"},"site_id":{"type":"string"},"created_at":{"type":"string","format":"dateTime"}}},"deployedBranch":{"type":"object","properties":{"id":{"type":"string"},"deploy_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"},"ssl_url":{"type":"string"}}},"user":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"full_name":{"type":"string"},"avatar_url":{"type":"string"},"email":{"type":"string"},"affiliate_id":{"type":"string"},"site_count":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"dateTime"},"last_login":{"type":"string","format":"dateTime"},"login_providers":{"type":"array","items":{"type":"string"}},"onboarding_progress":{"type":"object","properties":{"slides":{"type":"string"}}}}},"error":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","format":"int64"},"message":{"type":"string","x-nullable":false}}},"functionSchedule":{"type":"object","properties":{"name":{"type":"string"},"cron":{"type":"string"}}},"functionConfig":{"type":"object","properties":{"display_name":{"type":"string"},"generator":{"type":"string"},"build_data":{"type":"object"},"routes":{"type":"array","items":{"type":"object","properties":{"pattern":{"type":"string"},"literal":{"type":"string"},"expression":{"type":"string"},"methods":{"type":"array","items":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE","OPTIONS"]}},"prefer_static":{"type":"boolean"}}}},"priority":{"type":"integer"}}},"functionRoute":{"type":"object","properties":{"pattern":{"type":"string"},"literal":{"type":"string"},"expression":{"type":"string"},"methods":{"type":"array","items":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE","OPTIONS"]}},"prefer_static":{"type":"boolean"}}},"siteFunction":{"type":"object","properties":{"branch":{"type":"string"},"created_at":{"type":"string","format":"dateTime"},"functions":{"type":"array","items":{"type":"object"}},"id":{"type":"string"},"log_type":{"type":"string"},"provider":{"type":"string"}}}},"parameters":{"page":{"type":"integer","format":"int32","name":"page","required":false,"in":"query"},"perPage":{"type":"integer","format":"int32","name":"per_page","required":false,"in":"query"},"retryCount":{"name":"X-Nf-Retry-Count","type":"integer","in":"header"}},"x-tagGroups":[{"name":"OAuth","tags":["ticket","accessToken"]},{"name":"User accounts","tags":["user","accountMembership","member","accountType","paymentMethod","auditLog"]},{"name":"Site","tags":["site","environmentVariables","file","metadata","purge","snippet"]},{"name":"Domain names","tags":["dnsZone","sniCertificate"]},{"name":"Deploys","tags":["deploy","deployedBranch","deployKey"]},{"name":"Builds","tags":["build","buildLogMsg"]},{"name":"Webhooks and notifications","tags":["hook","hookType","buildHook"]},{"name":"Services","tags":["service","serviceInstance"]},{"name":"Functions","tags":["function"]},{"name":"Forms","tags":["form","submission"]},{"name":"Split tests","tags":["splitTest"]},{"name":"Large media","tags":["asset","assetPublicSignature"]}],"tags":[{"name":"ticket","x-displayName":"Ticket"},{"name":"accessToken","x-displayName":"Access token"},{"name":"user","x-displayName":"User"},{"name":"accountMembership","x-displayName":"Accounts"},{"name":"member","x-displayName":"Member"},{"name":"accountType","x-displayName":"Access type"},{"name":"paymentMethod","x-displayName":"Payment method"},{"name":"auditLog","x-displayName":"Audit log"},{"name":"site","x-displayName":"Site"},{"name":"environmentVariables","x-displayName":"Environment variables"},{"name":"file","x-displayName":"File"},{"name":"metadata","x-displayName":"Metadata"},{"name":"snippet","x-displayName":"Snippet"},{"name":"purge","x-displayName":"Cache purge"},{"name":"dnsZone","x-displayName":"DNS zone"},{"name":"sniCertificate","x-displayName":"SNI certificate"},{"name":"deploy","x-displayName":"Deploy"},{"name":"deployedBranch","x-displayName":"Deployed branch"},{"name":"deployKey","x-displayName":"Deploy key"},{"name":"build","x-displayName":"Build"},{"name":"buildLogMsg","x-displayName":"Build log message"},{"name":"hook","x-displayName":"Hook"},{"name":"hookType","x-displayName":"Hook type"},{"name":"buildHook","x-displayName":"Build hook"},{"name":"service","x-displayName":"Service"},{"name":"serviceInstance","x-displayName":"Service instance"},{"name":"function","x-displayName":"Function"},{"name":"form","x-displayName":"Form"},{"name":"submission","x-displayName":"Form submission"},{"name":"splitTest","x-displayName":"Split test"},{"name":"asset","x-displayName":"Asset"},{"name":"assetPublicSignature","x-displayName":"Asset public signature"}]}'); /***/ }), @@ -459042,7 +502263,7 @@ module.exports = JSON.parse('{"AssignmentExpression":["left","right"],"Assignmen /***/ ((module) => { "use strict"; -module.exports = {"version":"2.0.0"}; +module.exports = {"version":"2.1.0"}; /***/ }), @@ -459050,7 +502271,7 @@ module.exports = {"version":"2.0.0"}; /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"assert":true,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16","async_hooks":">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],"buffer_ieee754":">= 0.5 && < 0.9.7","buffer":true,"node:buffer":[">= 14.18 && < 15",">= 16"],"child_process":true,"node:child_process":[">= 14.18 && < 15",">= 16"],"cluster":">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],"console":true,"node:console":[">= 14.18 && < 15",">= 16"],"constants":true,"node:constants":[">= 14.18 && < 15",">= 16"],"crypto":true,"node:crypto":[">= 14.18 && < 15",">= 16"],"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"node:dgram":[">= 14.18 && < 15",">= 16"],"diagnostics_channel":[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],"dns":true,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16","domain":">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],"events":true,"node:events":[">= 14.18 && < 15",">= 16"],"freelist":"< 6","fs":true,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],"_http_agent":">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],"_http_client":">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],"_http_common":">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],"_http_incoming":">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],"_http_outgoing":">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],"_http_server":">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],"http":true,"node:http":[">= 14.18 && < 15",">= 16"],"http2":">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],"https":true,"node:https":[">= 14.18 && < 15",">= 16"],"inspector":">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],"_linklist":"< 8","module":true,"node:module":[">= 14.18 && < 15",">= 16"],"net":true,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12","os":true,"node:os":[">= 14.18 && < 15",">= 16"],"path":true,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16","perf_hooks":">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],"process":">= 1","node:process":[">= 14.18 && < 15",">= 16"],"punycode":">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],"querystring":true,"node:querystring":[">= 14.18 && < 15",">= 16"],"readline":true,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17","repl":true,"node:repl":[">= 14.18 && < 15",">= 16"],"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],"_stream_transform":">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],"_stream_wrap":">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],"_stream_passthrough":">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],"_stream_readable":">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],"_stream_writable":">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],"stream":true,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5","string_decoder":true,"node:string_decoder":[">= 14.18 && < 15",">= 16"],"sys":[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"node:test":[">= 16.17 && < 17",">= 18"],"timers":true,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16","_tls_common":">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],"_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],"tls":true,"node:tls":[">= 14.18 && < 15",">= 16"],"trace_events":">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],"tty":true,"node:tty":[">= 14.18 && < 15",">= 16"],"url":true,"node:url":[">= 14.18 && < 15",">= 16"],"util":true,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8":">= 1","node:v8":[">= 14.18 && < 15",">= 16"],"vm":true,"node:vm":[">= 14.18 && < 15",">= 16"],"wasi":">= 13.4 && < 13.5","worker_threads":">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],"zlib":">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}'); +module.exports = JSON.parse('{"assert":true,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16","async_hooks":">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],"buffer_ieee754":">= 0.5 && < 0.9.7","buffer":true,"node:buffer":[">= 14.18 && < 15",">= 16"],"child_process":true,"node:child_process":[">= 14.18 && < 15",">= 16"],"cluster":">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],"console":true,"node:console":[">= 14.18 && < 15",">= 16"],"constants":true,"node:constants":[">= 14.18 && < 15",">= 16"],"crypto":true,"node:crypto":[">= 14.18 && < 15",">= 16"],"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"node:dgram":[">= 14.18 && < 15",">= 16"],"diagnostics_channel":[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],"dns":true,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16","domain":">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],"events":true,"node:events":[">= 14.18 && < 15",">= 16"],"freelist":"< 6","fs":true,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],"_http_agent":">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],"_http_client":">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],"_http_common":">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],"_http_incoming":">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],"_http_outgoing":">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],"_http_server":">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],"http":true,"node:http":[">= 14.18 && < 15",">= 16"],"http2":">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],"https":true,"node:https":[">= 14.18 && < 15",">= 16"],"inspector":">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],"_linklist":"< 8","module":true,"node:module":[">= 14.18 && < 15",">= 16"],"net":true,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12","os":true,"node:os":[">= 14.18 && < 15",">= 16"],"path":true,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16","perf_hooks":">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],"process":">= 1","node:process":[">= 14.18 && < 15",">= 16"],"punycode":">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],"querystring":true,"node:querystring":[">= 14.18 && < 15",">= 16"],"readline":true,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17","repl":true,"node:repl":[">= 14.18 && < 15",">= 16"],"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],"_stream_transform":">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],"_stream_wrap":">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],"_stream_passthrough":">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],"_stream_readable":">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],"_stream_writable":">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],"stream":true,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5","string_decoder":true,"node:string_decoder":[">= 14.18 && < 15",">= 16"],"sys":[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"node:test":[">= 16.17 && < 17",">= 18"],"timers":true,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16","_tls_common":">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],"_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],"tls":true,"node:tls":[">= 14.18 && < 15",">= 16"],"trace_events":">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],"tty":true,"node:tty":[">= 14.18 && < 15",">= 16"],"url":true,"node:url":[">= 14.18 && < 15",">= 16"],"util":true,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8":">= 1","node:v8":[">= 14.18 && < 15",">= 16"],"vm":true,"node:vm":[">= 14.18 && < 15",">= 16"],"wasi":[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],"worker_threads":">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],"zlib":">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}'); /***/ }), diff --git a/package-lock.json b/package-lock.json index 36365e7c..c8f2b879 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,7 +1,7 @@ { "name": "actions-netlify", "version": "2.1.0", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -39,9 +39,9 @@ } }, "node_modules/@actions/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", - "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz", + "integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==", "dependencies": { "@actions/http-client": "^2.0.1", "uuid": "^8.3.2" @@ -59,68 +59,141 @@ } }, "node_modules/@actions/http-client": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", - "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.1.tgz", + "integrity": "sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==", "dependencies": { - "tunnel": "^0.0.6" + "tunnel": "^0.0.6", + "undici": "^5.25.4" } }, "node_modules/@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/compat-data": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz", - "integrity": "sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.3.tgz", - "integrity": "sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.0.tgz", + "integrity": "sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-module-transforms": "^7.21.2", - "@babel/helpers": "^7.21.0", - "@babel/parser": "^7.21.3", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.3", - "@babel/types": "^7.21.3", - "convert-source-map": "^1.7.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.24.0", + "@babel/parser": "^7.24.0", + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.0" + "json5": "^2.2.3", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -130,12 +203,6 @@ "url": "https://opencollective.com/babel" } }, - "node_modules/@babel/core/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -146,12 +213,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", - "integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dev": true, "dependencies": { - "@babel/types": "^7.21.3", + "@babel/types": "^7.23.6", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -160,37 +227,20 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", - "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.21.3", + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", "lru-cache": "^5.1.1", - "semver": "^6.3.0" + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { @@ -203,152 +253,152 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", - "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.21.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz", - "integrity": "sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.2", - "@babel/types": "^7.21.2" + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", - "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", + "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", - "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "dependencies": { - "@babel/types": "^7.20.2" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", - "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.0.tgz", - "integrity": "sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.0.tgz", + "integrity": "sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.0", - "@babel/types": "^7.21.0" + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -427,9 +477,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", - "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", + "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", "bin": { "parser": "bin/babel-parser.js" }, @@ -498,12 +548,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", - "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", + "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -600,12 +650,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", + "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -615,34 +665,34 @@ } }, "node_modules/@babel/template": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", - "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", + "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.3.tgz", - "integrity": "sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.21.3", - "@babel/types": "^7.21.3", - "debug": "^4.1.0", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz", + "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -659,13 +709,13 @@ } }, "node_modules/@babel/types": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", - "integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -694,18 +744,18 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", - "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -726,22 +776,30 @@ } }, "node_modules/@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "engines": { + "node": ">=14" + } + }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -762,9 +820,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { @@ -876,16 +934,16 @@ } }, "node_modules/@jest/console": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.2.tgz", - "integrity": "sha512-0N0yZof5hi44HAR2pPS+ikJ3nzKNoZdVu8FffRf3wy47I7Dm7etk/3KetMdRUqzVd16V4O2m2ISpNTbnIuqy1w==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.6.2", - "jest-util": "^29.6.2", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" }, "engines": { @@ -893,37 +951,37 @@ } }, "node_modules/@jest/core": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.2.tgz", - "integrity": "sha512-Oj+5B+sDMiMWLhPFF+4/DvHOf+U10rgvCLGPHP8Xlsy/7QxS51aU/eBngudHlJXnaWD5EohAgJ4js+T6pa+zOg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "dependencies": { - "@jest/console": "^29.6.2", - "@jest/reporters": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.5.0", - "jest-config": "^29.6.2", - "jest-haste-map": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.2", - "jest-resolve-dependencies": "^29.6.2", - "jest-runner": "^29.6.2", - "jest-runtime": "^29.6.2", - "jest-snapshot": "^29.6.2", - "jest-util": "^29.6.2", - "jest-validate": "^29.6.2", - "jest-watcher": "^29.6.2", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", "micromatch": "^4.0.4", - "pretty-format": "^29.6.2", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -940,88 +998,88 @@ } }, "node_modules/@jest/environment": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.2.tgz", - "integrity": "sha512-AEcW43C7huGd/vogTddNNTDRpO6vQ2zaQNrttvWV18ArBx9Z56h7BIsXkNFJVOO4/kblWEQz30ckw0+L3izc+Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "dependencies": { - "@jest/fake-timers": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.2" + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.2.tgz", - "integrity": "sha512-m6DrEJxVKjkELTVAztTLyS/7C92Y2b0VYqmDROYKLLALHn8T/04yPs70NADUYPrV3ruI+H3J0iUIuhkjp7vkfg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "dependencies": { - "expect": "^29.6.2", - "jest-snapshot": "^29.6.2" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.2.tgz", - "integrity": "sha512-6zIhM8go3RV2IG4aIZaZbxwpOzz3ZiM23oxAlkquOIole+G6TrbeXnykxWYlqF7kz2HlBjdKtca20x9atkEQYg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "dependencies": { - "jest-get-type": "^29.4.3" + "jest-get-type": "^29.6.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.2.tgz", - "integrity": "sha512-euZDmIlWjm1Z0lJ1D0f7a0/y5Kh/koLFMUBE5SUYWrmy8oNhJpbTBDAP6CxKnadcMLDoDf4waRYCe35cH6G6PA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.6.2", - "jest-mock": "^29.6.2", - "jest-util": "^29.6.2" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.2.tgz", - "integrity": "sha512-cjuJmNDjs6aMijCmSa1g2TNG4Lby/AeU7/02VtpW+SLcZXzOLK2GpN2nLqcFjmhy3B3AoPeQVx7BnyOf681bAw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "dependencies": { - "@jest/environment": "^29.6.2", - "@jest/expect": "^29.6.2", - "@jest/types": "^29.6.1", - "jest-mock": "^29.6.2" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/reporters": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.2.tgz", - "integrity": "sha512-sWtijrvIav8LgfJZlrGCdN0nP2EWbakglJY49J1Y5QihcQLfy7ovyxxjJBRXMNltgt4uPtEcFmIMbVshEDfFWw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", @@ -1030,13 +1088,13 @@ "glob": "^7.1.3", "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.6.2", - "jest-util": "^29.6.2", - "jest-worker": "^29.6.2", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", @@ -1055,9 +1113,9 @@ } }, "node_modules/@jest/schemas": { - "version": "29.6.0", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz", - "integrity": "sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "dependencies": { "@sinclair/typebox": "^0.27.8" @@ -1067,9 +1125,9 @@ } }, "node_modules/@jest/source-map": { - "version": "29.6.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.0.tgz", - "integrity": "sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", @@ -1081,13 +1139,13 @@ } }, "node_modules/@jest/test-result": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.2.tgz", - "integrity": "sha512-3VKFXzcV42EYhMCsJQURptSqnyjqCGbtLuX5Xxb6Pm6gUf1wIRIl+mandIRGJyWKgNKYF9cnstti6Ls5ekduqw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "dependencies": { - "@jest/console": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" }, @@ -1096,14 +1154,14 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.2.tgz", - "integrity": "sha512-GVYi6PfPwVejO7slw6IDO0qKVum5jtrJ3KoLGbgBWyr2qr4GaxFV6su+ZAjdTX75Sr1DkMFRk09r2ZVa+wtCGw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "dependencies": { - "@jest/test-result": "^29.6.2", + "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.2", + "jest-haste-map": "^29.7.0", "slash": "^3.0.0" }, "engines": { @@ -1111,22 +1169,22 @@ } }, "node_modules/@jest/transform": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.2.tgz", - "integrity": "sha512-ZqCqEISr58Ce3U+buNFJYUktLJZOggfyvR+bZMaiV1e8B1SIvJbwZMrYz3gx/KAPn9EXmOmN+uB08yLCjWkQQg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.2", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.6.2", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -1137,12 +1195,12 @@ } }, "node_modules/@jest/types": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.1.tgz", - "integrity": "sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", @@ -1154,56 +1212,60 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@netlify/open-api": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.15.1.tgz", - "integrity": "sha512-6OhUj74GNnj8hydQbbnbj2emYPwqRTZ1D5IfhQ3GXePjLB2xgQaNacMiKFXQ77Bqb2PVIxwkvYGsX0Sg3NjIKQ==" + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.28.0.tgz", + "integrity": "sha512-lSx9yVn5mzTS7u9aevQyDRoWaHJYNl15B7CU373g8We39wW8fGh4sdNY7ciPWshf42FblOVlBdoasn/LpzquXg==", + "engines": { + "node": ">=14" + } }, "node_modules/@netlify/zip-it-and-ship-it": { "version": "3.10.0", @@ -1277,6 +1339,20 @@ "node": ">=8" } }, + "node_modules/@netlify/zip-it-and-ship-it/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@netlify/zip-it-and-ship-it/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -1303,11 +1379,11 @@ } }, "node_modules/@netlify/zip-it-and-ship-it/node_modules/resolve": { - "version": "2.0.0-next.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", - "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -1517,9 +1593,9 @@ "dev": true }, "node_modules/@sinonjs/commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", - "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "dependencies": { "type-detect": "4.0.8" @@ -1535,9 +1611,9 @@ } }, "node_modules/@types/babel__core": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", - "integrity": "sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { "@babel/parser": "^7.20.7", @@ -1548,18 +1624,18 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -1567,12 +1643,12 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", - "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", "dev": true, "dependencies": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "node_modules/@types/glob": { @@ -1585,42 +1661,42 @@ } }, "node_modules/@types/graceful-fs": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true }, "node_modules/@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "node_modules/@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" } }, "node_modules/@types/jest": { - "version": "29.5.3", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.3.tgz", - "integrity": "sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -1628,9 +1704,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/minimatch": { @@ -1639,49 +1715,49 @@ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" }, "node_modules/@types/node": { - "version": "16.18.43", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.43.tgz", - "integrity": "sha512-YFpgPKPRcwYbeNOimfu70B+TVJe6tr88WiW/TzEldkwGxQXrmabpU+lDjrFlNqdqIi3ON0o69EQBW62VH4MIxw==" + "version": "16.18.87", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.87.tgz", + "integrity": "sha512-+IzfhNirR/MDbXz6Om5eHV54D9mQlEMGag6AgEzlju0xH3M8baCXYwqQ6RKgGMpn9wSTx6Ltya/0y4Z8eSfdLw==" }, "node_modules/@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "node_modules/@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, "node_modules/@types/yargs": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.23.tgz", - "integrity": "sha512-yuogunc04OnzGQCrfHx+Kk883Q4X0aSwmYZhKjI21m+SVYzjIbrWl8dOOwSv5hf2Um2pdCOXWo9isteZTNXUZQ==", + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.2.tgz", - "integrity": "sha512-yVrXupeHjRxLDcPKL10sGQ/QlVrA8J5IYOEWVqk0lJaSZP7X5DfnP7Ns3cc74/blmbipQ1htFNVGsHX6wsYm0A==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/type-utils": "5.59.2", - "@typescript-eslint/utils": "5.59.2", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", "semver": "^7.3.7", @@ -1731,7 +1807,7 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "node_modules/@typescript-eslint/scope-manager": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", @@ -1748,88 +1824,14 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.2.tgz", - "integrity": "sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.2.tgz", - "integrity": "sha512-b1LS2phBOsEy/T381bxkkywfQXkV1dWda/z0PhnIy3bC5+rQWQDS7fk9CSpcXBccPY27Z6vBEuaPBCKCgYezyQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.2", - "@typescript-eslint/utils": "5.59.2", + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -1850,9 +1852,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.2.tgz", - "integrity": "sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1863,13 +1865,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.2.tgz", - "integrity": "sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1890,17 +1892,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.2.tgz", - "integrity": "sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/typescript-estree": "5.59.2", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -1916,12 +1918,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz", - "integrity": "sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.2", + "@typescript-eslint/types": "5.62.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1932,6 +1934,12 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/@vercel/ncc": { "version": "0.36.1", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz", @@ -1942,9 +1950,9 @@ } }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2147,20 +2155,20 @@ } }, "node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" }, "node_modules/babel-jest": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.2.tgz", - "integrity": "sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "dependencies": { - "@jest/transform": "^29.6.2", + "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.5.0", + "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" @@ -2188,10 +2196,35 @@ "node": ">=8" } }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/babel-plugin-jest-hoist": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz", - "integrity": "sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "dependencies": { "@babel/template": "^7.3.3", @@ -2227,12 +2260,12 @@ } }, "node_modules/babel-preset-jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz", - "integrity": "sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "dependencies": { - "babel-plugin-jest-hoist": "^29.5.0", + "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" }, "engines": { @@ -2313,9 +2346,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "dev": true, "funding": [ { @@ -2325,13 +2358,17 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" }, "bin": { "browserslist": "cli.js" @@ -2399,12 +2436,18 @@ "dev": true }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2428,9 +2471,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001469", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001469.tgz", - "integrity": "sha512-Rcp7221ScNqQPP3W+lVOYDyjdR6dC+neEQCttoNr5bAyz54AboB4iwpnWgyi8P4YUsPybVzT4LgWiBbI3drL4g==", + "version": "1.0.30001596", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001596.tgz", + "integrity": "sha512-zpkZ+kEr6We7w63ORkoJ2pOfBwBkY/bJrG/UZ90qNb45Isblu8wzDgevEOrRL1r9dWayHjYiiyCMEXPn4DweGQ==", "dev": true, "funding": [ { @@ -2440,6 +2483,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ] }, @@ -2469,9 +2516,9 @@ } }, "node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true, "funding": [ { @@ -2484,9 +2531,9 @@ } }, "node_modules/cjs-module-lexer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", - "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, "node_modules/clean-deep": { @@ -2535,9 +2582,9 @@ } }, "node_modules/collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, "node_modules/color-convert": { @@ -2637,6 +2684,28 @@ "node": ">=8" } }, + "node_modules/cp-file/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cp-file/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/crc": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", @@ -2657,6 +2726,27 @@ "node": ">= 6.9.0" } }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2680,9 +2770,9 @@ } }, "node_modules/cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.2.tgz", + "integrity": "sha512-0sVXIohTfLqVIW3kb/0n6IiWF3Ifj5nm2XaSrLq2DI6fKIGa2fYAZdk917rUneaeLVpYfFcyXE2ft0fe3remsA==" }, "node_modules/debug": { "version": "4.3.4", @@ -2709,9 +2799,9 @@ } }, "node_modules/dedent": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.3.0.tgz", - "integrity": "sha512-7glNLfvdsMzZm3FpRY1CHuI2lbYDR+71YmrhmTZjYFD5pfT0ACgnGRdrrC9Mk2uICnzkcdelCx5at787UDGOvg==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", "dev": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" @@ -2725,7 +2815,8 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true }, "node_modules/deepmerge": { "version": "4.3.1", @@ -2736,6 +2827,22 @@ "node": ">=0.10.0" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/del": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", @@ -2948,9 +3055,9 @@ } }, "node_modules/diff-sequences": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", - "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -2980,9 +3087,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.340", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.340.tgz", - "integrity": "sha512-zx8hqumOqltKsv/MF50yvdAlPF9S/4PXbyfzJS6ZGhbddGkRegdwImmfSVqCkEziYzrIGZ/TlrzBND4FysfkDg==", + "version": "1.4.699", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.699.tgz", + "integrity": "sha512-I7q3BbQi6e4tJJN5CRcyvxhK0iJb34TV8eJQcgh+fR2fQ8miMgZcEInckCo1U9exDHbfz7DLDnFn8oqH/VcRKw==", "dev": true }, "node_modules/elf-cam": { @@ -3024,6 +3131,25 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.10.tgz", @@ -3034,9 +3160,9 @@ } }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, "engines": { "node": ">=6" @@ -3055,14 +3181,13 @@ } }, "node_modules/escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" + "esutils": "^2.0.2" }, "bin": { "escodegen": "bin/escodegen.js", @@ -3083,66 +3208,20 @@ "node": ">=4.0" } }, - "node_modules/escodegen/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", - "@humanwhocodes/config-array": "^0.11.10", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -3355,17 +3434,16 @@ } }, "node_modules/expect": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.2.tgz", - "integrity": "sha512-iAErsLxJ8C+S02QbLAwgSGSezLQK+XXRDt8IuFXFpwCNw2ECmzZSmjKcCaFVp5VRMk+WAvz6h6jokzEzBFZEuA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "dependencies": { - "@jest/expect-utils": "^29.6.2", - "@types/node": "*", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-util": "^29.6.2" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -3378,9 +3456,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -3412,12 +3490,13 @@ "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dependencies": { "reusify": "^1.0.4" } @@ -3479,12 +3558,13 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.9", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { @@ -3492,9 +3572,9 @@ } }, "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, "node_modules/flatten": { @@ -3575,9 +3655,9 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -3589,9 +3669,12 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -3623,13 +3706,18 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3688,9 +3776,9 @@ } }, "node_modules/globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -3736,34 +3824,28 @@ "node": ">=0.6.0" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3773,6 +3855,28 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -3807,6 +3911,17 @@ "node": ">=8" } }, + "node_modules/hasown": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -3842,9 +3957,9 @@ ] }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "engines": { "node": ">= 4" } @@ -3927,11 +4042,11 @@ "dev": true }, "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4041,37 +4156,28 @@ "dev": true }, "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.2.tgz", + "integrity": "sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==", "dev": true, "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" + "semver": "^7.5.4" }, "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node": ">=10" } }, "node_modules/istanbul-lib-report": { @@ -4088,21 +4194,6 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-report/node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", @@ -4118,9 +4209,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -4131,15 +4222,15 @@ } }, "node_modules/jest": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.2.tgz", - "integrity": "sha512-8eQg2mqFbaP7CwfsTpCxQ+sHzw1WuNWL5UUvjnWP4hx2riGz9fPSzYOaU5q8/GqWn1TfgZIVTqYJygbGbWAANg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "dependencies": { - "@jest/core": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^29.6.2" + "jest-cli": "^29.7.0" }, "bin": { "jest": "bin/jest.js" @@ -4157,12 +4248,13 @@ } }, "node_modules/jest-changed-files": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.5.0.tgz", - "integrity": "sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "dependencies": { "execa": "^5.0.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0" }, "engines": { @@ -4170,28 +4262,28 @@ } }, "node_modules/jest-circus": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.2.tgz", - "integrity": "sha512-G9mN+KOYIUe2sB9kpJkO9Bk18J4dTDArNFPwoZ7WKHKel55eKIS/u2bLthxgojwlf9NLCVQfgzM/WsOVvoC6Fw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "dependencies": { - "@jest/environment": "^29.6.2", - "@jest/expect": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", "dedent": "^1.0.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.6.2", - "jest-matcher-utils": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-runtime": "^29.6.2", - "jest-snapshot": "^29.6.2", - "jest-util": "^29.6.2", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0", - "pretty-format": "^29.6.2", + "pretty-format": "^29.7.0", "pure-rand": "^6.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" @@ -4201,22 +4293,21 @@ } }, "node_modules/jest-cli": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.2.tgz", - "integrity": "sha512-TT6O247v6dCEX2UGHGyflMpxhnrL0DNqP2fRTKYm3nJJpCTfXX3GCMQPGFjXDoj0i5/Blp3jriKXFgdfmbYB6Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "dependencies": { - "@jest/core": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", + "create-jest": "^29.7.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^29.6.2", - "jest-util": "^29.6.2", - "jest-validate": "^29.6.2", - "prompts": "^2.0.1", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "yargs": "^17.3.1" }, "bin": { @@ -4235,31 +4326,31 @@ } }, "node_modules/jest-config": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.2.tgz", - "integrity": "sha512-VxwFOC8gkiJbuodG9CPtMRjBUNZEHxwfQXmIudSTzFWxaci3Qub1ddTRbFNQlD/zUeaifLndh/eDccFX4wCMQw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.6.2", - "@jest/types": "^29.6.1", - "babel-jest": "^29.6.2", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.6.2", - "jest-environment-node": "^29.6.2", - "jest-get-type": "^29.4.3", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.2", - "jest-runner": "^29.6.2", - "jest-util": "^29.6.2", - "jest-validate": "^29.6.2", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.6.2", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -4280,24 +4371,24 @@ } }, "node_modules/jest-diff": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.2.tgz", - "integrity": "sha512-t+ST7CB9GX5F2xKwhwCf0TAR17uNDiaPTZnVymP9lw0lssa9vG+AFyDZoeIHStU3WowFFwT+ky+er0WVl2yGhA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "diff-sequences": "^29.4.3", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.2" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-docblock": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz", - "integrity": "sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "dependencies": { "detect-newline": "^3.0.0" @@ -4307,62 +4398,62 @@ } }, "node_modules/jest-each": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.2.tgz", - "integrity": "sha512-MsrsqA0Ia99cIpABBc3izS1ZYoYfhIy0NNWqPSE0YXbQjwchyt6B1HD2khzyPe1WiJA7hbxXy77ZoUQxn8UlSw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", - "jest-util": "^29.6.2", - "pretty-format": "^29.6.2" + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-environment-node": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.2.tgz", - "integrity": "sha512-YGdFeZ3T9a+/612c5mTQIllvWkddPbYcN2v95ZH24oWMbGA4GGS2XdIF92QMhUhvrjjuQWYgUGW2zawOyH63MQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "dependencies": { - "@jest/environment": "^29.6.2", - "@jest/fake-timers": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.2", - "jest-util": "^29.6.2" + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-get-type": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz", - "integrity": "sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-haste-map": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.2.tgz", - "integrity": "sha512-+51XleTDAAysvU8rT6AnS1ZJ+WHVNqhj1k6nTvN2PYP+HjU3kqlaKQ1Lnw3NYW3bm2r8vq82X0Z1nDDHZMzHVA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.6.2", - "jest-worker": "^29.6.2", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" }, @@ -4374,46 +4465,46 @@ } }, "node_modules/jest-leak-detector": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.2.tgz", - "integrity": "sha512-aNqYhfp5uYEO3tdWMb2bfWv6f0b4I0LOxVRpnRLAeque2uqOVVMLh6khnTcE2qJ5wAKop0HcreM1btoysD6bPQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "dependencies": { - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.2" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.2.tgz", - "integrity": "sha512-4LiAk3hSSobtomeIAzFTe+N8kL6z0JtF3n6I4fg29iIW7tt99R7ZcIFW34QkX+DuVrf+CUe6wuVOpm7ZKFJzZQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^29.6.2", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.2" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-message-util": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.2.tgz", - "integrity": "sha512-vnIGYEjoPSuRqV8W9t+Wow95SDp6KPX2Uf7EoeG9G99J2OVh7OSwpS4B6J0NfpEIpfkBNHlBZpA2rblEuEFhZQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.6.2", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -4422,14 +4513,14 @@ } }, "node_modules/jest-mock": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.2.tgz", - "integrity": "sha512-hoSv3lb3byzdKfwqCuT6uTscan471GUECqgNYykg6ob0yiAw3zYc7OrPnI9Qv8Wwoa4lC7AZ9hyS4AiIx5U2zg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-util": "^29.6.2" + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -4453,26 +4544,26 @@ } }, "node_modules/jest-regex-util": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.3.tgz", - "integrity": "sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-resolve": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.2.tgz", - "integrity": "sha512-G/iQUvZWI5e3SMFssc4ug4dH0aZiZpsDq9o1PtXTV1210Ztyb2+w+ZgQkB3iOiC5SmAEzJBOHWz6Hvrd+QnNPw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.2", + "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.6.2", - "jest-validate": "^29.6.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "resolve": "^1.20.0", "resolve.exports": "^2.0.0", "slash": "^3.0.0" @@ -4482,43 +4573,43 @@ } }, "node_modules/jest-resolve-dependencies": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.2.tgz", - "integrity": "sha512-LGqjDWxg2fuQQm7ypDxduLu/m4+4Lb4gczc13v51VMZbVP5tSBILqVx8qfWcsdP8f0G7aIqByIALDB0R93yL+w==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "dependencies": { - "jest-regex-util": "^29.4.3", - "jest-snapshot": "^29.6.2" + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-runner": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.2.tgz", - "integrity": "sha512-wXOT/a0EspYgfMiYHxwGLPCZfC0c38MivAlb2lMEAlwHINKemrttu1uSbcGbfDV31sFaPWnWJPmb2qXM8pqZ4w==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "dependencies": { - "@jest/console": "^29.6.2", - "@jest/environment": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^29.4.3", - "jest-environment-node": "^29.6.2", - "jest-haste-map": "^29.6.2", - "jest-leak-detector": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-resolve": "^29.6.2", - "jest-runtime": "^29.6.2", - "jest-util": "^29.6.2", - "jest-watcher": "^29.6.2", - "jest-worker": "^29.6.2", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, @@ -4527,31 +4618,31 @@ } }, "node_modules/jest-runtime": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.2.tgz", - "integrity": "sha512-2X9dqK768KufGJyIeLmIzToDmsN0m7Iek8QNxRSI/2+iPFYHF0jTwlO3ftn7gdKd98G/VQw9XJCk77rbTGZnJg==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.6.2", - "@jest/fake-timers": "^29.6.2", - "@jest/globals": "^29.6.2", - "@jest/source-map": "^29.6.0", - "@jest/test-result": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-mock": "^29.6.2", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.2", - "jest-snapshot": "^29.6.2", - "jest-util": "^29.6.2", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -4560,9 +4651,9 @@ } }, "node_modules/jest-snapshot": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.2.tgz", - "integrity": "sha512-1OdjqvqmRdGNvWXr/YZHuyhh5DeaLp1p/F8Tht/MrMw4Kr1Uu/j4lRG+iKl1DAqUJDWxtQBMk41Lnf/JETYBRA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", @@ -4570,20 +4661,20 @@ "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.6.2", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^29.6.2", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-util": "^29.6.2", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^29.6.2", + "pretty-format": "^29.7.0", "semver": "^7.5.3" }, "engines": { @@ -4591,12 +4682,12 @@ } }, "node_modules/jest-util": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.2.tgz", - "integrity": "sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -4608,17 +4699,17 @@ } }, "node_modules/jest-validate": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.2.tgz", - "integrity": "sha512-vGz0yMN5fUFRRbpJDPwxMpgSXW1LDKROHfBopAvDcmD6s+B/s8WJrwi+4bfH4SdInBA5C3P3BI19dBtKzx1Arg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "dependencies": { - "@jest/types": "^29.6.1", + "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", + "jest-get-type": "^29.6.3", "leven": "^3.1.0", - "pretty-format": "^29.6.2" + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -4637,18 +4728,18 @@ } }, "node_modules/jest-watcher": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.2.tgz", - "integrity": "sha512-GZitlqkMkhkefjfN/p3SJjrDaxPflqxEAv3/ik10OirZqJGYH5rPiIsgVcfof0Tdqg3shQGdEIxDBx+B4tuLzA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "dependencies": { - "@jest/test-result": "^29.6.2", - "@jest/types": "^29.6.1", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.13.1", - "jest-util": "^29.6.2", + "jest-util": "^29.7.0", "string-length": "^4.0.1" }, "engines": { @@ -4656,13 +4747,13 @@ } }, "node_modules/jest-worker": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.2.tgz", - "integrity": "sha512-l3ccBOabTdkng8I/ORCkADz4eSMKejTYv1vB/Z83UiubqhC1oQ5Li6dWCyqOIvSifGjUBxuvxvlm6KGK2DtuAQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "dependencies": { "@types/node": "*", - "jest-util": "^29.6.2", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -4715,6 +4806,12 @@ "node": ">=4" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -4752,6 +4849,15 @@ "node": ">=8" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -4909,27 +5015,20 @@ } }, "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, "dependencies": { - "semver": "^6.0.0" + "semver": "^7.5.3" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -5084,9 +5183,9 @@ } }, "node_modules/node-fetch": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", - "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -5109,9 +5208,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, "node_modules/node-source-walk": { @@ -5151,9 +5250,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5421,9 +5520,9 @@ } }, "node_modules/pirates": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", - "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "engines": { "node": ">= 6" @@ -5561,9 +5660,9 @@ } }, "node_modules/prettier": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.2.tgz", - "integrity": "sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -5576,12 +5675,12 @@ } }, "node_modules/pretty-format": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.2.tgz", - "integrity": "sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.6.0", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -5629,18 +5728,18 @@ } }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/pure-rand": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.1.tgz", - "integrity": "sha512-t+x1zEHDjBwkDGY5v5ApnZ/utcd4XYDiJsaQQoptTXgUXX95sDg1elCdJghzicm7n2mbCBJ3uYWr6M22SO19rg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", + "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", "dev": true, "funding": [ { @@ -5654,11 +5753,11 @@ ] }, "node_modules/qs": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz", - "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz", + "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -5741,12 +5840,12 @@ "integrity": "sha512-uuoJ1hU/k6M0779t3VMVIYpb2VMJk05cehCaABFhXaibcbvfgR8wKiozLjVFSzJPmQMRqIcO0HMyTFqfV09V6Q==" }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -5861,9 +5960,9 @@ ] }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5895,6 +5994,22 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -5917,13 +6032,17 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6242,9 +6361,9 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/ts-jest": { - "version": "29.1.1", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", - "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", + "version": "29.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", + "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -6260,7 +6379,7 @@ "ts-jest": "cli.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", @@ -6345,9 +6464,9 @@ } }, "node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6356,6 +6475,17 @@ "node": ">=14.17" } }, + "node_modules/undici": { + "version": "5.28.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", + "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", @@ -6373,9 +6503,9 @@ } }, "node_modules/universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==" }, "node_modules/unixify": { "version": "1.0.0", @@ -6400,9 +6530,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "dev": true, "funding": [ { @@ -6412,6 +6542,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { @@ -6419,7 +6553,7 @@ "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" @@ -6454,25 +6588,19 @@ } }, "node_modules/v8-to-istanbul": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", - "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" + "convert-source-map": "^2.0.0" }, "engines": { "node": ">=10.12.0" } }, - "node_modules/v8-to-istanbul/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -6512,17 +6640,9 @@ } }, "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==" - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "engines": { - "node": ">=0.10.0" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" }, "node_modules/wrap-ansi": { "version": "7.0.0", @@ -6634,4955 +6754,5 @@ "node": ">= 8" } } - }, - "dependencies": { - "@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true - }, - "@actions/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", - "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", - "requires": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" - } - }, - "@actions/github": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz", - "integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==", - "requires": { - "@actions/http-client": "^2.0.1", - "@octokit/core": "^3.6.0", - "@octokit/plugin-paginate-rest": "^2.17.0", - "@octokit/plugin-rest-endpoint-methods": "^5.13.0" - } - }, - "@actions/http-client": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", - "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", - "requires": { - "tunnel": "^0.0.6" - } - }, - "@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", - "dev": true, - "requires": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "dev": true, - "requires": { - "@babel/highlight": "^7.18.6" - } - }, - "@babel/compat-data": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz", - "integrity": "sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==", - "dev": true - }, - "@babel/core": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.3.tgz", - "integrity": "sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw==", - "dev": true, - "requires": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-module-transforms": "^7.21.2", - "@babel/helpers": "^7.21.0", - "@babel/parser": "^7.21.3", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.3", - "@babel/types": "^7.21.3", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.0" - }, - "dependencies": { - "convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", - "integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", - "dev": true, - "requires": { - "@babel/types": "^7.21.3", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" - }, - "dependencies": { - "@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - } - } - } - }, - "@babel/helper-compilation-targets": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", - "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.21.3", - "lru-cache": "^5.1.1", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", - "dev": true - }, - "@babel/helper-function-name": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", - "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", - "dev": true, - "requires": { - "@babel/template": "^7.20.7", - "@babel/types": "^7.21.0" - } - }, - "@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-module-transforms": { - "version": "7.21.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz", - "integrity": "sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.2", - "@babel/types": "^7.21.2" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", - "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", - "dev": true - }, - "@babel/helper-simple-access": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", - "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", - "dev": true, - "requires": { - "@babel/types": "^7.20.2" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", - "dev": true, - "requires": { - "@babel/types": "^7.18.6" - } - }, - "@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", - "dev": true - }, - "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "dev": true - }, - "@babel/helper-validator-option": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", - "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", - "dev": true - }, - "@babel/helpers": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.0.tgz", - "integrity": "sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==", - "dev": true, - "requires": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.0", - "@babel/types": "^7.21.0" - } - }, - "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@babel/parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", - "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==" - }, - "@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", - "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - } - }, - "@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-jsx": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", - "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.19.0" - } - }, - "@babel/template": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", - "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" - } - }, - "@babel/traverse": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.3.tgz", - "integrity": "sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.21.3", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.21.3", - "@babel/types": "^7.21.3", - "debug": "^4.1.0", - "globals": "^11.1.0" - }, - "dependencies": { - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - } - } - }, - "@babel/types": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", - "integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", - "dev": true, - "requires": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", - "to-fast-properties": "^2.0.0" - } - }, - "@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true - }, - "@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^3.3.0" - } - }, - "@eslint-community/regexpp": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", - "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", - "dev": true - }, - "@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - } - }, - "@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", - "dev": true - }, - "@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", - "dev": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - } - }, - "@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "dependencies": { - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - } - } - }, - "@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true - }, - "@jest/console": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.2.tgz", - "integrity": "sha512-0N0yZof5hi44HAR2pPS+ikJ3nzKNoZdVu8FffRf3wy47I7Dm7etk/3KetMdRUqzVd16V4O2m2ISpNTbnIuqy1w==", - "dev": true, - "requires": { - "@jest/types": "^29.6.1", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.6.2", - "jest-util": "^29.6.2", - "slash": "^3.0.0" - } - }, - "@jest/core": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.2.tgz", - "integrity": "sha512-Oj+5B+sDMiMWLhPFF+4/DvHOf+U10rgvCLGPHP8Xlsy/7QxS51aU/eBngudHlJXnaWD5EohAgJ4js+T6pa+zOg==", - "dev": true, - "requires": { - "@jest/console": "^29.6.2", - "@jest/reporters": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.5.0", - "jest-config": "^29.6.2", - "jest-haste-map": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.2", - "jest-resolve-dependencies": "^29.6.2", - "jest-runner": "^29.6.2", - "jest-runtime": "^29.6.2", - "jest-snapshot": "^29.6.2", - "jest-util": "^29.6.2", - "jest-validate": "^29.6.2", - "jest-watcher": "^29.6.2", - "micromatch": "^4.0.4", - "pretty-format": "^29.6.2", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "@jest/environment": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.2.tgz", - "integrity": "sha512-AEcW43C7huGd/vogTddNNTDRpO6vQ2zaQNrttvWV18ArBx9Z56h7BIsXkNFJVOO4/kblWEQz30ckw0+L3izc+Q==", - "dev": true, - "requires": { - "@jest/fake-timers": "^29.6.2", - "@jest/types": "^29.6.1", - "@types/node": "*", - "jest-mock": "^29.6.2" - } - }, - "@jest/expect": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.2.tgz", - "integrity": "sha512-m6DrEJxVKjkELTVAztTLyS/7C92Y2b0VYqmDROYKLLALHn8T/04yPs70NADUYPrV3ruI+H3J0iUIuhkjp7vkfg==", - "dev": true, - "requires": { - "expect": "^29.6.2", - "jest-snapshot": "^29.6.2" - } - }, - "@jest/expect-utils": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.2.tgz", - "integrity": "sha512-6zIhM8go3RV2IG4aIZaZbxwpOzz3ZiM23oxAlkquOIole+G6TrbeXnykxWYlqF7kz2HlBjdKtca20x9atkEQYg==", - "dev": true, - "requires": { - "jest-get-type": "^29.4.3" - } - }, - "@jest/fake-timers": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.2.tgz", - "integrity": "sha512-euZDmIlWjm1Z0lJ1D0f7a0/y5Kh/koLFMUBE5SUYWrmy8oNhJpbTBDAP6CxKnadcMLDoDf4waRYCe35cH6G6PA==", - "dev": true, - "requires": { - "@jest/types": "^29.6.1", - "@sinonjs/fake-timers": "^10.0.2", - "@types/node": "*", - "jest-message-util": "^29.6.2", - "jest-mock": "^29.6.2", - "jest-util": "^29.6.2" - } - }, - "@jest/globals": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.2.tgz", - "integrity": "sha512-cjuJmNDjs6aMijCmSa1g2TNG4Lby/AeU7/02VtpW+SLcZXzOLK2GpN2nLqcFjmhy3B3AoPeQVx7BnyOf681bAw==", - "dev": true, - "requires": { - "@jest/environment": "^29.6.2", - "@jest/expect": "^29.6.2", - "@jest/types": "^29.6.1", - "jest-mock": "^29.6.2" - } - }, - "@jest/reporters": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.2.tgz", - "integrity": "sha512-sWtijrvIav8LgfJZlrGCdN0nP2EWbakglJY49J1Y5QihcQLfy7ovyxxjJBRXMNltgt4uPtEcFmIMbVshEDfFWw==", - "dev": true, - "requires": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", - "@jridgewell/trace-mapping": "^0.3.18", - "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^5.1.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.6.2", - "jest-util": "^29.6.2", - "jest-worker": "^29.6.2", - "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", - "v8-to-istanbul": "^9.0.1" - } - }, - "@jest/schemas": { - "version": "29.6.0", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.0.tgz", - "integrity": "sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==", - "dev": true, - "requires": { - "@sinclair/typebox": "^0.27.8" - } - }, - "@jest/source-map": { - "version": "29.6.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.0.tgz", - "integrity": "sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==", - "dev": true, - "requires": { - "@jridgewell/trace-mapping": "^0.3.18", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" - } - }, - "@jest/test-result": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.2.tgz", - "integrity": "sha512-3VKFXzcV42EYhMCsJQURptSqnyjqCGbtLuX5Xxb6Pm6gUf1wIRIl+mandIRGJyWKgNKYF9cnstti6Ls5ekduqw==", - "dev": true, - "requires": { - "@jest/console": "^29.6.2", - "@jest/types": "^29.6.1", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - } - }, - "@jest/test-sequencer": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.2.tgz", - "integrity": "sha512-GVYi6PfPwVejO7slw6IDO0qKVum5jtrJ3KoLGbgBWyr2qr4GaxFV6su+ZAjdTX75Sr1DkMFRk09r2ZVa+wtCGw==", - "dev": true, - "requires": { - "@jest/test-result": "^29.6.2", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.2", - "slash": "^3.0.0" - } - }, - "@jest/transform": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.2.tgz", - "integrity": "sha512-ZqCqEISr58Ce3U+buNFJYUktLJZOggfyvR+bZMaiV1e8B1SIvJbwZMrYz3gx/KAPn9EXmOmN+uB08yLCjWkQQg==", - "dev": true, - "requires": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.1", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.2", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.6.2", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - } - }, - "@jest/types": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.1.tgz", - "integrity": "sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==", - "dev": true, - "requires": { - "@jest/schemas": "^29.6.0", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - } - }, - "@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true - }, - "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true - }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", - "dev": true, - "requires": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" - } - }, - "@netlify/open-api": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.15.1.tgz", - "integrity": "sha512-6OhUj74GNnj8hydQbbnbj2emYPwqRTZ1D5IfhQ3GXePjLB2xgQaNacMiKFXQ77Bqb2PVIxwkvYGsX0Sg3NjIKQ==" - }, - "@netlify/zip-it-and-ship-it": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-3.10.0.tgz", - "integrity": "sha512-XqvgFXN8YpIiHmmu4jdhHS+Huln81YnT1bieBBiadmHsFPblT9Fr6bWEp2Wlz31caEBXAxp1BAIZisp6Jmx+Mg==", - "requires": { - "archiver": "^4.0.0", - "array-flat-polyfill": "^1.0.1", - "common-path-prefix": "^2.0.0", - "cp-file": "^7.0.0", - "del": "^5.1.0", - "elf-cam": "^0.1.1", - "end-of-stream": "^1.4.4", - "esbuild": "0.11.10", - "filter-obj": "^2.0.1", - "find-up": "^4.1.0", - "glob": "^7.1.6", - "junk": "^3.1.0", - "locate-path": "^5.0.0", - "make-dir": "^3.1.0", - "merge-options": "^3.0.4", - "minimatch": "^3.0.4", - "p-map": "^3.0.0", - "path-exists": "^4.0.0", - "pkg-dir": "^4.2.0", - "precinct": "^6.3.1", - "read-package-json-fast": "^2.0.2", - "require-package-name": "^2.0.1", - "resolve": "^2.0.0-next.1", - "semver": "^6.3.0", - "unixify": "^1.0.0", - "yargs": "^15.4.1" - }, - "dependencies": { - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - }, - "resolve": { - "version": "2.0.0-next.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", - "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", - "requires": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@octokit/auth-token": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", - "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", - "requires": { - "@octokit/types": "^6.0.3" - } - }, - "@octokit/core": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz", - "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", - "requires": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.3", - "@octokit/request-error": "^2.0.5", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", - "requires": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/graphql": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", - "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", - "requires": { - "@octokit/request": "^5.6.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/openapi-types": { - "version": "12.11.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", - "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==" - }, - "@octokit/plugin-paginate-rest": { - "version": "2.21.3", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz", - "integrity": "sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==", - "requires": { - "@octokit/types": "^6.40.0" - } - }, - "@octokit/plugin-rest-endpoint-methods": { - "version": "5.16.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz", - "integrity": "sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==", - "requires": { - "@octokit/types": "^6.39.0", - "deprecation": "^2.3.1" - } - }, - "@octokit/request": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz", - "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", - "requires": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", - "requires": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "@octokit/types": { - "version": "6.41.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", - "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", - "requires": { - "@octokit/openapi-types": "^12.11.0" - } - }, - "@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, - "@sinonjs/commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", - "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^3.0.0" - } - }, - "@types/babel__core": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", - "integrity": "sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==", - "dev": true, - "requires": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", - "dev": true, - "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@types/babel__traverse": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", - "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", - "dev": true, - "requires": { - "@babel/types": "^7.3.0" - } - }, - "@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", - "requires": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/graceful-fs": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", - "dev": true - }, - "@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*" - } - }, - "@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", - "dev": true, - "requires": { - "@types/istanbul-lib-report": "*" - } - }, - "@types/jest": { - "version": "29.5.3", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.3.tgz", - "integrity": "sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA==", - "dev": true, - "requires": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" - } - }, - "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" - }, - "@types/node": { - "version": "16.18.43", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.43.tgz", - "integrity": "sha512-YFpgPKPRcwYbeNOimfu70B+TVJe6tr88WiW/TzEldkwGxQXrmabpU+lDjrFlNqdqIi3ON0o69EQBW62VH4MIxw==" - }, - "@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", - "dev": true - }, - "@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", - "dev": true - }, - "@types/yargs": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.23.tgz", - "integrity": "sha512-yuogunc04OnzGQCrfHx+Kk883Q4X0aSwmYZhKjI21m+SVYzjIbrWl8dOOwSv5hf2Um2pdCOXWo9isteZTNXUZQ==", - "dev": true, - "requires": { - "@types/yargs-parser": "*" - } - }, - "@types/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", - "dev": true - }, - "@typescript-eslint/eslint-plugin": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.2.tgz", - "integrity": "sha512-yVrXupeHjRxLDcPKL10sGQ/QlVrA8J5IYOEWVqk0lJaSZP7X5DfnP7Ns3cc74/blmbipQ1htFNVGsHX6wsYm0A==", - "dev": true, - "requires": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/type-utils": "5.59.2", - "@typescript-eslint/utils": "5.59.2", - "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "debug": "^4.3.4" - }, - "dependencies": { - "@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - } - }, - "@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" - } - } - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.2.tgz", - "integrity": "sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2" - } - }, - "@typescript-eslint/type-utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.2.tgz", - "integrity": "sha512-b1LS2phBOsEy/T381bxkkywfQXkV1dWda/z0PhnIy3bC5+rQWQDS7fk9CSpcXBccPY27Z6vBEuaPBCKCgYezyQ==", - "dev": true, - "requires": { - "@typescript-eslint/typescript-estree": "5.59.2", - "@typescript-eslint/utils": "5.59.2", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/types": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.2.tgz", - "integrity": "sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.2.tgz", - "integrity": "sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.2.tgz", - "integrity": "sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ==", - "dev": true, - "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/typescript-estree": "5.59.2", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz", - "integrity": "sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.2", - "eslint-visitor-keys": "^3.3.0" - } - }, - "@vercel/ncc": { - "version": "0.36.1", - "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz", - "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==", - "dev": true - }, - "acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "requires": { - "type-fest": "^0.21.3" - }, - "dependencies": { - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true - } - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "archiver": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-4.0.2.tgz", - "integrity": "sha512-B9IZjlGwaxF33UN4oPbfBkyA4V1SxNLeIhR1qY8sRXSsbdUkEHrrOvwlYFPx+8uQeCe9M+FG6KgO+imDmQ79CQ==", - "requires": { - "archiver-utils": "^2.1.0", - "async": "^3.2.0", - "buffer-crc32": "^0.2.1", - "glob": "^7.1.6", - "readable-stream": "^3.6.0", - "tar-stream": "^2.1.2", - "zip-stream": "^3.0.1" - } - }, - "archiver-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", - "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", - "requires": { - "glob": "^7.1.4", - "graceful-fs": "^4.2.0", - "lazystream": "^1.0.0", - "lodash.defaults": "^4.2.0", - "lodash.difference": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.union": "^4.6.0", - "normalize-path": "^3.0.0", - "readable-stream": "^2.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "array-flat-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-flat-polyfill/-/array-flat-polyfill-1.0.1.tgz", - "integrity": "sha512-hfJmKupmQN0lwi0xG6FQ5U8Rd97RnIERplymOv/qpq8AoNKPPAnxJadjFA23FNWm88wykh9HmpLJUUwUtNU/iw==" - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" - }, - "ast-module-types": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-3.0.0.tgz", - "integrity": "sha512-CMxMCOCS+4D+DkOQfuZf+vLrSEmY/7xtORwdxs4wtcC1wVgvk2MqFFTwQCFhvWsI4KPU9lcWXPI8DgRiz+xetQ==" - }, - "async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" - }, - "babel-jest": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.2.tgz", - "integrity": "sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A==", - "dev": true, - "requires": { - "@jest/transform": "^29.6.2", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.5.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - } - }, - "babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - } - }, - "babel-plugin-jest-hoist": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz", - "integrity": "sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==", - "dev": true, - "requires": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - } - }, - "babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", - "dev": true, - "requires": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" - } - }, - "babel-preset-jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz", - "integrity": "sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==", - "dev": true, - "requires": { - "babel-plugin-jest-hoist": "^29.5.0", - "babel-preset-current-node-syntax": "^1.0.0" - } - }, - "backoff": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", - "integrity": "sha512-wC5ihrnUXmR2douXmXLCe5O3zg3GKIyvRi/hi58a/XyRxVI+3/yM0PYueQOZXPXQ9pxBislYkw+sF9b7C/RuMA==", - "requires": { - "precond": "0.2" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "before-after-hook": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", - "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" - }, - "bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" - } - }, - "bs-logger": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", - "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", - "dev": true, - "requires": { - "fast-json-stable-stringify": "2.x" - } - }, - "bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", - "dev": true, - "requires": { - "node-int64": "^0.4.0" - } - }, - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==" - }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - }, - "caniuse-lite": { - "version": "1.0.30001469", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001469.tgz", - "integrity": "sha512-Rcp7221ScNqQPP3W+lVOYDyjdR6dC+neEQCttoNr5bAyz54AboB4iwpnWgyi8P4YUsPybVzT4LgWiBbI3drL4g==", - "dev": true - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "dev": true - }, - "ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", - "dev": true - }, - "cjs-module-lexer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", - "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", - "dev": true - }, - "clean-deep": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/clean-deep/-/clean-deep-3.4.0.tgz", - "integrity": "sha512-Lo78NV5ItJL/jl+B5w0BycAisaieJGXK1qYi/9m4SjR8zbqmrUtO7Yhro40wEShGmmxs/aJLI/A+jNhdkXK8mw==", - "requires": { - "lodash.isempty": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.transform": "^4.6.0" - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" - }, - "cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "dev": true - }, - "collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", - "dev": true - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "common-path-prefix": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-2.0.0.tgz", - "integrity": "sha512-Lb9qbwwyQdRDmyib0qur7BC9/GHIbviTaQebayFsGC/n77AwFhZINCcJkQx2qVv9LJsA8F5ex65F2qrOfWGUyw==" - }, - "compress-commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-3.0.0.tgz", - "integrity": "sha512-FyDqr8TKX5/X0qo+aVfaZ+PVmNJHJeckFBlq8jZGSJOgnynhfifoyl24qaqdUdDIBe0EVTHByN6NAkqYvE/2Xg==", - "requires": { - "buffer-crc32": "^0.2.13", - "crc32-stream": "^3.0.1", - "normalize-path": "^3.0.0", - "readable-stream": "^2.3.7" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "cp-file": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-7.0.0.tgz", - "integrity": "sha512-0Cbj7gyvFVApzpK/uhCtQ/9kE9UnYpxMzaq5nQQC/Dh4iaj5fxp7iEFIullrYwzj8nf0qnsI1Qsx34hAeAebvw==", - "requires": { - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "nested-error-stacks": "^2.0.0", - "p-event": "^4.1.0" - } - }, - "crc": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", - "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", - "requires": { - "buffer": "^5.1.0" - } - }, - "crc32-stream": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-3.0.1.tgz", - "integrity": "sha512-mctvpXlbzsvK+6z8kJwSJ5crm7yBwrQMTybJzMw1O4lLGJqjlDCXY2Zw7KheiA6XBEcBmfLx1D88mjRGVJtY9w==", - "requires": { - "crc": "^3.4.4", - "readable-stream": "^3.4.0" - } - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "crypto-random-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha512-GsVpkFPlycH7/fRR7Dhcmnoii54gV1nz7y4CWyeFS14N+JVBBhY+r8amRHE4BwSYal7BPTDp8isvAlCxyFt3Hg==" - }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A==" - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" - }, - "dedent": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.3.0.tgz", - "integrity": "sha512-7glNLfvdsMzZm3FpRY1CHuI2lbYDR+71YmrhmTZjYFD5pfT0ACgnGRdrrC9Mk2uICnzkcdelCx5at787UDGOvg==", - "dev": true, - "requires": {} - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - }, - "deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true - }, - "del": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", - "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==", - "requires": { - "globby": "^10.0.1", - "graceful-fs": "^4.2.2", - "is-glob": "^4.0.1", - "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.1", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "slash": "^3.0.0" - }, - "dependencies": { - "globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - } - } - } - }, - "deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", - "dev": true - }, - "detective-amd": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-3.1.2.tgz", - "integrity": "sha512-jffU26dyqJ37JHR/o44La6CxtrDf3Rt9tvd2IbImJYxWKTMdBjctp37qoZ6ZcY80RHg+kzWz4bXn39e4P7cctQ==", - "requires": { - "ast-module-types": "^3.0.0", - "escodegen": "^2.0.0", - "get-amd-module-type": "^3.0.0", - "node-source-walk": "^4.2.0" - } - }, - "detective-cjs": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-3.1.3.tgz", - "integrity": "sha512-ljs7P0Yj9MK64B7G0eNl0ThWSYjhAaSYy+fQcpzaKalYl/UoQBOzOeLCSFEY1qEBhziZ3w7l46KG/nH+s+L7BQ==", - "requires": { - "ast-module-types": "^3.0.0", - "node-source-walk": "^4.0.0" - } - }, - "detective-es6": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-2.2.2.tgz", - "integrity": "sha512-eZUKCUsbHm8xoeoCM0z6JFwvDfJ5Ww5HANo+jPR7AzkFpW9Mun3t/TqIF2jjeWa2TFbAiGaWESykf2OQp3oeMw==", - "requires": { - "node-source-walk": "^4.0.0" - } - }, - "detective-less": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/detective-less/-/detective-less-1.0.2.tgz", - "integrity": "sha512-Rps1xDkEEBSq3kLdsdnHZL1x2S4NGDcbrjmd4q+PykK5aJwDdP5MBgrJw1Xo+kyUHuv3JEzPqxr+Dj9ryeDRTA==", - "requires": { - "debug": "^4.0.0", - "gonzales-pe": "^4.2.3", - "node-source-walk": "^4.0.0" - } - }, - "detective-postcss": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-3.0.1.tgz", - "integrity": "sha512-tfTS2GdpUal5NY0aCqI4dpEy8Xfr88AehYKB0iBIZvo8y2g3UsrcDnrp9PR2FbzoW7xD5Rip3NJW7eCSvtqdUw==", - "requires": { - "debug": "^4.1.1", - "is-url": "^1.2.4", - "postcss": "^7.0.2", - "postcss-values-parser": "^1.5.0" - } - }, - "detective-sass": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-3.0.2.tgz", - "integrity": "sha512-DNVYbaSlmti/eztFGSfBw4nZvwsTaVXEQ4NsT/uFckxhJrNRFUh24d76KzoCC3aarvpZP9m8sC2L1XbLej4F7g==", - "requires": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^4.0.0" - } - }, - "detective-scss": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-2.0.2.tgz", - "integrity": "sha512-hDWnWh/l0tht/7JQltumpVea/inmkBaanJUcXRB9kEEXVwVUMuZd6z7eusQ6GcBFrfifu3pX/XPyD7StjbAiBg==", - "requires": { - "gonzales-pe": "^4.3.0", - "node-source-walk": "^4.0.0" - } - }, - "detective-stylus": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-1.0.3.tgz", - "integrity": "sha512-4/bfIU5kqjwugymoxLXXLltzQNeQfxGoLm2eIaqtnkWxqbhap9puDVpJPVDx96hnptdERzS5Cy6p9N8/08A69Q==" - }, - "detective-typescript": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-5.8.0.tgz", - "integrity": "sha512-SrsUCfCaDTF64QVMHMidRal+kmkbIc5zP8cxxZPsomWx9vuEUjBlSJNhf7/ypE5cLdJJDI4qzKDmyzqQ+iz/xg==", - "requires": { - "@typescript-eslint/typescript-estree": "^2.29.0", - "ast-module-types": "^2.6.0", - "node-source-walk": "^4.2.0", - "typescript": "^3.8.3" - }, - "dependencies": { - "@typescript-eslint/typescript-estree": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", - "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", - "requires": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", - "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "ast-module-types": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-2.7.1.tgz", - "integrity": "sha512-Rnnx/4Dus6fn7fTqdeLEAn5vUll5w7/vts0RN608yFa6si/rDOUonlIIiwugHBFWjylHjxm9owoSZn71KwG4gw==" - }, - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" - }, - "typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" - } - } - }, - "diff-sequences": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", - "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "electron-to-chromium": { - "version": "1.4.340", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.340.tgz", - "integrity": "sha512-zx8hqumOqltKsv/MF50yvdAlPF9S/4PXbyfzJS6ZGhbddGkRegdwImmfSVqCkEziYzrIGZ/TlrzBND4FysfkDg==", - "dev": true - }, - "elf-cam": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/elf-cam/-/elf-cam-0.1.1.tgz", - "integrity": "sha512-tKSFTWOp5OwJSp6MKyQDX7umYDkvUuI8rxHXw8BuUQ63d9Trj9xLeo6SHyoTGSoZNNZVitFa+RuHHXuoAzN3Rw==" - }, - "emittery": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", - "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "esbuild": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.10.tgz", - "integrity": "sha512-XvGbf+UreVFA24Tlk6sNOqNcvF2z49XAZt4E7A4H80+yqn944QOLTTxaU0lkdYNtZKFiITNea+VxmtrfjvnLPA==" - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", - "requires": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==" - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "requires": { - "prelude-ls": "~1.1.2" - } - } - } - }, - "eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", - "dev": true, - "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", - "@humanwhocodes/config-array": "^0.11.10", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "dependencies": { - "eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true - }, - "espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "requires": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" - }, - "execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - } - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", - "dev": true - }, - "expect": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.2.tgz", - "integrity": "sha512-iAErsLxJ8C+S02QbLAwgSGSezLQK+XXRDt8IuFXFpwCNw2ECmzZSmjKcCaFVp5VRMk+WAvz6h6jokzEzBFZEuA==", - "dev": true, - "requires": { - "@jest/expect-utils": "^29.6.2", - "@types/node": "*", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-util": "^29.6.2" - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "dependencies": { - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "requires": { - "is-glob": "^4.0.1" - } - } - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" - }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "requires": { - "reusify": "^1.0.4" - } - }, - "fb-watchman": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", - "dev": true, - "requires": { - "bser": "2.1.1" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "filter-obj": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-2.0.2.tgz", - "integrity": "sha512-lO3ttPjHZRfjMcxWKb1j1eDhTFsu4meeR3lnMcnBFhk6RuLhvEiuALu2TlfL310ph4lCYYwgF/ElIjdP739tdg==" - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true - }, - "flatten": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.3.tgz", - "integrity": "sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==" - }, - "flush-write-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-2.0.0.tgz", - "integrity": "sha512-uXClqPxT4xW0lcdSBheb2ObVU+kuqUk3Jk64EwieirEXZx9XUrVwp/JuBfKAWaM4T5Td/VL7QLDWPXp/MvGm/g==", - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - } - }, - "folder-walker": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/folder-walker/-/folder-walker-3.2.0.tgz", - "integrity": "sha512-VjAQdSLsl6AkpZNyrQJfO7BXLo4chnStqb055bumZMbRUPpVuPN3a4ktsnRCmrFZjtMlYLkyXiR5rAs4WOpC4Q==", - "requires": { - "from2": "^2.1.0" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "from2-array": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/from2-array/-/from2-array-0.0.4.tgz", - "integrity": "sha512-0G0cAp7sYLobH7ALsr835x98PU/YeVF7wlwxdWbCUaea7wsa7lJfKZUAo6p2YZGZ8F94luCuqHZS3JtFER6uPg==", - "requires": { - "from2": "^2.0.3" - } - }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true - }, - "get-amd-module-type": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-3.0.2.tgz", - "integrity": "sha512-PcuKwB8ouJnKuAPn6Hk3UtdfKoUV3zXRqVEvj8XGIXqjWfgd1j7QGdXy5Z9OdQfzVt1Sk29HVe/P+X74ccOuqw==", - "requires": { - "ast-module-types": "^3.0.0", - "node-source-walk": "^4.2.2" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - } - }, - "get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true - }, - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "gonzales-pe": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", - "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", - "requires": { - "minimist": "^1.2.5" - } - }, - "graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" - }, - "grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, - "graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" - }, - "hasha": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", - "requires": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - }, - "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" - } - } - }, - "html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==" - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" - }, - "indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", - "integrity": "sha512-bup+4tap3Hympa+JBJUG7XuOsdNQ6fxt0MHyXMKuLBKn0OqsTfvUxkUrroEX1+B2VsSHvCjiIcZVxRtYa4nllA==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", - "requires": { - "has": "^1.0.3" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==" - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" - }, - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" - }, - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" - }, - "is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" - }, - "is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", - "dev": true - }, - "istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "requires": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, - "istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "requires": { - "semver": "^7.5.3" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - } - }, - "istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", - "dev": true, - "requires": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - } - }, - "jest": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.2.tgz", - "integrity": "sha512-8eQg2mqFbaP7CwfsTpCxQ+sHzw1WuNWL5UUvjnWP4hx2riGz9fPSzYOaU5q8/GqWn1TfgZIVTqYJygbGbWAANg==", - "dev": true, - "requires": { - "@jest/core": "^29.6.2", - "@jest/types": "^29.6.1", - "import-local": "^3.0.2", - "jest-cli": "^29.6.2" - } - }, - "jest-changed-files": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.5.0.tgz", - "integrity": "sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==", - "dev": true, - "requires": { - "execa": "^5.0.0", - "p-limit": "^3.1.0" - } - }, - "jest-circus": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.2.tgz", - "integrity": "sha512-G9mN+KOYIUe2sB9kpJkO9Bk18J4dTDArNFPwoZ7WKHKel55eKIS/u2bLthxgojwlf9NLCVQfgzM/WsOVvoC6Fw==", - "dev": true, - "requires": { - "@jest/environment": "^29.6.2", - "@jest/expect": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/types": "^29.6.1", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "dedent": "^1.0.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.6.2", - "jest-matcher-utils": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-runtime": "^29.6.2", - "jest-snapshot": "^29.6.2", - "jest-util": "^29.6.2", - "p-limit": "^3.1.0", - "pretty-format": "^29.6.2", - "pure-rand": "^6.0.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - } - }, - "jest-cli": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.2.tgz", - "integrity": "sha512-TT6O247v6dCEX2UGHGyflMpxhnrL0DNqP2fRTKYm3nJJpCTfXX3GCMQPGFjXDoj0i5/Blp3jriKXFgdfmbYB6Q==", - "dev": true, - "requires": { - "@jest/core": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/types": "^29.6.1", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "import-local": "^3.0.2", - "jest-config": "^29.6.2", - "jest-util": "^29.6.2", - "jest-validate": "^29.6.2", - "prompts": "^2.0.1", - "yargs": "^17.3.1" - } - }, - "jest-config": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.2.tgz", - "integrity": "sha512-VxwFOC8gkiJbuodG9CPtMRjBUNZEHxwfQXmIudSTzFWxaci3Qub1ddTRbFNQlD/zUeaifLndh/eDccFX4wCMQw==", - "dev": true, - "requires": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.6.2", - "@jest/types": "^29.6.1", - "babel-jest": "^29.6.2", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.6.2", - "jest-environment-node": "^29.6.2", - "jest-get-type": "^29.4.3", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.2", - "jest-runner": "^29.6.2", - "jest-util": "^29.6.2", - "jest-validate": "^29.6.2", - "micromatch": "^4.0.4", - "parse-json": "^5.2.0", - "pretty-format": "^29.6.2", - "slash": "^3.0.0", - "strip-json-comments": "^3.1.1" - } - }, - "jest-diff": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.2.tgz", - "integrity": "sha512-t+ST7CB9GX5F2xKwhwCf0TAR17uNDiaPTZnVymP9lw0lssa9vG+AFyDZoeIHStU3WowFFwT+ky+er0WVl2yGhA==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "diff-sequences": "^29.4.3", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.2" - } - }, - "jest-docblock": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz", - "integrity": "sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==", - "dev": true, - "requires": { - "detect-newline": "^3.0.0" - } - }, - "jest-each": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.2.tgz", - "integrity": "sha512-MsrsqA0Ia99cIpABBc3izS1ZYoYfhIy0NNWqPSE0YXbQjwchyt6B1HD2khzyPe1WiJA7hbxXy77ZoUQxn8UlSw==", - "dev": true, - "requires": { - "@jest/types": "^29.6.1", - "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", - "jest-util": "^29.6.2", - "pretty-format": "^29.6.2" - } - }, - "jest-environment-node": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.2.tgz", - "integrity": "sha512-YGdFeZ3T9a+/612c5mTQIllvWkddPbYcN2v95ZH24oWMbGA4GGS2XdIF92QMhUhvrjjuQWYgUGW2zawOyH63MQ==", - "dev": true, - "requires": { - "@jest/environment": "^29.6.2", - "@jest/fake-timers": "^29.6.2", - "@jest/types": "^29.6.1", - "@types/node": "*", - "jest-mock": "^29.6.2", - "jest-util": "^29.6.2" - } - }, - "jest-get-type": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz", - "integrity": "sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==", - "dev": true - }, - "jest-haste-map": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.2.tgz", - "integrity": "sha512-+51XleTDAAysvU8rT6AnS1ZJ+WHVNqhj1k6nTvN2PYP+HjU3kqlaKQ1Lnw3NYW3bm2r8vq82X0Z1nDDHZMzHVA==", - "dev": true, - "requires": { - "@jest/types": "^29.6.1", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "fsevents": "^2.3.2", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.6.2", - "jest-worker": "^29.6.2", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - } - }, - "jest-leak-detector": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.2.tgz", - "integrity": "sha512-aNqYhfp5uYEO3tdWMb2bfWv6f0b4I0LOxVRpnRLAeque2uqOVVMLh6khnTcE2qJ5wAKop0HcreM1btoysD6bPQ==", - "dev": true, - "requires": { - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.2" - } - }, - "jest-matcher-utils": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.2.tgz", - "integrity": "sha512-4LiAk3hSSobtomeIAzFTe+N8kL6z0JtF3n6I4fg29iIW7tt99R7ZcIFW34QkX+DuVrf+CUe6wuVOpm7ZKFJzZQ==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "jest-diff": "^29.6.2", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.6.2" - } - }, - "jest-message-util": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.2.tgz", - "integrity": "sha512-vnIGYEjoPSuRqV8W9t+Wow95SDp6KPX2Uf7EoeG9G99J2OVh7OSwpS4B6J0NfpEIpfkBNHlBZpA2rblEuEFhZQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.1", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.6.2", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - } - }, - "jest-mock": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.2.tgz", - "integrity": "sha512-hoSv3lb3byzdKfwqCuT6uTscan471GUECqgNYykg6ob0yiAw3zYc7OrPnI9Qv8Wwoa4lC7AZ9hyS4AiIx5U2zg==", - "dev": true, - "requires": { - "@jest/types": "^29.6.1", - "@types/node": "*", - "jest-util": "^29.6.2" - } - }, - "jest-pnp-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "dev": true, - "requires": {} - }, - "jest-regex-util": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.3.tgz", - "integrity": "sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==", - "dev": true - }, - "jest-resolve": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.2.tgz", - "integrity": "sha512-G/iQUvZWI5e3SMFssc4ug4dH0aZiZpsDq9o1PtXTV1210Ztyb2+w+ZgQkB3iOiC5SmAEzJBOHWz6Hvrd+QnNPw==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.2", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.6.2", - "jest-validate": "^29.6.2", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" - } - }, - "jest-resolve-dependencies": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.2.tgz", - "integrity": "sha512-LGqjDWxg2fuQQm7ypDxduLu/m4+4Lb4gczc13v51VMZbVP5tSBILqVx8qfWcsdP8f0G7aIqByIALDB0R93yL+w==", - "dev": true, - "requires": { - "jest-regex-util": "^29.4.3", - "jest-snapshot": "^29.6.2" - } - }, - "jest-runner": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.2.tgz", - "integrity": "sha512-wXOT/a0EspYgfMiYHxwGLPCZfC0c38MivAlb2lMEAlwHINKemrttu1uSbcGbfDV31sFaPWnWJPmb2qXM8pqZ4w==", - "dev": true, - "requires": { - "@jest/console": "^29.6.2", - "@jest/environment": "^29.6.2", - "@jest/test-result": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.4.3", - "jest-environment-node": "^29.6.2", - "jest-haste-map": "^29.6.2", - "jest-leak-detector": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-resolve": "^29.6.2", - "jest-runtime": "^29.6.2", - "jest-util": "^29.6.2", - "jest-watcher": "^29.6.2", - "jest-worker": "^29.6.2", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" - } - }, - "jest-runtime": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.2.tgz", - "integrity": "sha512-2X9dqK768KufGJyIeLmIzToDmsN0m7Iek8QNxRSI/2+iPFYHF0jTwlO3ftn7gdKd98G/VQw9XJCk77rbTGZnJg==", - "dev": true, - "requires": { - "@jest/environment": "^29.6.2", - "@jest/fake-timers": "^29.6.2", - "@jest/globals": "^29.6.2", - "@jest/source-map": "^29.6.0", - "@jest/test-result": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", - "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-mock": "^29.6.2", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.6.2", - "jest-snapshot": "^29.6.2", - "jest-util": "^29.6.2", - "slash": "^3.0.0", - "strip-bom": "^4.0.0" - } - }, - "jest-snapshot": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.2.tgz", - "integrity": "sha512-1OdjqvqmRdGNvWXr/YZHuyhh5DeaLp1p/F8Tht/MrMw4Kr1Uu/j4lRG+iKl1DAqUJDWxtQBMk41Lnf/JETYBRA==", - "dev": true, - "requires": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.6.2", - "@jest/transform": "^29.6.2", - "@jest/types": "^29.6.1", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.6.2", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.6.2", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.6.2", - "jest-message-util": "^29.6.2", - "jest-util": "^29.6.2", - "natural-compare": "^1.4.0", - "pretty-format": "^29.6.2", - "semver": "^7.5.3" - } - }, - "jest-util": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.2.tgz", - "integrity": "sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w==", - "dev": true, - "requires": { - "@jest/types": "^29.6.1", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - } - }, - "jest-validate": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.2.tgz", - "integrity": "sha512-vGz0yMN5fUFRRbpJDPwxMpgSXW1LDKROHfBopAvDcmD6s+B/s8WJrwi+4bfH4SdInBA5C3P3BI19dBtKzx1Arg==", - "dev": true, - "requires": { - "@jest/types": "^29.6.1", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", - "leven": "^3.1.0", - "pretty-format": "^29.6.2" - }, - "dependencies": { - "camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true - } - } - }, - "jest-watcher": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.2.tgz", - "integrity": "sha512-GZitlqkMkhkefjfN/p3SJjrDaxPflqxEAv3/ik10OirZqJGYH5rPiIsgVcfof0Tdqg3shQGdEIxDBx+B4tuLzA==", - "dev": true, - "requires": { - "@jest/test-result": "^29.6.2", - "@jest/types": "^29.6.1", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "jest-util": "^29.6.2", - "string-length": "^4.0.1" - } - }, - "jest-worker": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.2.tgz", - "integrity": "sha512-l3ccBOabTdkng8I/ORCkADz4eSMKejTYv1vB/Z83UiubqhC1oQ5Li6dWCyqOIvSifGjUBxuvxvlm6KGK2DtuAQ==", - "dev": true, - "requires": { - "@types/node": "*", - "jest-util": "^29.6.2", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "dependencies": { - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true - }, - "junk": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz", - "integrity": "sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==" - }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true - }, - "lazystream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", - "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", - "requires": { - "readable-stream": "^2.0.5" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" - }, - "lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" - }, - "lodash.difference": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==" - }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==" - }, - "lodash.isempty": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", - "integrity": "sha512-oKMuF3xEeqDltrGMfDxAPGIVMSSRv8tbRSODbrs4KGsRRLEhrW8N8Rd4DRgB2+621hY8A8XwwrTVhXWpxFvMzg==" - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" - }, - "lodash.memoize": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", - "dev": true - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "lodash.transform": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz", - "integrity": "sha512-LO37ZnhmBVx0GvOU/caQuipEh4GN82TcWv3yHlebGDgOxbxiwwzW5Pcx2AcvpIv2WmvmSMoC492yQFNhy/l/UQ==" - }, - "lodash.union": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", - "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==" - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" - } - } - }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", - "dev": true, - "requires": { - "tmpl": "1.0.5" - } - }, - "merge-options": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", - "requires": { - "is-plain-obj": "^2.1.0" - } - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" - }, - "micro-api-client": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/micro-api-client/-/micro-api-client-3.3.0.tgz", - "integrity": "sha512-y0y6CUB9RLVsy3kfgayU28746QrNMpSm9O/AYGNsBgOkJr/X/Jk0VLGoO8Ude7Bpa8adywzF+MzXNZRFRsNPhg==" - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" - }, - "module-definition": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-3.4.0.tgz", - "integrity": "sha512-XxJ88R1v458pifaSkPNLUTdSPNVGMP2SXVncVmApGO+gAfrLANiYe6JofymCzVceGOMwQE2xogxBSc8uB7XegA==", - "requires": { - "ast-module-types": "^3.0.0", - "node-source-walk": "^4.0.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, - "nested-error-stacks": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", - "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==" - }, - "netlify": { - "version": "6.1.29", - "resolved": "https://registry.npmjs.org/netlify/-/netlify-6.1.29.tgz", - "integrity": "sha512-Xr26CcTLt7ChN2cWysCWbAItJHmTufVhVkF3VEd25uOtBNufvg674Amw6bkyWwvfGJzrNP+tj07YVtsQGdlOZQ==", - "requires": { - "@netlify/open-api": "^2.4.0", - "@netlify/zip-it-and-ship-it": "^3.10.0", - "backoff": "^2.5.0", - "clean-deep": "^3.4.0", - "flush-write-stream": "^2.0.0", - "folder-walker": "^3.2.0", - "from2-array": "0.0.4", - "hasha": "^5.2.2", - "lodash.camelcase": "^4.3.0", - "micro-api-client": "^3.3.0", - "node-fetch": "^2.6.1", - "omit.js": "^2.0.2", - "p-map": "^3.0.0", - "p-wait-for": "^3.2.0", - "parallel-transform": "^1.2.0", - "pump": "^3.0.0", - "qs": "^6.9.6", - "rimraf": "^3.0.2", - "tempy": "^0.3.0", - "through2-filter": "^3.0.0", - "through2-map": "^3.0.0" - } - }, - "node-fetch": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", - "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true - }, - "node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", - "dev": true - }, - "node-source-walk": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-4.3.0.tgz", - "integrity": "sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==", - "requires": { - "@babel/parser": "^7.0.0" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "requires": { - "path-key": "^3.0.0" - } - }, - "object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" - }, - "omit.js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/omit.js/-/omit.js-2.0.2.tgz", - "integrity": "sha512-hJmu9D+bNB40YpL9jYebQl4lsTW6yEHRTroJzNLqQJYHm7c+NQnJGfZmIWh8S3q3KoaxV1aLhV6B3+0N0/kyJg==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", - "dev": true, - "requires": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - } - }, - "p-event": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", - "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", - "requires": { - "p-timeout": "^3.1.0" - } - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==" - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "p-timeout": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", - "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", - "requires": { - "p-finally": "^1.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "p-wait-for": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-3.2.0.tgz", - "integrity": "sha512-wpgERjNkLrBiFmkMEjuZJEWKKDrNfHCKA1OhyN1wg1FrLkULbviEy6py1AyJUgZ72YWFbZ38FIpnqvVqAlDUwA==", - "requires": { - "p-timeout": "^3.0.0" - } - }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" - }, - "picocolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", - "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==" - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" - }, - "pirates": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", - "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "requires": { - "find-up": "^4.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - } - } - }, - "postcss": { - "version": "7.0.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", - "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", - "requires": { - "picocolors": "^0.2.1", - "source-map": "^0.6.1" - } - }, - "postcss-values-parser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-1.5.0.tgz", - "integrity": "sha512-3M3p+2gMp0AH3da530TlX8kiO1nxdTnc3C6vr8dMxRLIlh8UYkz0/wcwptSXjhtx2Fr0TySI7a+BHDQ8NL7LaQ==", - "requires": { - "flatten": "^1.0.2", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" - } - }, - "precinct": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/precinct/-/precinct-6.3.1.tgz", - "integrity": "sha512-JAwyLCgTylWminoD7V0VJwMElWmwrVSR6r9HaPWCoswkB4iFzX7aNtO7VBfAVPy+NhmjKb8IF8UmlWJXzUkOIQ==", - "requires": { - "commander": "^2.20.3", - "debug": "^4.1.1", - "detective-amd": "^3.0.0", - "detective-cjs": "^3.1.1", - "detective-es6": "^2.1.0", - "detective-less": "^1.0.2", - "detective-postcss": "^3.0.1", - "detective-sass": "^3.0.1", - "detective-scss": "^2.0.1", - "detective-stylus": "^1.0.0", - "detective-typescript": "^5.8.0", - "module-definition": "^3.3.0", - "node-source-walk": "^4.2.0" - } - }, - "precond": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", - "integrity": "sha512-QCYG84SgGyGzqJ/vlMsxeXd/pgL/I94ixdNFyh1PusWmTCyVfPJjZ1K1jvHtsbfnXQs2TSkEP2fR7QiMZAnKFQ==" - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, - "prettier": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.2.tgz", - "integrity": "sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==", - "dev": true - }, - "pretty-format": { - "version": "29.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.2.tgz", - "integrity": "sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg==", - "dev": true, - "requires": { - "@jest/schemas": "^29.6.0", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true - } - } - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, - "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true - }, - "pure-rand": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.1.tgz", - "integrity": "sha512-t+x1zEHDjBwkDGY5v5ApnZ/utcd4XYDiJsaQQoptTXgUXX95sDg1elCdJghzicm7n2mbCBJ3uYWr6M22SO19rg==", - "dev": true - }, - "qs": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz", - "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==", - "requires": { - "side-channel": "^1.0.4" - } - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" - }, - "react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, - "read-package-json-fast": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", - "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", - "requires": { - "json-parse-even-better-errors": "^2.3.0", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==" - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "require-package-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/require-package-name/-/require-package-name-2.0.1.tgz", - "integrity": "sha512-uuoJ1hU/k6M0779t3VMVIYpb2VMJk05cehCaABFhXaibcbvfgR8wKiozLjVFSzJPmQMRqIcO0HMyTFqfV09V6Q==" - }, - "resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, - "requires": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "requires": { - "resolve-from": "^5.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - } - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "requires": { - "lru-cache": "^6.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - } - }, - "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, - "source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, - "stack-utils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", - "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", - "dev": true, - "requires": { - "escape-string-regexp": "^2.0.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - } - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "string-length": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", - "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", - "dev": true, - "requires": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true - }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" - }, - "tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "requires": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - } - }, - "temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", - "integrity": "sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ==" - }, - "tempy": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-0.3.0.tgz", - "integrity": "sha512-WrH/pui8YCwmeiAoxV+lpRH9HpRtgBhSR2ViBPgpGb/wnYDzp21R4MN45fsCGvLROvY67o3byhJRYRONJyImVQ==", - "requires": { - "temp-dir": "^1.0.0", - "type-fest": "^0.3.1", - "unique-string": "^1.0.0" - }, - "dependencies": { - "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==" - } - } - }, - "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "requires": { - "through2": "~2.0.0", - "xtend": "~4.0.0" - } - }, - "through2-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-map/-/through2-map-3.0.0.tgz", - "integrity": "sha512-Ms68QPbSJKjRYY7fmqZHB0VGt+vD0/tjmDHUWgxltjifCof6hZWWeQAEi27Wjbs7jyNlIIyerQw/TVj7gHkd/Q==", - "requires": { - "through2": "~2.0.0", - "xtend": "^4.0.0" - } - }, - "tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "ts-jest": { - "version": "29.1.1", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", - "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", - "dev": true, - "requires": { - "bs-logger": "0.x", - "fast-json-stable-stringify": "2.x", - "jest-util": "^29.0.0", - "json5": "^2.2.3", - "lodash.memoize": "4.x", - "make-error": "1.x", - "semver": "^7.5.3", - "yargs-parser": "^21.0.1" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "requires": { - "tslib": "^1.8.1" - } - }, - "tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - }, - "typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==" - }, - "uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==" - }, - "unique-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha512-ODgiYu03y5g76A1I9Gt0/chLCzQjvzDy7DsZGsLOE/1MrF6wriEskSncj1+/C58Xk/kPZDppSctDybCwOSaGAg==", - "requires": { - "crypto-random-string": "^1.0.0" - } - }, - "universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - }, - "unixify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unixify/-/unixify-1.0.0.tgz", - "integrity": "sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg==", - "requires": { - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", - "dev": true, - "requires": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" - }, - "dependencies": { - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - } - } - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "v8-to-istanbul": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", - "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", - "dev": true, - "requires": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" - }, - "dependencies": { - "convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - } - } - }, - "walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", - "dev": true, - "requires": { - "makeerror": "1.0.12" - } - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==" - }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==" - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, - "yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "requires": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - } - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true - }, - "zip-stream": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-3.0.1.tgz", - "integrity": "sha512-r+JdDipt93ttDjsOVPU5zaq5bAyY+3H19bDrThkvuVxC0xMQzU1PJcS6D+KrP3u96gH9XLomcHPb+2skoDjulQ==", - "requires": { - "archiver-utils": "^2.1.0", - "compress-commons": "^3.0.0", - "readable-stream": "^3.6.0" - } - } } } diff --git a/src/main.ts b/src/main.ts index d0e09036..7da74e3a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -189,8 +189,8 @@ export async function run(inputs: Inputs): Promise { (productionDeploy ? 'production' : context.issue.number !== undefined - ? 'pull request' - : 'commit') + ? 'pull request' + : 'commit') const description = inputs.githubDeploymentDescription() // Create GitHub Deployment